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



##########
File path: tests/serialization/test_dag_serialization.py
##########
@@ -1433,29 +1461,32 @@ def test_serialized_objects_are_sorted(self, 
object_to_serialized, expected_outp
         assert serialized_obj == expected_output
 
     def test_params_upgrade(self):
+        """when pre-2.2.0 param (i.e. primitive) is deserialized we convert to 
Param"""
         serialized = {
             "__version": 1,
             "dag": {
                 "_dag_id": "simple_dag",
-                "fileloc": __file__,
+                "fileloc": '__file__',
                 "tasks": [],
                 "timezone": "UTC",
                 "params": {"none": None, "str": "str", "dict": {"a": "b"}},
             },
         }
-        SerializedDAG.validate_schema(serialized)

Review comment:
       fyi @jedcunningham @kaxil @msumit we have to remove this line because it 
is validating pre-2.2.0 params against the current schema.  
   
   it's not needed because `validate_schema` is only called when serializing; 
not when deserializing, and the test still verifies that the json deserializes 
properly.
   
   if we wanted to keep this line, we'd have to loosen `schema.json` to allow 
arbitrary dict:
   
   ```json
   "params": {
       "anyOf": [
           { "$ref": "#/definitions/params_dict" },
           {"$ref": "#/definitions/dict"}]
   },
   ```
   
   But this is no longer the serialization schema.




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