potiuk commented on code in PR #74383:
URL: https://github.com/apache/airflow/pull/74383#discussion_r4308139103
##########
airflow-ctl/src/airflowctl/ctl/cli_config.py:
##########
@@ -525,8 +525,9 @@ def __init__(self, file_path: str | Path | None = None):
]
# Datamodels whose generated bool flags follow the datamodel field
defaults instead of
# defaulting to False, so the CLI keeps the API semantics (e.g. a bare
``tasks clear``
- # must keep ``dry_run=True`` and preview instead of clearing).
- self.field_bool_default_datamodels = ["ClearTaskInstancesBody"]
+ # must keep ``dry_run=True`` and preview instead of clearing, and a
bare ``dags update``
+ # must not send ``is_paused=False`` and unpause the Dag).
+ self.field_bool_default_datamodels = ["ClearTaskInstancesBody",
"DAGPatchBody"]
Review Comment:
`PoolPatchBody` has the same bug: `include_deferred: bool | None = None`
gets a generated `--include-deferred` flag defaulting to `False`, so
`airflowctl pools update --pool p --slots 10` silently sends
`include_deferred=False` and flips it on a pool that had it enabled.
The allowlist fixes one datamodel at a time; the cause is
`_get_bool_arg_default()` returning `False` for every bool field outside the
list. Using the field's own default for every request-body datamodel (and
leaving `None` out of the body) would fix the whole class and make the list
unnecessary.
--
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]