Repository navigation
fix(importers): resolve an unstated threshold and clip as the Python path does (#334, #348) #408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sromoam
wants to merge
60
commits into
dev
Choose a base branch
from
fix/334-348-importer-defaults
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
e364b7a
fix(importers): resolve unstated threshold and clip as the Python pat…
sromoam adbda67
fix(importers): credit a zero threshold to the comparator only when i…
sromoam 3637981
Merge origin/dev into fix/334-348-importer-defaults
sromoam 530e77f
test: pin the free-form clip default from #334 in the extension refer…
sromoam ede3216
Merge remote-tracking branch 'origin/dev' into m408
sromoam 60703e0
fix(334): name an adopted comparator threshold in the explain() trail
sromoam 626f6dd
fix(348): resolve comparator keys on a nested model as the Python pat…
sromoam 7dfab62
docs(348): document the nested-model comparator warning and the new d…
sromoam 83f1556
docs(348): say the nested-object default threshold is fixed, not the …
sromoam 6e51532
fix(348): plural warning verbs, keep ValueError for a list comparator…
sromoam fe8b830
Merge origin/dev into fix/334-348-importer-defaults
sromoam c6878eb
fix(importers): check an adopted comparator threshold and resolve nes…
sromoam 2934248
docs(importers): state the threshold and clip defaults the importers …
sromoam dad0ca9
fix(importers): load a comparator that requires threshold on an array…
sromoam f7a4640
test(importers): pin the union, nested-warning and explain() behaviou…
sromoam 1caa1cb
docs(importers): correct the free-form clip, nested comparator and wa…
sromoam ff19b01
docs(importers): scope the free-form clip claim to each object, and n…
sromoam a7ab802
docs(thresholds): state that an invalid field threshold raises, on ev…
sromoam 09dcedd
fix(thresholds): raise on a field threshold that is not a number from…
sromoam a17802c
test(thresholds): pin the raise for an invalid field threshold on eve…
sromoam 4f0fb4a
docs(thresholds): one message per path, int or float only, match_thre…
sromoam f5ad746
fix(thresholds): check Annotated fields, quote values as written, no …
sromoam 3991537
test(thresholds): pin the per-path messages, Annotated, postponed ann…
sromoam be9b0b0
fix(thresholds): load an in-range Decimal, Fraction or numpy threshol…
sromoam d78cb3c
fix(thresholds): give every threshold message a fix, and the list ref…
sromoam 526061b
fix(thresholds): check a forward-referenced field when the class is d…
sromoam 7aa8375
docs(thresholds): a number from 0.0 to 1.0, on the class, config and …
sromoam 55e4023
fix(thresholds): keep the runtime match_threshold check of evaluate()…
sromoam 1654b58
fix(thresholds): check forward-referenced lists, keep numpy verdicts,…
sromoam 32febb2
fix(importers): name a titled schema's model in its warnings, and say…
sromoam 89b7e07
docs(thresholds): scope the runtime check, forward-referenced lists, …
sromoam 9794614
docs(thresholds): a bare alias name for a list is ignored once resolv…
sromoam 9d4a8a5
chore: merge origin/dev into fix/334-348-importer-defaults
sromoam 0cad533
fix(thresholds): check an Annotated field whose type is defined furth…
sromoam 4e59553
docs(thresholds): numpy float16 and float32 compare as Python floats,…
sromoam f7c7782
fix(auto): a runtime match_threshold=False does not warn that the thr…
sromoam 60cc3a2
fix(thresholds): correct the threshold messages whose advice was wron…
sromoam d77fb56
docs(thresholds): scope the numpy, runtime, class match_threshold and…
sromoam e9228d7
fix(thresholds): evaluate Annotated metadata as pydantic does, once p…
sromoam 44d21f9
fix(thresholds): a list-of-models message no longer tells an element …
sromoam 96f5567
fix(thresholds): an unresolved dict or tuple gets the usual fix, and …
sromoam c4612ba
docs(thresholds): scope the Python list warning, name match_threshold…
sromoam 9b2b5a9
docs(changelog): rewrap the threshold-rule paragraph
sromoam 3a18858
test(thresholds): pin that a numpy float16 or float32 match_threshold…
sromoam cb26400
test(thresholds): drop the postponed Annotated case from the dict-or-…
sromoam 8ce3b28
Revert "fix(thresholds): evaluate Annotated metadata as pydantic does…
sromoam 5d85b9b
Revert "fix(thresholds): check an Annotated field whose type is defin…
sromoam 605ea32
docs(thresholds): an Annotated field written as a string that names s…
sromoam a5230d5
fix(thresholds): a class loads when the working directory no longer e…
sromoam d86e94e
docs(importers): a threshold a custom comparator's constructor sets i…
sromoam 43579b1
docs(thresholds): scope the Annotated, numpy float64 and array-sentin…
sromoam 2b8d1b0
fix(evaluate): a runtime match_threshold of any real type in range is…
sromoam f7149a4
docs(thresholds): scope the Set at, None and unread-key claims
sromoam a93086a
docs(changelog): give the TP-to-FD example for a comparator's constru…
sromoam 726726f
ci(thresholds): mark the test's exec calls reviewed, and skip the mad…
sromoam f0800a4
Merge origin/dev into fix/334-348-importer-defaults
sromoam b78859f
test(thresholds): patch in the NaN threshold the report test needs
sromoam e7ccbdc
test(thresholds): name the bool match_threshold test for the refusal …
sromoam 619b714
fix(importers): name the model in the nested-model warnings as the er…
sromoam 006f558
Merge dev into fix/334-348-importer-defaults
sromoam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(348): plural warning verbs, keep ValueError for a list comparator…
…, and correct the README and test names
- Loading branch information
commit 6e51532551f55763173f03498fa35126e2d088b7
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Medium: rebuilding the comparator with
create_comparator(name, {})gives errors that name no field, and lets non-TypeErrorexceptions escape.On an array of objects with both a comparator and a comparator-config, a comparator with a required argument fails like this:
Failed to create NeedsPattern with config {}: missing 1 required positional argument. The message names no field, and it blames an argument the author did supply. A constructor that raisesRuntimeErrorescapesfrom_json_schema, which documents onlyValueError. A custom class namedLevenshteinComparatorthat requires config loaded on the merge base and raises on head.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in c6878eb and dad0ca9. On an array of objects, the comparator is now rebuilt with every config key except
threshold, so a comparator that requires another key still builds. Your custom LevenshteinComparator case loads, as it does on dev. A comparator whose constructor requiresthresholditself falls back to the one built from your full config (dad0ca9). It is never called there, so it loads as on dev, and explain() reports 0.5, as for any array of objects. If the comparator still cannot be built, the error is a ValueError naming the field and the key, whatever the constructor raised, so your RuntimeError case no longer escapes from_json_schema. Your NeedsPattern repro gets the same error as on dev: a List[StructuredModel] field cannot have a comparator.