utkarsharma2 commented on code in PR #31866:
URL: https://github.com/apache/airflow/pull/31866#discussion_r1230479865


##########
tests/utils/test_json.py:
##########
@@ -111,6 +111,23 @@ def test_encode_xcom_with_nested_dict(self, data):
         e = json.loads(i, cls=utils_json.XComDecoder)
         assert data == e
 
+    @pytest.mark.parametrize(
+        "data",
+        [
+            '[{"__classname__": "airflow.datasets.Dataset", "__version__": 1,'
+            ' "__data__": {"__var": {"uri": 
"bq://google_cloud_default@?table=table_name&schema=schema_name",'
+            ' "extra": null}, "__type": "dict"}}]'
+        ],
+    )
+    def test_decode_xcom_with_old_data(self, data):
+        """
+        Ensure that the Xcom value encoded by Airflow 2.5.2 is getting decoded 
by Airflow 2.6.
+        """
+        d = json.loads(data, cls=utils_json.XComDecoder)
+        assert d == [
+            
Dataset(uri="bq://google_cloud_default@?table=table_name&schema=schema_name", 
extra=None)
+        ]
+

Review Comment:
   @hussein-awala Moved test case to 
`airflow/tests/serialization/test_serde.py` and the else part is covered by 
this testcase - 
https://github.com/apache/airflow/blob/a81ac70b33a589c58b59864df931d3293fada382/tests/serialization/test_serde.py#L259



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