Skip to content

Conversation

@scottsand-db
Copy link
Collaborator

@scottsand-db scottsand-db commented Jan 21, 2026

🥞 Stacked PR

Use this link to review incremental changes.


What changes are proposed in this pull request?

This PR adds a fairly simple In-Memory UC-Commits-Client for tests.

We will then be able to build e2e read/write/publish tests on top of this client, later.

How was this change tested?

Add some simple tests for this client.

@scottsand-db scottsand-db changed the title done test-only: In-Memory UC-Commits-Client Jan 21, 2026
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rename from commits_client.rs to mod.rs. Glad GitHub captures this succinctly!

mod in_memory;

#[cfg(any(test, feature = "test-utils"))]
pub use in_memory::InMemoryCommitsClient;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The InMemory UC-Commits-Client is only visible when (a) inside tests, and (b) using the test-utils feature flag.

@scottsand-db scottsand-db requested a review from nicklan January 21, 2026 00:04
@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

❌ Patch coverage is 93.16770% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.28%. Comparing base (1a731eb) to head (92e09d7).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
uc-client/src/commits_client/in_memory.rs 93.16% 6 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1644      +/-   ##
==========================================
+ Coverage   84.16%   84.28%   +0.12%     
==========================================
  Files         122      124       +2     
  Lines       34111    34423     +312     
  Branches    34111    34423     +312     
==========================================
+ Hits        28710    29015     +305     
+ Misses       4013     3993      -20     
- Partials     1388     1415      +27     

☔ 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.

Comment on lines +17 to +18
/// The highest version that has been ratified (committed) to this table.
max_ratified_version: i64,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my knowledge: do we use the word "ratified" as a specific state in design docs for catalog-based commits?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not just design docs, but also the table feature protocol specification, too. https://github.com/delta-io/delta/blob/master/protocol_rfcs/catalog-managed.md#terminology-commits

Writers propose commits to the catalog, which can either reject the commit, or approve (aka "ratify") it.

Copy link
Contributor

@gotocoding-DB gotocoding-DB left a comment

Choose a reason for hiding this comment

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

LGTM

pub fn create_table(&self, table_id: impl Into<String>) -> Result<()> {
let mut tables = self.tables.write().unwrap();
match tables.entry(table_id.into()) {
std::collections::hash_map::Entry::Vacant(e) => {
Copy link
Collaborator

@OussamaSaoudi OussamaSaoudi Jan 23, 2026

Choose a reason for hiding this comment

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

maybe use std::collections::hash_map; above?

Suggested change
std::collections::hash_map::Entry::Vacant(e) => {
hash_map::Entry::Vacant(e) => {

)));
}

if self.catalog_commits.len() as u16 >= Self::MAX_UNPUBLISHED_COMMITS {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why the u16 instead of usize?


impl UCCommitsClient for InMemoryCommitsClient {
async fn get_commits(&self, request: CommitsRequest) -> Result<CommitsResponse> {
let tables = self.tables.read().unwrap();
Copy link
Collaborator

@OussamaSaoudi OussamaSaoudi Jan 23, 2026

Choose a reason for hiding this comment

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

Do we expect external folks to use this test? We should probably make this an error. Maybe a Fatal variant?

NVM, seems this is test-only.

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