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

feat: support new PyIceberg IO properties and custom IOConfig in write_iceberg #3633

Merged
merged 2 commits into from
Dec 24, 2024

Conversation

kevinzwang
Copy link
Member

@kevinzwang kevinzwang commented Dec 21, 2024

In addition to the new features, I restructured our _convert_iceberg_file_io_properties_to_io_config in two ways:

  1. we no longer import the property key constants from PyIceberg and instead hard-code them ourselves. this is because many of the keys only exist depending on the PyIceberg version being used, so we would need to add a multitude of version checks to cover all the possible keys.
  2. we now directly construct the configs using a new get_first_property_value function, instead creating a dictionary to pass into the constructors. This allows us to better take advantage of the type system and enables type checkers to catch potential issues. Also this function allows us to have multiple properties that can be used for a config value

I also cleaned up read_iceberg just a little bit to make the names and types more similar to write_iceberg

@kevinzwang kevinzwang requested a review from jaychia December 21, 2024 07:22
@github-actions github-actions bot added the feat label Dec 21, 2024
@kevinzwang
Copy link
Member Author

Resolves #3627

Copy link

codecov bot commented Dec 21, 2024

Codecov Report

Attention: Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.99%. Comparing base (1c0f780) to head (bb97524).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
daft/io/_iceberg.py 70.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3633      +/-   ##
==========================================
+ Coverage   77.90%   77.99%   +0.09%     
==========================================
  Files         720      720              
  Lines       88724    88794      +70     
==========================================
+ Hits        69117    69252     +135     
+ Misses      19607    19542      -65     
Files with missing lines Coverage Δ
daft/dataframe/dataframe.py 85.34% <100.00%> (+0.04%) ⬆️
daft/logical/builder.py 89.57% <100.00%> (-0.13%) ⬇️
daft/io/_iceberg.py 90.00% <70.00%> (+4.28%) ⬆️

... and 10 files with indirect coverage changes

Copy link
Contributor

@jaychia jaychia left a comment

Choose a reason for hiding this comment

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

LGTM with comments

@@ -9,82 +9,52 @@
from daft.logical.builder import LogicalPlanBuilder

if TYPE_CHECKING:
from pyiceberg.table import Table as PyIcebergTable
# from pyiceberg.table import Table as PyIcebergTable
Copy link
Contributor

Choose a reason for hiding this comment

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

Rm

return None

io_config = IOConfig(
s3=S3Config(
endpoint_url=props.get("s3.endpoint"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these (including the GCS ones below) also use get_first_property_value since we also want it to affect any_props_set?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good point, will change that

@kevinzwang kevinzwang enabled auto-merge (squash) December 24, 2024 19:52
Copy link

codspeed-hq bot commented Dec 24, 2024

CodSpeed Performance Report

Merging #3633 will improve performances by 98.6%

Comparing kevin/pyiceberg-new-props (bb97524) with main (1a4ae66)

Summary

⚡ 1 improvements
✅ 26 untouched benchmarks

Benchmarks breakdown

Benchmark main kevin/pyiceberg-new-props Change
test_show[100 Small Files] 30.4 ms 15.3 ms +98.6%

@kevinzwang kevinzwang merged commit e59581c into main Dec 24, 2024
41 checks passed
@kevinzwang kevinzwang deleted the kevin/pyiceberg-new-props branch December 24, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants