Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shapely >= 2.0.0 not supported for google-cloud-bigquery = "^2.x.x" with extras pandas #1842

Closed
MichaelKarpe opened this issue Mar 5, 2024 · 2 comments
Labels
api: bigquery Issues related to the googleapis/python-bigquery API.

Comments

@MichaelKarpe
Copy link

Installing google-cloud-bigquery 2.x.x with pandas extras only does not enforce "Shapely (>=1.6.0,<2.0dev)" as for extras geopandas or all, leading to an ImportError when importing QueryJob.

Related error: #2855 in google-cloud-aiplatform that was marked as closed but was actually not resolved.

Environment details

  • OS type and version: Windows 11
  • Python version: python --version 3.9.6
  • pip version: pip --version 23.2
  • google-cloud-bigquery version: pip show google-cloud-bigquery 2.34.4

Steps to reproduce

  1. pip install google-cloud-bigquery==2.34.4 shapely==2.0.3
  2. from google.cloud.bigquery import QueryJob

Code example

from google.cloud.bigquery import QueryJob

Stack trace

..\.venv\lib\site-packages\...: in <module>
    from google.cloud.bigquery import QueryJob
..\.venv\lib\site-packages\google\cloud\bigquery\__init__.py:35: in <module>
    from google.cloud.bigquery.client import Client
..\.venv\lib\site-packages\google\cloud\bigquery\client.py:74: in <module>
    from google.cloud.bigquery import _pandas_helpers
..\.venv\lib\site-packages\google\cloud\bigquery\_pandas_helpers.py:56: in <module>
    _to_wkb = _to_wkb()
..\.venv\lib\site-packages\google\cloud\bigquery\_pandas_helpers.py:46: in _to_wkb
    from shapely.geos import WKBWriter, lgeos  # type: ignore
E   ImportError: cannot import name 'WKBWriter' from 'shapely.geos' (.venv\lib\site-packages\shapely\geos.py)
@MichaelKarpe
Copy link
Author

I opened #1843 if you confirm this is the way to solve the issue.

@chalmerlowe chalmerlowe added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Mar 8, 2024
@chalmerlowe
Copy link
Contributor

I am going to closing this issue and associated PR.
Version 2 of bigquery is well outside Google's publicly stated support window: lower major versions are supported for 12 months after a higher major version is released.
Version 3 was released in 2022-03-29 and thus we were committed to support version 2 until 2023-03-29.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API.
Projects
None yet
Development

No branches or pull requests

2 participants