Skip to content

Commit

Permalink
Fixing issue with missing environment varibles on notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
german-grandas committed Sep 11, 2024
1 parent 329417b commit f1bf05a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@
"from google.cloud.sql.connector import IPTypes\n",
"\n",
"# initialize parameters\n",
"GCP_PROJECT_ID = os.environ.get(\"GCP_PROJECT_ID\")\n",
"GCP_CLOUD_SQL_REGION = os.environ.get(\"CLOUDSQL_INSTANCE_REGION\")\n",
"GCP_CLOUD_SQL_INSTANCE = os.environ.get(\"CLOUDSQL_INSTANCE\")\n",
"INSTANCE_CONNECTION_NAME = os.environ.get(\"CLOUDSQL_INSTANCE_CONNECTION_NAME\")\n",
"print(f\"Your instance connection name is: {INSTANCE_CONNECTION_NAME}\")\n",
"cloud_variables = INSTANCE_CONNECTION_NAME.split(\":\")\n",
"\n",
"GCP_PROJECT_ID = os.environ.get(\"GCP_PROJECT_ID\", cloud_variables[0])\n",
"GCP_CLOUD_SQL_REGION = os.environ.get(\"CLOUDSQL_INSTANCE_REGION\", cloud_variables[1])\n",
"GCP_CLOUD_SQL_INSTANCE = os.environ.get(\"CLOUDSQL_INSTANCE\", cloud_variables[2])\n",
"\n",
"DB_NAME = os.environ.get(\"INSTANCE_CONNECTION_NAME\", \"pgvector-database\")\n",
"VECTOR_EMBEDDINGS_TABLE_NAME = os.environ.get(\"EMBEDDINGS_TABLE_NAME\", \"netflix_reviews_db\")\n",
Expand Down

0 comments on commit f1bf05a

Please sign in to comment.