dstandish commented on a change in pull request #19267:
URL: https://github.com/apache/airflow/pull/19267#discussion_r743321614



##########
File path: tests/serialization/test_dag_serialization.py
##########
@@ -733,7 +735,10 @@ def test_dag_params_roundtrip(self, val, expected_val):
         dag = DAG(dag_id='simple_dag', params=val)
         BaseOperator(task_id='simple_task', dag=dag, start_date=datetime(2019, 
8, 1))
 
-        serialized_dag = SerializedDAG.to_dict(dag)
+        serialized_dag_json = SerializedDAG.to_json(dag)
+
+        serialized_dag = json.loads(serialized_dag_json)

Review comment:
       by calling `to_json` we make this test stricter.  the full serialization 
process not only converts to a dictionary  (which is python, thus can handle 
arbitrary data types) but also ultimately serializes to json.  but the test 
previously did not convert to json it only to dict and  back.  and this is 
actually one of the reasons we did not catch the `set` issue, because itt 
worked for to_dict but not for to_json.
   
   so here we first go all the way to json before deserilaizing.  in other 
words, previously the round trip wasn't really a full round trip and that's 
what this change fixes.




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