Skip to content

Potential PostgreSQL result handler improvements #1755

Description

@nj1973

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?

  • run_id
  • source_table_name

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions