airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Use custom dag_folder not settings.DAGS_FOLDER for FileLoadStat

Open radujica opened this issue 11 months ago • 7 comments

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.

radujica avatar Dec 19 '24 12:12 radujica

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

boring-cyborg[bot] avatar Dec 19 '24 12:12 boring-cyborg[bot]

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

radujica avatar Dec 19 '24 12:12 radujica

@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

ashb avatar Dec 19 '24 13:12 ashb

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

potiuk avatar Dec 19 '24 13:12 potiuk

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 :)

potiuk avatar Dec 19 '24 13:12 potiuk

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

ashb avatar Dec 19 '24 13:12 ashb

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 avatar Dec 19 '24 15:12 radujica

@ashb @XD-DENG not urgent, enjoy holidays! just to say this is ready for review IMO

radujica avatar Dec 27 '24 13:12 radujica

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 22 '25 00:03 github-actions[bot]