akki commented on a change in pull request #15843:
URL: https://github.com/apache/airflow/pull/15843#discussion_r633056978
##########
File path: airflow/providers/docker/operators/docker.py
##########
@@ -95,9 +96,9 @@ class DockerOperator(BaseOperator):
:type tmp_dir: str
:param user: Default user inside the docker container.
:type user: int or str
- :param volumes: List of volumes to mount into the container, e.g.
- ``['/host/path:/container/path', '/host/path2:/container/path2:ro']``.
- :type volumes: list
+ :param mounts: List of volumes to mount into the container. Each item
should
+ be a :py:class:`docker.types.Mount` instance.
+ :type volumes: list[Mount]
Review comment:
Should this also be changed to `:type mounts`?
##########
File path: tests/providers/docker/operators/test_docker_swarm.py
##########
@@ -77,6 +77,7 @@ def _client_service_logs_effect():
image='ubuntu:latest',
command='env',
user='unittest',
+ mounts=[],
Review comment:
IIUC this test would pass even if there were no changes made to
`DockerSwarmOperator` in this PR (since we're checking the default value of
`DockerOperator` right now).
I think it is worth passing some value to the operator & checking it gets
passed here as expected.
##########
File path: airflow/providers/docker/operators/docker.py
##########
@@ -95,9 +96,9 @@ class DockerOperator(BaseOperator):
:type tmp_dir: str
:param user: Default user inside the docker container.
:type user: int or str
- :param volumes: List of volumes to mount into the container, e.g.
- ``['/host/path:/container/path', '/host/path2:/container/path2:ro']``.
- :type volumes: list
+ :param mounts: List of volumes to mount into the container. Each item
should
+ be a :py:class:`docker.types.Mount` instance.
Review comment:
Seems like Airflow documentation generator doesn't render this syntax to
much useful HTML - I compared [this
code](https://github.com/apache/airflow/blob/cf6324e43b2f7c183c3872704733b69d1498cda1/airflow/providers/google/cloud/hooks/bigquery.py#L2865)
for this [doc
string](https://airflow.apache.org/docs/apache-airflow-providers-google/stable/_api/airflow/providers/google/cloud/hooks/bigquery/index.html#airflow.providers.google.cloud.hooks.bigquery.BigQueryCursor.fetchmany).
What do you think about the idea of changing the type to
`list[docker.types.Mount]` in the next line?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]