Conversation
anayeaye
left a comment
There was a problem hiding this comment.
These changes look good--was the main update just to the airflow base url?
| else | ||
| echo "$collection_id failed to publish ❌" | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
I can delete this file once this PR is reviewed!
| """Extract the HTTP status code from the AirflowAPIError | ||
| message and return 500 otherwise | ||
| """ | ||
| try: |
There was a problem hiding this comment.
you can use contextlib to suppress these errors rather than an except/pass if there's no intention to log the error
import contextlib
with contextlib.suppress(ValueError, IndexError):
parts = error_message.split(" returns ")
if len(parts) > 1:
status_str = parts[1].split(":")[0]
return int(status_str)There was a problem hiding this comment.
Just a style choice though - feel free to just resolve the comment
| try: | ||
| parts = error_message.split(" returns ") | ||
| if len(parts) > 1: | ||
| status_str = parts[1].split(":")[0] | ||
| return int(status_str) | ||
| except (ValueError, IndexError): | ||
| pass |
| status_code = _extract_http_status_code(str(e)) | ||
| print(json.dumps({"statusCode": status_code, "error": str(e)})) |
There was a problem hiding this comment.
should this raise? 🤷🏼♂️
There was a problem hiding this comment.
Not necessarily 🫨 See my comment below
| status_code = _extract_http_status_code(str(e)) | ||
| print(json.dumps({"statusCode": status_code, "error": str(e)})) |
There was a problem hiding this comment.
I don't want it to raise necessarily because I don't want it to prematurely abort before it reports on the results of the files
There was a problem hiding this comment.
maybe I'm confused then, should we catching a different exception? AirflowAPIError reads as if the trigger_dag_run request failed and the dag never started
https://github.com/NASA-IMPACT/veda-architecture/issues/849
What Changed
scripts/airflow_api.pythat triggers that DAGs according to the version it identifies based on env var settings