uranusjr commented on code in PR #30730:
URL: https://github.com/apache/airflow/pull/30730#discussion_r1184138291


##########
airflow/providers/docker/operators/docker.py:
##########
@@ -291,6 +296,9 @@ def __init__(
             if skip_on_exit_code
             else []
         )
+        self.port_bindings = port_bindings or {}

Review Comment:
   Is it really useful to coerce this to dict here? From what I can tell down 
below, we’re actually converting the value back to None anyway. So it may 
actually be easier to do `self.port_bindings = port_bindings or None` instead?



##########
airflow/providers/docker/operators/docker.py:
##########
@@ -357,6 +365,7 @@ def _run_image_with_mounts(self, target_mounts, 
add_tmp_variable: bool) -> list[
             command=self.format_command(self.command),
             name=self.container_name,
             environment={**env_file_vars, **self.environment, 
**self._private_environment},
+            ports=list(self.port_bindings.keys()) if self.port_bindings else 
None,

Review Comment:
   ```suggestion
               ports=list(self.port_bindings) if self.port_bindings else None,
   ```



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