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

refactor(python): Clean up some of the AnyValue conversion logic #15190

Merged
merged 23 commits into from
Mar 20, 2024

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Mar 20, 2024

Mostly a lot of refactoring, but also addressed some minor issues.

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars labels Mar 20, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 99.26740% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 81.23%. Comparing base (6a87324) to head (272ee1e).
Report is 2 commits behind head on main.

Files Patch % Lines
py-polars/polars/_utils/construction/dataframe.py 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15190      +/-   ##
==========================================
+ Coverage   81.22%   81.23%   +0.01%     
==========================================
  Files        1348     1348              
  Lines      175330   175304      -26     
  Branches     2508     2509       +1     
==========================================
+ Hits       142409   142412       +3     
+ Misses      32442    32411      -31     
- Partials      479      481       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +54 to +56
# Special case for Array as it needs to pass the dtype argument on construction
if isinstance(dtype, dt.Array):
return functools.partial(PySeries.new_array, dtype=dtype)
Copy link
Member Author

@stinodego stinodego Mar 20, 2024

Choose a reason for hiding this comment

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

Note: Constructing a Series with an uninstantiated pl.Array was and is still broken:

import polars as pl

s = pl.Series([[1, 2], [3, 4]], dtype=pl.Array)
print(s)
# ValueError: cannot construct PySeries for type Array

@stinodego stinodego marked this pull request as ready for review March 20, 2024 22:09
@stinodego stinodego merged commit 97eff07 into main Mar 20, 2024
26 checks passed
@stinodego stinodego deleted the av-cleanup branch March 20, 2024 22:42
@c-peters c-peters added the accepted Ready for implementation label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation internal An internal refactor or improvement python Related to Python Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants