Skip to content

fix(staging): report the value's type, not the key's, in Datasaur validation error - #4473

Open
simpleqt wants to merge 1 commit into
Unstructured-IO:mainfrom
simpleqt:fix/datasaur-error-variable
Open

fix(staging): report the value's type, not the key's, in Datasaur validation error#4473
simpleqt wants to merge 1 commit into
Unstructured-IO:mainfrom
simpleqt:fix/datasaur-error-variable

Conversation

@simpleqt

@simpleqt simpleqt commented Sep 5, 2026

Copy link
Copy Markdown

Summary

In stage_for_datasaur, the validation error used type(key) — always <class 'str'> since key is the dict key name — producing self-contradictory messages like "Expected type <class 'str'> for start_idx. Got <class 'str'>" when a value has the wrong type (e.g. start_idx=1.5). Changed to type(entity[key]).

Checklist

  • Conventional Commit title
  • Existing test (test_unstructured/staging/test_datasaur.py) asserts only pytest.raises(ValueError), no message match — safe

Review in cubic

…idation error

type(key) is always str (the dict key name), so a bad value produced a
self-contradictory message like "Expected type <class 'str'> for
start_idx. Got <class 'str'>". Report type(entity[key]) instead.
Copilot AI lite review requested due to automatic review settings September 5, 2026 17:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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