Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Python exceptions in public module #1771

Closed
Simske opened this issue Oct 25, 2023 · 5 comments
Closed

Expose Python exceptions in public module #1771

Simske opened this issue Oct 25, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@Simske
Copy link

Simske commented Oct 25, 2023

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

@Simske Simske added the enhancement New feature or request label Oct 25, 2023
@roeap
Copy link
Collaborator

roeap commented Nov 9, 2023

I'm happy to open a PR for this.

@Simske, that would be great. The exceptions were actually meant to be public :).

Personally I would go for the dedicated submodule approach.

@ion-elgreco
Copy link
Collaborator

@roeap I checked but they are already available under the exceptions module

@roeap
Copy link
Collaborator

roeap commented Nov 14, 2023

well - even better :). @Simske, could you confirm that works for you?

@ion-elgreco
Copy link
Collaborator

I'm closing this since have it already in the exceptions module.

@Simske
Copy link
Author

Simske commented Nov 25, 2023

I'm not sure how I overlooked that - thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants