Skip to content

Commit

Permalink
Improve credentials checking
Browse files Browse the repository at this point in the history
  • Loading branch information
tylere committed Jun 5, 2024
1 parent 48503d4 commit febbc99
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@
"except google.auth.exceptions.DefaultCredentialsError:\n",
" !gcloud auth application-default login\n",
" credentials, project_id = google.auth.default()\n",
"\n",
"try:\n",
" ee.Initialize(credentials=credentials, project=project_id)\n",
"except google.auth.exceptions.RefreshError:\n",
" !gcloud auth application-default login\n",
" credentials, project_id = google.auth.default()\n",
"ee.Initialize(credentials=credentials, project=project_id)"
]
},
Expand Down Expand Up @@ -195,6 +199,13 @@
"source": [
"cluster.shutdown()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit febbc99

Please sign in to comment.