Skip to content

Docs: Add missing _downcast_ns_timestamp_to_us to ArrowScan docstring#3594

Merged
Fokko merged 1 commit into
apache:mainfrom
qzyu999:fix-arrowscan-docstring
Jul 6, 2026
Merged

Docs: Add missing _downcast_ns_timestamp_to_us to ArrowScan docstring#3594
Fokko merged 1 commit into
apache:mainfrom
qzyu999:fix-arrowscan-docstring

Conversation

@qzyu999

@qzyu999 qzyu999 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Minor documentation gap (no issue).

Rationale for this change

The ArrowScan class declares _downcast_ns_timestamp_to_us: bool | None as a class-level type annotation and documents all other attributes in the docstring, but this attribute was missing from the Attributes section.

What changes are included in this PR?

Adds one line to the ArrowScan class docstring documenting the _downcast_ns_timestamp_to_us attribute.

Are there any user-facing changes?

No.

@ebyhr ebyhr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. The constant at L1767 contains "ON_WRITE", but the actual usage is on read in my understanding.

@qzyu999

qzyu999 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Looks good to me. The constant at L1767 contains "ON_WRITE", but the actual usage is on read in my understanding.

Hi @ebyhr, good catch on DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE. It does seem to be used for writing in /pyiceberg/table/__init__.py (append(), overwrite(), upsert(), add_files()) and pyiceberg/io/pyarrow.py (write_file(), _dataframe_to_data_files()), while using it for schema inference in pyiceberg/catalog/__init__.py (_convert_schema_if_needed). It's really only in this ArrowScan where it's quite misleading.

I can create a separate PR to rename it to DOWNCAST_NS_TIMESTAMP_TO_US while keeping it backwards compatible since it's a user-facing variable, WDYT?

Edit: Opened a new PR (#3596) for renaming DOWNCAST_NS_TIMESTAMP_TO_US_ON_WRITE.

@Fokko Fokko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this @qzyu999

@Fokko Fokko merged commit af1416d into apache:main Jul 6, 2026
17 checks passed
@qzyu999 qzyu999 deleted the fix-arrowscan-docstring branch July 6, 2026 19:59
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.

3 participants