mohiuddin-khan-shiam opened a new pull request, #52768:
URL: https://github.com/apache/airflow/pull/52768
# Description
## Problem
Primitive parameters discovered via OpenAPI introspection were always
registered
with `argparse` as
[str](cci:1://file:///d:/Github/airflow/airflow-ctl/src/airflowctl/utils/module_loading.py:22:0-38:101)
because the code used
[type(parameter_type)](cci:1://file:///d:/Github/airflow/airflow-ctl/src/airflowctl/ctl/cli_config.py:118:16-119:62)
where
`parameter_type` itself was already a string. This caused:
* all numeric / boolean CLI options to be parsed as strings,
* boolean flags not to use `BooleanOptionalAction`,
* mismatched data types sent to the Airflow REST API.
## Solution
* Added helper
[_python_type_from_string()](cci:1://file:///d:/Github/airflow/airflow-ctl/src/airflowctl/ctl/cli_config.py:444:4-468:42)
that maps the textual type names
(`"int"`, `"float"`, `"bool"`, …) to their real Python counterparts.
* Reworked argument creation to use that mapping and properly configure
booleans with `BooleanOptionalAction`.
* Imported `datetime` to support `datetime.datetime` mapping.
## Impact
CLI arguments now receive the correct Python types at parse-time, preventing
type-related runtime errors and ensuring the generated payloads match the
API schema.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]