Skip to content

Commit 2086b34

Browse files
authored
feat(db-dtypes): support pandas 3.0 (#17177)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-cloud-python/issues) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #15509 🦕
1 parent 2408166 commit 2086b34

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
# See https://pre-commit.com/hooks.html for more hooks
1717
repos:
1818
- repo: https://github.com/pre-commit/pre-commit-hooks
19-
rev: v4.0.1
19+
rev: v6.0.0
2020
hooks:
2121
- id: trailing-whitespace
2222
- id: end-of-file-fixer
2323
- id: check-yaml
2424
- repo: https://github.com/psf/black
25-
rev: 22.3.0
25+
rev: 23.7.0
2626
hooks:
2727
- id: black
2828
- repo: https://github.com/pycqa/flake8
29-
rev: 3.9.2 # version-scanner: ignore
29+
rev: 6.1.0 # version-scanner: ignore
3030
hooks:
3131
- id: flake8
32+
args: [--config, packages/google-cloud-alloydb/.flake8]

packages/db-dtypes/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"numpy >= 1.24.0, <= 2.2.6 ; python_version == '3.10'",
3434
"numpy >= 1.24.0 ; python_version != '3.10'",
3535
"packaging >= 24.2.0",
36-
"pandas >= 1.5.3, < 3.0.0",
36+
"pandas >= 1.5.3, < 4.0.0",
3737
"pyarrow >= 13.0.0",
3838
]
3939

packages/db-dtypes/tests/compliance/json/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ def data_missing_for_sorting():
8383
return JSONArray._from_sequence([json.dumps({"b": 1}), None, json.dumps({"a": 4})])
8484

8585

86+
@pytest.fixture
87+
def data_for_sorting():
88+
return JSONArray._from_sequence(
89+
[json.dumps({"b": 1}), json.dumps({"c": 4}), json.dumps({"a": 2})]
90+
)
91+
92+
8693
@pytest.fixture
8794
def na_cmp():
8895
"""

packages/db-dtypes/tests/compliance/json/test_json_compliance.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,18 @@ def test_sort_values(self, data_for_sorting):
232232
def test_sort_values_frame(self, data_for_sorting):
233233
super().test_sort_values_frame(data_for_sorting)
234234

235+
@pytest.mark.skip(reason="BigQuery does not allow sort by a JSON-type column.")
236+
def test_rank(self, data_for_sorting, ascending):
237+
super().test_rank(data_for_sorting, ascending)
238+
239+
@pytest.mark.skip(reason="BigQuery does not allow sort by a JSON-type column.")
240+
def test_rank_method(self, data_for_sorting, method):
241+
super().test_rank_method(data_for_sorting, method)
242+
243+
@pytest.mark.skip(reason="BigQuery does not allow sort by a JSON-type column.")
244+
def test_rank_missing(self, data_missing_for_sorting, na_option):
245+
super().test_rank_missing(data_missing_for_sorting, na_option)
246+
235247
def test_argmax_argmin_no_skipna_notimplemented(self, data_missing_for_sorting):
236248
# This test was failing compliance checks because it attempted to match
237249
# a pytest regex match using an empty string (""), which pytest version

0 commit comments

Comments
 (0)