Re: [PR] Fix AttributeError: 'DagRunNote' object has no attribute 'dag_id' [airflow]

2024-06-21 Thread via GitHub


uranusjr commented on code in PR #38843:
URL: https://github.com/apache/airflow/pull/38843#discussion_r1648445031


##
airflow/models/dagrun.py:
##
@@ -1661,7 +1661,5 @@ def __init__(self, content, user_id=None):
 self.user_id = user_id
 
 def __repr__(self):
-prefix = f"<{self.__class__.__name__}: {self.dag_id}.{self.dagrun_id} 
{self.run_id}"
-if self.map_index != -1:
-prefix += f" map_index={self.map_index}"
+prefix = f"<{self.__class__.__name__}: 
{self.dag_run.dag_id}.{self.dag_run_id} {self.dag_run.run_id} {self.content}"

Review Comment:
   This should still show map_index. Honestly I’m not event sure why 
`dag_run_id` should be shown, it is just a number and not really useful in any 
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: commits-unsubscr...@airflow.apache.org

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



Re: [PR] Fix AttributeError: 'DagRunNote' object has no attribute 'dag_id' [airflow]

2024-05-15 Thread via GitHub


MyLong commented on code in PR #38843:
URL: https://github.com/apache/airflow/pull/38843#discussion_r1601882632


##
airflow/models/dagrun.py:
##
@@ -1648,5 +1648,5 @@ def __init__(self, content, user_id=None):
 self.user_id = user_id
 
 def __repr__(self):
-prefix = f"<{self.__class__.__name__}: 
{self.dag_run_id}.{self.content}"
+prefix = f"<{self.__class__.__name__}: 
{self.dag_run.dag_id}.{self.dag_run_id} {self.dag_run.run_id} {self.content}"

Review Comment:
   No,Here is an example. 
   
![image](https://github.com/apache/airflow/assets/3182009/ca4d06b7-4b51-4aa2-839c-ac2b9623b3d1)
   
   
   > isn't `self.dag_run_id` and `self.dag_run.run_id` is the same?
   
   



-- 
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-unsubscr...@airflow.apache.org

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



Re: [PR] Fix AttributeError: 'DagRunNote' object has no attribute 'dag_id' [airflow]

2024-05-15 Thread via GitHub


romsharon98 commented on code in PR #38843:
URL: https://github.com/apache/airflow/pull/38843#discussion_r1601528489


##
airflow/models/dagrun.py:
##
@@ -1648,5 +1648,5 @@ def __init__(self, content, user_id=None):
 self.user_id = user_id
 
 def __repr__(self):
-prefix = f"<{self.__class__.__name__}: 
{self.dag_run_id}.{self.content}"
+prefix = f"<{self.__class__.__name__}: 
{self.dag_run.dag_id}.{self.dag_run_id} {self.dag_run.run_id} {self.content}"

Review Comment:
   isn't `self.dag_run_id` and `self.dag_run.run_id` is the same?



-- 
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-unsubscr...@airflow.apache.org

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



Re: [PR] Fix AttributeError: 'DagRunNote' object has no attribute 'dag_id' [airflow]

2024-05-15 Thread via GitHub


romsharon98 commented on code in PR #38843:
URL: https://github.com/apache/airflow/pull/38843#discussion_r1601528489


##
airflow/models/dagrun.py:
##
@@ -1648,5 +1648,5 @@ def __init__(self, content, user_id=None):
 self.user_id = user_id
 
 def __repr__(self):
-prefix = f"<{self.__class__.__name__}: 
{self.dag_run_id}.{self.content}"
+prefix = f"<{self.__class__.__name__}: 
{self.dag_run.dag_id}.{self.dag_run_id} {self.dag_run.run_id} {self.content}"

Review Comment:
   isn't self.dag_run_id and self.dag_run.run_id is the same?



-- 
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-unsubscr...@airflow.apache.org

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



Re: [PR] Fix AttributeError: 'DagRunNote' object has no attribute 'dag_id' [airflow]

2024-04-08 Thread via GitHub


MyLong commented on code in PR #38843:
URL: https://github.com/apache/airflow/pull/38843#discussion_r1556746373


##
airflow/models/dagrun.py:
##
@@ -1648,7 +1648,5 @@ def __init__(self, content, user_id=None):
 self.user_id = user_id
 
 def __repr__(self):
-prefix = f"<{self.__class__.__name__}: {self.dag_id}.{self.dagrun_id} 
{self.run_id}"
-if self.map_index != -1:
-prefix += f" map_index={self.map_index}"
+prefix = f"<{self.__class__.__name__}: 
{self.dag_run_id}.{self.content}"

Review Comment:
   ok,I will try it.



-- 
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-unsubscr...@airflow.apache.org

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



Re: [PR] Fix AttributeError: 'DagRunNote' object has no attribute 'dag_id' [airflow]

2024-04-08 Thread via GitHub


hussein-awala commented on code in PR #38843:
URL: https://github.com/apache/airflow/pull/38843#discussion_r1556607661


##
airflow/models/dagrun.py:
##
@@ -1648,7 +1648,5 @@ def __init__(self, content, user_id=None):
 self.user_id = user_id
 
 def __repr__(self):
-prefix = f"<{self.__class__.__name__}: {self.dag_id}.{self.dagrun_id} 
{self.run_id}"
-if self.map_index != -1:
-prefix += f" map_index={self.map_index}"
+prefix = f"<{self.__class__.__name__}: 
{self.dag_run_id}.{self.content}"

Review Comment:
   This information is not sufficient, we can use the `dag_run` relationship to 
fetch the dag_id and the run_id.



-- 
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-unsubscr...@airflow.apache.org

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