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

typing_extensions package isn't installed with apache-airflow-providers-amazon causing an issue for SqlToS3Operator #21566

Closed
2 tasks done
frankcash opened this issue Feb 14, 2022 · 6 comments · Fixed by #21567
Labels
area:providers kind:bug This is a clearly a bug

Comments

@frankcash
Copy link
Contributor

frankcash commented Feb 14, 2022

Apache Airflow Provider(s)

amazon

Versions of Apache Airflow Providers

3.0.0rc2

Apache Airflow version

2.2.3 (latest released)

Python version

Python 3.9.7 (default, Oct 12 2021, 02:43:43)

Operating System

Debian GNU/Linux 11 (bullseye)

Deployment

Docker-Compose

Deployment details

No response

What happened

I was working on adding this operator to a DAG and it failed to import due to a lack of a required file

What you expected to happen

No response

How to reproduce

Add


from airflow.providers.amazon.aws.transfers.sql_to_s3 import SqlToS3Operator

to a dag

Anything else

This can be resolved by adding typing-extensions==4.1.1 to requirements.txt when building the project (locally)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@frankcash frankcash added area:providers kind:bug This is a clearly a bug labels Feb 14, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 14, 2022

Thanks for opening your first issue here! Be sure to follow the issue template!

@frankcash
Copy link
Contributor Author

It looks like as of Python 3.8 this functionality can be achieved by changing the import to

from typing import Literal

instead of

from typing_extensions import Literal

but utilizing typing_extensions wouldn't break backwards compatibility it would just require a change here

typing-extensions>=3.7.4;python_version<"3.8"

@frankcash
Copy link
Contributor Author

Also looks like the SQS Sensor suffers from a similar issue https://github.com/apache/airflow/blob/main/airflow/providers/amazon/aws/sensors/sqs.py#L24

@josh-fell
Copy link
Contributor

FYI - There is typing_compat that could be used for the Literal type import.

@josh-fell
Copy link
Contributor

Might be worth putting in some sort of CI check for these compat-related imports too. @potiuk WDYT?

@potiuk
Copy link
Member

potiuk commented Feb 14, 2022

Ah yeah. Absolutely :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants