Xiezhibin commented on issue #2132:
URL:
https://github.com/apache/iceberg-python/issues/2132#issuecomment-3043982685
> No, I don't think this is needed, the `EMPTY_DICT` avoids doing
null-checks :)
π Thanks! βthe EMPTY_DICT saves us from writing extra null checks π,
I plan to modify the following parts according to the reference content to
see if it is feasible.
- **Position Notes and Warnings Prior to Examples**: so users get the
important caveats upfront.
- **Add a table that outlines the input and output and whether they are
required**.
- **Provide Two Examples**: one simple before, one showing the full
parameters.
The second example about Add files to Iceberg table with custom snapshot
properties:
```python
# Assume an existing Iceberg table object `tbl`
file_paths = [
"s3a://warehouse/default/existing-1.parquet",
"s3a://warehouse/default/existing-2.parquet",
]
# Custom snapshot properties
snapshot_properties = {"abc": "def"}
# Enable duplicate file checking
check_duplicate_files = True
# Add the Parquet files to the Iceberg table without rewriting
tbl.add_files(
file_paths=file_paths,
snapshot_properties=snapshot_properties,
check_duplicate_files=check_duplicate_files
)
# NameMapping must have been set to enable reads
assert tbl.name_mapping() is not None
# Verify that the snapshot property was set correctly
assert tbl.metadata.snapshots[-1].summary["abc"] == "def"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]