pyogrio 0.7.1__tar.gz → 0.7.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyogrio might be problematic. Click here for more details.

Files changed (52) hide show
  1. {pyogrio-0.7.1/pyogrio.egg-info → pyogrio-0.7.2}/PKG-INFO +2 -1
  2. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_compat.py +1 -0
  3. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_version.py +3 -3
  4. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/geopandas.py +6 -2
  5. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/test_geopandas_io.py +24 -0
  6. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/util.py +3 -1
  7. {pyogrio-0.7.1 → pyogrio-0.7.2/pyogrio.egg-info}/PKG-INFO +2 -1
  8. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio.egg-info/requires.txt +1 -0
  9. {pyogrio-0.7.1 → pyogrio-0.7.2}/setup.py +1 -1
  10. {pyogrio-0.7.1 → pyogrio-0.7.2}/LICENSE +0 -0
  11. {pyogrio-0.7.1 → pyogrio-0.7.2}/MANIFEST.in +0 -0
  12. {pyogrio-0.7.1 → pyogrio-0.7.2}/README.md +0 -0
  13. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/__init__.py +0 -0
  14. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_env.py +0 -0
  15. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_err.pxd +0 -0
  16. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_err.pyx +0 -0
  17. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_geometry.pxd +0 -0
  18. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_geometry.pyx +0 -0
  19. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_io.pxd +0 -0
  20. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_io.pyx +0 -0
  21. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_ogr.pxd +0 -0
  22. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/_ogr.pyx +0 -0
  23. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/arrow_bridge.h +0 -0
  24. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/core.py +0 -0
  25. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/errors.py +0 -0
  26. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/raw.py +0 -0
  27. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/__init__.py +0 -0
  28. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/conftest.py +0 -0
  29. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/README.md +0 -0
  30. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/naturalearth_lowres/naturalearth_lowres.cpg +0 -0
  31. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/naturalearth_lowres/naturalearth_lowres.dbf +0 -0
  32. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/naturalearth_lowres/naturalearth_lowres.prj +0 -0
  33. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/naturalearth_lowres/naturalearth_lowres.shp +0 -0
  34. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/naturalearth_lowres/naturalearth_lowres.shx +0 -0
  35. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/sample.osm.pbf +0 -0
  36. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/test_datetime.geojson +0 -0
  37. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/test_datetime_tz.geojson +0 -0
  38. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/test_fgdb.gdb.zip +0 -0
  39. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/test_gpkg_nulls.gpkg +0 -0
  40. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/test_multisurface.gpkg +0 -0
  41. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/test_nested.geojson +0 -0
  42. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/fixtures/test_ogr_types_list.geojson +0 -0
  43. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/test_arrow.py +0 -0
  44. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/test_core.py +0 -0
  45. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/test_path.py +0 -0
  46. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/test_raw_io.py +0 -0
  47. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio/tests/win32.py +0 -0
  48. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio.egg-info/SOURCES.txt +0 -0
  49. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio.egg-info/dependency_links.txt +0 -0
  50. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyogrio.egg-info/top_level.txt +0 -0
  51. {pyogrio-0.7.1 → pyogrio-0.7.2}/pyproject.toml +0 -0
  52. {pyogrio-0.7.1 → pyogrio-0.7.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyogrio
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Vectorized spatial vector file format I/O using GDAL/OGR
5
5
  Home-page: https://github.com/geopandas/pyogrio
6
6
  Author: Brendan C. Ward
@@ -11,6 +11,7 @@ Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
12
  Requires-Dist: certifi
13
13
  Requires-Dist: numpy
14
+ Requires-Dist: packaging
14
15
  Provides-Extra: dev
15
16
  Requires-Dist: Cython; extra == "dev"
16
17
  Provides-Extra: test
@@ -28,6 +28,7 @@ HAS_ARROW_API = __gdal_version__ >= (3, 6, 0) and pyarrow is not None
28
28
 
29
29
  HAS_GEOPANDAS = geopandas is not None
30
30
 
31
+ PANDAS_GE_15 = pandas is not None and Version(pandas.__version__) >= Version("1.5.0")
31
32
  PANDAS_GE_20 = pandas is not None and Version(pandas.__version__) >= Version("2.0.0")
32
33
 
33
34
  HAS_GDAL_GEOS = __gdal_geos_version__ is not None
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2023-10-26T15:56:41-0700",
11
+ "date": "2023-10-30T11:39:03-0700",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "97d9dee48584208ccbb479b87d58ec1eb92b3f9c",
15
- "version": "0.7.1"
14
+ "full-revisionid": "71acde57ef674c8622d17b29663ff4349b1fee6e",
15
+ "version": "0.7.2"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -2,7 +2,7 @@ import os
2
2
 
3
3
  import numpy as np
4
4
 
5
- from pyogrio._compat import HAS_GEOPANDAS, PANDAS_GE_20
5
+ from pyogrio._compat import HAS_GEOPANDAS, PANDAS_GE_15, PANDAS_GE_20
6
6
  from pyogrio.raw import (
7
7
  DRIVERS_NO_MIXED_SINGLE_MULTI,
8
8
  DRIVERS_NO_MIXED_DIMENSIONS,
@@ -275,7 +275,11 @@ def read_dataframe(
275
275
  # Index not asked, no geometry column and no attribute columns: return empty
276
276
  return pd.DataFrame()
277
277
  elif geometry_name in df.columns:
278
- df["geometry"] = from_wkb(df.pop(geometry_name), crs=meta["crs"])
278
+ wkb_values = df.pop(geometry_name)
279
+ if PANDAS_GE_15 and wkb_values.dtype != object:
280
+ # for example ArrowDtype will otherwise create numpy array with pd.NA
281
+ wkb_values = wkb_values.to_numpy(na_value=None)
282
+ df["geometry"] = from_wkb(wkb_values, crs=meta["crs"])
279
283
  if force_2d:
280
284
  df["geometry"] = shapely.force_2d(df["geometry"])
281
285
  return gp.GeoDataFrame(df, geometry="geometry")
@@ -17,6 +17,7 @@ from pyogrio.tests.conftest import (
17
17
  requires_arrow_api,
18
18
  requires_gdal_geos,
19
19
  )
20
+ from pyogrio._compat import PANDAS_GE_15
20
21
 
21
22
  try:
22
23
  import pandas as pd
@@ -1442,3 +1443,26 @@ def test_metadata_unsupported(tmpdir, naturalearth_lowres, metadata_type):
1442
1443
  metadata_key = "layer_metadata" if metadata_type == "metadata" else metadata_type
1443
1444
 
1444
1445
  assert read_info(filename)[metadata_key] is None
1446
+
1447
+
1448
+ @pytest.mark.skipif(not PANDAS_GE_15, reason="ArrowDtype requires pandas 1.5+")
1449
+ def test_read_dataframe_arrow_dtypes(tmp_path):
1450
+ # https://github.com/geopandas/pyogrio/issues/319 - ensure arrow binary
1451
+ # column can be converted with from_wkb in case of missing values
1452
+ pytest.importorskip("pyarrow")
1453
+ filename = tmp_path / "test.gpkg"
1454
+ df = gp.GeoDataFrame(
1455
+ {"col": [1.0, 2.0]}, geometry=[Point(1, 1), None], crs="EPSG:4326"
1456
+ )
1457
+ write_dataframe(df, filename)
1458
+
1459
+ result = read_dataframe(
1460
+ filename,
1461
+ use_arrow=True,
1462
+ arrow_to_pandas_kwargs={
1463
+ "types_mapper": lambda pa_dtype: pd.ArrowDtype(pa_dtype)
1464
+ },
1465
+ )
1466
+ assert isinstance(result["col"].dtype, pd.ArrowDtype)
1467
+ result["col"] = result["col"].astype("float64")
1468
+ assert_geodataframe_equal(result, df)
@@ -2,6 +2,8 @@ import re
2
2
  import sys
3
3
  from urllib.parse import urlparse
4
4
 
5
+ from packaging.version import Version
6
+
5
7
  from pyogrio._env import GDALEnv
6
8
 
7
9
  with GDALEnv():
@@ -187,7 +189,7 @@ def _mask_to_wkb(mask):
187
189
  try:
188
190
  import shapely
189
191
 
190
- if int(shapely.__version__.split(".")[0]) < 2:
192
+ if Version(shapely.__version__) < Version("2.0.0"):
191
193
  shapely = None
192
194
  except ImportError:
193
195
  shapely = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyogrio
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Vectorized spatial vector file format I/O using GDAL/OGR
5
5
  Home-page: https://github.com/geopandas/pyogrio
6
6
  Author: Brendan C. Ward
@@ -11,6 +11,7 @@ Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
12
  Requires-Dist: certifi
13
13
  Requires-Dist: numpy
14
+ Requires-Dist: packaging
14
15
  Provides-Extra: dev
15
16
  Requires-Dist: Cython; extra == "dev"
16
17
  Provides-Extra: test
@@ -1,5 +1,6 @@
1
1
  certifi
2
2
  numpy
3
+ packaging
3
4
 
4
5
  [benchmark]
5
6
  pytest-benchmark
@@ -227,7 +227,7 @@ setup(
227
227
  long_description_content_type="text/markdown",
228
228
  long_description=open("README.md").read(),
229
229
  python_requires=">=3.8",
230
- install_requires=["certifi", "numpy"],
230
+ install_requires=["certifi", "numpy", "packaging"],
231
231
  extras_require={
232
232
  "dev": ["Cython"],
233
233
  "test": ["pytest", "pytest-cov"],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes