Lee-W commented on code in PR #49164:
URL: https://github.com/apache/airflow/pull/49164#discussion_r2292628873


##########
airflow-core/src/airflow/serialization/serialized_objects.py:
##########
@@ -1932,85 +1932,92 @@ def serialize_dag(cls, dag: SdkDag) -> dict:
     @classmethod
     def deserialize_dag(cls, encoded_dag: dict[str, Any]) -> SerializedDAG:
         """Deserializes a DAG from a JSON object."""
-        if "dag_id" not in encoded_dag:
-            raise RuntimeError(
-                "Encoded dag object has no dag_id key.  You may need to run 
`airflow dags reserialize`."
+        try:

Review Comment:
   
   
   Updatedhttps://github.com/apache/airflow/pull/49164#discussion_r2292623452. 
The idea is that the try block should consist only of the logic that might 
raise an exception.
   
   e.g.,
   
   ```python
   try:
       c = a/b
       print(c)
   except ZeroDivisionError:
      ....
   ```
   
   is not ideal
   
   and should be changed to 
   
   ```
   try:
       c = a/b
   except ZeroDivisionError:
      ....
   
   print(c)
   ```
   
   instead
   



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