Skip to content

Conversation

@sunank200
Copy link
Collaborator

@sunank200 sunank200 commented Feb 6, 2025

This pull request resolves a Pydantic validation error in the DmsDescribeReplicationConfigsOperator tests caused by a missing logical_date field in the DagRun instance. The test was updated to set logical_date using execution_date, ensuring successful validation and correct construction of the template context.

Previously it was throwing following error:

providers/tests/amazon/aws/operators/test_dms.py:503: in test_template_fields_native
    context = ti.get_template_context(session)
airflow/models/taskinstance.py:3242: in get_template_context
    return _get_template_context(
airflow/models/taskinstance.py:960: in _get_template_context
    dag_run=DagRunSDK.model_validate(dag_run, from_attributes=True),
E   pydantic_core._pydantic_core.ValidationError: 1 validation error for DagRun
E   logical_date
E     Input should be a valid datetime [type=datetime_type, input_value=None, input_type=NoneType]
E       For further information visit https://errors.pydantic.dev/2.10/v/datetime_type

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Feb 6, 2025
@sunank200 sunank200 requested a review from ashb February 6, 2025 13:17
@sunank200 sunank200 requested a review from uranusjr February 6, 2025 13:17
@phanikumv phanikumv added the full tests needed We need to run full set of tests for this PR to merge label Feb 6, 2025
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We "shouldn't" need to change tests like this, but since we have #46522 lets merge this and unblock main.

@ashb ashb merged commit fe30f87 into apache:main Feb 6, 2025
91 checks passed
@ashb ashb deleted the fix-dms-tests branch February 6, 2025 14:43
insomnes pushed a commit to insomnes/airflow that referenced this pull request Feb 6, 2025
insomnes pushed a commit to insomnes/airflow that referenced this pull request Feb 6, 2025
niklasr22 pushed a commit to niklasr22/airflow that referenced this pull request Feb 8, 2025
ambika-garg pushed a commit to ambika-garg/airflow that referenced this pull request Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers full tests needed We need to run full set of tests for this PR to merge provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants