xBis7 commented on code in PR #63932:
URL: https://github.com/apache/airflow/pull/63932#discussion_r3123141604
##########
providers/openlineage/src/airflow/providers/openlineage/plugins/adapter.py:
##########
@@ -162,18 +158,18 @@ def emit(self, event: RunEvent):
transport_type = f"{self._client.transport.kind}".lower()
try:
- with ExitStack() as stack:
- if DualStatsManager is not None:
- stack.enter_context(
- DualStatsManager.timer(
- "ol.emit.attempts",
- extra_tags={"event_type": event_type,
"transport_type": transport_type},
- )
- )
- else:
-
stack.enter_context(Stats.timer(f"ol.emit.attempts.{event_type}.{transport_type}"))
- stack.enter_context(Stats.timer("ol.emit.attempts"))
-
+ ctx: AbstractContextManager[object]
+ if AIRFLOW_V_3_2_1_PLUS:
+ ctx = Stats.timer(
+ "ol.emit.attempts",
+ legacy_name_tags={"event_type": event_type,
"transport_type": transport_type},
Review Comment:
In the places where it's provided, it is then merged with the `tags` param
and the values then end up as tags in the modern name.
On second thought, I think a have a simpler approach than using this param,
that will help us get rid of the back compat checks for the params.
We will always use just `tags` and get the legacy name variables from the
YAML. Internally, `stats` will cross-reference the provided tags with what is
listed on the YAML file.
There won't be any merging of the dictionaries and the YAML will be the
single source of truth which is the actual intention.
--
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]