Repository navigation
The on-premise Device Detection engine gives its components, with Metrics among them - #229
Draft
jwrosewell wants to merge 3 commits into
Draft
jwrosewell wants to merge 3 commits into
jwrosewell wants to merge 3 commits into
Conversation
…eturns The on-premise device detection specification says the Metrics component MUST also be added to the list of components returned by the Engine (device-detection-specification/pipeline-elements/device-detection-on-premise.md line 464 at dbaf099c712e2bd3a2a80bfb4eaf284b079f05eb). DD-21.
get_components gives the names of the data file's components followed by Metrics, the component of the match metric properties, as device-detection-specification/pipeline-elements/device-detection-on-premise.md line 464 at dbaf099c712e2bd3a2a80bfb4eaf284b079f05eb requires. DD-21.
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 problem
The on-premise Device Detection engine gives no list of the components it holds, so a caller cannot see that the Metrics component is among them.
The specification
device-detection-specification/pipeline-elements/device-detection-on-premise.md lines 464 to 465 at dbaf099c: "Component = "Metrics" - This component MUST also be added to the list of components returned by the Engine."
The change
tests/test_properties.pygainstest_components_include_metrics(the list is the native components followed byMetrics, and the native list does not already hold it) andtest_every_property_component_is_listed(every property's component, the match metrics included, is in the list).DeviceDetectionOnPremise.get_components(), a new public method, returns the names of the data file's components in the native order followed byMetrics. It reads the native metadata on each call, so it follows a data file refresh, and raises the engine closed error afterclose(). Nothing is removed or renamed.The runs
51Degrees-LiteV4.1.hash,python -m pytest tests/test_properties.pyfromdevice-detection/fiftyone_devicedetection_onpremise:AttributeError: 'DeviceDetectionOnPremise' object has no attribute 'get_components';python -m pytest tests: 103 passed, 14 subtests passed, 0 failed.What remains
The two CI runs above.
Before you upgrade
Nothing changes for existing callers.
get_components()is a new method.