Skip to content

Prepare v1.7.2: fix file naming, improve error messages - #62

Merged
vianneybacoup merged 9 commits into
mainfrom
fix/v1.7.2-improvements
Apr 17, 2026
Merged

Prepare v1.7.2: fix file naming, improve error messages#62
vianneybacoup merged 9 commits into
mainfrom
fix/v1.7.2-improvements

Conversation

@vianneybacoup

Copy link
Copy Markdown
Collaborator

Summary

  • Bump version to 1.7.2 (was stuck at 1.7.0 in the v1.7.1 release)
  • Fix multi-file output naming: files were named output.csv_0 instead of output_0.csv when using files: N. The index suffix is now inserted before the extension for all formats (CSV, JSON, Parquet)
  • Confirm case-insensitive provider lookup: provider names like RANDOM.NUMBER.F64 or Person.Fname already resolve correctly — added explicit tests documenting this behavior
  • Improve unknown provider error messages: sub-builders returned empty error strings that got double-wrapped into unreadable BadYAMLFormat("BadYAMLFormat(\"\")") messages. Now each builder reports the unrecognized segment and lists valid options (e.g. Unknown provider: random.float. Expected one of: random.bool, random.date.*, random.number.*, random.string.*). Also fixed FakeLakeError::Display to produce human-readable output instead of Debug formatting

Test plan

  • All 302 unit tests pass
  • All 16 integration tests pass (including given_seeded_multifile_parquet_should_be_reproducible updated for new naming)
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • Manual verification: files: 3 produces output_0.csv, output_1.csv, output_2.csv
  • Manual verification: invalid provider random.float now shows helpful error with suggestions

🤖 Generated with Claude Code

vianneybacoup and others added 7 commits April 16, 2026 15:25
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Files were named output.csv_0 instead of output_0.csv when using the
files: N config option. Split the extension from the base name before
inserting the file index suffix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Provider names are already resolved case-insensitively via
to_lowercase() at the entry point. Add an explicit test covering
mixed-case and uppercase variants of all provider families.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sub-builders returned empty error strings, and config.rs double-wrapped
them into nested BadYAMLFormat("BadYAMLFormat(\"BadYAMLFormat(\"\")\")")
messages. Fix both issues:

- Each sub-builder now reports the unrecognized segment and lists valid
  options (e.g. "Unknown provider: random.float. Expected one of:
  random.bool, random.date.*, random.number.*, random.string.*")
- config.rs propagates provider errors directly instead of re-wrapping
- FakeLakeError::Display now formats human-readable messages instead of
  using Debug output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…iant

Replace duplicated "Unknown provider: ... Expected one of: ..." format
strings across all builders with a structured FakeLakeError::UnknownProvider
variant that holds the wrong provider name and a static list of valid
options. Each builder declares its AVAILABLE list as a const and delegates
formatting to the Display impl.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Prepares the v1.7.2 release by correcting multi-file output naming, improving provider-resolution error reporting, and documenting provider lookup behavior (case-insensitive) via tests.

Changes:

  • Bump crate version to 1.7.2.
  • Adjust multi-file output naming to insert the index before the extension (e.g. output_0.csv).
  • Add UnknownProvider error variant + improved Display, propagate errors without double-wrapping, and add case-insensitive provider resolution tests.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test.rs Updates integration test expectations/cleanup for new multi-file Parquet naming.
src/generate/output_format.rs Implements index-before-extension naming for multi-file generation.
src/errors.rs Adds UnknownProvider and improves human-readable error formatting.
src/config.rs Stops re-wrapping provider-builder errors at the column level.
src/providers/provider.rs Updates unknown-provider handling to include valid options; adds case-insensitive provider resolution test.
src/providers/random/builder.rs Improves unknown-provider errors for random.* root selection.
src/providers/random/date/builder.rs Improves unknown-provider errors for date sub-providers.
src/providers/random/number/builder.rs Improves unknown-provider errors for number sub-providers.
src/providers/random/string/builder.rs Improves unknown-provider errors for string sub-providers.
src/providers/person/builder.rs Improves unknown-provider errors for person sub-providers.
src/providers/increment/builder.rs Improves unknown-provider errors for increment sub-providers.
src/providers/constant/builder.rs Improves unknown-provider errors for constant sub-providers.
Cargo.toml Version bump to 1.7.2.
Cargo.lock Lockfile updated for version bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/generate/output_format.rs Outdated
Comment thread src/generate/output_format.rs Outdated
vianneybacoup and others added 2 commits April 16, 2026 16:57
The unknown_provider function now accepts a prefix and an Option<&str>
segment, and assembles the full provider name internally. This removes
the duplicated format!("prefix.{}", other.unwrap_or("<missing>"))
pattern from every builder call site.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address Copilot review: replace rfind with strip_suffix to avoid
truncating filenames that contain the extension mid-string. Also add
an integration test verifying multi-file indexed naming for CSV and
JSON formats, not just Parquet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vianneybacoup
vianneybacoup merged commit 2ff0aa9 into main Apr 17, 2026
5 checks passed
@vianneybacoup
vianneybacoup deleted the fix/v1.7.2-improvements branch April 17, 2026 06:55
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.

2 participants