Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RR.read_rms() and RR.read_stores() return pyarrow tables #2

Open
DyanneVaught opened this issue Oct 20, 2022 · 3 comments
Open

RR.read_rms() and RR.read_stores() return pyarrow tables #2

DyanneVaught opened this issue Oct 20, 2022 · 3 comments

Comments

@DyanneVaught
Copy link

Following the latest update, RR.read_rms() and RR.read_stores() return PyArrow tables rather than pandas dataframes. In the example script, this causes the error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [7], in <cell line: 4>()
      1 # %% Next, RMS Versions, which you can combine later with sales or products
      2 # to get detailed UPC information separated by versions
      3 RR.read_rms()
----> 4 print(RR.df_rms.head())

AttributeError: 'pyarrow.lib.Table' object has no attribute 'head'

And similarly:


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [9], in <cell line: 6>()
      1 # note the filtering comes after the reading in the case of stores
      2 # unlike for sales
      3 RR.filter_stores(keep_channels = KEEP_CHANNELS, keep_states = KEEP_STATES)
----> 6 print(RR.df_stores.head())

AttributeError: 'pyarrow.lib.Table' object has no attribute 'head'

I believe the intent is to return dataframes, as with RR.read_extra() and RR.read_products(). Solved in the example by adding:

RR.df_rms = RR.df_rms.to_pandas()
RR.df_stores = RR.df_stores.to_pandas()
@DyanneVaught
Copy link
Author

read_sales() seems to have the same issue.

@DyanneVaught
Copy link
Author

Upon further investigation, converting rms and stores to pandas seems to break RR.read_sales(). Perhaps the most prudent solution is to eliminate the lines calling the head() function in the example script! (Lines 67 and 79 in Example.py, maybe also line 83)

@chrisconlon
Copy link
Owner

Oops -- didn't have tracking on -- I will look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants