refactor: Improve handling of artifacts in vertex base class
This commit is contained in:
parent
384977e156
commit
b8a361c546
2 changed files with 4 additions and 4 deletions
|
|
@ -31,10 +31,10 @@ class ResultData(BaseModel):
|
||||||
if not values.get("logs") and values.get("artifacts"):
|
if not values.get("logs") and values.get("artifacts"):
|
||||||
# Build the log from the artifacts
|
# Build the log from the artifacts
|
||||||
message = values["artifacts"]
|
message = values["artifacts"]
|
||||||
if "stream_url" in message:
|
if "stream_url" in message and "type" in message:
|
||||||
stream_url = StreamURL(location=message["stream_url"])
|
stream_url = StreamURL(location=message["stream_url"])
|
||||||
values["logs"] = [Log(message=stream_url, type=message["type"])]
|
values["logs"] = [Log(message=stream_url, type=message["type"])]
|
||||||
else:
|
elif "type" in message:
|
||||||
values["logs"] = [Log(message=message, type=message["type"])]
|
values["logs"] = [Log(message=message, type=message["type"])]
|
||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -628,8 +628,8 @@ class Vertex:
|
||||||
self._built_object, self.artifacts = result
|
self._built_object, self.artifacts = result
|
||||||
elif len(result) == 3:
|
elif len(result) == 3:
|
||||||
self._custom_component, self._built_object, self.artifacts = result
|
self._custom_component, self._built_object, self.artifacts = result
|
||||||
self.artifacts_raw = self.artifacts.pop("raw", None)
|
self.artifacts_raw = self.artifacts.get("raw", None)
|
||||||
self.artifacts_type = self.artifacts.pop("type", None) or ArtifactType.UNKNOWN.value
|
self.artifacts_type = self.artifacts.get("type", None) or ArtifactType.UNKNOWN.value
|
||||||
else:
|
else:
|
||||||
self._built_object = result
|
self._built_object = result
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue