dag_id = "test-dag"
    ti = create_task_instance(dag_id=dag_id, session=session)
    ti.state = State.RUNNING
    ti.next_kwargs = {"foo": "bar"}
    session.commit()
    pydantic_task_instance = TaskInstancePydantic.model_validate(ti)
    json_string = pydantic_task_instance.model_dump_json()
    print(json_string)
    deserialized_model = TaskInstancePydantic.model_validate_json(json_string)
    assert deserialized_model.dag_id == dag_id
    assert deserialized_model.state == State.RUNNING
    assert deserialized_model.try_number == ti.try_number
    assert deserialized_model.execution_date == ti.execution_date
    assert deserialized_model.next_kwargs == {"foo": "bar"}
@pytest.mark.skipif(not _ENABLE_AIP_44, reason="AIP-44 is disabled")
def test_serializing_pydantic_dagrun(session, create_task_instance):