Skip to content

Conversation

@mjohanse-emr
Copy link
Collaborator

What does this Pull Request accomplish?

Uses sys.modules to redirect old imports from

ni_measurement_plugin_sdk_service._internal.stubs.ni.protobuf

to their new location in the ni.protobuf.types package.

Why should this Pull Request be merged?

Because these stubs were moved out of this package and into ni.protobuf.types, old code generated by the measurement SDK will still have the old import statements. This will allow the old code to work by importing the new code.

Example: This code runs successfully...

from ni_measurement_plugin_sdk_service._internal.stubs.ni.protobuf.types.array_pb2 import Double2DArray


my_array = Double2DArray(rows=2, columns=2, data=[1, 2, 3, 4])
print(f"my_array: {my_array}")

What testing has been done?

  • I tried this out by running the python script shown above successfully.
  • Unit tests, mypy, pyright, styleguide.

Michael Johansen added 2 commits August 20, 2025 13:23
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
@github-actions
Copy link
Contributor

Test Results

    52 files  ±0      52 suites  ±0   1h 19m 57s ⏱️ + 2m 8s
   713 tests ±0     713 ✅ ±0      0 💤 ±0  0 ❌ ±0 
21 564 runs  ±0  20 488 ✅ ±0  1 076 💤 ±0  0 ❌ ±0 

Results for commit 19e975f. ± Comparison against base commit 69f3620.

@mjohanse-emr mjohanse-emr marked this pull request as ready for review August 20, 2025 20:00
@mjohanse-emr mjohanse-emr merged commit 2e6e8c4 into main Aug 21, 2025
17 checks passed
@mjohanse-emr mjohanse-emr deleted the users/mjohanse/redirect branch August 21, 2025 14:20
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.

4 participants