Skip to content

test: add more test cases to improve test coverage for the write functionality in Lance#5619

Merged
wjones127 merged 1 commit intolance-format:mainfrom
lichuang:more-test-write
Jan 14, 2026
Merged

test: add more test cases to improve test coverage for the write functionality in Lance#5619
wjones127 merged 1 commit intolance-format:mainfrom
lichuang:more-test-write

Conversation

@lichuang
Copy link
Copy Markdown
Contributor

@lichuang lichuang commented Jan 4, 2026

This PR adds four new test cases to improve test coverage for the write functionality in Lance:

Changes

  • test_max_rows_per_file - Tests the max_rows_per_file parameter behavior

    • Validates that data is correctly split into multiple fragments based on row count limits
    • Verifies row distribution: 12,000 rows with limit of 5,000 creates 3 fragments [5000, 5000, 2000]
  • test_max_rows_per_group - Tests max_rows_per_group parameter across different Lance file versions

    • V1 (Legacy): Row group chunking affects fragment distribution
    • V2 (Stable): Ignores row group size, splits only at file boundaries
    • Demonstrates the behavioral differences between V1 and V2 implementations
  • test_empty_stream_write: Verifies graceful handling of empty input streams to prevent unexpected panics or cryptic errors.

  • test_schema_mismatch_on_append: Ensures clear error messages and data integrity when attempting to append data with incompatible schemas.

  • test_disk_full_error: Validates proper error propagation for storage-related failures to help users quickly identify and debug disk space issues.

  • test_write_interruption_recovery: Tests the complete transaction flow for interrupted writes, ensuring dataset consistency, data integrity, and successful retry capability.

Motivation

These tests improve confidence in the write functionality by covering important parameters and features that were previously untested or under-tested. They help prevent regressions and ensure correct behavior across different Lance file versions.

@github-actions github-actions Bot added the chore label Jan 4, 2026
@lichuang lichuang force-pushed the more-test-write branch 2 times, most recently from 1304652 to 8335288 Compare January 4, 2026 09:13
Copy link
Copy Markdown
Contributor

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

Also changed the type in the PR title to test.

Comment thread rust/lance/src/dataset/write.rs Outdated
@wjones127 wjones127 changed the title chore: add more test cases to improve test coverage for the write functionality in Lance test: add more test cases to improve test coverage for the write functionality in Lance Jan 5, 2026
@wjones127 wjones127 self-assigned this Jan 5, 2026
Comment thread rust/lance/src/dataset/write.rs
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 87.94788% with 37 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance/src/dataset/write.rs 87.94% 34 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

@lichuang
Copy link
Copy Markdown
Contributor Author

@wjones127 please review this pr again

Copy link
Copy Markdown
Contributor

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

Seems good. I have a few suggestions to make it shorter.

Comment thread rust/lance/src/dataset/write.rs Outdated
Comment thread rust/lance/src/dataset/write.rs Outdated
Comment thread rust/lance/src/dataset/write.rs Outdated
Comment thread rust/lance/src/dataset/write.rs Outdated
Comment thread rust/lance/src/dataset/write.rs Outdated
Comment thread rust/lance/src/dataset/write.rs Outdated
@lichuang
Copy link
Copy Markdown
Contributor Author

all checks has passed, please review it again. @wjones127

@wjones127 wjones127 merged commit 445dd5b into lance-format:main Jan 14, 2026
29 checks passed
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
…tionality in Lance (lance-format#5619)

This PR adds four new test cases to improve test coverage for the write
functionality in Lance:

### Changes

- **`test_max_rows_per_file`** - Tests the `max_rows_per_file` parameter
behavior
- Validates that data is correctly split into multiple fragments based
on row count limits
- Verifies row distribution: 12,000 rows with limit of 5,000 creates 3
fragments [5000, 5000, 2000]

- **`test_max_rows_per_group`** - Tests `max_rows_per_group` parameter
across different Lance file versions
   - **V1 (Legacy)**: Row group chunking affects fragment distribution
- **V2 (Stable)**: Ignores row group size, splits only at file
boundaries
- Demonstrates the behavioral differences between V1 and V2
implementations

- **test_empty_stream_write:** Verifies graceful handling of empty input
streams to prevent unexpected panics or cryptic errors.
  
- **test_schema_mismatch_on_append:** Ensures clear error messages and
data integrity when attempting to append data with incompatible schemas.
  
- **test_disk_full_error:** Validates proper error propagation for
storage-related failures to help users quickly identify and debug disk
space issues.
  
- **test_write_interruption_recovery:** Tests the complete transaction
flow for interrupted writes, ensuring dataset consistency, data
integrity, and successful retry capability.

### Motivation

These tests improve confidence in the write functionality by covering
important parameters and features that were previously untested or
under-tested. They help prevent regressions and ensure correct behavior
across different Lance file versions.
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