Skip to content

Commit 6fd5ad3

Browse files
author
Yi-Ting Lee
committed
add __str__ methods to queryLineage results
1 parent b2d4744 commit 6fd5ad3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/sagemaker/lineage/query.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ def __eq__(self, other):
9292
and self.destination_arn == other.destination_arn
9393
)
9494

95+
def __str__(self):
96+
"""Define string representation of `Edge`."""
97+
return (str(self.__dict__))
98+
9599

96100
class Vertex:
97101
"""A vertex for a lineage graph."""
@@ -130,6 +134,10 @@ def __eq__(self, other):
130134
and self.lineage_source == other.lineage_source
131135
)
132136

137+
def __str__(self):
138+
"""Define string representation of `Vertex`."""
139+
return (str(self.__dict__))
140+
133141
def to_lineage_object(self):
134142
"""Convert the ``Vertex`` object to its corresponding lineage object.
135143
@@ -199,6 +207,12 @@ def __init__(
199207
if vertices is not None:
200208
self.vertices = vertices
201209

210+
def __str__(self):
211+
"""Define string representation of `LineageQueryResult`."""
212+
result_dict = vars(self)
213+
214+
return (str({k: [vars(val) for val in v] for k, v in result_dict.items()}))
215+
202216

203217
class LineageFilter(object):
204218
"""A filter used in a lineage query."""

0 commit comments

Comments
 (0)