apache-airflow-providers-openlineage 2.7.0rc1__py3-none-any.whl → 2.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of apache-airflow-providers-openlineage might be problematic. Click here for more details.

@@ -29,7 +29,7 @@ from airflow import __version__ as airflow_version
29
29
 
30
30
  __all__ = ["__version__"]
31
31
 
32
- __version__ = "2.7.0"
32
+ __version__ = "2.7.1"
33
33
 
34
34
  if packaging.version.parse(packaging.version.parse(airflow_version).base_version) < packaging.version.parse(
35
35
  "2.10.0"
@@ -222,8 +222,8 @@ class OpenLineageListener:
222
222
  tags=dag.tags,
223
223
  task=task_metadata,
224
224
  run_facets={
225
- **get_task_parent_run_facet(parent_run_id=parent_run_id, parent_job_name=dag.dag_id),
226
225
  **get_user_provided_run_facets(task_instance, TaskInstanceState.RUNNING),
226
+ **get_task_parent_run_facet(parent_run_id=parent_run_id, parent_job_name=dag.dag_id),
227
227
  **get_airflow_mapped_task_facet(task_instance),
228
228
  **get_airflow_run_facet(dagrun, dag, task_instance, task, task_uuid),
229
229
  **debug_facet,
@@ -349,8 +349,8 @@ class OpenLineageListener:
349
349
  nominal_start_time=data_interval_start,
350
350
  nominal_end_time=data_interval_end,
351
351
  run_facets={
352
- **get_task_parent_run_facet(parent_run_id=parent_run_id, parent_job_name=dag.dag_id),
353
352
  **get_user_provided_run_facets(task_instance, TaskInstanceState.SUCCESS),
353
+ **get_task_parent_run_facet(parent_run_id=parent_run_id, parent_job_name=dag.dag_id),
354
354
  **get_airflow_run_facet(dagrun, dag, task_instance, task, task_uuid),
355
355
  **get_airflow_debug_facet(),
356
356
  },
@@ -487,8 +487,8 @@ class OpenLineageListener:
487
487
  job_description=doc,
488
488
  job_description_type=doc_type,
489
489
  run_facets={
490
- **get_task_parent_run_facet(parent_run_id=parent_run_id, parent_job_name=dag.dag_id),
491
490
  **get_user_provided_run_facets(task_instance, TaskInstanceState.FAILED),
491
+ **get_task_parent_run_facet(parent_run_id=parent_run_id, parent_job_name=dag.dag_id),
492
492
  **get_airflow_run_facet(dagrun, dag, task_instance, task, task_uuid),
493
493
  **get_airflow_debug_facet(),
494
494
  },
@@ -24,8 +24,10 @@ from airflow.models import Param
24
24
  from airflow.models.xcom_arg import XComArg
25
25
 
26
26
  if TYPE_CHECKING:
27
+ from airflow.providers.openlineage.utils.utils import AnyOperator
27
28
  from airflow.sdk import DAG, BaseOperator
28
29
  from airflow.sdk.definitions.mappedoperator import MappedOperator
30
+ from airflow.serialization.serialized_objects import SerializedDAG
29
31
 
30
32
  T = TypeVar("T", bound=DAG | BaseOperator | MappedOperator)
31
33
  else:
@@ -76,7 +78,7 @@ def disable_lineage(obj: T) -> T:
76
78
  return obj
77
79
 
78
80
 
79
- def is_task_lineage_enabled(task: BaseOperator | MappedOperator) -> bool:
81
+ def is_task_lineage_enabled(task: AnyOperator) -> bool:
80
82
  """Check if selective enable OpenLineage parameter is set to True on task level."""
81
83
  if task.params.get(ENABLE_OL_PARAM_NAME) is False:
82
84
  log.debug(
@@ -85,7 +87,7 @@ def is_task_lineage_enabled(task: BaseOperator | MappedOperator) -> bool:
85
87
  return task.params.get(ENABLE_OL_PARAM_NAME) is True
86
88
 
87
89
 
88
- def is_dag_lineage_enabled(dag: DAG) -> bool:
90
+ def is_dag_lineage_enabled(dag: DAG | SerializedDAG) -> bool:
89
91
  """
90
92
  Check if DAG is selectively enabled to emit OpenLineage events.
91
93
 
@@ -34,6 +34,7 @@ from airflow import __version__ as AIRFLOW_VERSION
34
34
 
35
35
  # TODO: move this maybe to Airflow's logic?
36
36
  from airflow.models import DagRun, TaskReschedule
37
+ from airflow.models.mappedoperator import MappedOperator as SerializedMappedOperator
37
38
  from airflow.providers.openlineage import (
38
39
  __version__ as OPENLINEAGE_PROVIDER_VERSION,
39
40
  conf,
@@ -53,7 +54,7 @@ from airflow.providers.openlineage.utils.selective_enable import (
53
54
  is_task_lineage_enabled,
54
55
  )
55
56
  from airflow.providers.openlineage.version_compat import AIRFLOW_V_3_0_PLUS, get_base_airflow_version_tuple
56
- from airflow.serialization.serialized_objects import SerializedBaseOperator
57
+ from airflow.serialization.serialized_objects import SerializedBaseOperator, SerializedDAG
57
58
  from airflow.utils.module_loading import import_string
58
59
 
59
60
  if AIRFLOW_V_3_0_PLUS:
@@ -65,6 +66,8 @@ if not AIRFLOW_V_3_0_PLUS:
65
66
  from airflow.utils.session import NEW_SESSION, provide_session
66
67
 
67
68
  if TYPE_CHECKING:
69
+ from typing import TypeAlias
70
+
68
71
  from openlineage.client.event_v2 import Dataset as OpenLineageDataset
69
72
  from openlineage.client.facet_v2 import RunFacet, processing_engine_run
70
73
 
@@ -76,10 +79,11 @@ if TYPE_CHECKING:
76
79
  Redactable,
77
80
  Redacted,
78
81
  SecretsMasker,
79
- should_hide_value_for_key,
80
82
  )
81
83
  from airflow.sdk.execution_time.task_runner import RuntimeTaskInstance
82
84
  from airflow.utils.state import DagRunState, TaskInstanceState
85
+
86
+ AnyOperator: TypeAlias = BaseOperator | MappedOperator | SerializedBaseOperator | SerializedMappedOperator
83
87
  else:
84
88
  try:
85
89
  from airflow.sdk import DAG, BaseOperator
@@ -129,13 +133,13 @@ def try_import_from_string(string: str) -> Any:
129
133
  return import_string(string)
130
134
 
131
135
 
132
- def get_operator_class(task: BaseOperator) -> type:
136
+ def get_operator_class(task: BaseOperator | MappedOperator) -> type:
133
137
  if task.__class__.__name__ in ("DecoratedMappedOperator", "MappedOperator"):
134
138
  return task.operator_class
135
139
  return task.__class__
136
140
 
137
141
 
138
- def get_operator_provider_version(operator: BaseOperator | MappedOperator) -> str | None:
142
+ def get_operator_provider_version(operator: AnyOperator) -> str | None:
139
143
  """Get the provider package version for the given operator."""
140
144
  try:
141
145
  class_path = get_fully_qualified_class_name(operator)
@@ -215,7 +219,7 @@ def _truncate_string_to_byte_size(s: str, max_size: int = _MAX_DOC_BYTES) -> str
215
219
  return truncated.decode("utf-8", errors="ignore")
216
220
 
217
221
 
218
- def get_task_documentation(operator: BaseOperator | MappedOperator | None) -> tuple[str | None, str | None]:
222
+ def get_task_documentation(operator: AnyOperator | None) -> tuple[str | None, str | None]:
219
223
  """Get task documentation and mime type, truncated to _MAX_DOC_BYTES bytes length, if present."""
220
224
  if not operator:
221
225
  return None, None
@@ -242,7 +246,7 @@ def get_task_documentation(operator: BaseOperator | MappedOperator | None) -> tu
242
246
  return None, None
243
247
 
244
248
 
245
- def get_dag_documentation(dag: DAG | None) -> tuple[str | None, str | None]:
249
+ def get_dag_documentation(dag: DAG | SerializedDAG | None) -> tuple[str | None, str | None]:
246
250
  """Get dag documentation and mime type, truncated to _MAX_DOC_BYTES bytes length, if present."""
247
251
  if not dag:
248
252
  return None, None
@@ -313,23 +317,23 @@ def get_user_provided_run_facets(ti: TaskInstance, ti_state: TaskInstanceState)
313
317
  return custom_facets
314
318
 
315
319
 
316
- def get_fully_qualified_class_name(operator: BaseOperator | MappedOperator) -> str:
317
- if isinstance(operator, (MappedOperator, SerializedBaseOperator)):
320
+ def get_fully_qualified_class_name(operator: AnyOperator) -> str:
321
+ if isinstance(operator, (SerializedMappedOperator, SerializedBaseOperator)):
318
322
  # as in airflow.api_connexion.schemas.common_schema.ClassReferenceSchema
319
323
  return operator._task_module + "." + operator.task_type
320
324
  op_class = get_operator_class(operator)
321
325
  return op_class.__module__ + "." + op_class.__name__
322
326
 
323
327
 
324
- def is_operator_disabled(operator: BaseOperator | MappedOperator) -> bool:
328
+ def is_operator_disabled(operator: AnyOperator) -> bool:
325
329
  return get_fully_qualified_class_name(operator) in conf.disabled_operators()
326
330
 
327
331
 
328
- def is_selective_lineage_enabled(obj: DAG | BaseOperator | MappedOperator) -> bool:
332
+ def is_selective_lineage_enabled(obj: DAG | SerializedDAG | AnyOperator) -> bool:
329
333
  """If selective enable is active check if DAG or Task is enabled to emit events."""
330
334
  if not conf.selective_enable():
331
335
  return True
332
- if isinstance(obj, DAG):
336
+ if isinstance(obj, (DAG, SerializedDAG)):
333
337
  return is_dag_lineage_enabled(obj)
334
338
  if isinstance(obj, (BaseOperator, MappedOperator)):
335
339
  return is_task_lineage_enabled(obj)
@@ -750,7 +754,7 @@ def get_airflow_state_run_facet(
750
754
  }
751
755
 
752
756
 
753
- def _get_tasks_details(dag: DAG) -> dict:
757
+ def _get_tasks_details(dag: DAG | SerializedDAG) -> dict:
754
758
  tasks = {
755
759
  single_task.task_id: {
756
760
  "operator": get_fully_qualified_class_name(single_task),
@@ -769,7 +773,7 @@ def _get_tasks_details(dag: DAG) -> dict:
769
773
  return tasks
770
774
 
771
775
 
772
- def _get_task_groups_details(dag: DAG) -> dict:
776
+ def _get_task_groups_details(dag: DAG | SerializedDAG) -> dict:
773
777
  return {
774
778
  tg_id: {
775
779
  "parent_group": tg.parent_group.group_id,
@@ -781,7 +785,7 @@ def _get_task_groups_details(dag: DAG) -> dict:
781
785
  }
782
786
 
783
787
 
784
- def _emits_ol_events(task: BaseOperator | MappedOperator) -> bool:
788
+ def _emits_ol_events(task: AnyOperator) -> bool:
785
789
  config_selective_enabled = is_selective_lineage_enabled(task)
786
790
  config_disabled_for_operators = is_operator_disabled(task)
787
791
  # empty operators without callbacks/outlets are skipped for optimization by Airflow
@@ -842,8 +846,19 @@ class OpenLineageRedactor(SecretsMasker):
842
846
  instance = cls()
843
847
  instance.patterns = other.patterns
844
848
  instance.replacer = other.replacer
849
+ for attr in ["sensitive_variables_fields", "min_length_to_mask", "secret_mask_adapter"]:
850
+ if hasattr(other, attr):
851
+ setattr(instance, attr, getattr(other, attr))
845
852
  return instance
846
853
 
854
+ def _should_hide_value_for_key(self, name):
855
+ """Compatibility helper for should_hide_value_for_key across Airflow versions."""
856
+ try:
857
+ return self.should_hide_value_for_key(name)
858
+ except AttributeError:
859
+ # fallback to module level function
860
+ return should_hide_value_for_key(name)
861
+
847
862
  def _redact(self, item: Redactable, name: str | None, depth: int, max_depth: int, **kwargs) -> Redacted: # type: ignore[override]
848
863
  if AIRFLOW_V_3_0_PLUS:
849
864
  # Keep compatibility for Airflow 2.x, remove when Airflow 3.0 is the minimum version
@@ -864,7 +879,7 @@ class OpenLineageRedactor(SecretsMasker):
864
879
  # Those are deprecated values in _DEPRECATION_REPLACEMENTS
865
880
  # in airflow.utils.context.Context
866
881
  return "<<non-redactable: Proxy>>"
867
- if name and should_hide_value_for_key(name):
882
+ if name and self._should_hide_value_for_key(name):
868
883
  return self._redact_all(item, depth, max_depth)
869
884
  if attrs.has(type(item)):
870
885
  # TODO: FIXME when mypy gets compatible with new attrs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: apache-airflow-providers-openlineage
3
- Version: 2.7.0rc1
3
+ Version: 2.7.1
4
4
  Summary: Provider package apache-airflow-providers-openlineage for Apache Airflow
5
5
  Keywords: airflow-provider,openlineage,airflow,integration
6
6
  Author-email: Apache Software Foundation <dev@airflow.apache.org>
@@ -20,15 +20,15 @@ Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
21
  Classifier: Programming Language :: Python :: 3.13
22
22
  Classifier: Topic :: System :: Monitoring
23
- Requires-Dist: apache-airflow>=2.10.0rc1
24
- Requires-Dist: apache-airflow-providers-common-sql>=1.20.0rc1
25
- Requires-Dist: apache-airflow-providers-common-compat>=1.4.0rc1
23
+ Requires-Dist: apache-airflow>=2.10.0
24
+ Requires-Dist: apache-airflow-providers-common-sql>=1.20.0
25
+ Requires-Dist: apache-airflow-providers-common-compat>=1.4.0
26
26
  Requires-Dist: attrs>=22.2
27
27
  Requires-Dist: openlineage-integration-common>=1.36.0
28
28
  Requires-Dist: openlineage-python>=1.36.0
29
29
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
30
- Project-URL: Changelog, https://airflow.staged.apache.org/docs/apache-airflow-providers-openlineage/2.7.0/changelog.html
31
- Project-URL: Documentation, https://airflow.staged.apache.org/docs/apache-airflow-providers-openlineage/2.7.0
30
+ Project-URL: Changelog, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/2.7.1/changelog.html
31
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-openlineage/2.7.1
32
32
  Project-URL: Mastodon, https://fosstodon.org/@airflow
33
33
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
34
34
  Project-URL: Source Code, https://github.com/apache/airflow
@@ -59,7 +59,7 @@ Project-URL: YouTube, https://www.youtube.com/channel/UCSXwxpWZQ7XZ1WL3wqevChA/
59
59
 
60
60
  Package ``apache-airflow-providers-openlineage``
61
61
 
62
- Release: ``2.7.0``
62
+ Release: ``2.7.1``
63
63
 
64
64
 
65
65
  `OpenLineage <https://openlineage.io/>`__
@@ -72,7 +72,7 @@ This is a provider package for ``openlineage`` provider. All classes for this pr
72
72
  are in ``airflow.providers.openlineage`` python package.
73
73
 
74
74
  You can find package information and changelog for the provider
75
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/2.7.0/>`_.
75
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/2.7.1/>`_.
76
76
 
77
77
  Installation
78
78
  ------------
@@ -118,5 +118,5 @@ Dependent package
118
118
  ================================================================================================================== =================
119
119
 
120
120
  The changelog for the provider package can be found in the
121
- `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/2.7.0/changelog.html>`_.
121
+ `changelog <https://airflow.apache.org/docs/apache-airflow-providers-openlineage/2.7.1/changelog.html>`_.
122
122
 
@@ -1,5 +1,5 @@
1
1
  airflow/providers/openlineage/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
2
- airflow/providers/openlineage/__init__.py,sha256=V74GXGDPbkHBL8PGjhukBdt2qnse-q5vXJaaIwZcp-4,1500
2
+ airflow/providers/openlineage/__init__.py,sha256=nYsV_xtFWF8HJOMfs8oL5yZCnRUSCSNP2uPr4_oa1fE,1500
3
3
  airflow/providers/openlineage/conf.py,sha256=9v2DpQ84BBCdRxPlh8QsboTqX8HXe-qeHVcTMRL5c3o,5807
4
4
  airflow/providers/openlineage/get_provider_info.py,sha256=2Oy13q-jA-UYt-a9pYBk4PnImYshGnJCPD1Jj80ChNw,9453
5
5
  airflow/providers/openlineage/sqlparser.py,sha256=8Aq0qbUUBthKjXBV756p2aBf8RYfCuBBfgxwhGpQIg4,20360
@@ -20,15 +20,15 @@ airflow/providers/openlineage/operators/empty.py,sha256=g3ksadUeHW6IydzqIT4KxGU3
20
20
  airflow/providers/openlineage/plugins/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
21
21
  airflow/providers/openlineage/plugins/adapter.py,sha256=moIgAoBTTVaKuU-i00xvkKyR7Rv9hoIU79awcZVJwg8,23065
22
22
  airflow/providers/openlineage/plugins/facets.py,sha256=x2EPwst9MsoO53OpFV_aANO_rhiPq_2GLP4UOrqBnnQ,4279
23
- airflow/providers/openlineage/plugins/listener.py,sha256=wtYWPl_rftzp842gtUpnhr5ffraz-78vakUWxAztUtM,32329
23
+ airflow/providers/openlineage/plugins/listener.py,sha256=IQbTH5yvbR7R85Ffuvxq3oCi_5a_VDy_FVongNSMCfI,32329
24
24
  airflow/providers/openlineage/plugins/macros.py,sha256=RfxkpNq78CHzfTAf9X7MQ_zRArMRu9sSD2j69fPSK7s,5265
25
25
  airflow/providers/openlineage/plugins/openlineage.py,sha256=dP3GOVtOGAIokeaeRx2OW_c1TKAxDvATlD9OGMyXqr0,2032
26
26
  airflow/providers/openlineage/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
27
- airflow/providers/openlineage/utils/selective_enable.py,sha256=Nf94UaziAQHDvpx7bEDMRbT3twXVslDilUI1ZTEOB0M,3382
27
+ airflow/providers/openlineage/utils/selective_enable.py,sha256=XpozjxcWBASAQXSR2N0GkA-QZVq6EmerOzyR4-eQ64M,3521
28
28
  airflow/providers/openlineage/utils/spark.py,sha256=X5liLxVLgQcgPF_0lFtQULeMOv_9dGj-HFjtZvWFgOo,7626
29
29
  airflow/providers/openlineage/utils/sql.py,sha256=b_k2fUyGGWzR1eau7tgq7vKQJsR7wPQzDF8M-WRq6jk,9548
30
- airflow/providers/openlineage/utils/utils.py,sha256=AqsrTPAoXoPnetJPxRED9qa1tsdECP44352gnuTbVj0,35715
31
- apache_airflow_providers_openlineage-2.7.0rc1.dist-info/entry_points.txt,sha256=GAx0_i2OeZzqaiiiYuA-xchICDXiCT5kVqpKSxsOjt4,214
32
- apache_airflow_providers_openlineage-2.7.0rc1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
33
- apache_airflow_providers_openlineage-2.7.0rc1.dist-info/METADATA,sha256=d9ZUhTdnTDNhPFEw7hYM0YnC9RTOTytbvnC_pMVcv00,5714
34
- apache_airflow_providers_openlineage-2.7.0rc1.dist-info/RECORD,,
30
+ airflow/providers/openlineage/utils/utils.py,sha256=4sSXFo8reWjULIUdymCcpjwyCacaU_PhoBGyg8oa6pM,36466
31
+ apache_airflow_providers_openlineage-2.7.1.dist-info/entry_points.txt,sha256=GAx0_i2OeZzqaiiiYuA-xchICDXiCT5kVqpKSxsOjt4,214
32
+ apache_airflow_providers_openlineage-2.7.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
33
+ apache_airflow_providers_openlineage-2.7.1.dist-info/METADATA,sha256=jDZJjRvk6jrtako4OVtJHg8iecARz34XevVNHxyrkoE,5688
34
+ apache_airflow_providers_openlineage-2.7.1.dist-info/RECORD,,