Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Fix for supporting DF categoricals unboxing#923

Merged
AlexanderKalistratov merged 1 commit intoIntelPython:masterfrom
kozlov-alexey:bugfix/add_df_boxing_categorical
Sep 8, 2020
Merged

Fix for supporting DF categoricals unboxing#923
AlexanderKalistratov merged 1 commit intoIntelPython:masterfrom
kozlov-alexey:bugfix/add_df_boxing_categorical

Conversation

@kozlov-alexey
Copy link
Copy Markdown
Contributor

No description provided.

@kozlov-alexey kozlov-alexey requested review from AlexanderKalistratov, PokhodenkoSA and densmirn and removed request for densmirn September 7, 2020 13:36
Comment thread sdc/hiframes/api.py
return lambda column: np.array(column)

if isinstance(column, (types.Array, StringArrayType)):
if isinstance(column, (types.Array, StringArrayType, Categorical)):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are there other methods which need the same fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think half of all DF and Series methods should have some special handling of Categoricals (see e.g. df.values). If we talk only about boxing/unboxing/fix_df_array/fix_df_index function, then probably no, since we don't support CategoricalIndexes yet. At least it looks so.

boxed = func(pd_value)
assert(boxed.equals(pd_value))

@skip_numba_jit("capturing DFs (not only categoricals) as freevar not working")
Copy link
Copy Markdown
Contributor Author

@kozlov-alexey kozlov-alexey Sep 7, 2020

Choose a reason for hiding this comment

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

OK, here's what's going on: this doesn't test lowering, but test possibility of capture as freevar/const and it currently works only for categorical series since impl for them was added via @lower_const in

@lower_constant(SeriesType)

Probably the same can be done for DFs, non-categorical Series and other types, but it's outside the scope of this PR.

@AlexanderKalistratov AlexanderKalistratov merged commit db4f431 into IntelPython:master Sep 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants