Skip to content

Conversation

@lbhm
Copy link
Collaborator

@lbhm lbhm commented Sep 24, 2025

What changes are proposed in this pull request?

This PR resolves #1296 and refactors the fields of Metadata to make them private.

The change forces all callers to instantiate Metadata via the try_new function. Otherwise, we cannot guarantee that metadata columns never leak to the Delta log, as callers might directly instantiate a Metadata instance with an illegal table schema.

This PR affects the following public APIs

None. All Metadata fields have been pub(crate).

How was this change tested?

This is a pure refactoring. Existing tests verify correctness.

@lbhm lbhm requested review from scovich and zachschuermann and removed request for zachschuermann September 24, 2025 16:09
@lbhm lbhm requested a review from zachschuermann September 24, 2025 16:09
@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.76%. Comparing base (a27f366) to head (7aa51d0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1347      +/-   ##
==========================================
+ Coverage   84.73%   84.76%   +0.02%     
==========================================
  Files         113      113              
  Lines       28396    28421      +25     
  Branches    28396    28421      +25     
==========================================
+ Hits        24062    24091      +29     
+ Misses       3198     3194       -4     
  Partials     1136     1136              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lbhm lbhm changed the title refactor!: Make Metadata fields private refactor: Make Metadata fields private Sep 25, 2025
@lbhm lbhm changed the title refactor: Make Metadata fields private refactor: Make Metadata fields private Sep 25, 2025
Copy link
Member

@zachschuermann zachschuermann left a comment

Choose a reason for hiding this comment

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

looks good! (perhaps we could take some follow up to add some testing utils so we have less verbose callsites but let's take that up later)

@zachschuermann zachschuermann merged commit fc5ccb0 into delta-io:main Sep 25, 2025
21 checks passed
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.

Make Metadata fields private to prevent bypassing Metadata::try_from

3 participants