kacpermuda commented on code in PR #37797:
URL: https://github.com/apache/airflow/pull/37797#discussion_r1507781181
##########
airflow/providers/openlineage/plugins/adapter.py:
##########
@@ -117,13 +117,19 @@ def build_task_instance_run_id(dag_id, task_id,
execution_date, try_number):
)
)
- def emit(self, event: RunEvent):
+ def emit(self, event: RunEvent) -> RunEvent:
+ """Emit OpenLineage event.
+
+ :param event: Event to be emitted.
+ :return: Redacted Event.
+ """
if not self._client:
self._client = self.get_or_create_openlineage_client()
redacted_event: RunEvent = self._redacter.redact(event, max_depth=20)
# type: ignore[assignment]
try:
- with Stats.timer("ol.emit.attempts"):
- return self._client.emit(redacted_event)
+ with
Stats.timer(f"ol.emit.attempts.{event.eventType.value}.{self._client.transport.kind}"):
+ self._client.emit(redacted_event)
+ return redacted_event
Review Comment:
`self._client.emit` returns nothing, so i changed the `emit()` to return
redacted_event, this way, i can pass it to the listener and emit size event
with operator name. (not sure if correct approach, but easy one 😉 )
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]