Skip to content

Expose Python exceptions in public module #1771

Closed
@Simske

Description

@Simske

Description

The deltalake-Python module defines multiple exceptions which can be raised when working with the package (DeltaError, TableNotFoundError, CommitFailedError, DeltaProtocolError). However these exceptions are defined only in the "private" deltalake._internal submodule, and not in the root module or a public submodule.

As I don't expect the interface of ._internal to be stable it would be useful to expose them in a public module with a stable interface.

My suggestion would be to either:

  • expose them via the root module
  • expose them in dedicated public submodule exceptions

I'm happy to open a PR for this.

Use Case

The user needs to import the exceptions if they want to do speficic exception handling, e.g.

try:
    table = deltalake.DeltaTable(table_uri)
except deltalake.exceptions.TableNotFoundError:
    logging.warning("Table '%s' not found, skipping", table_uri)

Related Issue(s)
None

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions