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

Remove urllib3.BaseHTTPResponse as a type-hint. #647

Conversation

JohnMoutafis
Copy link
Contributor

@JohnMoutafis JohnMoutafis commented Sep 16, 2024

Issue

By merging this PR we introduced an unforeseen issue coming from urllib3 (although the issue is documented as fixed).

Traceback (most recent call last):
1368
  File "/mnt/test/verify_tiledb_version.py", line 9, in <module>
1369
    import tiledb
1370
  File "/opt/conda/lib/python3.9/site-packages/tiledb/__init__.py", line 119, in <module>
1371
    from tiledb.cloud.cloudarray import CloudArray
1372
  File "/opt/conda/lib/python3.9/site-packages/tiledb/cloud/__init__.py", line 3, in <module>
1373
    from . import array
1374
  File "/opt/conda/lib/python3.9/site-packages/tiledb/cloud/array.py", line 7, in <module>
1375
    from . import client
1376
  File "/opt/conda/lib/python3.9/site-packages/tiledb/cloud/client.py", line 17, in <module>
1377
    from tiledb.cloud import tiledb_cloud_error
1378
  File "/opt/conda/lib/python3.9/site-packages/tiledb/cloud/tiledb_cloud_error.py", line 11, in <module>
1379
    class TileDBCloudError(tiledb.TileDBError):
1380
  File "/opt/conda/lib/python3.9/site-packages/tiledb/cloud/tiledb_cloud_error.py", line 36, in TileDBCloudError
1381
    def from_response(cls, resp: urllib3.BaseHTTPResponse) -> Self:
1382
AttributeError: module 'urllib3' has no attribute 'BaseHTTPResponse'

Proposed Solution

Remove that type hint

@Shelnutt2
Copy link
Member

Can this be changed to handle it in the same we we did in #588 ?

@JohnMoutafis
Copy link
Contributor Author

Will try that @Shelnutt2 thanks!

@JohnMoutafis JohnMoutafis merged commit 3f07d51 into main Sep 16, 2024
15 of 18 checks passed
@JohnMoutafis JohnMoutafis deleted the johnmoutafis/sc-55182/cloud-py-v0-12-25-udf-and-jupyterhub-release branch September 16, 2024 14:06
@thetorpedodog
Copy link
Contributor

What’s embarrassing is that the change in #588 is from when I did this exact thing before!

By merging this PR we introduced an unforeseen issue coming from urllib3 (although the issue is documented as fixed).

For the record this is not an issue with it not being in __all__; that only affects if BaseHTTPResponse is added to your module’s namespace if you do from urllib3 import *. Instead, it’s because the latest version of urllib3 that works with Python 3.8 is so old it doesn’t have BaseHTTPResponse as a concept yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants