jscheffl commented on code in PR #62705:
URL: https://github.com/apache/airflow/pull/62705#discussion_r2874785033


##########
providers/edge3/src/airflow/providers/edge3/executors/edge_executor.py:
##########
@@ -192,11 +197,14 @@ def _update_orphaned_jobs(self, session: Session) -> bool:
                     "queue": job.queue,
                     "state": str(TaskInstanceState.FAILED),
                 }
-                Stats.incr(
-                    
f"edge_worker.ti.finish.{job.queue}.{TaskInstanceState.FAILED}.{job.dag_id}.{job.task_id}",
-                    tags=tags,
-                )
-                Stats.incr("edge_worker.ti.finish", tags=tags)
+                if DualStatsManager is not None:

Review Comment:
   In other places we used to take the `AIRFLOW_V_3_2_PLUS` constant - that is 
a signal for us once we drop support for <3.2 we can clean the code.
   
   Can you adjust it here as well? Then in ~2+ Years we have it easier to find 
for cleaning up the back-compat.
   
   Like:
   ```
   if AIRFLOW_V_3_2_PLUS:
       from airflow.sdk.observability.stats import DualStatsManager
   
       DualStatsManager.incr("edge_worker.ti.finish", tags={}, 
legacy_name_tags=tags)
   else:
       Stats.incr(... the legacy way...)



-- 
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]

Reply via email to