Skip to content

Commit 4613e7a

Browse files
[ARROW-208] Replaced deprecated pkg_resource with packaging.version (#188)
* Replaced deprecated pkg_resource with packaging.version
1 parent 754ca75 commit 4613e7a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

bindings/python/pymongoarrow/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@
1717

1818
# We must import pyarrow before attempting to load the Cython module.
1919
import pyarrow as pa # noqa: F401
20-
from packaging.version import parse as _parse_version
2120

2221
from pymongoarrow.version import _MIN_LIBBSON_VERSION, __version__ # noqa: F401
2322

23+
try:
24+
from packaging.version import parse as _parse_version
25+
except ImportError:
26+
from distutils.version import LooseVersion as _LooseVersion
27+
28+
def _parse_version(version):
29+
return _LooseVersion(version)
30+
31+
2432
try:
2533
from pymongoarrow.lib import libbson_version
2634
except ImportError:

bindings/python/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ filterwarnings = [
105105
"error",
106106
# https://github.com/dateutil/dateutil/issues/1314
107107
"module:datetime.datetime.utc:DeprecationWarning",
108+
# https://jira.mongodb.org/browse/ARROW-204
109+
'ignore:Passing a BlockManager to DataFrame is deprecated and will raise in a future version. Use public APIs instead.',
110+
# https://jira.mongodb.org/browse/ARROW-206
111+
'ignore:DatetimeTZBlock is deprecated and will be removed in a future version. Use public APIs instead.'
108112
]
109113

110114
[tool.ruff]

0 commit comments

Comments
 (0)