driplineorg / driplineorg/dripline-python
Inconsistent response behavior with a 'values' array
- Dominant language
- Python
- Stars
- 3
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
Services and endpoints send responses differently depending on the request.
https://github.com/driplineorg/dripline-python/blob/2ff8c54e3464670c95dc9e044430a039042ca524/dripline/core/request_handler.py#L32
Calling `get` with a specifier, e.g. `dl-agent get -s ` returns the value in a dictionary with the `"values"` key pointing to the value.
Calling `get` without a specifier, e.g. `dl-agent get ` returns just the value (this could be a dictionary, string, float, etc).
Calling `set` with a specifier returns a value based on the return value of the implemented `on_set`.
Calling `set` without a specifier returns a None value.
Callng `cmd` (always requires a specifier) returns the value based on the return value of the function called in the implementation.
Out of all of these, only calling `get` with a specifier puts the return value into a 'values' array. This inconsistency in behavior does not serve a discernible purpose at the moment, and consistent behavior should be established by no longer putting values in a 'values' array.
Applying a calibration function and getting a dictionary of the form {"value_raw": , "value_cal": } would be unaffected.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.