Fix airflowctl date parameters rejecting every input value - #71328
Open
DHBhensdadia wants to merge 1 commit into
Open
Fix airflowctl date parameters rejecting every input value#71328DHBhensdadia wants to merge 1 commit into
DHBhensdadia wants to merge 1 commit into
Conversation
Auto-generated commands derive their argparse ``type=`` callable from the OpenAPI parameter annotation. For ``datetime.date`` that callable was the class itself, which takes three integers rather than a string, so no value a user could type was ever accepted. argparse surfaced the resulting TypeError as "invalid date value", which reads as a formatting complaint and gives no hint that the option cannot work at all.
DHBhensdadia
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
August 8, 2026 11:37
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_python_type_from_stringmaps OpenAPI parameter annotations to the argparsetype=callable used by auto-generated commands.datetime.datewas mapped to the class itself, but argparse calls that callable with the raw string from the command line anddate.__init__expects three integers, so every value was rejected:The message reads as a complaint about the format, but no input can succeed.
_is_primitive_typeacceptsdatetime.date, andDagRunOperations.listdeclarespartition_date_gteandpartition_date_lteasdatetime.date | None, so this affects the shipped CLI. The hand-written commands indag_command.pyalready parse these values withdate.fromisoformat; the generated path had no equivalent.This adds
iso_date_typealongside the existingjson_dict_typeand wires it into the mapping, so a valid value is parsed into adateand an invalid one reports the format that is actually expected.datetime.datetimehas the same root cause but is left untouched here, since #70249 and #70250 are already open against it. The remaining constructor entries (bytes,list,tuple,set) are not reachable today, as no operation is annotated with them.related: #70232
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.