Skip to content

ArkoudaSeriesAccessor.locate materializes to pandas #5412

@ajpotts

Description

@ajpotts

Reported by @1RyanK:

In [1]: import pandas as pd
   ...: import arkouda as ak
   ...: 
   ...: # Make a distributed Series
   ...: s = pd.Series([10,20,30], index=pd.Index([1,2,3])).ak.to_ak()
   ...: out = s.ak.locate([3,1])  # run once to warm up
   ...: 
   ...: # Monkeypatch: log legacy Index.to_pandas calls
   ...: import arkouda.pandas.index as ak_index_mod
   ...: orig_to_pandas = ak_index_mod.Index.to_pandas
   ...: 
   ...: def logged_to_pandas(self, *args, **kwargs):
   ...:     print(">>> MATERIALIZATION: legacy Index.to_pandas was called")
   ...:     return orig_to_pandas(self, *args, **kwargs)
   ...: 
   ...: ak_index_mod.Index.to_pandas = logged_to_pandas
   ...: 
   ...: # Now call the accessor locate again
   ...: out2 = s.ak.locate([3,1])
   ...: 
>>> MATERIALIZATION: legacy Index.to_pandas was called

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions