ashb commented on a change in pull request #21445:
URL: https://github.com/apache/airflow/pull/21445#discussion_r806228240



##########
File path: tests/serialization/test_dag_serialization.py
##########
@@ -1174,6 +1175,24 @@ def test_operator_deserialize_old_names(self):
         serialized_op = SerializedBaseOperator.deserialize_operator(blob)
         assert serialized_op.downstream_task_ids == {'foo'}
 
+    def test_task_resources(self):
+        """
+        Test TaskGroup serialization/deserialization.
+        """
+        from airflow.operators.dummy import DummyOperator
+
+        execution_date = datetime(2020, 1, 1)
+        task_id = 'task1'
+        with DAG("test_task_resources", start_date=execution_date) as dag:
+            task = DummyOperator(task_id=task_id, resources={"cpus": 0.1, 
"ram": 2048})
+
+        SerializedDAG.validate_schema(SerializedDAG.to_dict(dag))
+

Review comment:
       Please can you add a test here that checks the json/dict structure, not 
just the end-to-end. (This is important for making sure that we can continue to 
load the serialized blobs we store in the DB.)




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