You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "shaealh (via GitHub)" <gi...@apache.org> on 2026/07/15 03:50:01 UTC

[PR] Remove airflow.utils dependency from Docker provider [airflow]

shaealh opened a new pull request, #69900:
URL: https://github.com/apache/airflow/pull/69900

   ## Why
   
   Issue #62063 tracks removing provider dependencies on `airflow.utils` as part of the provider/client separation work. The Docker provider had one remaining dependency in `DockerSwarmOperator` for generating temporary service names.
   
   ## What changed
   
   - Replaced the `airflow.utils.strings.get_random_string` import with a private provider-local helper.
   - Preserved the existing service-name format: the configured prefix followed by eight alphanumeric characters.
   - Added focused unit coverage for the generated service name.
   - Confirmed that `providers/docker/src` no longer imports `airflow.utils`.
   
   This does not introduce any user-facing behavior changes.
   
   ## Testing
   
   - Commit and pre-commit checks passed.
   - Docker Swarm operator tests: 25 passed.
   - Full Docker provider suite attempted: 143 passed and 2 skipped; 15 Docker-dependent tests could not run because a local Docker daemon was unavailable.
   
   related: #62063
   
   --- 
   


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove airflow.utils dependency from Docker provider [airflow]

Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh merged PR #69900:
URL: https://github.com/apache/airflow/pull/69900


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove airflow.utils dependency from Docker provider [airflow]

Posted by "SameerMesiah97 (via GitHub)" <gi...@apache.org>.
SameerMesiah97 commented on PR #69900:
URL: https://github.com/apache/airflow/pull/69900#issuecomment-4989259073

   > Thank you for the approval @SameerMesiah97 can you merge the PR? Thanks
   
   I do not have merge rights


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove airflow.utils dependency from Docker provider [airflow]

Posted by "shaealh (via GitHub)" <gi...@apache.org>.
shaealh commented on PR #69900:
URL: https://github.com/apache/airflow/pull/69900#issuecomment-5028705867

   @amoghrajesh this was approved, would you be able to merge? Thanks


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove airflow.utils dependency from Docker provider [airflow]

Posted by "shaealh (via GitHub)" <gi...@apache.org>.
shaealh commented on code in PR #69900:
URL: https://github.com/apache/airflow/pull/69900#discussion_r3600319696


##########
providers/docker/tests/unit/docker/operators/test_docker_swarm.py:
##########
@@ -27,10 +28,13 @@
 from docker.errors import APIError
 
 from airflow.providers.common.compat.sdk import AirflowException
-from airflow.providers.docker.operators.docker_swarm import DockerSwarmOperator
+from airflow.providers.docker.operators.docker_swarm import DockerSwarmOperator, _generate_service_name
 
 
 class TestDockerSwarmOperator:
+    def test_generate_service_name(self):
+        assert re.fullmatch(r"custom-prefix-[A-Za-z0-9]{8}", _generate_service_name("custom-prefix"))

Review Comment:
   Thank you @amoghrajesh! Done ✅ 



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove airflow.utils dependency from Docker provider [airflow]

Posted by "shaealh (via GitHub)" <gi...@apache.org>.
shaealh commented on PR #69900:
URL: https://github.com/apache/airflow/pull/69900#issuecomment-5013193365

   Hi @potiuk @amoghrajesh can we please merge this? Thanks 


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove airflow.utils dependency from Docker provider [airflow]

Posted by "shaealh (via GitHub)" <gi...@apache.org>.
shaealh commented on PR #69900:
URL: https://github.com/apache/airflow/pull/69900#issuecomment-4988537963

   Thank you for the approval @SameerMesiah97 can you merge the PR? 
   Thanks


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove airflow.utils dependency from Docker provider [airflow]

Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on code in PR #69900:
URL: https://github.com/apache/airflow/pull/69900#discussion_r3596003634


##########
providers/docker/tests/unit/docker/operators/test_docker_swarm.py:
##########
@@ -27,10 +28,13 @@
 from docker.errors import APIError
 
 from airflow.providers.common.compat.sdk import AirflowException
-from airflow.providers.docker.operators.docker_swarm import DockerSwarmOperator
+from airflow.providers.docker.operators.docker_swarm import DockerSwarmOperator, _generate_service_name
 
 
 class TestDockerSwarmOperator:
+    def test_generate_service_name(self):
+        assert re.fullmatch(r"custom-prefix-[A-Za-z0-9]{8}", _generate_service_name("custom-prefix"))

Review Comment:
   Doesn't seem to test anything meaningful. Lets remove this.



-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org