feat(db-dtypes): support pandas 3.1.0 and update extension compliance tests

Open
#18,528 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
numpy, pandas, python
Domain
data, testing-qa

Research direction

Start in tests/compliance/ and inspect the JSONArray and TimeArray compliance coverage, then review packages/db-dtypes/setup.py for the pandas version bound. Run the compliance tests against pandas 3.1.0 and check fillna, comparisons, reductions, warnings, and test_map behavior. Done means the compliance tests pass and the pandas upper bound is updated after compatibility is confirmed.

Written by the indexing model from the issue text.

Description

Description

(introduced in pandas 3.1.0rc0) includes changes to pandas' internal ExtensionArray compliance test base classes and reduction semantics.

Areas to address:
  1. Private import removal: Replace from pandas.compat.numpy import np_version_gt2 in tests/compliance/ with a dynamic version check against NumPy (packaging.version.parse(np.__version__) >= Version('2')).
  2. JSONArray & TimeArray compliance: Update JSONArray and TimeArray methods to conform to pandas 3.1 ExtensionArray behaviors:
    • ExtensionArray.fillna dict filling semantics.
    • Comparison and reduction return dtypes and Pandas4Warning deprecation warnings.
    • test_map return types.
  3. Upper bound relaxation: Relax pandas < 3.1.0 back to pandas < 4.0.0 in packages/db-dtypes/setup.py once fully compliant.
Dominant language
Python
Stars
5.4k
Forks
1.8k
Avg merge
2d 7h
Merged PRs (30d)
173

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-python

All issues in googleapis/google-cloud-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.