You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PS D:\dev\measurementlink-python\examples\sample_measurement> poetry run python .\measurement.py -v
2023-09-01 17:48:26,593 INFO: Measurement service hosted on port: 52794
2023-09-01 17:48:27,123 INFO: Successfully registered with discovery service.
Press enter to close the measurement service.
2023-09-01 17:49:09,385 INFO: gRPC server call /ni.measurementlink.measurement.v2.MeasurementService/GetMetadata responded OK in 0.9639 ms
2023-09-01 17:50:07,890 INFO: gRPC server call /ni.measurementlink.measurement.v2.MeasurementService/Measure responded OK in 0.6051 ms
2023-09-01 17:50:07,890 ERROR: Exception iterating responses: 'int' object is not iterable
Traceback (most recent call last):
File "D:\dev\measurementlink-python\examples\sample_measurement\.venv\lib\site-packages\grpc\_server.py", line 589, in _take_response_from_response_iterator
return next(response_iterator), True
File "D:\dev\measurementlink-python\ni_measurementlink_service\_loggers.py", line 391, in __next__
response = next(self._inner_iterator)
File "D:\dev\measurementlink-python\ni_measurementlink_service\_internal\grpc_servicer.py", line 385, in Measure
mapping_by_id = serializer.deserialize_parameters(
File "D:\dev\measurementlink-python\ni_measurementlink_service\_internal\parameter\serializer.py", line 41, in deserialize_parameters
_deserialize_enum_parameters(parameter_metadata_dict, overlapping_parameter_by_id)
File "D:\dev\measurementlink-python\ni_measurementlink_service\_internal\parameter\serializer.py", line 231, in _deserialize_enum_parameters
parameter_by_id[id][index] = enum_type(member_value)
TypeError: 'int' object is not iterable
Workaround
Make the default value non-empty (e.g. [Color.BLUE]).
Possible Solution
I think we should save the passed-in enum_type and use it during deserialization, instead of using the type of the default value.
Inferring the enum type from the default value as described in #364 could still work, but not when the default value is an empty list.
Bug Report
Deserializing an enum array does not work when the configuration's
default_value
parameter is set to[]
(empty list).Repro or Code Sample
Steps:
Enum Array In
.Expected Behavior
The measurement logs this message:
Current Behavior
The measurement produces this error:
Workaround
Make the default value non-empty (e.g.
[Color.BLUE]
).Possible Solution
I think we should save the passed-in
enum_type
and use it during deserialization, instead of using the type of the default value.Inferring the enum type from the default value as described in #364 could still work, but not when the default value is an empty list.
Context
#364
Your Environment
ni-measurementlink-service
version: 1.1.0, 1.2 main branchAB#2509973
AB#2514631
The text was updated successfully, but these errors were encountered: