Skip to content

Add the rest of the _convert_schema_if_needed calls #2300

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rambleraptor
Copy link
Contributor

Closes #2270

This adds the rest of the _convert_schema_if_needed calls.

Rationale for this change

Are these changes tested?

Are there any user-facing changes?

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.

Thanks for the PR!

Looks like theres one more usage of _convert_schema_if_needed here
And another usage of pyarrow_to_schema here

I think we should pass format_version down in both.

I found these by checking the signature changes in #2294
These 3 functions were changed as well, but i double checked them and they are all good.

_pyarrow_to_schema_without_ids
_ConvertToIceberg
_check_pyarrow_schema_compatible

@rambleraptor
Copy link
Contributor Author

good call. both instances fixed

@rambleraptor rambleraptor requested a review from kevinjqliu August 8, 2025 22:57
],
names=["timestamp_ns", "timestamptz_ns"],

catalog = load_catalog("default", type="in-memory")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit can we use arrow_table_schema_with_nanoseconds_timestamp_precisions here? its pretty comprehensive

Comment on lines +2265 to +2269
with pytest.raises(NotImplementedError, match="Writing V3 is not yet supported"):
catalog.create_table("ns.table1", schema=table.schema, properties={"format-version": "3"})

with pytest.raises(NotImplementedError, match="Writing V3 is not yet supported"):
catalog.create_table("ns.table2", schema=table2.schema, properties={"format-version": "3"})
Copy link
Contributor

Choose a reason for hiding this comment

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

nit can we test that the same code that works for v3 doesnt work for v2. something like

    with pytest.raises(NotImplementedError, match="..."):
        _create_table(session_catalog, identifier, {"format-version": "2"}, schema=table.schema)

@kevinjqliu kevinjqliu added this to the PyIceberg 0.10.0 milestone Aug 10, 2025
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.

Improve timestamp support
2 participants