Repository navigation
Conversation
|
The dependency pins are temporary while the updated packages are being published. Once the packages are publicly available on PyPI, I’ll update The publish workflows for the pinned upstream commit are: |
There was a problem hiding this comment.
🟡 Changes recommended
Git-based dependencies block PyPI and TestPyPI uploads, while passing a bare string to batch_delete_aliases can delete unrelated alias registrations.
2 open issues
What changed in this PR
This PR aligns the high-level Python datastore client with upstream Metadata V1 deletion APIs and Data V2 pagination contracts.
Changes:
- Adds single-item and batch metadata deletion methods, tests, and documentation.
- Adds pagination tokens while retaining
next_linkas an alias, plus measurement keywords and output-only step child indicators. - Temporarily pins three upstream client/proto dependencies to a specific Git commit.
| File | Description |
|---|---|
tests/unit/metadata/test_delete_metadata.py |
Tests deletion request forwarding and force options. |
tests/unit/data/test_v2_types.py |
Tests keywords, child indicators, and field mappings. |
tests/unit/data/test_v2_data_store_client.py |
Tests pagination parameters, tokens, and read masks. |
src/ni/datastore/metadata/_metadata_store_client.py |
Adds single-item and batch deletion wrappers. |
src/ni/datastore/data/v2/_types/_step.py |
Adds output-only has_children support. |
src/ni/datastore/data/v2/_types/_read_fields.py |
Adds child-indicator and keyword read fields. |
src/ni/datastore/data/v2/_types/_query_results.py |
Adds continuation tokens with a legacy alias. |
src/ni/datastore/data/v2/_types/_measurement.py |
Adds measurement keyword storage and conversion. |
src/ni/datastore/data/v2/_types/_create.py |
Adds typed measurement keyword creation input. |
src/ni/datastore/data/v2/_data_store_client.py |
Forwards pagination parameters and returns tokens. |
pyproject.toml |
Pins upstream dependencies to a Git commit. |
poetry.lock |
Records updated dependency versions and Git sources. |
docs/reference/ni-metadata-store.md |
Documents deletion APIs and force behavior. |
docs/reference/ni-data-store-v2.md |
Documents pagination, keywords, and child indicators. |
Review effort: Balanced
| request = BatchDeleteAliasesRequest( | ||
| requests=[DeleteAliasRequest(alias_name=alias_name) for alias_name in alias_names] |
| | Schema | `delete_schema` | `batch_delete_schemas` | | ||
| | Alias | `delete_alias` | `batch_delete_aliases` | | ||
|
|
||
| Single-item methods accept the corresponding ID, or alias name. Batch methods accept an iterable |
There was a problem hiding this comment.
Please remove this comma.
| Single-item methods accept the corresponding ID, or alias name. Batch methods accept an iterable | |
| Single-item methods accept the corresponding ID or alias name. Batch methods accept an iterable |
|
|
||
| page_size: Maximum number of test results to return. Zero uses the service default. | ||
|
|
||
| page_token: Token from a previous response used to retrieve the next page. |
There was a problem hiding this comment.
I think it would be helpful to explain the behavior when page_token is a blank string (the default case).
There was a problem hiding this comment.
This applies to other Query methods in this file as well.
| CreateUutInstanceRequest, | ||
| CreateUutRequest, | ||
| DeleteAliasRequest, | ||
| BatchDeleteAliasesRequest, |
There was a problem hiding this comment.
You may have gotten a formatting error about this, but I would recommend keeping these imports in alphabetical order. These BatchDelete* lines should go above the Create* lines.
| delete_response = self._get_metadata_store_client().delete_alias(delete_request) | ||
| return delete_response.unregistered | ||
|
|
||
| def delete_uut_instance(self, uut_instance_id: str, *, force: bool = False) -> None: |
There was a problem hiding this comment.
The rest of the file groups methods together by metadata entity type. I would recommend putting delete_uut_instance and batch_delete_uut_instances directly after query_uut_instances. The same goes for the other entity types. This makes the diff more spread out, but it keeps things consistent with the current organization of the file.
There was a problem hiding this comment.
I agree with this, and it would match how the RPCs are grouped in the proto file.
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
Signed-off-by: Michael Johansen <michael.johansen@emerson.com>
@priya-ni I got all the ni-apis-python packages published and updated this PR to use those published packages. |
| delete_response = self._get_metadata_store_client().delete_alias(delete_request) | ||
| return delete_response.unregistered | ||
|
|
||
| def delete_uut_instance(self, uut_instance_id: str, *, force: bool = False) -> None: |
There was a problem hiding this comment.
I agree with this, and it would match how the RPCs are grouped in the proto file.
| assert step.has_children is True | ||
|
|
||
|
|
||
| def test___step___does_not_write_has_children_to_protobuf() -> None: |
There was a problem hiding this comment.
Similar to my comment in the low-level library, if has_children is sufficiently covered by the existing full request/response tests we don't need a dedicated test for it.

What does this Pull Request accomplish?
next_page_tokensupport while retainingnext_linkas a compatibility alias.72f6068c27af07ba8dcf3e2b2f71e4f6838ffe22.Why should this Pull Request be merged?
It brings the high-level client in line with the merged upstream deletion APIs and Data V2 pagination contract. The Git pins are temporary until the corresponding packages are published to PyPI; then they can be replaced with version constraints.
What testing has been done?
pytest tests/unit -q: 485 passedgit diff --checkpassed