Skip to content

Conversation

@xchwan
Copy link
Contributor

@xchwan xchwan commented Nov 10, 2025


There is no chart_utils under airflow-core/tests/unit/
The log_groomer file will broken due to import error.
fix it with relative path ( I tried absolute path but it under test folder).

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Signed-off-by: Xch1 <qchwan@gmail.com>
@potiuk
Copy link
Member

potiuk commented Nov 11, 2025

The import is correct. The tests folders should be added to PYTHONPATH automatically. also the IDEs should nicely show them imported from the right place - but the problem was that our prek-hook had a bug and some of the folders created recently did not have properly namspaced __init__.py files.

Proper fix in #58211

@potiuk potiuk closed this Nov 11, 2025
@xchwan
Copy link
Contributor Author

xchwan commented Nov 12, 2025

The import is correct. The tests folders should be added to PYTHONPATH automatically. also the IDEs should nicely show them imported from the right place - but the problem was that our prek-hook had a bug and some of the folders created recently did not have properly namspaced __init__.py files.

Proper fix in #58211

Thank you for your suggestion, but adding
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
— if I’m not mistaken — would cause it to import helm_template_generator from helm-tests/tests/chart_utils instead of from airflow-core/tests/unit/charts.
Is that expected behavior?

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.

2 participants