Lee-W commented on code in PR #37570:
URL: https://github.com/apache/airflow/pull/37570#discussion_r1499116204


##########
tests/api_connexion/schemas/test_dataset_schema.py:
##########
@@ -162,6 +162,37 @@ def test_serialize(self, session):
         }
 
 
+class TestDatasetEventCreateSchema(TestDatasetSchemaBase):
+    def test_serialize(self, session):
+        d = DatasetModel("s3://abc")
+        session.add(d)
+        session.commit()
+        event = DatasetEvent(
+            id=1,
+            dataset_id=d.id,
+            extra={"foo": "bar"},
+            source_dag_id=None,
+            source_task_id=None,
+            source_run_id=None,
+            source_map_index=-1,
+        )
+        session.add(event)
+        session.flush()
+        serialized_data = dataset_event_schema.dump(event)
+        assert serialized_data == {
+            "id": 1,
+            "dataset_id": d.id,
+            "dataset_uri": "s3://abc",
+            "extra": {"foo": "bar"},
+            "source_dag_id": None,
+            "source_task_id": None,
+            "source_run_id": None,
+            "source_map_index": -1,

Review Comment:
   I just checked and tested. I think it should be -1 
https://github.com/apache/airflow/blob/f9317611d7f3faad918efa47090be11a4096dfbf/airflow/models/dataset.py#L277



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to