For consideration.
1. Create table error handler
If self._client.create_table below throws an exception, there are a couple of cases we can provide a more informative error message.
try:
_ = clients.get_ibis_table(self._client, schema_name, table_name)
# Do nothing, the table exists.
except sqlalchemy.exc.NoSuchTableError:
self._client.create_table(table_name, schema=RESULTS_TABLE_SCHEMA)
psycopg2.errors.InvalidSchemaName then either the schema does not exist or, more likely, we are missing the USAGE privilege. We can give the user some clues in the error message. GRANT USAGE ON SCHEMA ...
psycopg2.errors.InsufficientPrivilege then we are missing the CREATE privilege. GRANT CREATE ON SCHEMA ...
2. Result table
Should we create some default indexes on the results table?
For consideration.
1. Create table error handler
If
self._client.create_tablebelow throws an exception, there are a couple of cases we can provide a more informative error message.psycopg2.errors.InvalidSchemaNamethen either the schema does not exist or, more likely, we are missing the USAGE privilege. We can give the user some clues in the error message.GRANT USAGE ON SCHEMA ...psycopg2.errors.InsufficientPrivilegethen we are missing the CREATE privilege.GRANT CREATE ON SCHEMA ...2. Result table
Should we create some default indexes on the results table?
run_idsource_table_name