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

bug: Missing attribute: WKTReader #1364

Closed
chalmerlowe opened this issue Sep 23, 2022 · 3 comments · Fixed by #1376
Closed

bug: Missing attribute: WKTReader #1364

chalmerlowe opened this issue Sep 23, 2022 · 3 comments · Fixed by #1376
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@chalmerlowe
Copy link
Contributor

An issue that appears to be in this library popped up while running a test in a related bigquery library.

.nox/prerelease/lib/python3.8/site-packages/google/cloud/bigquery/table.py:46: in <module>
    _read_wkt = shapely.geos.WKTReader(shapely.geos.lgeos).read
E   AttributeError: module 'shapely.geos' has no attribute 'WKTReader'

Based on a quick review, it appears that shapely.geos no longer has a WKTReader class and it appears that the WKTReader class has been removed from the library entirely and they might be relying on a function elsewhere in the codebase. If I had to wager a guess, I might look at the from_wkt method in io.py.

Environment details

N/A

Steps to reproduce

N/A

Code example

N/A

Stack trace

nox > py.test --quiet --junitxml=prerelease_unit_3.8_sponge_log.xml tests/unit
ImportError while loading conftest '/tmpfs/src/github/python-bigquery-sqlalchemy/tests/unit/conftest.py'.
tests/unit/conftest.py:28: in <module>
    from . import fauxdbi
tests/unit/fauxdbi.py:29: in <module>
    import google.cloud.bigquery.schema
.nox/prerelease/lib/python3.8/site-packages/google/cloud/bigquery/__init__.py:35: in <module>
    from google.cloud.bigquery.client import Client
.nox/prerelease/lib/python3.8/site-packages/google/cloud/bigquery/client.py:63: in <module>
    from google.cloud.bigquery import _job_helpers
.nox/prerelease/lib/python3.8/site-packages/google/cloud/bigquery/_job_helpers.py:24: in <module>
    from google.cloud.bigquery import job
.nox/prerelease/lib/python3.8/site-packages/google/cloud/bigquery/job/__init__.py:27: in <module>
    from google.cloud.bigquery.job.copy_ import CopyJob
.nox/prerelease/lib/python3.8/site-packages/google/cloud/bigquery/job/copy_.py:21: in <module>
    from google.cloud.bigquery.table import TableReference
.nox/prerelease/lib/python3.8/site-packages/google/cloud/bigquery/table.py:46: in <module>
    _read_wkt = shapely.geos.WKTReader(shapely.geos.lgeos).read
E   AttributeError: module 'shapely.geos' has no attribute 'WKTReader'
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Sep 23, 2022
@chalmerlowe chalmerlowe added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Sep 23, 2022
@chalmerlowe chalmerlowe self-assigned this Oct 3, 2022
@tparkerNYT
Copy link

I am still experiencing this issue with from google.cloud import aiplatform and from vertexai import preview. I am using the latest version of shapely.

@tomaxberg
Copy link

Try reinstall packages bs4, docarray, tiktoken, and streamlit. This worked for me.

@chalmerlowe
Copy link
Contributor Author

@tparkerNYT

In looking at your tracebacks, they show line 46 in the file google/cloud/bigquery/table.py as:

_read_wkt = shapely.geos.WKTReader(shapely.geos.lgeos).read

Starting in version 3.3.6 of python-bigquery, code was inserted that began to refer to objects in shapely by their current nomenclature instead of referencing WKTReader.

If you upgrade your version of python-bigquery, it should fix this issue.

Gonna leave this issue closed and close out the related one in the pubsub library

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. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants