dag_id = "test-dag"
    ti = create_task_instance(dag_id=dag_id, session=session)
    ti.dag_run.state = State.RUNNING
    session.commit()
    pydantic_dag_run = DagRunPydantic.model_validate(ti.dag_run)
    json_string = pydantic_dag_run.model_dump_json()
    print(json_string)
    deserialized_model = DagRunPydantic.model_validate_json(json_string)
    assert deserialized_model.dag_id == dag_id
    assert deserialized_model.state == State.RUNNING
def test_serializing_pydantic_dagmodel():
    dag_model = DagModel(
        dag_id="test-dag",
        fileloc="/tmp/dag_1.py",
        schedule_interval="2 2 * * *",
        is_active=True,
        is_paused=False,
    )
    pydantic_dag_model = DagModelPydantic.model_validate(dag_model)
    json_string = pydantic_dag_model.model_dump_json()
    print(json_string)
    deserialized_model = DagModelPydantic.model_validate_json(json_string)
    assert deserialized_model.dag_id == "test-dag"
    assert deserialized_model.fileloc == "/tmp/dag_1.py"
    assert deserialized_model.schedule_interval == "2 2 * * *"
    assert deserialized_model.is_active is True
    assert deserialized_model.is_paused is False
def test_serializing_pydantic_local_task_job(session, create_task_instance):