[GitHub] [airflow] uranusjr commented on a diff in pull request #27640: Added exclude_microseconds to cli
uranusjr commented on code in PR #27640: URL: https://github.com/apache/airflow/pull/27640#discussion_r1027639225 ## airflow/cli/cli_parser.py: ## @@ -433,6 +433,12 @@ def string_lower_type(val): ARG_RUN_ID = Arg(("-r", "--run-id"), help="Helps to identify this run") ARG_CONF = Arg(("-c", "--conf"), help="JSON string that gets pickled into the DagRun's conf attribute") ARG_EXEC_DATE = Arg(("-e", "--exec-date"), help="The execution date of the DAG", type=parsedate) +ARG_REPLACE_MICRO = Arg( +("--replace-microseconds",), +help="whether microseconds should be zeroed", +action="store_false", +default=True, +) Review Comment: The looks wrong…? If I understand the structure correctly, this would make ``` airflow trigger --replace-microseconds ``` NOT zero-out microseconds. I think the correct implementation is ```suggestion ARG_REPLACE_MICRO = Arg( ("--no-replace-microseconds",), help="whether microseconds should be zeroed", dest="replace_microseconds", action="store_false", default=True, ) ``` -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [airflow] uranusjr commented on a diff in pull request #27640: Added exclude_microseconds to cli
uranusjr commented on code in PR #27640: URL: https://github.com/apache/airflow/pull/27640#discussion_r1021046613 ## airflow/cli/cli_parser.py: ## @@ -433,6 +445,9 @@ def string_lower_type(val): ARG_RUN_ID = Arg(("-r", "--run-id"), help="Helps to identify this run") ARG_CONF = Arg(("-c", "--conf"), help="JSON string that gets pickled into the DagRun's conf attribute") ARG_EXEC_DATE = Arg(("-e", "--exec-date"), help="The execution date of the DAG", type=parsedate) +ARG_REPLACE_MICRO = Arg( +("--replace-microseconds",), help="whether microseconds should be zeroed", default=True, type=bool_type +) Review Comment: The `type=bool_type` part is not idiomatic, you likely want to do `--no-replace-microseconds` and `action="store_true"`. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [airflow] uranusjr commented on a diff in pull request #27640: Added exclude_microseconds to cli
uranusjr commented on code in PR #27640: URL: https://github.com/apache/airflow/pull/27640#discussion_r1021046613 ## airflow/cli/cli_parser.py: ## @@ -433,6 +445,9 @@ def string_lower_type(val): ARG_RUN_ID = Arg(("-r", "--run-id"), help="Helps to identify this run") ARG_CONF = Arg(("-c", "--conf"), help="JSON string that gets pickled into the DagRun's conf attribute") ARG_EXEC_DATE = Arg(("-e", "--exec-date"), help="The execution date of the DAG", type=parsedate) +ARG_REPLACE_MICRO = Arg( +("--replace-microseconds",), help="whether microseconds should be zeroed", default=True, type=bool_type +) Review Comment: The `type=bool_type` part is wrong, you likely want `action="store_true"`. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org