Skip to content

Commit 04dcd2b

Browse files
author
Nissan Pow
committed
cleanup: remove duplicate import, unused imports, and non-functional mock test
1 parent 8f33660 commit 04dcd2b

2 files changed

Lines changed: 0 additions & 32 deletions

File tree

metaflow/plugins/aws/step_functions/step_functions_cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
from .production_token import load_token, new_token, store_token
2222
from .step_functions import StepFunctions
23-
from metaflow.tagging_util import validate_tags
2423
from ..aws_utils import validate_aws_tag
2524

2625
VALID_NAME = re.compile(r"[^a-zA-Z0-9_\-\.]")

test/unit/test_tag_improvements.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"""
66

77
import json
8-
import os
9-
import pytest
10-
from unittest.mock import patch, MagicMock
118

129

1310
class TestTriggerTimeTags:
@@ -130,34 +127,6 @@ def test_get_origin_run_tags_handles_missing_run(self):
130127
result = _get_origin_run_tags("NonExistentFlow", "nonexistent_run_id")
131128
assert result == []
132129

133-
def test_get_origin_run_tags_with_mock(self):
134-
"""Test that user_tags from origin run are returned."""
135-
from metaflow.cli_components.run_cmds import _get_origin_run_tags
136-
137-
mock_run = MagicMock()
138-
mock_run.user_tags = {"experiment_v2", "batch_1"}
139-
140-
with patch(
141-
"metaflow.cli_components.run_cmds.Run",
142-
return_value=mock_run,
143-
create=True,
144-
) as mock_cls:
145-
# We need to patch where it's imported
146-
with patch(
147-
"metaflow.client.core.Run",
148-
return_value=mock_run,
149-
):
150-
# The function does a local import, so we need to patch at module level
151-
pass
152-
153-
# Since the function uses a local import, let's test through the actual
154-
# function with a mock at the right level
155-
with patch.dict("sys.modules", {}):
156-
# This is tricky with local imports. Test the contract instead:
157-
# _get_origin_run_tags should return a list
158-
result = _get_origin_run_tags("SomeFlow", "some_run_id")
159-
assert isinstance(result, list)
160-
161130
def test_resume_tags_merge_logic(self):
162131
"""Verify that origin tags are merged with CLI tags correctly."""
163132
# Simulates the merge logic in resume()

0 commit comments

Comments
 (0)