Skip to content

Commit 64e6214

Browse files
authored
INTPYTHON-609 Add support for PyArrow 20 (#310)
1 parent 4321bb0 commit 64e6214

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build:
99
- asdf install uv latest
1010
- asdf global uv latest
1111
install:
12-
- cd bindings/python && uv sync --no-install-project --group docs
12+
- cd bindings/python && uv sync --no-install-project --frozen --group docs
1313
build:
1414
html:
15-
- cd bindings/python && uv run --no-project sphinx-build -c docs -T -b html docs $READTHEDOCS_OUTPUT/html
15+
- cd bindings/python && uv run --no-project --frozen sphinx-build -c docs -T -b html docs $READTHEDOCS_OUTPUT/html

bindings/python/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
---
55

6+
# Changes in Version 1.8.0 (2025/MM/YY)
7+
8+
- Add support for PyArrow 20.0.
9+
610
# Changes in Version 1.7.2 (2025/04/23)
711

812
- Fix handling of empty embedded arrays.

bindings/python/justfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default:
77
@just --list
88

99
build-libbson:
10-
uv sync --no-install-project --dev
10+
uv sync --no-install-project --dev --frozen
1111
bash build-libbson.sh
1212

1313
import-check:
@@ -27,18 +27,18 @@ test *args:
2727
uv run pytest {{args}}
2828

2929
lint:
30-
uv sync --no-install-project --dev
30+
uv sync --no-install-project --dev --frozen
3131
uv run --no-project pre-commit run --hook-stage manual --all-files
3232
uv run --no-project check-manifest -v
3333

3434
docs:
35-
uv sync --no-install-project --group docs
35+
uv sync --no-install-project --group docs --frozen
3636
uv run --no-project sphinx-build -T -b html {{sphinx_opts}} {{docs_build}}/html
3737

3838
docs-serve:
39-
uv sync --no-install-project --group docs --group dev
39+
uv sync --no-install-project --group docs --group dev --frozen
4040
urn run --no-project sphinx-autobuild --watch ./pymongoarrow docs {{docs_build}}/html
4141

4242
docs-linkcheck *args:
43-
uv sync --no-install-project --group docs
43+
uv sync --no-install-project --group docs --frozen
4444
PYTHONHASHSEED=0 uv run --no-project python -m sphinx -q -b linkcheck docs {{docs_build}}/linkcheck {{args}}

bindings/python/pymongoarrow/types.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ class _BsonArrowTypes(enum.Enum):
6767

6868

6969
class BSONExtensionScalar(ExtensionScalar):
70-
def as_py(self):
70+
def as_py(self, *args, **kwargs):
7171
if self.value is None:
7272
return None
73-
return self._bson_class(self.value.as_py())
73+
return self._bson_class(self.value.as_py(*args, **kwargs))
7474

7575

7676
class ObjectIdScalar(BSONExtensionScalar):
@@ -101,10 +101,10 @@ def __arrow_ext_deserialize__(self, storage_type, serialized):
101101

102102

103103
class Decimal128Scalar(ExtensionScalar):
104-
def as_py(self):
104+
def as_py(self, *args, **kwargs):
105105
if self.value is None:
106106
return None
107-
return Decimal128.from_bid(self.value.as_py())
107+
return Decimal128.from_bid(self.value.as_py(*args, **kwargs))
108108

109109

110110
class Decimal128Type(ExtensionType):
@@ -131,11 +131,11 @@ def __arrow_ext_deserialize__(self, storage_type, serialized):
131131

132132

133133
class BinaryScalar(ExtensionScalar):
134-
def as_py(self):
134+
def as_py(self, *args, **kwargs):
135135
value = self.value
136136
if value is None:
137137
return None
138-
return Binary(self.value.as_py(), self.type.subtype)
138+
return Binary(self.value.as_py(*args, **kwargs), self.type.subtype)
139139

140140

141141
class BinaryType(ExtensionType):

bindings/python/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ requires = [
66
# Needed for numpy headers.
77
"numpy>=2.0",
88
# Must be kept in sync with "project.dependencies" below.
9-
"pyarrow>=19.0,<19.1.0",
9+
"pyarrow>=20.0,<20.1.0",
1010
]
1111

1212
[project]
@@ -37,7 +37,7 @@ readme = "README.md"
3737
requires-python = ">=3.9"
3838
dependencies = [
3939
# Must be kept in sync with "build_sytem.requires" above.
40-
"pyarrow >=19.0,<19.1",
40+
"pyarrow >=20.0,<20.1",
4141
"pymongo >=4.4,<5",
4242
"pandas >=1.3.5,<3",
4343
"packaging >=23.2",

0 commit comments

Comments
 (0)