diff --git a/ibis/backends/duckdb/tests/test_geospatial.py b/ibis/backends/duckdb/tests/test_geospatial.py index d28d312b8d93..0c656a644235 100644 --- a/ibis/backends/duckdb/tests/test_geospatial.py +++ b/ibis/backends/duckdb/tests/test_geospatial.py @@ -1,11 +1,12 @@ from __future__ import annotations -from operator import methodcaller +from operator import attrgetter, methodcaller import numpy.testing as npt import pandas.testing as tm import pyarrow as pa import pytest +from packaging.version import parse as vparse from pytest import param import ibis @@ -168,10 +169,33 @@ def test_geospatial_start_point(lines, lines_gdf): # this one takes a bit longer than the rest. -def test_geospatial_unary_union(zones, zones_gdf): +@pytest.mark.parametrize( + "expected_func", + [ + param( + attrgetter("unary_union"), + marks=pytest.mark.xfail( + condition=vparse(gpd.__version__) >= vparse("1"), + raises=Warning, + reason="unary_union property is deprecated", + ), + id="version<1", + ), + param( + methodcaller("union_all"), + marks=pytest.mark.xfail( + condition=vparse(gpd.__version__) < vparse("1"), + raises=AttributeError, + reason="union_all doesn't exist", + ), + id="version>=1", + ), + ], +) +def test_geospatial_unary_union(zones, zones_gdf, expected_func): unary_union = zones.geom.unary_union().name("unary_union") # this returns a shapely geometry object - gp_unary_union = zones_gdf.geometry.unary_union + gp_unary_union = expected_func(zones_gdf.geometry) # using set_precision because https://github.com/duckdb/duckdb_spatial/issues/189 assert shapely.equals( diff --git a/poetry.lock b/poetry.lock index d3ff275ee488..0a5407ecd5f5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -911,23 +911,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -[[package]] -name = "click-plugins" -version = "1.1.1" -description = "An extension module for click to enable registering CLI commands via setuptools entry-points." -optional = false -python-versions = "*" -files = [ - {file = "click-plugins-1.1.1.tar.gz", hash = "sha256:46ab999744a9d831159c3411bb0c79346d94a444df9a3a3742e9ed63645f264b"}, - {file = "click_plugins-1.1.1-py2.py3-none-any.whl", hash = "sha256:5d262006d3222f5057fd81e1623d4443e41dcda5dc815c06b442aa3c02889fc8"}, -] - -[package.dependencies] -click = ">=4.0" - -[package.extras] -dev = ["coveralls", "pytest (>=3.6)", "pytest-cov", "wheel"] - [[package]] name = "clickhouse-connect" version = "0.7.12" @@ -1021,23 +1004,6 @@ pandas = ["pandas"] sqlalchemy = ["sqlalchemy (>1.3.21,<2.0)"] tzlocal = ["tzlocal"] -[[package]] -name = "cligj" -version = "0.7.2" -description = "Click params for commmand line interfaces to GeoJSON" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4" -files = [ - {file = "cligj-0.7.2-py3-none-any.whl", hash = "sha256:c1ca117dbce1fe20a5809dc96f01e1c2840f6dcc939b3ddbb1111bf330ba82df"}, - {file = "cligj-0.7.2.tar.gz", hash = "sha256:a4bc13d623356b373c2c27c53dbd9c68cae5d526270bfa71f6c6fa69669c6b27"}, -] - -[package.dependencies] -click = ">=4.0" - -[package.extras] -test = ["pytest-cov"] - [[package]] name = "cloudpickle" version = "3.0.0" @@ -1707,53 +1673,6 @@ docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1 testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8.0.1)", "pytest (>=7.4.3)", "pytest-asyncio (>=0.21)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)", "virtualenv (>=20.26.2)"] typing = ["typing-extensions (>=4.8)"] -[[package]] -name = "fiona" -version = "1.9.6" -description = "Fiona reads and writes spatial data files" -optional = false -python-versions = ">=3.7" -files = [ - {file = "fiona-1.9.6-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:63e528b5ea3d8b1038d788e7c65117835c787ba7fdc94b1b42f09c2cbc0aaff2"}, - {file = "fiona-1.9.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:918bd27d8625416672e834593970f96dff63215108f81efb876fe5c0bc58a3b4"}, - {file = "fiona-1.9.6-cp310-cp310-manylinux2014_x86_64.whl", hash = "sha256:e313210b30d09ed8f829bf625599e248dadd78622728030221f6526580ff26c5"}, - {file = "fiona-1.9.6-cp310-cp310-win_amd64.whl", hash = "sha256:89095c2d542325ee45894b8837e8048cdbb2f22274934e1be3b673ca628010d7"}, - {file = "fiona-1.9.6-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:98cea6f435843b2119731c6b0470e5b7386aa16b6aa7edabbf1ed93aefe029c3"}, - {file = "fiona-1.9.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f4230eccbd896a79d1ebfa551d84bf90f512f7bcbe1ca61e3f82231321f1a532"}, - {file = "fiona-1.9.6-cp311-cp311-manylinux2014_x86_64.whl", hash = "sha256:48b6218224e96de5e36b5eb259f37160092260e5de0dcd82ca200b1887aa9884"}, - {file = "fiona-1.9.6-cp311-cp311-win_amd64.whl", hash = "sha256:c1dd5fbc29b7303bb87eb683455e8451e1a53bb8faf20ef97fdcd843c9e4a7f6"}, - {file = "fiona-1.9.6-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:42d8a0e5570948d3821c493b6141866d9a4d7a64edad2be4ecbb89f81904baac"}, - {file = "fiona-1.9.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39819fb8f5ec6d9971cb01b912b4431615a3d3f50c83798565d8ce41917930db"}, - {file = "fiona-1.9.6-cp312-cp312-manylinux2014_x86_64.whl", hash = "sha256:9b53034efdf93ada9295b081e6a8280af7c75496a20df82d4c2ca46d65b85905"}, - {file = "fiona-1.9.6-cp312-cp312-win_amd64.whl", hash = "sha256:1dcd6eca7524535baf2a39d7981b4a46d33ae28c313934a7c3eae62eecf9dfa5"}, - {file = "fiona-1.9.6-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:e5404ed08c711489abcb3a50a184816825b8af06eb73ad2a99e18b8e7b47c96a"}, - {file = "fiona-1.9.6-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:53bedd2989e255df1bf3378ae9c06d6d241ec273c280c544bb44ffffebb97fb0"}, - {file = "fiona-1.9.6-cp37-cp37m-win_amd64.whl", hash = "sha256:77653a08564a44e634c44cd74a068d2f55d1d4029edd16d1c8aadcc4d8cc1d2c"}, - {file = "fiona-1.9.6-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:e7617563b36d2be99f048f0d0054b4d765f4aae454398f88f19de9c2c324b7f8"}, - {file = "fiona-1.9.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:50037c3b7a5f6f434b562b5b1a5b664f1caa7a4383b00af23cdb59bfc6ba852c"}, - {file = "fiona-1.9.6-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:bf51846ad602757bf27876f458c5c9f14b09421fac612f64273cc4e3fcabc441"}, - {file = "fiona-1.9.6-cp38-cp38-win_amd64.whl", hash = "sha256:11af1afc1255642a7787fe112c29d01f968f1053e4d4700fc6f3bb879c1622e0"}, - {file = "fiona-1.9.6-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:52e8fec650b72fc5253d8f86b63859acc687182281c29bfacd3930496cf982d1"}, - {file = "fiona-1.9.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c9b92aa1badb2773e7cac19bef3064d73e9d80c67c42f0928db2520a04be6f2f"}, - {file = "fiona-1.9.6-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:0eaffbf3bfae9960484c0c08ea461b0c40e111497f04e9475ebf15ac7a22d9dc"}, - {file = "fiona-1.9.6-cp39-cp39-win_amd64.whl", hash = "sha256:f1b49d51a744874608b689f029766aa1e078dd72e94b44cf8eeef6d7bd2e9051"}, - {file = "fiona-1.9.6.tar.gz", hash = "sha256:791b3494f8b218c06ea56f892bd6ba893dfa23525347761d066fb7738acda3b1"}, -] - -[package.dependencies] -attrs = ">=19.2.0" -certifi = "*" -click = ">=8.0,<9.0" -click-plugins = ">=1.0" -cligj = ">=0.5" -six = "*" - -[package.extras] -all = ["fiona[calc,s3,test]"] -calc = ["shapely"] -s3 = ["boto3 (>=1.3.1)"] -test = ["fiona[s3]", "pytest (>=7)", "pytest-cov", "pytz"] - [[package]] name = "fonttools" version = "4.53.0" @@ -1981,22 +1900,26 @@ gcsfuse = ["fusepy"] [[package]] name = "geopandas" -version = "0.14.4" +version = "1.0.0" description = "Geographic pandas extensions" optional = false python-versions = ">=3.9" files = [ - {file = "geopandas-0.14.4-py3-none-any.whl", hash = "sha256:3bb6473cb59d51e1a7fe2dbc24a1a063fb0ebdeddf3ce08ddbf8c7ddc99689aa"}, - {file = "geopandas-0.14.4.tar.gz", hash = "sha256:56765be9d58e2c743078085db3bd07dc6be7719f0dbe1dfdc1d705cb80be7c25"}, + {file = "geopandas-1.0.0-py3-none-any.whl", hash = "sha256:cdd3ddf3c9f978997c7f08d0c544b6f887c94af4bc2e01e3df3ae69a43510df3"}, + {file = "geopandas-1.0.0.tar.gz", hash = "sha256:386d42c028047e2b0f09191d7859268304761c4711a247173a88891b6161f711"}, ] [package.dependencies] -fiona = ">=1.8.21" numpy = ">=1.22" packaging = "*" pandas = ">=1.4.0" +pyogrio = ">=0.7.2" pyproj = ">=3.3.0" -shapely = ">=1.8.0" +shapely = ">=2.0.0" + +[package.extras] +all = ["GeoAlchemy2", "SQLAlchemy (>=1.3)", "folium", "geopy", "mapclassify", "matplotlib (>=3.5.0)", "psycopg-binary (>=3.1.0)", "pyarrow (>=8.0.0)", "xyzservices"] +dev = ["black", "codecov", "pre-commit", "pytest (>=3.1.0)", "pytest-cov", "pytest-xdist"] [[package]] name = "google-api-core" @@ -5318,6 +5241,52 @@ files = [ {file = "pyodbc-5.1.0.tar.gz", hash = "sha256:397feee44561a6580be08cedbe986436859563f4bb378f48224655c8e987ea60"}, ] +[[package]] +name = "pyogrio" +version = "0.9.0" +description = "Vectorized spatial vector file format I/O using GDAL/OGR" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pyogrio-0.9.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:1a495ca4fb77c69595747dd688f8f17bb7d2ea9cd86603aa71c7fc98cc8b4174"}, + {file = "pyogrio-0.9.0-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:6dc94a67163218581c7df275223488ac9b31dc582ccd756da607c3338908566c"}, + {file = "pyogrio-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e38c3c6d37cf2cc969407e4d051dcb507cfd948eb26c7b0840c4f7d7d4a71bd4"}, + {file = "pyogrio-0.9.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:f47c9b6818cc0f420015b672d5dcc488530a5ee63e5ba35a184957b21ea3922a"}, + {file = "pyogrio-0.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:fb04bd80964428491951766452f0071b0bc37c7d38c45ef02502dbd83e5d74a0"}, + {file = "pyogrio-0.9.0-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:f5d80eb846be4fc4e642cbedc1ed0c143e8d241653382ecc76a7620bbd2a5c3a"}, + {file = "pyogrio-0.9.0-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:2f2ec57ab74785db9c2bf47c0a6731e5175595a13f8253f06fa84136adb310a9"}, + {file = "pyogrio-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a289584da6df7ca318947301fe0ba9177e7f863f63110e087c80ac5f3658de8"}, + {file = "pyogrio-0.9.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:13642608a1cd67797ae8b5d792b0518d8ef3eb76506c8232ab5eaa1ea1159dff"}, + {file = "pyogrio-0.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:9440466c0211ac81f3417f274da5903f15546b486f76b2f290e74a56aaf0e737"}, + {file = "pyogrio-0.9.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:2e98913fa183f7597c609e774820a149e9329fd2a0f8d33978252fbd00ae87e6"}, + {file = "pyogrio-0.9.0-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:f8bf193269ea9d347ac3ddada960a59f1ab2e4a5c009be95dc70e6505346b2fc"}, + {file = "pyogrio-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f964002d445521ad5b8e732a6b5ef0e2d2be7fe566768e5075c1d71398da64a"}, + {file = "pyogrio-0.9.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:083351b258b3e08b6c6085dac560bd321b68de5cb4a66229095da68d5f3d696b"}, + {file = "pyogrio-0.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:796e4f6a4e769b2eb6fea9a10546ea4bdee16182d1e29802b4d6349363c3c1d7"}, + {file = "pyogrio-0.9.0-cp38-cp38-macosx_12_0_arm64.whl", hash = "sha256:7fcafed24371fe6e23bcf5abebbb29269f8d79915f1dd818ac85453657ea714a"}, + {file = "pyogrio-0.9.0-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:30cbeeaedb9bced7012487e7438919aa0c7dfba18ac3d4315182b46eb3139b9d"}, + {file = "pyogrio-0.9.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4da0b9deb380bd9a200fee13182c4f95b02b4c554c923e2e0032f32aaf1439ed"}, + {file = "pyogrio-0.9.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:4e0f90a6c3771ee1f1fea857778b4b6a1b64000d851b819f435f9091b3c38c60"}, + {file = "pyogrio-0.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:959022f3ad04053f8072dc9a2ad110c46edd9e4f92352061ba835fc91df3ca96"}, + {file = "pyogrio-0.9.0-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:2829615cf58b1b24a9f96fea42abedaa1a800dd351c67374cc2f6341138608f3"}, + {file = "pyogrio-0.9.0-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:17420febc17651876d5140b54b24749aa751d482b5f9ef6267b8053e6e962876"}, + {file = "pyogrio-0.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a2fcaa269031dbbc8ebd91243c6452c5d267d6df939c008ab7533413c9cf92d"}, + {file = "pyogrio-0.9.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:019731a856a9abfe909e86f50eb13f8362f6742337caf757c54b7c8acfe75b89"}, + {file = "pyogrio-0.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:d668cb10f2bf6ccd7c402f91e8b06290722dd09dbe265ae95b2c13db29ebeba0"}, + {file = "pyogrio-0.9.0.tar.gz", hash = "sha256:6a6fa2e8cf95b3d4a7c0fac48bce6e5037579e28d3eb33b53349d6e11f15e5a8"}, +] + +[package.dependencies] +certifi = "*" +numpy = "*" +packaging = "*" + +[package.extras] +benchmark = ["pytest-benchmark"] +dev = ["Cython"] +geopandas = ["geopandas"] +test = ["pytest", "pytest-cov"] + [[package]] name = "pyopenssl" version = "24.1.0" @@ -7712,4 +7681,4 @@ visualization = ["graphviz"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "a0ce04c4268df6dda6a10db2ea858ad3324d933f7799ad3e16102a9dde9a230f" +content-hash = "2764b71a0cc589939f1e466aeb325f93ad77771c0795fbcfdc77ffec1304549f" diff --git a/pyproject.toml b/pyproject.toml index 7c02c4dea749..fe54e1443100 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ datafusion = { version = ">=0.6,<39", optional = true } db-dtypes = { version = ">=0.3,<2", optional = true } deltalake = { version = ">=0.9.0,<1", optional = true } duckdb = { version = ">=0.8.1,<2", optional = true } -geopandas = { version = ">=0.6,<1", optional = true } +geopandas = { version = ">=0.6,<2", optional = true } google-cloud-bigquery = { version = ">=3,<4", optional = true } google-cloud-bigquery-storage = { version = ">=2,<3", optional = true } graphviz = { version = ">=0.16,<1", optional = true } diff --git a/requirements-dev.txt b/requirements-dev.txt index d09c1548dd6e..66f18f7b24a5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -31,13 +31,11 @@ cfgv==3.4.0 ; python_version >= "3.10" and python_version < "4.0" chardet==5.2.0 ; python_version >= "3.10" and python_version < "4.0" charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "4.0" cleo==2.1.0 ; python_version >= "3.10" and python_version < "4.0" -click-plugins==1.1.1 ; python_version >= "3.10" and python_version < "4.0" click==8.1.7 ; python_version >= "3.10" and python_version < "4.0" clickhouse-connect[arrow,numpy,pandas]==0.7.12 ; python_version >= "3.10" and python_version < "4.0" -cligj==0.7.2 ; python_version >= "3.10" and python_version < "4" cloudpickle==3.0.0 ; python_version >= "3.10" and python_version < "4.0" codespell[hard-encoding-detection,toml]==2.3.0 ; python_version >= "3.10" and python_version < "4.0" -colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and (sys_platform == "win32" or platform_system == "Windows" or os_name == "nt" or python_version < "3.13") +colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and (sys_platform == "win32" or platform_system == "Windows" or python_version < "3.13" or os_name == "nt") comm==0.2.2 ; python_version >= "3.10" and python_version < "3.13" contourpy==1.2.1 ; python_version >= "3.10" and python_version < "3.13" coverage[toml]==7.5.4 ; python_version >= "3.10" and python_version < "4.0" @@ -61,13 +59,12 @@ execnet==2.1.1 ; python_version >= "3.10" and python_version < "4.0" executing==2.0.1 ; python_version >= "3.10" and python_version < "4.0" fastjsonschema==2.20.0 ; python_version >= "3.10" and python_version < "4.0" filelock==3.15.4 ; python_version >= "3.10" and python_version < "4.0" -fiona==1.9.6 ; python_version >= "3.10" and python_version < "4.0" fonttools==4.53.0 ; python_version >= "3.10" and python_version < "3.13" fqdn==1.5.1 ; python_version >= "3.10" and python_version < "3.13" frozenlist==1.4.1 ; python_version >= "3.10" and python_version < "4.0" fsspec==2024.6.0 ; python_version >= "3.10" and python_version < "4.0" gcsfs==2024.6.0 ; python_version >= "3.10" and python_version < "4.0" -geopandas==0.14.4 ; python_version >= "3.10" and python_version < "4.0" +geopandas==1.0.0 ; python_version >= "3.10" and python_version < "4.0" google-api-core==2.19.0 ; python_version >= "3.10" and python_version < "4.0" google-api-core[grpc]==2.19.0 ; python_version >= "3.10" and python_version < "4.0" google-auth-oauthlib==1.2.0 ; python_version >= "3.10" and python_version < "4.0" @@ -204,6 +201,7 @@ pyinstrument==4.6.2 ; python_version >= "3.10" and python_version < "4.0" pyjwt==2.8.0 ; python_version >= "3.10" and python_version < "4.0" pymysql==1.1.1 ; python_version >= "3.10" and python_version < "4.0" pyodbc==5.1.0 ; python_version >= "3.10" and python_version < "4.0" +pyogrio==0.9.0 ; python_version >= "3.10" and python_version < "4.0" pyopenssl==24.1.0 ; python_version >= "3.10" and python_version < "4.0" pyparsing==3.1.2 ; python_version >= "3.10" and python_version < "3.13" pyproj==3.6.1 ; python_version >= "3.10" and python_version < "4.0"