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

Airflint duplicates imports when they already exist in the top-level code #70

Open
csp33 opened this issue May 30, 2023 · 3 comments
Open

Comments

@csp33
Copy link

csp33 commented May 30, 2023

Example:
image
is refactored to:
image

(datetime import is duplicated)

@feluelle
Copy link
Owner

Sorry for the late reply. That is true, we are currently not checking the global usage of the same import.

@Almenon
Copy link

Almenon commented Jan 18, 2024

Same issue, I would expect it to move the import instead of copying.

@feluelle
Copy link
Owner

feluelle commented Feb 19, 2024

Yes, that is why it is currently recommended to use a tool that can detect unused imports and remove them e.g. autoflake.

Actually, the issue is about not moving to the function level, if it is not possible such as when using the dag constructor as this has to be parsed always.

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