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

feat: add restore command in python binding #1529

Merged
merged 17 commits into from
Aug 1, 2023
Merged

Conversation

loleek
Copy link
Contributor

@loleek loleek commented Jul 11, 2023

Description

This is a implementation of the Restore Command for python binding.

Related Issue(s)

#837

@github-actions github-actions bot added binding/python Issues for the Python package binding/rust Issues for the Rust crate documentation Improvements or additions to documentation rust labels Jul 11, 2023
Comment on lines 332 to 335
if let Some(version) = version_to_restore {
cmd = cmd.with_version_to_restore(version)
}
if let Some(ds) = datetime_to_restore {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since both of these parameters are optional there is a potential for a user to inadvertently provide both arguments and that would result in two restore "commands" being passed into the builder, and the datetime one is the one which will win in that case.

I think it might be useful to raise an error here to indicate to the user that they should not provide both parameters, or issue a warning that the version_to_restore will be ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check has been done here.parameter check. Should I do double check?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the check is good. But TBH, for the Python interface, I think we should combine the parameters into one. See my other comment.

Copy link
Collaborator

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the high-quality tests. I think there's some UX stuff on the Python API that could be improved, then I think this is ready to be merged.

Comment on lines 332 to 335
if let Some(version) = version_to_restore {
cmd = cmd.with_version_to_restore(version)
}
if let Some(ds) = datetime_to_restore {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the check is good. But TBH, for the Python interface, I think we should combine the parameters into one. See my other comment.

python/deltalake/table.py Outdated Show resolved Hide resolved
@loleek loleek requested a review from wjones127 July 19, 2023 13:15
@wjones127 wjones127 enabled auto-merge (squash) August 1, 2023 03:18
@wjones127 wjones127 merged commit 2210c3b into delta-io:main Aug 1, 2023
21 checks passed
polynomialherder pushed a commit to polynomialherder/delta-rs that referenced this pull request Aug 15, 2023
# Description
This is a implementation of the Restore Command for python binding.

# Related Issue(s)
delta-io#837

---------

Co-authored-by: Will Jones <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/python Issues for the Python package binding/rust Issues for the Rust crate documentation Improvements or additions to documentation rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants