Skip to content

Replace read_data with read_measurement_value and read_condition_value.#120

Merged
mjohanse-emr merged 12 commits intomainfrom
users/mjohanse/use_new_reads
Mar 13, 2026
Merged

Replace read_data with read_measurement_value and read_condition_value.#120
mjohanse-emr merged 12 commits intomainfrom
users/mjohanse/use_new_reads

Conversation

@mjohanse-emr
Copy link
Collaborator

@mjohanse-emr mjohanse-emr commented Mar 11, 2026

What does this Pull Request accomplish?

Replaces the read_data method in the datastore-python package with these new read entrypoints:

  • read_measurement_value
  • read_condition_value

These read methods no longer uses the Moniker and MonikerClient to perform the read. It simply calls the lower level read_measurement_value or read_condition_value with the id from the PublishedMeasurement or PublishedCondition.

Tests and examples have been updated to use these new read methods.

All usage, documentation, and testing of Moniker and MonikerClient has been scrubbed from this python package.

I bumped the version to 2.0.0 since there are breaking changes to the read methods in this PR.

Why should this Pull Request be merged?

AB#3712177

We want datastore-python to use the new id based read entrypoints.
We want datastore-python to have similarly named read methods to the C# API.

What testing has been done?

All acceptance and unit tests pass.

…alue

Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Copilot AI review requested due to automatic review settings March 11, 2026 22:10
@mjohanse-emr mjohanse-emr requested review from hunter-ni and removed request for Copilot March 11, 2026 22:11
@mjohanse-emr mjohanse-emr marked this pull request as draft March 12, 2026 17:39
@mjohanse-emr
Copy link
Collaborator Author

I'm going to close this PR temporarily. Johann and I discussed an alternative that I'm going to try out, so I don't want y'all to waste time reviewing this in the current state.

Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@mjohanse-emr mjohanse-emr reopened this Mar 12, 2026
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@mjohanse-emr mjohanse-emr changed the title Update read_data to call into read_measurement_value and read_condition_value. Replace read_data with read_measurement_value and read_condition_value. Mar 13, 2026
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@mjohanse-emr mjohanse-emr marked this pull request as ready for review March 13, 2026 14:50
Copilot AI review requested due to automatic review settings March 13, 2026 14:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates ni.datastore’s read APIs to use ID-based gRPC read entrypoints (read_measurement_value / read_condition_value) and removes the Moniker/MonikerClient path, aligning the Python API with the newer service surface (and C# naming) while bumping the package to 2.0.0.

Changes:

  • Replace read_data with read_measurement_value and read_condition_value, removing Moniker-based reads and related types.
  • Update unit/acceptance tests, examples, notebooks, and docs to use the new read entrypoints.
  • Update dependencies/lockfiles (drop moniker client, require newer measurements-data client) and bump version to 2.0.0.dev0.

Reviewed changes

Copilot reviewed 26 out of 29 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/unit/data/test_read.py Updates read unit tests to call new ID-based read APIs and adds new behavior/error tests.
tests/unit/data/test_moniker.py Removes Moniker wrapper tests (Moniker no longer supported).
tests/unit/data/test_grpc_conversion.py Removes Any/unpack conversion tests that were tied to moniker/Any-based reads.
tests/unit/data/test_close_client.py Removes moniker-client close assertions; keeps data-store client close behavior.
tests/unit/conftest.py Removes mocked MonikerClient fixture and related patching.
tests/acceptance/test_query_measurements.py Updates acceptance reads to read_measurement_value.
tests/acceptance/test_query_conditions.py Updates acceptance reads to read_condition_value.
tests/acceptance/test_publish_with_metadata.py Updates measurement read to read_measurement_value.
tests/acceptance/test_publish_measurement_batch_and_read_data.py Renames tests and switches to read_measurement_value.
tests/acceptance/test_publish_measurement_and_read_data.py Renames tests and switches to read_measurement_value.
tests/acceptance/test_publish_condition_batch_and_read_data.py Renames tests and switches to read_condition_value.
tests/acceptance/test_publish_condition_and_read_data.py Renames tests and switches to read_condition_value.
src/ni/datastore/data/_types/_published_measurement.py Removes Moniker field from PublishedMeasurement wrapper and adjusts proto conversion/equality.
src/ni/datastore/data/_types/_published_condition.py Removes Moniker field from PublishedCondition wrapper and adjusts proto conversion/equality.
src/ni/datastore/data/_types/_moniker.py Deletes Moniker wrapper type.
src/ni/datastore/data/_grpc_conversion.py Replaces Any unpacking with response-oneof based read conversion helpers.
src/ni/datastore/data/_data_store_client.py Introduces read_measurement_value / read_condition_value and removes MonikerClient plumbing.
src/ni/datastore/data/init.py Stops exporting Moniker from public package surface.
pyproject.toml Bumps version to 2.0.0.dev0; removes moniker client dependency; bumps measurements-data client constraint.
poetry.lock Reflects dependency removals/updates.
examples/system/pyproject.toml Enables local path dev dependency for ni-datastore.
examples/system/poetry.lock Lockfile updates reflecting example dependency changes.
examples/overview/src/overview.py Updates example code to use read_measurement_value.
examples/overview/pyproject.toml Enables local path dev dependency for ni-datastore.
examples/overview/poetry.lock Lockfile updates reflecting example dependency changes.
examples/notebooks/voltage-regulator/publish_waveforms.ipynb Updates notebook reads to new APIs.
examples/notebooks/overview/publish_measurement.ipynb Updates notebook read call and also updates kernel metadata.
examples/notebooks/extension-attributes/extension_attributes.ipynb Updates notebook read call to read_measurement_value.
docs/reference/ni-data-store.md Removes moniker fields from reference docs for published entities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@mjohanse-emr mjohanse-emr merged commit ec74bcc into main Mar 13, 2026
29 checks passed
@mjohanse-emr mjohanse-emr deleted the users/mjohanse/use_new_reads branch March 13, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants