apache-airflow-providers-openlineage 1.9.0__py3-none-any.whl → 1.9.0rc1__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.

@@ -41,8 +41,7 @@ class OperatorLineage:
41
41
 
42
42
 
43
43
  class BaseExtractor(ABC, LoggingMixin):
44
- """
45
- Abstract base extractor class.
44
+ """Abstract base extractor class.
46
45
 
47
46
  This is used mostly to maintain support for custom extractors.
48
47
  """
@@ -56,8 +55,7 @@ class BaseExtractor(ABC, LoggingMixin):
56
55
  @classmethod
57
56
  @abstractmethod
58
57
  def get_operator_classnames(cls) -> list[str]:
59
- """
60
- Get a list of operators that extractor works for.
58
+ """Get a list of operators that extractor works for.
61
59
 
62
60
  This is an abstract method that subclasses should implement. There are
63
61
  operators that work very similarly and one extractor can cover.
@@ -79,8 +77,7 @@ class DefaultExtractor(BaseExtractor):
79
77
 
80
78
  @classmethod
81
79
  def get_operator_classnames(cls) -> list[str]:
82
- """
83
- Assign this extractor to *no* operators.
80
+ """Assign this extractor to *no* operators.
84
81
 
85
82
  Default extractor is chosen not on the classname basis, but
86
83
  by existence of get_openlineage_facets method on operator.
@@ -139,8 +139,7 @@ class OpenLineageAdapter(LoggingMixin):
139
139
  )
140
140
 
141
141
  def emit(self, event: RunEvent):
142
- """
143
- Emit OpenLineage event.
142
+ """Emit OpenLineage event.
144
143
 
145
144
  :param event: Event to be emitted.
146
145
  :return: Redacted Event.
@@ -296,17 +295,11 @@ class OpenLineageAdapter(LoggingMixin):
296
295
  """
297
296
  error_facet = {}
298
297
  if error:
299
- stack_trace = None
300
- if isinstance(error, BaseException) and error.__traceback__:
298
+ if isinstance(error, BaseException):
301
299
  import traceback
302
300
 
303
- stack_trace = "\\n".join(traceback.format_exception(type(error), error, error.__traceback__))
304
-
305
- error_facet = {
306
- "errorMessage": ErrorMessageRunFacet(
307
- message=str(error), programmingLanguage="python", stackTrace=stack_trace
308
- )
309
- }
301
+ error = "\\n".join(traceback.format_exception(type(error), error, error.__traceback__))
302
+ error_facet = {"errorMessage": ErrorMessageRunFacet(message=error, programmingLanguage="python")}
310
303
 
