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

ENH: Update pandas read_* funcions of dtype_backend param with pyarrow #843

Merged
merged 26 commits into from
Feb 4, 2025

Conversation

hainaweiben
Copy link
Collaborator

@hainaweiben hainaweiben commented Feb 1, 2025

What do these changes do?

Update dtype_backend parameter for consistency with pandas

  • Renamed use_arrow_dtype to dtype_backend in read_parquet and updated related logic to align with pandas and Dask.
  • Adjusted read_csv and read_sql files to ensure compatibility and reflect the new parameter where applicable.
  • Added relevant documentation updates to reflect these changes.

This change aims at providing a consistent user experience across pandas, Dask, and xorbits by adopting the dtype_backend parameter.

Related issue number

Fixes #770

Check code requirements

  • tests added / passed (if needed)
  • Ensure all linting tests pass

    - Renamed 'use_arrow_dtype' to 'dtype_backend' in read_parquet and updated related logic to align with pandas and Dask.
    - Adjusted read_csv and read_sql files to ensure compatibility and reflect the new parameter where applicable.
    - Added relevant documentation updates to reflect these changes.

    This change aims at providing a consistent user experience across pandas, Dask, and xorbits by adopting the 'dtype_backend' parameter.
Fix segmentation fault in tensor operations by adding version constraints
for numpy and pyarrow in Python 3.11 test environment. The issue occurs
in numpy.searchsorted when used with newer versions of numpy (>=2.2.0)
and pyarrow (>=19.0.0) in tensor-related tests.
@hainaweiben hainaweiben changed the title ENH ENH: Standardize dtype_backend Parameter Across pandas and xorbits. Feb 1, 2025
@XprobeBot XprobeBot added the enhancement New feature or request label Feb 1, 2025
Copy link

codecov bot commented Feb 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.03%. Comparing base (232c1d9) to head (1204771).
Report is 1 commits behind head on main.

❌ Your project status has failed because the head coverage (82.03%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #843      +/-   ##
==========================================
- Coverage   82.04%   82.03%   -0.01%     
==========================================
  Files        1071     1071              
  Lines       80153    80155       +2     
  Branches    12202    12203       +1     
==========================================
+ Hits        65758    65759       +1     
+ Misses      12837    12830       -7     
- Partials     1558     1566       +8     
Flag Coverage Δ
unittests 81.93% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@luweizheng luweizheng left a comment

Choose a reason for hiding this comment

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

Should we use numpy or numpy_nullable for dtype_backend.

python/xorbits/_mars/dataframe/datasource/read_csv.py Outdated Show resolved Hide resolved
python/xorbits/_mars/config.py Show resolved Hide resolved
hainaweiben and others added 4 commits February 3, 2025 11:43
…e `dtype_backend` parameter across the DataFrame-related functionalities in Xorbits.
- Change the parameter "use_arrow_dtype" to "dtype_backend" in the benchmark.
@hainaweiben
Copy link
Collaborator Author

The optional values for the parameter dtype_backend are "numpy_nullable" and "pyarrow", with the former being the default.

@luweizheng luweizheng changed the title ENH: Standardize dtype_backend Parameter Across pandas and xorbits. ENH: Update dtype_backend param of read_* with pyarrow engine Feb 4, 2025
@luweizheng luweizheng changed the title ENH: Update dtype_backend param of read_* with pyarrow engine ENH: Update pandas read_* funcions of dtype_backend param with pyarrow Feb 4, 2025
Copy link
Collaborator

@luweizheng luweizheng left a comment

Choose a reason for hiding this comment

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

LGTM

@luweizheng luweizheng merged commit d0ef304 into xorbitsai:main Feb 4, 2025
21 of 23 checks passed
@hainaweiben hainaweiben deleted the feature/dtype-backend-update branch February 4, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: xorbits's read_parquet compatible with pandas on pyarrow engine
3 participants