Skip to content

Commit

Permalink
Merge pull request #7745 from khoaguin/data_asset_id_before_upload
Browse files Browse the repository at this point in the history
Showing name and shape of asset before uploading (`CreateAsset`)
  • Loading branch information
koenvanderveen authored Jun 13, 2023
2 parents e300d97 + fb6ec59 commit df5b027
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/syft/src/syft/service/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ class CreateAsset(SyftObject):
mock_is_real: bool = False
created_at: Optional[DateTime]

__attr_repr_cols__ = ["name"]

class Config:
validate_assignment = True

Expand Down Expand Up @@ -491,7 +493,6 @@ def add_contributor(
def add_asset(self, asset: CreateAsset) -> None:
if asset.mock is None:
raise ValueError(_ASSET_WITH_NONE_MOCK_ERROR_MESSAGE)

self.asset_list.append(asset)

def remove_asset(self, name: str) -> None:
Expand Down
6 changes: 4 additions & 2 deletions packages/syft/src/syft/types/syft_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def list_dict_repr_html(self) -> str:

# get id
id_ = getattr(item, "id", None)
if id is not None:
if id_ is not None:
id_ = f"{str(id_)[:4]}...{str(id_)[-3:]}"

if type(item) == type:
Expand All @@ -569,7 +569,9 @@ def list_dict_repr_html(self) -> str:
t = item.__class__.__name__
except Exception:
t = item.__repr__()
cols["id"].append(id_)
if id_ is not None:
cols["id"].append(id_)

if not is_homogenous:
cols["type"].append(t)

Expand Down

0 comments on commit df5b027

Please sign in to comment.