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

Fixes #3158: Dataframe containing a Segarray .__str__() bug #3161

Merged
merged 1 commit into from
May 6, 2024

Conversation

stress-tess
Copy link
Member

@stress-tess stress-tess commented May 6, 2024

This PR (closes #3158) fixes bug when printing a dataframe containing a segarray.

To handle this I added an nbytes attribute to segarray which just wraps the underlying values. I also modified the series init to not assume that when data is a list that it contains 2 elements (the first being the data and the second being the index) when the index is provided. This actual broke _return_agg_series because it was ignoring what was being passed in as the index keyword

It also adds arkouda/scipy/stats/*.pyi to the .gitignore cause it was showing up in my untracked files. I'm not sure if this is necessary

>>> akdf = ak.DataFrame({'just_vals': ak.SegArray(ak.array([0,3,5,7]), ak.arange(10))})
>>> print(akdf)  # this used to break

… bug

This PR (closes Bears-R-Us#3158) fixes bug when printing a dataframe containing a segarray. To handle this I added an `nbytes` attribute to segarray which just wraps the underlying values. I also modified the series init to not assume that when `data` is a list that it contains 2 elements (the first being the data and the second being the index) when the `index` is provided.
Copy link
Contributor

@ajpotts ajpotts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@stress-tess stress-tess added this pull request to the merge queue May 6, 2024
Merged via the queue into Bears-R-Us:master with commit ab99910 May 6, 2024
13 checks passed
@stress-tess stress-tess deleted the 3158_df_segarr_str_bug branch May 6, 2024 21:58
@stress-tess stress-tess restored the 3158_df_segarr_str_bug branch May 8, 2024 23:40
@stress-tess stress-tess deleted the 3158_df_segarr_str_bug branch May 8, 2024 23:40
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

Successfully merging this pull request may close these issues.

Dataframe containing a Segarray .__str__() bug
3 participants