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

[0.6.x] Backport PR #523 to cast data to iceberg table's pyarrow schema #559

Conversation

HonahX
Copy link
Contributor

@HonahX HonahX commented Mar 29, 2024

Backport #523

Depends on #560

@HonahX HonahX changed the title [0.6.x] Backport PR #352 to Improve error message in case of a mismatch [0.6.x] Backport PR #523 to cast data to iceberg table's pyarrow schema Mar 29, 2024
_check_schema_compatible(self.schema(), other_schema=df.schema)
# cast if the two schemas are compatible but not equal
if schema_to_pyarrow(self.schema()) != df.schema:
df = df.cast(schema_to_pyarrow(self.schema()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to use schema_to_pyarrow directly here since schema.as_arrow() is not available in 0.6.x

@HonahX HonahX added this to the PyIceberg 0.6.1 milestone Mar 29, 2024
Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

LGTM! Would it be easier to pull #532 in instead of making a new commit?

@HonahX
Copy link
Contributor Author

HonahX commented Mar 29, 2024

@kevinjqliu I did not include that PR since that adds a new API and I think for a patch release we should not add any new functionality. I added that one to 0.7.0 milestone. WDYT?

@kevinjqliu
Copy link
Contributor

that makes sense, thanks!

@HonahX HonahX force-pushed the backport/cast_data_to_pyarrow_schema_on_write branch from 93b61dd to 37d70c8 Compare March 31, 2024 01:01
@HonahX HonahX merged commit 83c8c3e into apache:pyiceberg-0.6.x Mar 31, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants