Skip to content

Commit fd95c82

Browse files
authored
Merge pull request #2384 from dhruvesh09/r0.23.0
Use `component/{run_id}/value` instead of `component/{run_id}` as fil…
2 parents fe4912b + a6719a5 commit fd95c82

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

tfx/components/base/base_driver.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def _prepare_output_paths(artifact: types.Artifact):
5252
# idempotent executions is needed.
5353
return
5454

55+
# TODO(b/147242148): Introduce principled artifact structure (directory
56+
# or file) definition.
5557
if isinstance(artifact, types.ValueArtifact):
5658
artifact_dir = os.path.dirname(artifact.uri)
5759
else:
@@ -222,6 +224,10 @@ def _prepare_output_artifacts(
222224
for i, artifact in enumerate(output_list):
223225
artifact.uri = _generate_output_uri(base_output_dir, name, execution_id,
224226
is_single_artifact, i)
227+
# TODO(b/147242148): Introduce principled artifact structure (directory
228+
# or file) definition.
229+
if isinstance(artifact, types.ValueArtifact):
230+
artifact.uri = os.path.join(artifact.uri, 'value')
225231
_prepare_output_paths(artifact)
226232

227233
result[name] = output_list

tfx/orchestration/portable/outputs_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(self, pipeline_node: pipeline_pb2.PipelineNode,
6363
def generate_output_artifacts(
6464
self, execution_id: int) -> Dict[Text, List[types.Artifact]]:
6565
"""Generates output artifacts given execution_id."""
66+
# TODO(b/166312308): support ValueArtifact behavior.
6667
output_artifacts = collections.defaultdict(list)
6768
for key, output_spec in self._pipeline_node.outputs.outputs.items():
6869
artifact = types.Artifact(

tfx/types/artifact_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def decode(self, value: bytes):
8787
_BYTE_VALUE = b'This is a string'
8888

8989
# Mock paths for string artifact.
90-
_VALID_URI = '/tmp/uri'
90+
_VALID_URI = '/tmp/uri/value'
9191
_VALID_FILE_URI = _VALID_URI
9292

9393
# Mock invalid paths. _BAD_URI points to a valid dir but there's no file within.

0 commit comments

Comments
 (0)