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



##########
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__',

Review comment:
        this value actually does not have any impact on the test.  it could be 
`/hello/world.py`  
   but when you  put `__file__` you  can't run the bit of code interactively.
   
   ```python
   serialized = {
       "__version": 1,
       "dag": {
           "_dag_id": "simple_dag",
           "fileloc": __file__,
           "tasks": [],
           "timezone": "UTC",
           "params": {"none": None, "str": "str", "dict": {"a": "b"}},
       },
   }
   dag = SerializedDAG.from_dict(serialized)
   Traceback (most recent call last):
     File 
"/Users/dstandish/.virtualenvs/local/lib/python3.8/site-packages/IPython/core/interactiveshell.py",
 line 3444, in run_code
       exec(code_obj, self.user_global_ns, self.user_ns)
     File "<ipython-input-2-4ee74d1eaf6b>", line 5, in <module>
       "fileloc": __file__,
   NameError: name '__file__' is not defined
   ```




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