Skip to content

Commit

Permalink
Cloud: Add prefix to single paper (#203)
Browse files Browse the repository at this point in the history
* Add prefix to single paper

* Skip folders with no pipeline

* Skip 404 pipeline
  • Loading branch information
haroldrubio authored Jan 8, 2025
1 parent 8bd0916 commit 94a9b4b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions expertise/service/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ def _generate_vertex_prefix(api_request):
return f"venueid-{group_entity['memberOf']}"
# Handle group-noteId request
elif 'id' in note_entity:
return f"{note_entity['id']}-{group_entity['memberOf']}"
return f"pid-{note_entity['id']}-{group_entity['memberOf']}"

def create_job(self, json_request: dict):
def create_folder(bucket_name, folder_path):
Expand Down Expand Up @@ -894,7 +894,14 @@ def check_result(request, job):
]
for request in authenticated_requests:
request_name = request['name']
job = aip.PipelineJob.get(f"projects/{self.project_number}/locations/{self.region}/pipelineJobs/{request_name}")
try:
job = aip.PipelineJob.get(f"projects/{self.project_number}/locations/{self.region}/pipelineJobs/{request_name}")
except Exception as e:
if '404' in str(e):
self.logger.info(f"No pipeline for job {request_name}")
continue
else:
raise e

descriptions = JobDescription.VALS.value
status = GCPInterface.GCS_STATE_TO_JOB_STATE.get(job.state, '')
Expand Down

0 comments on commit 94a9b4b

Please sign in to comment.