From 87453fb94ef2dddd0693dfeab9995ff2ee6100b9 Mon Sep 17 00:00:00 2001 From: Raj Patel <57837394+rajc242@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:29:52 -0500 Subject: [PATCH] fix: Query syntax (#952) --- notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb b/notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb index a0d700400..e4ceb4708 100644 --- a/notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb +++ b/notebooks/postgresql2bq/postgresql-to-bigquery-notebook.ipynb @@ -475,7 +475,8 @@ "with DB.connect() as conn:\n", " print(\"connected to database\")\n", " if not POSTGRESQL_TABLE_LIST and not POSTGRESQL_SCHEMA_LIST: # Migrate all possible tables from database\n", - " results = conn.execute(text("select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA not in ('pg_catalog','information_schema')")).fetchall()\n", + " query_str = \"select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA not in ('pg_catalog','information_schema');\"\n", + " results = conn.execute(text(query_str)).fetchall()\n", "\n", " elif POSTGRESQL_SCHEMA_LIST and not POSTGRESQL_TABLE_LIST: # Only Migrate tables associated with the provided schema list\n", " results = conn.execute(text(\"select TABLE_SCHEMA,TABLE_NAME from INFORMATION_SCHEMA.Tables where TABLE_SCHEMA in ('{}');\".format(\"','\".join(POSTGRESQL_SCHEMA_LIST)))).fetchall()\n",