geraj1010 commented on code in PR #41416:
URL: https://github.com/apache/airflow/pull/41416#discussion_r1719322139


##########
airflow/providers/docker/operators/docker_swarm.py:
##########
@@ -116,6 +126,8 @@ def __init__(
         networks: list[str | types.NetworkAttachmentConfig] | None = None,
         placement: types.Placement | list[types.Placement] | None = None,
         container_resources: types.Resources | None = None,
+        logging_driver: str | None = None,

Review Comment:
   It would make it more clear about which logging drivers are available. 
However, `mypy` doesn't like it the `Literal` type here:
   ```
   airflow/providers/docker/operators/docker_swarm.py:147: error: Incompatible
   types in assignment (expression has type "str", variable has type
   "Optional[Literal['json-file', 'gelf']]")  [assignment]
                   logging_driver = cast(str, self.logging_driver.lower())
   ```
   I think I could use an `Enum`, but then I would have to create an enum class 
just for logging drivers. Not sure if it's really worth the extra effort.



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