311
304
  event = RunEvent(
312
305
  eventType=RunState.FAIL,
@@ -102,8 +102,7 @@ class AirflowRunFacet(BaseFacet):
102
102
 
103
103
  @define(slots=False)
104
104
  class UnknownOperatorInstance(RedactMixin):
105
- """
106
- Describes an unknown operator.
105
+ """Describes an unknown operator.
107
106
 
108
107
  This specifies the (class) name of the operator and its properties.
109
108
  """
@@ -367,7 +367,7 @@ class OpenLineageListener:
367
367
  except BaseException:
368
368
  # Kill the process directly.
369
369
  self._terminate_with_wait(process)
370
- self.log.debug("Process with pid %s finished - parent", pid)
370
+ self.log.warning("Process with pid %s finished - parent", pid)
371
371
  else:
372
372
  setproctitle(getproctitle() + " - OpenLineage - " + callable_name)
373
373
  configure_orm(disable_connection_pool=True)
@@ -381,7 +381,7 @@ class OpenLineageListener:
381
381
  if not self._executor:
382
382
  self._executor = ProcessPoolExecutor(
383
383
  max_workers=conf.dag_state_change_process_pool_size(),
384
- initializer=_executor_initializer,
384
+ initializer=_executor_initializer(),
385
385
  )
386
386
  return self._executor
387
387
 
@@ -118,8 +118,7 @@ def from_table_meta(
118
118
 
119
119
 
120
120
  class SQLParser(LoggingMixin):
121
- """
122
- Interface for openlineage-sql.
121
+ """Interface for openlineage-sql.
123
122
 
124
123
  :param dialect: dialect specific to the database
125
124
  :param default_schema: schema applied to each table with no schema parsed
@@ -245,8 +244,7 @@ class SQLParser(LoggingMixin):
245
244
  sqlalchemy_engine: Engine | None = None,
246
245
  use_connection: bool = True,
247
246
  ) -> OperatorLineage:
248
- """
249
- Parse SQL statement(s) and generate OpenLineage metadata.
247
+ """Parse SQL statement(s) and generate OpenLineage metadata.
250
248
 
251
249
  Generated OpenLineage metadata contains:
252
250
 
@@ -32,8 +32,7 @@ log = logging.getLogger(__name__)
32
32
 
33
33
 
34
34
  def enable_lineage(obj: T) -> T:
35
- """
36
- Set selective enable OpenLineage parameter to True.
35
+ """Set selective enable OpenLineage parameter to True.
37
36
 
38
37
  The method also propagates param to tasks if the object is DAG.
39
38
  """
@@ -49,8 +48,7 @@ def enable_lineage(obj: T) -> T:
49
48
 
50
49
 
51
50
  def disable_lineage(obj: T) -> T:
52
- """
53
- Set selective enable OpenLineage parameter to False.
51
+ """Set selective enable OpenLineage parameter to False.
54
52
 
55
53
  The method also propagates param to tasks if the object is DAG.
56
54
  """
@@ -75,8 +73,7 @@ def is_task_lineage_enabled(task: Operator) -> bool:
75
73
 
76
74
 
77
75
  def is_dag_lineage_enabled(dag: DAG) -> bool:
78
- """
79
- Check if DAG is selectively enabled to emit OpenLineage events.
76
+ """Check if DAG is selectively enabled to emit OpenLineage events.
80
77
 
81
78
  The method also checks if selective enable parameter is set to True
82
79
  or if any of the tasks in DAG is selectively enabled.
@@ -85,8 +85,7 @@ def get_table_schemas(
85
85
  in_query: str | None,
86
86
  out_query: str | None,
87
87
  ) -> tuple[list[Dataset], list[Dataset]]:
88
- """
89
- Query database for table schemas.
88
+ """Query database for table schemas.
90
89
 
91
90
  Uses provided hook. Responsibility to provide queries for this function is on particular extractors.
92
91
  If query for input or output table isn't provided, the query is skipped.
@@ -112,8 +111,7 @@ def get_table_schemas(
112
111
 
113
112
 
114
113
  def parse_query_result(cursor) -> list[TableSchema]:
115
- """
116
- Fetch results from DB-API 2.0 cursor and creates list of table schemas.
114
+ """Fetch results from DB-API 2.0 cursor and creates list of table schemas.
117
115
 
118
116
  For each row it creates :class:`TableSchema`.
119
117
  """
@@ -150,7 +150,7 @@ class InfoJsonEncodable(dict):
150
150
  return value.isoformat()
151
151
  if isinstance(value, datetime.timedelta):
152
152
  return f"{value.total_seconds()} seconds"
153
- if isinstance(value, (set, tuple)):
153
+ if isinstance(value, (set, list, tuple)):
154
154
  return str(list(value))
155
155
  return value
156
156
 
@@ -214,12 +214,6 @@ class TaskInstanceInfo(InfoJsonEncodable):
214
214
  }
215
215
 
216
216
 
217
- class DatasetInfo(InfoJsonEncodable):
218
- """Defines encoding Airflow Dataset object to JSON."""
219
-
220
- includes = ["uri", "extra"]
221
-
222
-
223
217
  class TaskInfo(InfoJsonEncodable):
224
218
  """Defines encoding BaseOperator/AbstractOperator object to JSON."""
225
219
 
@@ -248,9 +242,6 @@ class TaskInfo(InfoJsonEncodable):
248
242
  "run_as_user",
249
243
  "sla",
250
244
  "task_id",
251
- "trigger_dag_id",
252
- "external_dag_id",
253
- "external_task_id",
254
245
  "trigger_rule",
