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


##########
airflow-core/src/airflow/models/callback.py:
##########
@@ -14,6 +14,7 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+

Review Comment:
   nit: whitespace accident?



##########
providers/edge3/src/airflow/providers/edge3/worker_api/v2-edge-generated.yaml:
##########


Review Comment:
   Interesting that it forces re-generation. But OK.



##########
airflow-core/src/airflow/models/callback.py:
##########
@@ -169,6 +152,14 @@ def get_metric_info(self, status: CallbackState, result: 
Any) -> dict:
 
         return {"stat": name, "tags": tags}
 
+    def get_dag_id(self) -> str | None:
+        """Return the DAG ID for scheduler routing."""
+        return self.data.get("dag_id")
+
+    def get_executor_name(self) -> str | None:
+        """Return the executor name for scheduler routing."""
+        return self.data.get("executor")

Review Comment:
   How about making this a property of the class?
   ```suggestion
       @property
       def dag_id(self) -> str | None:
           """Return the DAG ID for scheduler routing."""
           return self.data.get("dag_id")
   
       @property
       def executor_name(self) -> str | None:
           """Return the executor name for scheduler routing."""
           return self.data.get("executor")
   ```



##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -802,6 +803,14 @@ def key(self) -> TaskInstanceKey:
         """Returns a tuple that identifies the task instance uniquely."""
         return TaskInstanceKey(self.dag_id, self.task_id, self.run_id, 
self.try_number, self.map_index)
 
+    def get_dag_id(self) -> str:
+        """Return the DAG ID for scheduler routing."""
+        return self.dag_id
+
+    def get_executor_name(self) -> str | None:
+        """Return the executor name for scheduler routing."""
+        return self.executor

Review Comment:
   How about making this a property of the class?
   ```suggestion
       @property
       def dag_id(self) -> str:
           """Return the DAG ID for scheduler routing."""
           return self.dag_id
   
       @property
       def executor_name(self) -> str | None:
           """Return the executor name for scheduler routing."""
           return self.executor
   ```



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