ds2_event_2 = DatasetEvent(dataset_id=2)
    DagScheduleDatasetReference(dag_id=dag.dag_id, dataset=ds1)
    TaskOutletDatasetReference(task_id=task1.task_id, dag_id=dag.dag_id, dataset=ds1)
    dr.consumed_dataset_events.append(ds1_event)
    dr.consumed_dataset_events.append(ds2_event_1)
    dr.consumed_dataset_events.append(ds2_event_2)
    session.commit()
    print(ds2_event_2.dataset.consuming_dags)
    pydantic_dse1 = DatasetEventPydantic.model_validate(ds1_event)
    json_string1 = pydantic_dse1.model_dump_json()
    print(json_string1)
    pydantic_dse2 = DatasetEventPydantic.model_validate(ds2_event_1)
    json_string2 = pydantic_dse2.model_dump_json()
    print(json_string2)
    pydantic_dag_run = DagRunPydantic.model_validate(dr)
    json_string_dr = pydantic_dag_run.model_dump_json()
    print(json_string_dr)
    deserialized_model1 = DatasetEventPydantic.model_validate_json(json_string1)
    assert deserialized_model1.dataset.id == 1
    assert deserialized_model1.dataset.uri == "one"
    assert len(deserialized_model1.dataset.consuming_dags) == 1
    assert len(deserialized_model1.dataset.producing_tasks) == 1
    deserialized_model2 = DatasetEventPydantic.model_validate_json(json_string2)
    assert deserialized_model2.dataset.id == 2
    assert deserialized_model2.dataset.uri == "two"
    assert len(deserialized_model2.dataset.consuming_dags) == 0
    assert len(deserialized_model2.dataset.producing_tasks) == 0
    deserialized_dr = DagRunPydantic.model_validate_json(json_string_dr)
    assert len(deserialized_dr.consumed_dataset_events) == 3