255
246
  "upstream_task_ids",
256
247
  "wait_for_downstream",
@@ -264,8 +255,6 @@ class TaskInfo(InfoJsonEncodable):
264
255
  if hasattr(task, "task_group") and getattr(task.task_group, "_group_id", None)
265
256
  else None
266
257
  ),
267
- "inlets": lambda task: [DatasetInfo(inlet) for inlet in task.inlets],
268
- "outlets": lambda task: [DatasetInfo(outlet) for outlet in task.outlets],
269
258
  }
270
259
 
271
260
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-openlineage
3
- Version: 1.9.0
3
+ Version: 1.9.0rc1
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>
@@ -21,8 +21,8 @@ Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
23
  Classifier: Topic :: System :: Monitoring
24
- Requires-Dist: apache-airflow-providers-common-sql>=1.6.0
25
- Requires-Dist: apache-airflow>=2.7.0
24
+ Requires-Dist: apache-airflow-providers-common-sql>=1.6.0rc0
25
+ Requires-Dist: apache-airflow>=2.7.0rc0
26
26
  Requires-Dist: attrs>=22.2
27
27
  Requires-Dist: openlineage-integration-common>=1.16.0
28
28
  Requires-Dist: openlineage-python>=1.16.0
@@ -80,7 +80,7 @@ Provides-Extra: common.sql
80
80
 
81
81
  Package ``apache-airflow-providers-openlineage``
82
82
 
83
- Release: ``1.9.0``
83
+ Release: ``1.9.0.rc1``
84
84
 
85
85
 
86
86
  `OpenLineage <https://openlineage.io/>`__
@@ -2,9 +2,9 @@ airflow/providers/openlineage/LICENSE,sha256=FFb4jd2AXnOOf7XLP04pQW6jbdhG49TxlGY
2
2
  airflow/providers/openlineage/__init__.py,sha256=wyNzY61gCpS2r6Wx-q-JiM8TbOKgTbDVngFZmcVmqOc,1498
3
3
  airflow/providers/openlineage/conf.py,sha256=ZHUZF3wjFGupfFa40F1DjZSkOQJCUtWFyQM3nvz6Bq4,5099
4
4
  airflow/providers/openlineage/get_provider_info.py,sha256=v-KK3oIOhEr-LE1WE8J6MaduGde709qiUmbkOklREn4,7472
5
- airflow/providers/openlineage/sqlparser.py,sha256=qX2ID75PH11-youFvRdRHqZbYzLdbm95H3STvbBzGb8,15667
5
+ airflow/providers/openlineage/sqlparser.py,sha256=nMUA7Ak2HNfnGZ1PybWbNPENZfQIcJ1eE8AMh9UD-O8,15653
6
6
  airflow/providers/openlineage/extractors/__init__.py,sha256=I0X4f6zUniclyD9zT0DFHRImpCpJVP4MkPJT3cd7X5I,1081
7
- airflow/providers/openlineage/extractors/base.py,sha256=D-ll2cz_WWv1XYh2_UfzmpCl8S5iC2aptFTy2sWZeHY,5499
7
+ airflow/providers/openlineage/extractors/base.py,sha256=o6z8bXwNor1hwcUzezJ8LIPynR_BqXkP-qtwEgLtD2Q,5476
8
8
  airflow/providers/openlineage/extractors/bash.py,sha256=m4hLvDV4-zX4gp8apRuhpAR3Uakr8UOUxf-thTWmOxw,2563
9
9
  airflow/providers/openlineage/extractors/manager.py,sha256=9TyszMLAsgPS9NETWq7fPJjxcbTFk47x4kd1NRGCvsw,10315
10
10
  airflow/providers/openlineage/extractors/python.py,sha256=EQXCj2aHr2XXw0pNxeX-ii8UQFCoqkdf40ozqmA5d58,3151
@@ -13,16 +13,16 @@ airflow/providers/openlineage/facets/AirflowRunFacet.json,sha256=Mk85_KKwBOEcn_p
13
13
  airflow/providers/openlineage/facets/AirflowStateRunFacet.json,sha256=xhHQEKD9Jopw-oqbkCCrrwFjfXnxvuJAritsmegKjuQ,937
