You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/19 07:07:08 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #16666: Replace execution_date with run_id in airflow tasks run command

uranusjr commented on a change in pull request #16666:
URL: https://github.com/apache/airflow/pull/16666#discussion_r691842893



##########
File path: airflow/models/taskinstance.py
##########
@@ -465,6 +466,22 @@ def next_try_number(self):
         """Setting Next Try Number"""
         return self._try_number + 1
 
+    @property
+    def run_id(self):
+        """Fetches the run_id from the associated DagRun"""
+        # TODO: Remove this once run_id is added as a column in TaskInstance
+
+        # IF we have pre-loaded it, just use that
+        info = inspect(self)
+        if info.attrs.dag_run.loaded_value is not NO_VALUE:
+            return self.dag_un.run_id

Review comment:
       TIL




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org