Replace read_data with read_measurement_value and read_condition_value.#120
Replace read_data with read_measurement_value and read_condition_value.#120mjohanse-emr merged 12 commits intomainfrom
Conversation
…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>
|
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>
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>
There was a problem hiding this comment.
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_datawithread_measurement_valueandread_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>
What does this Pull Request accomplish?
Replaces the
read_datamethod in thedatastore-pythonpackage with these new read entrypoints:read_measurement_valueread_condition_valueThese read methods no longer uses the
MonikerandMonikerClientto perform the read. It simply calls the lower levelread_measurement_valueorread_condition_valuewith theidfrom thePublishedMeasurementorPublishedCondition.Tests and examples have been updated to use these new read methods.
All usage, documentation, and testing of
MonikerandMonikerClienthas 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-pythonto use the newidbased read entrypoints.We want
datastore-pythonto have similarly named read methods to the C# API.What testing has been done?
All acceptance and unit tests pass.