Repository navigation
feat: Add measurement mapping support in Specs - #242
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Nullable-response type errors and an export-order contract violation break required checks, while the new mapping tests also omit required dtype assertions.
3 open issues
What changed in this PR
Adds measurement mapping to the NI SystemLink Spec client so users can associate specifications with measurement data across create, read, query, and update operations.
Changes:
- Adds a public mapping model, specification field, and query projection support.
- Flattens the first mapping item into optional DataFrame columns.
- Extends examples and tests for mapping creation, filtering, projection, and updates.
Validation was limited to a standalone AST check. Project tests, linting, type checks, builds, and credentialed integration tests were not run during this review.
| File | Description |
|---|---|
tests/spec/test_spec_dataframe_utilitites.py |
Tests mapping flattening, partial values, and absent mappings. |
tests/integration/spec/test_spec.py |
Tests mapping persistence, clearing, filtering, and projection. |
nisystemlink/clients/spec/utilities/_dataframe_utilities.py |
Flattens mapping fields into DataFrame columns. |
nisystemlink/clients/spec/models/_specification.py |
Defines the mapping model and specification field. |
nisystemlink/clients/spec/models/_query_specs.py |
Adds mapping projection and filter documentation. |
nisystemlink/clients/spec/models/__init__.py |
Exports the new mapping model. |
examples/spec/update_and_delete_specs.py |
Demonstrates updating a measurement mapping. |
examples/spec/get_and_query_specs.py |
Demonstrates creating and querying mapped specifications. |
Review effort: Max
…rder Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
hariram-ni
approved these changes
Nov 13, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ahalya-ni
commented
Nov 16, 2026
Ahalya-ni
marked this pull request as ready for review
November 16, 2026 09:23
Ahalya-ni
requested review from
cameronwaterman,
rbell517 and
spanglerco
as code owners
November 16, 2026 09:23
Contributor
Author
|
Gentle reminder to review this PR |
rbell517
approved these changes
Nov 18, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.


What does this Pull Request accomplish?
User Story 4137170: Add measurementMapping in Python client
Adds
measurement_mappingsupport to the Spec client:MeasurementMappingItemmodel (optionalfilterandresult_filter) andmeasurement_mappingfield on specification definitions, so it is available for create, get, query and update.convert_specs_to_dataframehas a newmeasurement_mapping_formatargument, likecondition_format. Built-in formats:normalize_measurement_mappings_per_column(default): one row per spec, with columns such asmeasurement_mapping[0].filter.normalize_measurement_mappings_per_row: one row per mapping item.summarize_measurement_mappings_as_a_string: onemeasurement_mappingcolumn with a readable summary.Noneleaves mappings out, and a custom function can be passed.Why should this Pull Request be merged?
Lets users create, read, query, update and tabulate the mapping between a specification and its measurement data, including specs with multiple mapping items.
What testing has been done?