14
14
  airflow/providers/openlineage/facets/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
15
15
  airflow/providers/openlineage/plugins/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
16
- airflow/providers/openlineage/plugins/adapter.py,sha256=s0-eQw7cqzlUbznHdnLWihmdLKczHjuDj1TYYmJSK04,18720
17
- airflow/providers/openlineage/plugins/facets.py,sha256=kNxxnibLurcv8SV0qXPkwXxpKWhByo745vcqzWGNMIs,4450
18
- airflow/providers/openlineage/plugins/listener.py,sha256=q6r63SS3ZKdZKyTlEhw8c12onHh7kQCQ-_G1kA67btw,17952
16
+ airflow/providers/openlineage/plugins/adapter.py,sha256=nm8muyX-CwBaCNy_YDYbz-iFNL4msVZX6gFb4EaI-YE,18552
17
+ airflow/providers/openlineage/plugins/facets.py,sha256=t60uCyp-FZKAeO7PSom5eAbn0cilN_Mfciip4FWG22M,4445
18
+ airflow/providers/openlineage/plugins/listener.py,sha256=dk7omQItGSLcVw6bK56ScxLTnYQyQa1bXz2Fw402cjA,17956
19
19
  airflow/providers/openlineage/plugins/macros.py,sha256=hgFA3ZdQibyn4KXIOsKYBm4WRKDLA5q6Asscx5rvNfM,3076
20
20
  airflow/providers/openlineage/plugins/openlineage.py,sha256=rsRUW_zpXVAglzsgQRv5T9VWYY7CMQl0qRWm8-3oqDA,1678
21
21
  airflow/providers/openlineage/utils/__init__.py,sha256=9hdXHABrVpkbpjZgUft39kOFL2xSGeG4GEua0Hmelus,785
22
- airflow/providers/openlineage/utils/selective_enable.py,sha256=dFJ7wK7J_-BFwcOKp9tqFOSrASV3lmLv7HtRkEuMk3Q,3087
23
- airflow/providers/openlineage/utils/sql.py,sha256=5K3qFhevq-R4CDUZbq-XfFKPLWixIOtaypRem3jiHvw,9534
24
- airflow/providers/openlineage/utils/utils.py,sha256=Tx4YZ-Ap-P27YCmZ3ivNX-f6Wiw7RU9FdeteV9zrQRA,19852
25
- apache_airflow_providers_openlineage-1.9.0.dist-info/entry_points.txt,sha256=GAx0_i2OeZzqaiiiYuA-xchICDXiCT5kVqpKSxsOjt4,214
26
- apache_airflow_providers_openlineage-1.9.0.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
27
- apache_airflow_providers_openlineage-1.9.0.dist-info/METADATA,sha256=lhhju2QyGDIlIcT2_rnT4-JZIipJ-TCxlPJuTsopesI,6368
28
- apache_airflow_providers_openlineage-1.9.0.dist-info/RECORD,,
22
+ airflow/providers/openlineage/utils/selective_enable.py,sha256=JVTmXdQknBL-9N0drFDkVMf1HCf8C6nbITVaP4-5ba4,3072
23
+ airflow/providers/openlineage/utils/sql.py,sha256=yNBGMnWMECHtbpTh5nlaQh01O__LWkeQaSqrOVRWz6Y,9524
24
+ airflow/providers/openlineage/utils/utils.py,sha256=QBg4B-isDrizb53cQFOflFx8LVKiabwE08I70I0AxOY,19485
25
+ apache_airflow_providers_openlineage-1.9.0rc1.dist-info/entry_points.txt,sha256=GAx0_i2OeZzqaiiiYuA-xchICDXiCT5kVqpKSxsOjt4,214
26
+ apache_airflow_providers_openlineage-1.9.0rc1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
27
+ apache_airflow_providers_openlineage-1.9.0rc1.dist-info/METADATA,sha256=kamPdoPzxHZpb788jJ_RhWSQUgR1U76rKpRnraIm5Qg,6381
28
+ apache_airflow_providers_openlineage-1.9.0rc1.dist-info/RECORD,,