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

Rethink the load_version and load_with_datetime interfaces #1910

Closed
MrPowers opened this issue Nov 25, 2023 · 1 comment · Fixed by #1968
Closed

Rethink the load_version and load_with_datetime interfaces #1910

MrPowers opened this issue Nov 25, 2023 · 1 comment · Fixed by #1968
Labels
enhancement New feature or request
Milestone

Comments

@MrPowers
Copy link
Collaborator

Description

There are currently a few different interfaces for time traveling:

Option 1:

DeltaTable("some_path", version=1)

Option 2:

dt = DeltaTable("some_path")
dt.load_version(1)

Option 3:

dt = DeltaTable("some_path")
dt.load_with_datetime("2018-01-26T18:30:09Z")

We should consider providing a single interface:

dt = DeltaTable("some_path").time_travel(version=1)
dt = DeltaTable("some_path").time_travel(version_as_of="2018-01-26T18:30:09Z")

I don't think methods like these should be limited to only taking string arguments: load_with_datetime(datetime_string: str)

Users should be able to pass in Python date and datetime objects as well.

@MrPowers MrPowers added the enhancement New feature or request label Nov 25, 2023
@ion-elgreco
Copy link
Collaborator

Good one, we can perhaps consolidate the load_version and load_with_datetime into a single function:

DeltaTable.load_to(version: int | datetime)

@ion-elgreco ion-elgreco added this to the python v0.15 milestone Nov 26, 2023
roeap added a commit that referenced this issue Dec 19, 2023
…ersion` (#1968)

# Description
Combines the two functions into one.

# Related Issue(s)
- closes #1910
- closes #1967

---------

Co-authored-by: Robert Pack <42610831+roeap@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

2 participants