Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions splitgraph/core/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ def __eq__(self, other: object) -> bool:
return NotImplemented
return self.image_hash == other.image_hash and self.repository == other.repository

def to_schema(self) -> str:
"""Schema reference for the given image."""
return self.repository.to_schema() + ":" + self.image_hash

def get_parent_children(self) -> Tuple[Optional[str], List[str]]:
"""Gets the parent and a list of children of a given image."""
parent = self.parent_id
Expand Down Expand Up @@ -117,8 +121,7 @@ def get_table(self, table_name: str) -> Table:
)
if not result:
raise TableNotFoundError(
"Image %s:%s does not have a table %s!"
% (self.repository, self.image_hash, table_name)
"Image %s does not have a table %s!" % (self.to_schema(), table_name)
)
table_schema, objects = result
return Table(
Expand Down Expand Up @@ -212,9 +215,8 @@ def lq_checkout(
continue

logging.debug(
"Mounting %s:%s/%s into %s",
self.repository.to_schema(),
self.image_hash,
"Mounting %s/%s into %s",
self.to_schema(),
table_name,
target_schema,
)
Expand Down