-
Notifications
You must be signed in to change notification settings - Fork 415
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
Conversation
interesting, caught by type check in Python :) |
python/deltalake/writer.py
Outdated
@@ -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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this 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!
Signed-off-by: Nikolay Ulmasov <ulmasov@hotmail.com>
Signed-off-by: Nikolay Ulmasov <ulmasov@hotmail.com>
Signed-off-by: Nikolay Ulmasov <ulmasov@hotmail.com>
closing this as something got messed up with rebase, will create a different PR |
Description
Extended write_deltalake to accept either PyArrow or Deltalake schema.
Added a test
Related Issue(s)
closes #1862