-
Notifications
You must be signed in to change notification settings - Fork 178
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
add pydantic only for apache-airflow 2.6 #725
Conversation
First attempt failed when I ran the test. This second version passed the following sets of tests:
|
@pixie79 I may be missing something here, but doesn't this add Pydantic as a dependency for all versions of Airflow? Or where is the logic to restrict this to just Airflow 2.6? |
It adds it as optional rather than required which allows both sets of test to pass. Also then allows the restrictions on mwaa to work. |
Got it, that makes sense to me. So we're essentially asking the user to decide for themself if they need Pydantic? And if they decide they do, they just change their requirement to |
Yup, which i think is fair, what is odd is by just doing that change the tests passed and I am not really sure why they should? |
Does this or need to be switched to be against main rather than the remove-pydantic branch? |
@pixie79 this change, by itself, will break some integration tests. I think our CI is set to only run integration tests on PRs to the If you'd like to see the integration tests running and fix them - please go ahead and update your PR to be based on Otherwise, you can keep your PR as it is a co-author on the original PR #654. This will mean an additional PR to fix the integration tests, which will break once your PR is merged to #654. The first approach of making a PR in the main is probably more pragmatic; let us know your preference - we're happy either way. |
Speed up the integration tests by caching the dag bag result. Previously, for each parametrized dag run test, it would reparse all of the dags, which takes a non-trivial amount of time to parse all of the cosmos example dags. On my local machine, the total time went from 1616s to 540s, which will save a good amount of GH minutes 😃.
Fix exceptions raised for some versions of Python (e.g. 2.4) after prematurely merging astronomer#732, leading to the main branch becoming red ``` ../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.8-2.5/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:186: in exec_module exec(co, module.__dict__) tests/test_example_dags_no_connections.py:4: in <module> from functools import cache E ImportError: cannot import name 'cache' from 'functools' ```
Converts pydantic to being optional, as it is required for Airflow 2.6 but not others. Closes astronomer#725 Closes astronomer#654
Description
Adds pydantic as a requirement only if airflow version is 2.6.
Related Issue(s)
closes #654
Checklist