-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Allow to disable openlineage at operator level #33685
Conversation
How is this different from setting this in config? |
The current config/env var |
Happens. Mypy uses heuristics that "guesses" type of the variables. And sometimes it gets it wrong when it does not run on "all files". Local version of pre-commit runs only on the files that are affected by commit and MyPy often will pull the other files and import them to feed it's heuristcs. But not always. So sometimes mypy is not able to guess correctly the type if it is not given explicitly all files. Also sometimes the result depend if you use the same breeze image or whether you have an old one - because you might have older version of dependencies. Also sometimes it depends on the cache you have locally built. Sometimes that cache is just not invalidated properly. And to add up, all this is succintly explained JUST below the error you see in CI. Including precise instructions on what you should do to reproduce the failure you see locally. I wonder (maybe you have an idea @RNHTTR ) how to better communicate it than the yellow message above :) ? Any ideas? |
Is it duplicate of standard configurations Airflow Env Var? |
I don't think I understand; |
@RHATTR: When yo do this (note I removed the "openlineage_" from your code to avoid double-openlineage in variable):
Then conf.get will automatically read stuff from What @Taragolis is saying is that:
can be replaced with:
And it will:
No need to do all the |
59aaef6
to
6aa2c52
Compare
6aa2c52
to
6f3f9ac
Compare
6f3f9ac
to
26298b7
Compare
This is an interesting/subtle issue you see here in the tests.... I believe the problem is that at the time of openlineage import in tests, ProvidersManager have not yet extracted the configuration for openlineage provider. (it is intialized by pytest automated fixture when the test is run). That's why - I think - the default value is missing and you are getting [openlineage/disabyled_for_operators] not found in config" The solution to that is to extract this one: _openlineage_disabled_for_operators = conf.get("openlineage", "disabled_for_operators")
openlineage_disabled_for_operators = set(
operator.strip() for operator in _openlineage_disabled_for_operators.split(";")
) to become a cached_property returning the list of disabled operators: @cached_property
def disabled_operators() -> set[str]:
return set(
operator.strip() for operator in conf.get("openlineage", "disabled_for_operators").split(";")
) then change:
into:
This will change the list to be retrieved only after provider manager already loaded defaults for provider configuration. That should solve the test failure. |
26298b7
to
0990ab2
Compare
It might be valuable to disable OpenLineage extraction at the Operator level instead of at the Airflow level. This PR adds an environment variable to check for Operators for which OpenLineage extraction has been disabled.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.