code: 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="foo",
          source_task_id="bar",
          source_run_id="custom",
          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": "foo",
          "source_task_id": "bar",
          "source_run_id": "custom",
          "source_map_index": -1,
          "timestamp": self.timestamp,
          "created_dagruns": [],
      }
  
imports: from __future__ import annotations
  import pytest
  import time_machine
  from airflow.api_connexion.schemas.dataset_schema import DatasetCollection, DatasetEventCollection, dataset_collection_schema, dataset_event_collection_schema, dataset_event_schema, dataset_schema
  from airflow.datasets import Dataset
  from airflow.models.dataset import DatasetEvent, DatasetModel
  from airflow.operators.empty import EmptyOperator
  from tests.test_utils.db import clear_db_dags, clear_db_datasets
label_desc: Use image node_id 1 for calling the TestDatasetEventSchema obj's underlying member method code with example usage: obj.test_serialize(session) without return types