-
Notifications
You must be signed in to change notification settings - Fork 180
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
Build DagFactory DAGs when there is an invalid YAML in the DAGs folder #184
Conversation
@quy196hp Thank you very much for your contribution, and I am sorry for the delay in giving feedback. Please, could you address the linting issue, so the checks pass?
|
6e3ebdf
to
60294b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test needs fixing too:
=========================== short test summary info ============================
FAILED tests/test_dagfactory.py::test_load_yaml_dags_fail - Failed: DID NOT RAISE <class 'Exception'>
========================= 1 failed, 79 passed in 2.26s =========================
___________________________ test_load_yaml_dags_fail ___________________________
def test_load_yaml_dags_fail():
with pytest.raises(Exception):
> load_yaml_dags(
globals_dict=globals(),
dags_folder="tests/fixtures",
suffix=["invalid_yaml.yml"],
)
E Failed: DID NOT RAISE <class 'Exception'>
@quydx I added tests in 90487b0 and e9a3c72. They are based on the PR #236 The idea is not to delete the test but to check if we're logging the error message as expected so that this type of error isn't hidden. Additionally, I thought it was helpful to add an invalid With these, the feature is fully covered with tests and we can guarantee the new behaviour is as intended. |
Greate idea @tatiana , it seems more comprehensive way to handle this case. Things are good now |
### Added - Support using envvar in config YAML by @tatiana in #236 - **Callback improvements** - Support installed code via python callable string by @john-drews in #221 - Add `callback_file` & `callback_name` to `default_args` DAG level by @subbota19 in #218 - Cast callbacks to functions when set with `default_args` on TaskGroups by @Baraldo and @pankajastro in #235 - **Telemetry** - For more information, please, read the [Privacy Notice](https://github.com/astronomer/dag-factory/blob/main/PRIVACY_NOTICE.md#collection-of-data). - Add scarf to readme for website analytics by @cmarteepants in #219 - Support telemetry during DAG parsing emitting data to Scarf by @tatiana in #250. ### Fixed - Build DAGs when tehre is an invalid YAML in the DAGs folder by @quydx and @tatiana in #184 ### Others - Development tools - Fix make docker-run by @pankajkoti in #249 - Add vim dot files to .gitignore by @tatiana in #228 - Use Hatchling to modern package building by @kaxil in #208 - CI - Fix static check failures in PR #218 by @pankajkoti in #251 - Fix pre-commit checks by @tatiana in #247 - Remove tox and corresponding build jobs in CI by @pankajkoti in #248 - Install Airflow with different versions in the CI by @pankajkoti in #237 - Run pre-commit hooks on all existing files by @pankajkoti in #245 - Add Python 3.11 and 3.12 to CI test pipeline by @pankajkoti in #229 - Tests - Fix duplicate test name by @pankajastro in #234 - Add static check by @pankajastro in #231 - Fix running tests locally (outside the CI) by @tatiana in #227 - Add the task_2 back to dataset example by @cmarteepants in #204 - Remove unnecessary config line by @jlaneve in #202 - Documentation - Update the license from MIT to Apache 2.0 by @pankajastro in #191 - Add registration icon and links to Airflow references by @cmarteepants in #190 - Update quickstart and add feature examples by @cmarteepants #189 ### Breaking changes - Removed support for Python 3.7 - The license was changed from MIT to Apache 2.0 Closes: #217
Before, when the Airflow DAGs folder had an invalid YAML file, no DagFactory DAGs would be loaded. This PR changes this behaviour to log any invalid YAML file paths but render valid DagFactory YAML-based DAGs.
Co-authored-by: Tatiana Al-Chueyr [email protected]