Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Heather MacDonald committed Jul 12, 2023
1 parent cf5fd06 commit c3df71a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions client/verta/verta/tracking/entities/_deployable_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ def set_schema(self, input: dict, output: dict = None) -> None:
"""
if not isinstance(input, dict):
raise TypeError(f"`input` must be of type dict, not {type(input)}; did you remember to call `.schema()`?")
raise TypeError(
f"`input` must be of type dict, not {type(input)}; did you remember to call `.schema()`?"
)
if output is not None and not isinstance(output, dict):
raise TypeError(f"`output` must be of type dict, not {type(output)}; did you remember to call `.schema()`?")
raise TypeError(
f"`output` must be of type dict, not {type(output)}; did you remember to call `.schema()`?"
)

schema = {
"input": input,
Expand All @@ -125,11 +129,13 @@ def set_schema(self, input: dict, output: dict = None) -> None:
schema["output"] = output

# write a temp file because otherwise `log_artifact` will think the artifact contents are the file path
with tempfile.NamedTemporaryFile(mode='w') as temp_file:
with tempfile.NamedTemporaryFile(mode="w") as temp_file:
temp_filename = temp_file.name
with open(temp_filename, 'w') as file:
with open(temp_filename, "w") as file:
json.dump(schema, file)
self.log_artifact(key="model_schema_json", artifact=temp_filename, overwrite=True)
self.log_artifact(
key="model_schema_json", artifact=temp_filename, overwrite=True
)

def get_schema(self) -> Dict[str, dict]:
"""
Expand Down

2 comments on commit c3df71a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker Tag: VRD-975_rmv_get_and_set_schema-2023-07-12T23-55-11--c3df71a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Total coverage (common): 15.06
Total coverage (server): 61.25

Changed Files coverage (common): coverage 100
Changed Files coverage (server): 100

Please sign in to comment.