This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 1dc852d  Add __repr__ to SerializedDagModel (#9862)
1dc852d is described below

commit 1dc852d4afe8073cf9b410cc5e98955d2028cb4a
Author: Kaxil Naik <[email protected]>
AuthorDate: Sat Jul 18 22:28:31 2020 +0100

    Add __repr__ to SerializedDagModel (#9862)
    
    Before: `<airflow.models.serialized_dag.SerializedDagModel at 
0x7fab30d68c50>`
    After: `<SerializedDag: example_xcom_args>`
---
 airflow/models/serialized_dag.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/airflow/models/serialized_dag.py b/airflow/models/serialized_dag.py
index bac2c4c..5592127 100644
--- a/airflow/models/serialized_dag.py
+++ b/airflow/models/serialized_dag.py
@@ -76,6 +76,9 @@ class SerializedDagModel(Base):
         self.data = SerializedDAG.to_dict(dag)
         self.last_updated = timezone.utcnow()
 
+    def __repr__(self):
+        return f"<SerializedDag: {self.dag_id}>"
+
     @classmethod
     @provide_session
     def write_dag(cls, dag: DAG, min_update_interval: Optional[int] = None, 
session=None):

Reply via email to