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

Use custom dag_folder not settings.DAGS_FOLDER for FileLoadStat #45073

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

radujica
Copy link

The stats would still use settings.DAGS_FOLDER despite dag_folder arg being set to a different path and used for the actual dags parsing.

Copy link

boring-cyborg bot commented Dec 19, 2024

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@radujica radujica force-pushed the fix/collect_dags-dag-folder-for-stats branch from 3518cfd to ba11246 Compare December 19, 2024 12:55
@radujica radujica marked this pull request as ready for review December 19, 2024 12:55
@radujica
Copy link
Author

I would love to write a test but for the life of me I can't find a tl;dr on how to run the dagbag tests quickly and locally without any Docker breeze.

I would have expected this to simply be:

conda create -n airflow python==3.12
pip install -e .[devel]
pytest tests/models/test_dagbag.py::test_dagbag_dag_collection

@ashb
Copy link
Member

ashb commented Dec 19, 2024

@radujica We switched to uv recently. Something like this should work

uv venv
uv sync  --extra devel --group dev
.venv/bin/pytest tests/models/test_dagbag.py::test_dagbag_dag_collection

@potiuk
Copy link
Member

potiuk commented Dec 19, 2024

TL;DR; is directly there in the contributing docs BTW: https://github.com/apache/airflow/blob/main/contributing-docs/07_local_virtualenv.rst

@potiuk
Copy link
Member

potiuk commented Dec 19, 2024

Also @ashb - not sure if you know but uv run pytest ... is a simpler replacement when you already did sync once. It will repeat the latest sync (if needed) and activate the default venv for the command :)

@ashb
Copy link
Member

ashb commented Dec 19, 2024

uv run -- knew about but forgot as I'm so used to activating venvs for my workflow.

@radujica
Copy link
Author

Thank you for the swift input both :)

Had lazily assumed I could just use conda but clearly it misses something that uv does not, as the error went away after using uv. For posterity, this works fine on my mac:

uv venv
uv sync --extra devel
uv run pytest tests/models/test_dagbag.py::TestDagBag::test_dagbag_dag_collection

Never used uv before and funny enough, it seems to override what conda does, i.e. I created a new conda env and installed pytest inside however pytest still points to the pytest installed by uv "outside" the conda env.

Anyway, will update PR with test soon enough.

@radujica radujica force-pushed the fix/collect_dags-dag-folder-for-stats branch from ba11246 to c56a5d1 Compare December 19, 2024 19:25
@radujica radujica force-pushed the fix/collect_dags-dag-folder-for-stats branch from c56a5d1 to 80bc2f9 Compare December 19, 2024 19:26
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