henry3260 commented on code in PR #67947:
URL: https://github.com/apache/airflow/pull/67947#discussion_r3426239964


##########
airflow-ctl/src/airflowctl/ctl/cli_config.py:
##########
@@ -712,10 +737,19 @@ def _get_func(args: Namespace, api_operation: dict, 
api_client: Client = NEW_API
                                 datamodel_param_name = parameter_key
                             if expanded_parameter in self.excluded_parameters:
                                 continue
-                            if expanded_parameter in args_dict.keys():
+                            if (
+                                expanded_parameter in args_dict.keys()
+                                and args_dict[expanded_parameter] is not None
+                            ):
+                                val = args_dict[expanded_parameter]

Review Comment:
   If I understand correctly, the `None` filtering is not strictly required for 
fields where `null` and “not provided” are equivalent. More importantly, this 
new path does not protect boolean fields, because the generated CLI currently 
defaults bool arguments to `False`. For `ClearTaskInstancesBody`, some API 
defaults are `True` or `None` (`dry_run`, `only_failed`, `reset_dag_runs`, 
`run_on_latest_version`), so `airflowctl tasks clear <dag_id>` may send 
explicit `False` values and override the API defaults. 



##########
airflow-ctl/docs/images/output_main.svg:
##########


Review Comment:
   maybe we need to regenerate help image and hash
   



##########
airflow-ctl/tests/airflow_ctl/ctl/commands/test_pool_command.py:
##########
@@ -174,8 +175,10 @@ def test_export_json_to_file(self, mock_client, tmp_path, 
capsys):
 
         # Verify output message
         captured = capsys.readouterr()
-        expected_output = f"Exported {len(exported_data)} pool(s) to 
{export_file}"
-        assert expected_output in captured.out.replace("\n", "")
+        ansi_escape = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")
+        out_str = ansi_escape.sub("", captured.out).replace("\n", "")
+        # Since rich wraps long lines, newlines are removed, so we assert the 
combined text.
+        assert out_str == f"Exported {len(exported_data)} pool(s) to 
{export_file}"

Review Comment:
   Could I ask why we need to change this?



-- 
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]

Reply via email to