Skip to content

Commit a2919cb

Browse files
committed
fix: refactor doc string and test
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
1 parent d4425de commit a2919cb

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

flytekit/image_spec/noop_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class NoOpBuilder(ImageSpecBuilder):
88

99
def should_build(self, image_spec: ImageSpec) -> bool:
1010
"""
11-
The build_image function of NoOpBuilder uses the image_spec name as defined by the user without
12-
checking whether the image exists in the Docker registry. Therefore, the should_build function
13-
should always return True to trigger the build_image function.
11+
The build_image function of NoOpBuilder does not actually build a Docker image.
12+
Since no Docker build process occurs, we do not need to check for Docker daemon
13+
or existing images. Therefore, should_build should always return True.
1414
1515
Args:
1616
image_spec (ImageSpec): Image specification

tests/flytekit/unit/core/image_spec/test_image_spec.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ def test_noop_builder_updates_image_name_mapping():
364364
from flytekit.image_spec.noop_builder import NoOpBuilder
365365

366366
# Clear any existing mappings to ensure clean test state
367+
ImageBuildEngine._REGISTRY.pop("noop", None)
367368
ImageBuildEngine._IMAGE_NAME_TO_REAL_NAME.clear()
368369

369370
# Register NoOpBuilder
@@ -391,5 +392,5 @@ def test_noop_builder_updates_image_name_mapping():
391392
assert actual_real_name == expected_image_name
392393

393394
# Clean up
394-
del ImageBuildEngine._REGISTRY["noop"]
395+
ImageBuildEngine._REGISTRY.pop("noop", None)
395396
ImageBuildEngine._IMAGE_NAME_TO_REAL_NAME.clear()

0 commit comments

Comments
 (0)