airflow
airflow copied to clipboard
Use custom dag_folder not settings.DAGS_FOLDER for FileLoadStat
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.
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
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 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
TL;DR; is directly there in the contributing docs BTW: https://github.com/apache/airflow/blob/main/contributing-docs/07_local_virtualenv.rst
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 :)
uv run -- knew about but forgot as I'm so used to activating venvs for my workflow.
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.
@ashb @XD-DENG not urgent, enjoy holidays! just to say this is ready for review IMO
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.