Add Support for Batch Publishing Non-Scalar Measurement Values#133
Open
hunter-ni wants to merge 18 commits into
Open
Add Support for Batch Publishing Non-Scalar Measurement Values#133hunter-ni wants to merge 18 commits into
hunter-ni wants to merge 18 commits into
Conversation
…entBatchRequest with non-scalar measurement values.
…tchRequest with values.
… types of (single) Vector and simple Iterables of primitive types.
…MeasurementBatchRequest.
…ement data as a batch
…asurementBatch test names
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request extends the NI DataStore Python client’s batch publishing support to include non-scalar measurement value types (e.g., AnalogWaveform, Vector, XYData) in addition to the existing scalar batch support, aligning the client with updated service API capabilities.
Changes:
- Updated gRPC request population logic to accept
Iterables of supported non-scalar measurement types and map them into the appropriatePublishMeasurementBatchRequestfields. - Added extensive unit and acceptance tests validating successful conversions/publishing and error handling for heterogeneous/unsupported iterables.
- Added a notebook example demonstrating batch publishing for both scalar and non-scalar measurements (and conditions).
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/data/test_publish_measurement.py | Updates an assertion to match the new unsupported-iterable error message format. |
| tests/unit/data/test_grpc_conversion.py | Adds unit tests covering batch conversion for multiple non-scalar types and error cases. |
| tests/acceptance/test_publish_measurement_batch_and_read_data.py | Adds acceptance tests for batch publishing/read-back of non-scalar values (e.g., AnalogWaveform, per-iteration Vector). |
| src/ni/datastore/data/_grpc_conversion.py | Implements iterable-of-non-scalar handling for publish_measurement_batch request construction. |
| pyproject.toml | Bumps ni-measurements-data-v1-client minimum prerelease version to pick up new API support. |
| poetry.lock | Updates locked dependency versions consistent with the updated client/proto requirements. |
| examples/notebooks/publish/publish_batch.ipynb | New notebook documenting and exercising scalar + non-scalar batch publishing flows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
papowerNI
reviewed
May 20, 2026
There was a problem hiding this comment.
Note: It looks like the documentation on publish_measurement_batch might be out of date, it seems to still refer to only scalars and always has a single measurement id on output.
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?
This set of changes updates the MDS Python API to support the batch publishing of non-scalar measurement values (e.g.,
AnalogWaveform). This is in addition to the pre-existing support for batch publishing scalar measurement values.This reflects the addition of this support to the service API itself in ni/ni-apis#161.
Implementation
_grpc_conversion.pyto handle anIterableof the various supported non-scalar data types being supplied as thevaluesobject being passed intopublish_measurement_batch.Iterableis consistent with our existing support of anIterableoffloat,int,str, andboolbeing supplied for batch publishing scalar values.Why should this Pull Request be merged?
This PR should be submitted to maintain feature support/consistency between the MDS Python API and the
DataStoreServiceitself.What testing has been done?
PublishMeasurementBatchRequestappropriately from batched, non-scalar values supplied topublish_measurement_batchIterables and unsupported types being suppliedpublish_measurement_batch(in addition topublish_condition_batch).