Repository navigation
Describe the Pipeline's Evidence, and read Evidence keys in any case - #139
Merged
Merged
Conversation
advertize-accepted-evidence.md line 5 says every Pipeline MUST be able to describe the Evidence keys it can use, and evidence.md line 10 says keys MUST be case-insensitive. The tests ask a Pipeline which keys it accepts, change an element's filter after the build, and filter Flow Data's Evidence through the Pipeline. They send usage sharing the same values under keys in two letter cases, expecting one record, record a key whose prefix is not in lower case, expecting it under the lower case element, and give on-premise Device Detection its usual keys in other letter cases against a real data file.
The Pipeline had no way to give the Evidence it accepts. It now has get_evidence_key_filter, which accepts a key when any of its elements does, reading each element's filter when asked, as advertize-accepted-evidence.md line 5 asks. evidence.md line 10 says keys are case-insensitive. Usage sharing hashed the values for its repeat check under keys as spelled, so the same values under keys in another case were shared again, and it named each record element by the key's prefix as spelled. On-premise Device Detection gave the native evidence each key as spelled, where the native evidence matches the prefix with case, so Header.User-Agent was ignored. The repeat check now hashes lower case keys, the record element is the prefix in lower case, and the engine gives the native evidence each prefix in lower case.
…ative results open
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Pipeline could not describe the Evidence it accepts, and usage sharing and on-premise Device Detection treated an Evidence key spelled in other letters as a different key. The Pipeline now gives its accepted Evidence, and both read keys in any letters.
Problem
Pipeline(pipeline.pyat 6ad5ae2d) had no way to give the Evidence keys it can use, though each Flow Element can.Header.User-Agentwas ignored.What the specification says
advertize-accepted-evidence.md line 5 at 706de1f0: "All Flow Elements and Pipelines MUST be capable of programmatically describing the Evidence keys that they can make use of."
evidence.md line 10 at 706de1f0: "Keys MUST be case-insensitive and will usually be split into <prefix>.<field>."
What changed
c62ef9f9adds the tests:test_pipeline_evidence_key_filter.pyinfiftyone_pipeline_core(the Pipeline accepts what any element accepts, reads its elements' filters when asked, and filters Evidence to what it accepts), two tests intest_share_usage_record_fields.py(a repeat with keys in other letters is shared once, and Evidence is recorded under its prefix in lower case), andtest_evidence_key_case.pyin on-premise Device Detection.34dcb7a2addsPipeline.get_evidence_key_filter(), whose filter accepts a key when any element's filter does, reading each element's filter when a key is checked, as an element's keys can change once its data or the cloud service's answer arrives. Usage sharing hashes lower case keys for its repeat check and names each record element by the prefix in lower case. On-premise Device Detection gives the native evidence each key with its prefix in lower case.0c514e76closes each flow data the Evidence key case test makes.Before you upgrade
Header.Xis recorded underheader, where it was recorded underHeader.Header.User-Agent, where it ignored it.How it was verified
fiftyone_pipeline_engines_fiftyone("2 failed, 95 passed"). In on-premise Device Detection,test_a_key_in_any_case_reaches_the_native_engineintest_evidence_key_case.pyfailed forHeader.User-Agent,HEADER.USER-AGENTandQuery.User-Agentat line 61 ("3 failed, 77 passed"), so this run is that test's red too.rc28e5bf2, is green. Its ten Build and Test jobs, Python 3.10 to 3.14 on Ubuntu and Windows, each passed, withtest_pipeline_evidence_key_filter.py(3 tests),test_share_usage_record_fields.py(9) andtest_evidence_key_case.pypassing in each. The 11Setting 'PullRequestSha'lines all name 0c514e7, and Configure printed "Left out 5 macOS entries". macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.test_evidence_key_case.py, whose flow data stayed open ("6 native object(s) still alive").0c514e76reads each value inside awithblock.What it releases
fiftyone_pipeline_core,fiftyone_pipeline_engines_fiftyoneandfiftyone_devicedetection_onpremiseand their dependants, which Monday's release plan releases already.What remains
Nothing.