guydriesen commented on code in PR #39464:
URL: https://github.com/apache/airflow/pull/39464#discussion_r1593969669
##########
airflow/providers/docker/operators/docker_swarm.py:
##########
@@ -225,6 +231,24 @@ def stream_new_logs(last_line_logged, since=0):
sleep(2)
last_line_logged, last_timestamp =
stream_new_logs(last_line_logged, since=last_timestamp)
+ @staticmethod
+ def format_args(args: list[str] | str | None) -> list[str] | None:
+ """Retrieve args.
+
+ The args string is parsed to a list. If it starts with ``[``,
+ the string is treated as a Python literal and parsed into a list.
+
+ :param args: args to the docker service
+
+ :return: the args as list
+ """
+ if isinstance(args, str):
+ if args.strip().startswith("["):
+ return ast.literal_eval(args)
+ else:
+ return shlex.split(args)
+ return args
Review Comment:
I see, yes, it's probably even better to leave that out.
Initially I thought to replicate the behavior of the docker command, as that
is what the args are on the containerspec.
Thanks, I'll remove it.
--
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]