airflow.providers.openlineage.utils.utils¶
Attributes¶
Classes¶
Airflow objects might not be json-encodable overall. |
|
Defines encoding DAG object to JSON. |
|
Defines encoding DagRun object to JSON. |
|
Defines encoding TaskInstance object to JSON. |
|
Defines encoding Airflow Asset object to JSON. |
|
Defines encoding BaseOperator/AbstractOperator object to JSON. |
|
Defines encoding BaseOperator/AbstractOperator object to JSON used when user enables full task info. |
|
Defines encoding TaskGroup object to JSON. |
|
This class redacts sensitive data similar to SecretsMasker in Airflow logs. |
Functions¶
|
|
|
|
|
Get the provider package version for the given operator. |
|
|
|
Retrieve the parent run facet for task-level events. |
|
|
|
|
|
|
|
|
If selective enable is active check if DAG or Task is enabled to emit events. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Convert an Asset with an AIP-60 compliant URI to an OpenLineageDataset. |
Module Contents¶
- airflow.providers.openlineage.utils.utils.get_operator_provider_version(operator)[source]¶
Get the provider package version for the given operator.
- airflow.providers.openlineage.utils.utils.get_task_parent_run_facet(parent_run_id, parent_job_name, parent_job_namespace=conf.namespace())[source]¶
Retrieve the parent run facet for task-level events.
This facet currently always points to the DAG-level run ID and name, as external events for DAG runs are not yet handled.
- airflow.providers.openlineage.utils.utils.is_selective_lineage_enabled(obj)[source]¶
If selective enable is active check if DAG or Task is enabled to emit events.
- airflow.providers.openlineage.utils.utils.is_ti_rescheduled_already(ti, session=NEW_SESSION)[source]¶
- class airflow.providers.openlineage.utils.utils.InfoJsonEncodable(obj)[source]¶
Bases:
dictAirflow objects might not be json-encodable overall.
The class provides additional attributes to control what and how is encoded:
renames: a dictionary of attribute name changes
- casts: a dictionary consisting of attribute namesand corresponding methods that should changeobject value
includes: list of attributes to be included in encoding
excludes: list of attributes to be excluded from encoding
Don’t use both includes and excludes.
- class airflow.providers.openlineage.utils.utils.DagInfo(obj)[source]¶
Bases:
InfoJsonEncodableDefines encoding DAG object to JSON.
- class airflow.providers.openlineage.utils.utils.DagRunInfo(obj)[source]¶
Bases:
InfoJsonEncodableDefines encoding DagRun object to JSON.
- class airflow.providers.openlineage.utils.utils.TaskInstanceInfo(obj)[source]¶
Bases:
InfoJsonEncodableDefines encoding TaskInstance object to JSON.
- class airflow.providers.openlineage.utils.utils.AssetInfo(obj)[source]¶
Bases:
InfoJsonEncodableDefines encoding Airflow Asset object to JSON.
- class airflow.providers.openlineage.utils.utils.TaskInfo(obj)[source]¶
Bases:
InfoJsonEncodableDefines encoding BaseOperator/AbstractOperator object to JSON.
- class airflow.providers.openlineage.utils.utils.TaskInfoComplete(obj)[source]¶
Bases:
TaskInfoDefines encoding BaseOperator/AbstractOperator object to JSON used when user enables full task info.
- class airflow.providers.openlineage.utils.utils.TaskGroupInfo(obj)[source]¶
Bases:
InfoJsonEncodableDefines encoding TaskGroup object to JSON.
- airflow.providers.openlineage.utils.utils.get_airflow_run_facet(dag_run, dag, task_instance, task, task_uuid)[source]¶
- airflow.providers.openlineage.utils.utils.get_airflow_state_run_facet(dag_id, run_id, task_ids, dag_run_state)[source]¶
- airflow.providers.openlineage.utils.utils.get_unknown_source_attribute_run_facet(task, name=None)[source]¶
- class airflow.providers.openlineage.utils.utils.OpenLineageRedactor[source]¶
Bases:
airflow.sdk.execution_time.secrets_masker.SecretsMaskerThis class redacts sensitive data similar to SecretsMasker in Airflow logs.
The difference is that our default max recursion depth is way higher - due to the structure of OL events we need more depth. Additionally, we allow data structures to specify data that needs not to be redacted by specifying _skip_redact list by deriving RedactMixin.
- airflow.providers.openlineage.utils.utils.translate_airflow_asset(asset, lineage_context)[source]¶
Convert an Asset with an AIP-60 compliant URI to an OpenLineageDataset.
This function returns None if no URI normalizer is defined, no asset converter is found or some core Airflow changes are missing and ImportError is raised.