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: extend write_deltalake to accept Deltalake schema #1879

Closed
wants to merge 3 commits into from

Conversation

r3stl355
Copy link
Contributor

Description

Extended write_deltalake to accept either PyArrow or Deltalake schema.
Added a test

Related Issue(s)

closes #1862

@github-actions github-actions bot added the binding/python Issues for the Python package label Nov 18, 2023
@r3stl355
Copy link
Contributor Author

interesting, caught by type check in Python :)

@@ -179,6 +180,8 @@ def write_deltalake(
raise ValueError("You must provide schema if data is Iterable")
else:
schema = data.schema
elif isinstance(schema, Schema):
schema = schema.to_pyarrow()
Copy link
Collaborator

@ion-elgreco ion-elgreco Nov 18, 2023

Choose a reason for hiding this comment

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

This DeltaLake.schema to pyarrow schema needs happen also when we do pa.Table.from_pandas().

Also, probably best to merge it after this PR since I've been moving some things around in the writer https://github.com/delta-io/delta-rs/pull/1820/files#diff-557b42d8017266a17216274b0b47022a587045905f0990e2723c4a2369a037e8

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, missed that, will fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, makes sense to wait until that PR is merged as it changes the same file. I'll refresh the PR once the other one is merged

wjones127
wjones127 previously approved these changes Nov 18, 2023
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.

Thanks for working on this!

@r3stl355
Copy link
Contributor Author

closing this as something got messed up with rebase, will create a different PR

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use deltalake Schema in write_deltalake
3 participants