-
Notifications
You must be signed in to change notification settings - Fork 406
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
feat(python): add DeltaTable.is_deltatable static method (#2662) #2715
Conversation
a8261be
to
5c5432e
Compare
@omkar-foss thanks for the PR, I do believe we should do a bit differently. Now we are loading the state of the table, which could be potentially very large. We could also simply look if _delta_log exists or not, and whether that is then also not empty. Or we do some other kind of lazy loading where we simply read the first log entry |
@ion-elgreco Yes I completely agree. I wasn't aware that the As a matter of fact, the I'll update the PR accordingly, thanks for your quick review 😁👍🏽 |
@omkar-foss there might be some internal code on the rust side that does something like this already, I am not certain, but worth it to check |
This adds a static method `is_deltatable(path, opts)` to the `DeltaTable` Python class, which returns `True` if able to locate a delta table at specified `path` and `False` otherwise. It does so by reusing the Rust internal `is_delta_table_location()` via the `DeltaTableBuilder`. Additionally, this also adds documentation of the usage with examples for the `DeltaTable.is_deltatable()` method.
5c5432e
to
92fb829
Compare
Hey @ion-elgreco, I've updated the PR as discussed. I've attempted to reuse the Rust side internal Kindly check out the PR when you get some time and let me know if any improvement suggestions or changes required. Thanks! |
@omkar-foss Nice work! Thanks for the contribution :) |
closes #2662.
Description
This adds a static method
is_deltatable(path, opts)
to theDeltaTable
Python class, which returnsTrue
if able tolocate a delta table at specified
path
andFalse
otherwise.It does so by reusing the Rust internal
is_delta_table_location()
via the
DeltaTableBuilder
.Additionally, this also adds documentation of the usage with
examples for the
DeltaTable.is_deltatable()
method.