Skip to content

Commit

Permalink
update manifest flow
Browse files Browse the repository at this point in the history
  • Loading branch information
annirudh committed Jan 14, 2021
1 parent 6955722 commit 6c7987a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion wandb/sdk/internal/internal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ def create_artifact_manifest(
$projectName: String!,
$runName: String!,
$includeUpload: Boolean!,
$type: ArtifactManifestType! = FULL
$type: ArtifactManifestType = FULL
) {
createArtifactManifest(input: {
name: $name,
Expand Down Expand Up @@ -1837,6 +1837,7 @@ def create_artifact_manifest(
entity_name = entity or self.settings("entity")
project_name = project or self.settings("project")
run_name = run or self.current_run_id
type = type or "FULL"

response = self.gql(
mutation,
Expand Down
5 changes: 1 addition & 4 deletions wandb/sdk_py27/internal/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ def before_commit():
path = os.path.abspath(fp.name)
json.dump(self._manifest.to_manifest_json(), fp, indent=4)
digest = wandb.util.md5_file(path)
_, resp = self._api.update_artifact_manifest(
manifest_id,
digest=digest,
)
_, resp = self._api.update_artifact_manifest(manifest_id, digest=digest,)

# We're duplicating the file upload logic a little, which isn't great.
upload_url = resp["uploadUrl"]
Expand Down
15 changes: 10 additions & 5 deletions wandb/sdk_py27/internal/internal_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ def create_artifact_manifest(
$projectName: String!,
$runName: String!,
$includeUpload: Boolean!,
$type: ArtifactManifestType! = FULL
$type: ArtifactManifestType = FULL
) {
createArtifactManifest(input: {
name: $name,
Expand Down Expand Up @@ -1837,6 +1837,7 @@ def create_artifact_manifest(
entity_name = entity or self.settings("entity")
project_name = project or self.settings("project")
run_name = run or self.current_run_id
type = type or "FULL"

response = self.gql(
mutation,
Expand All @@ -1853,8 +1854,10 @@ def create_artifact_manifest(
},
)

return response["createArtifactManifest"]["artifactManifest"]["id"],\
response["createArtifactManifest"]["artifactManifest"]["file"]
return (
response["createArtifactManifest"]["artifactManifest"]["id"],
response["createArtifactManifest"]["artifactManifest"]["file"],
)

def update_artifact_manifest(
self,
Expand Down Expand Up @@ -1901,8 +1904,10 @@ def update_artifact_manifest(
},
)

return response["updateArtifactManifest"]["artifactManifest"]["id"],\
response["updateArtifactManifest"]["artifactManifest"]["file"]
return (
response["updateArtifactManifest"]["artifactManifest"]["id"],
response["updateArtifactManifest"]["artifactManifest"]["file"],
)

@normalize_exceptions
def create_artifact_files(self, artifact_files):
Expand Down

0 comments on commit 6c7987a

Please sign in to comment.