Skip to content

The on-premise Device Detection engine gives its components, with Metrics among them - #229

Draft
jwrosewell wants to merge 3 commits into
rcfrom
remote/python-m1
Draft

jwrosewell wants to merge 3 commits into
rcfrom
remote/python-m1

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

  • dd57c1d, the test. tests/test_properties.py gains test_components_include_metrics (the list is the native components followed by Metrics, and the native list does not already hold it) and test_every_property_component_is_listed (every property's component, the match metrics included, is in the list).
  • 556719d, the fix. DeviceDetectionOnPremise.get_components(), a new public method, returns the names of the data file's components in the native order followed by Metrics. It reads the native metadata on each call, so it follows a data file refresh, and raises the engine closed error after close(). Nothing is removed or renamed.

The runs

  • With the free 51Degrees-LiteV4.1.hash, python -m pytest tests/test_properties.py from device-detection/fiftyone_devicedetection_onpremise:
    • at the test commit, 2 failed and 5 passed, both new tests failing with AttributeError: 'DeviceDetectionOnPremise' object has no attribute 'get_components';
    • at the fix, 7 passed.
  • The whole on-premise suite at the fix, python -m pytest tests: 103 passed, 14 subtests passed, 0 failed.
  • Red on CI, the test commit on rc: to follow.
  • Full build on CI at the head: to follow.

What remains

The two CI runs above.

Before you upgrade

Nothing changes for existing callers. get_components() is a new method.

…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.
@jwrosewell jwrosewell added the remote-conformance Brings the code into conformance with the specification label Nov 16, 2026
@jwrosewell jwrosewell changed the title Specification conformance, Remote fix pack python-m1: 51degrees-python The on-premise Device Detection engine gives its components, with Metrics among them Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

remote-conformance Brings the code into conformance with the specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant