code: def test_serialize(self, dag_maker, session):
      dataset = Dataset(
          uri="s3://bucket/key",
          extra={"foo": "bar"},
      )
      with dag_maker(
          dag_id="test_dataset_upstream_schema",
          serialized=True,
          session=session,
      ):
          EmptyOperator(task_id="task1", outlets=[dataset])
      with dag_maker(
          dag_id="test_dataset_downstream_schema",
          schedule=[dataset],
          serialized=True,
          session=session,
      ):
          EmptyOperator(task_id="task2")
  
      dataset_model = (
          session.query(DatasetModel).filter_by(uri=dataset.uri).one()
      )
  
      serialized_data = dataset_schema.dump(dataset_model)
      serialized_data["id"] = 1
      assert serialized_data == {
          "id": 1,
          "uri": "s3://bucket/key",
          "extra": {"foo": "bar"},
          "created_at": self.timestamp,
          "updated_at": self.timestamp,
          "consuming_dags": [
              {
                  "dag_id": "test_dataset_downstream_schema",
                  "created_at": self.timestamp,
                  "updated_at": self.timestamp,
              }
          ],
          "producing_tasks": [
              {
                  "task_id": "task1",
                  "dag_id": "test_dataset_upstream_schema",
                  "created_at": self.timestamp,
                  "updated_at": self.timestamp,
              }
          ],
      }
  
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 TestDatasetSchema obj's underlying member method code with example usage: obj.test_serialize(dag_maker, session) without return types