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

Upgrading requests-toolbelt to version 1.0.0 #14410

Closed
LeoNatanian opened this issue May 23, 2023 · 2 comments
Closed

Upgrading requests-toolbelt to version 1.0.0 #14410

LeoNatanian opened this issue May 23, 2023 · 2 comments

Comments

@LeoNatanian
Copy link

requests-toolbelt==0.10.1

Problem:
On a clean install using the project-tutorial from the dagster website, the application did not run out-of-the-box using the dagster dev command line. For reference: https://docs.dagster.io/tutorial/setup.

When running the dagster dev line, i received the following stack trace error which originated from:

ImportError: cannot import name 'appengine' from 'urllib3.contrib' (/home/lnatanian/dev/dagster/venv/lib/python3.8/site-packages/urllib3/contrib/__init__.py)

Solution:
TL;DR: Using pip3 install requests-toolbelt --upgrade and upgrading the version to 1.0.0 it began working.

I dove into the urllib3 library that originated the error and noticed that there was an a large if-else block that attempted to import various requests libraries depending on the requests version in the environment. This hinted that requests library was likely the culprit. Checking the versioning number between the two, I decided to upgrade to the latest and it now works. My suggestion is to use the latest version 1.0.0 if it does not break regression testing.

@OwenKephart
Copy link
Contributor

Hi @LeoNatanian ! Thanks for the report. I wasn't able to reproduce this issue on a fresh virtualenv, and for reference, here's the output of my pip freeze:

alembic==1.10.4
aniso8601==9.0.1
anyio==3.6.2
backoff==2.2.1
certifi==2023.5.7
charset-normalizer==3.1.0
click==8.1.3
coloredlogs==14.0
contourpy==1.0.7
croniter==1.3.14
cycler==0.11.0
dagit==1.3.5
dagster==1.3.5
dagster-duckdb==0.19.5
dagster-duckdb-pandas==0.19.5
dagster-graphql==1.3.5
docstring-parser==0.15
duckdb==0.8.0
fonttools==4.39.4
fsspec==2023.5.0
gql==3.4.1
graphene==3.2.2
graphql-core==3.2.3
graphql-relay==3.2.0
greenlet==2.0.2
grpcio==1.47.5
grpcio-health-checking==1.47.5
h11==0.14.0
httptools==0.5.0
humanfriendly==10.0
idna==3.4
importlib-resources==5.12.0
Jinja2==3.1.2
kiwisolver==1.4.4
Mako==1.2.4
MarkupSafe==2.1.2
matplotlib==3.7.1
multidict==6.0.4
numpy==1.24.3
packaging==23.1
pandas==1.5.3
pendulum==2.1.2
Pillow==9.5.0
protobuf==4.23.1
pydantic==1.10.8
pyparsing==3.0.9
python-dateutil==2.8.2
python-dotenv==1.0.0
pytz==2023.3
pytzdata==2020.1
PyYAML==6.0
requests==2.31.0
requests-toolbelt==0.10.1
six==1.16.0
sniffio==1.3.0
SQLAlchemy==1.4.48
starlette==0.27.0
tabulate==0.9.0
tomli==2.0.1
toposort==1.10
tqdm==4.65.0
typing_extensions==4.6.0
universal_pathlib==0.0.23
urllib3==1.26.16
uvicorn==0.22.0
uvloop==0.17.0
watchdog==3.0.0
watchfiles==0.19.0
websockets==11.0.3
yarl==1.9.2
zipp==3.15.0

The line you note is not actually a pin enforced when you're installing dagster, it's just used internally when we're running Pyright (a static type checking tool). So this pin would not impact the version that pip decides to install (and in general we don't make a habit of pinning transitive dependencies). With that in mind, I'll close this issue as I think this would need to be something fixed outside of dagster.

@hbruch
Copy link

hbruch commented Nov 12, 2023

Looks this issue was introduced via qql (see also graphql-python/gql#412), this should be resolved with gql 3.5 will be released (see graphql-python/gql#439).

edit: to be more precise, qql hat requests-toolbelt fixed to <1, which is incompatible with urllib v2. Bugfix release qql 3.4.1 fixed urllib to <2 (urllib3==1.26.16 in the above freeze output)

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

No branches or pull requests

3 participants