Skip to content

Merge scan options into FileIO at TableScan.__init__ time#3258

Open
rccreager wants to merge 1 commit intoapache:mainfrom
rccreager:rccreager/iceberg-python-issue-3166
Open

Merge scan options into FileIO at TableScan.__init__ time#3258
rccreager wants to merge 1 commit intoapache:mainfrom
rccreager:rccreager/iceberg-python-issue-3166

Conversation

@rccreager
Copy link
Copy Markdown

@rccreager rccreager commented Apr 19, 2026

Closes #3166

Rationale for this change

The Table.scan(..) method accepts a parameter options: Properties; this parameter is not actually threaded into the FileIO instance used in the DataScan class which scans the data. Instead, the internal callers were using a FileIO instance with only the basic catalog-level parameters set and were not respecting the user-specified options.

This is resolved by merging scan options into the FileIO at TableScan.__init__ time, using the existing load_file_io method. This means that if the user provides new parameters to scan, a new FileIO instance must be created with the merged properties. FileIO properties are immutable after construction, and the cached filesystem objects are built from those properties at first access, so a new instance is required.

If the options are empty or if the key:value pairs are all present in the existing FileIO options, you can use the existing FileIO instance.

I wanted to fix the problem at initialization, rather than at the various callsites, because self.io is also used in scan_plan_helper() for manifest reads, not just in to_arrow() for data reads. Fixing at init time covers both.

Are these changes tested?

I added tests to confirm that the init method has the expected behavior.

Are there any user-facing changes?

Yes. Scan-level options passed to Table.scan(options=...) are now respected by the underlying FileIO during data and manifest reads. Previously these options were silently ignored.

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.

Table.scan(options=...) silently ignores S3 properties for FileIO during data materialization (to_pandas / to_arrow)

1 participant