Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix airflow dags list-jobs --limit to reject non-numeric values - #73105

Draft
roykoand wants to merge 1 commit into
apache:mainfrom
roykoand:fix-dags-list-jobs-limit-validation
Draft

Fix airflow dags list-jobs --limit to reject non-numeric values#73105
roykoand wants to merge 1 commit into
apache:mainfrom
roykoand:fix-dags-list-jobs-limit-validation

Conversation

@roykoand

Copy link
Copy Markdown
Contributor

ARG_LIMIT (used by airflow dags list-jobs --limit) had no type= validation, unlike its siblings ARG_JOB_LIMIT and ARG_NUM_EXECUTIONS, which both use type=positive_int(...). A non-numeric --limit value (e.g. airflow dags list-jobs --limit abc) was passed through argparse as a raw string and crashed deep inside SQLAlchemy's limit-clause coercion with an unhandled ValueError/traceback, instead of the standard argparse usage error every other typed numeric flag produces.

This adds the same type=positive_int(allow_zero=False) to ARG_LIMIT, plus a regression test asserting --limit abc now exits with argparse's usage-error code (2) instead of crashing.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Sonnet 5)

Generated-by: Claude Code (Sonnet 5) following the guidelines

🤖 Generated with Claude Code

ARG_LIMIT had no type validation, unlike its siblings ARG_JOB_LIMIT and
ARG_NUM_EXECUTIONS, so a non-numeric --limit value crashed deep inside
SQLAlchemy's limit-clause coercion with a raw traceback instead of a
clean argparse usage error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant