NSLS-II / olog

Python client to the Olog
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

API: update put_property api #28

Closed ke-zhang-rd closed 4 years ago

ke-zhang-rd commented 4 years ago

Based on discussion in #26

danielballan commented 4 years ago

I might be misunderstanding the connection between this and #26, but I had in mind something that transforms:

{'name': 'A', 'attributes': [{'name': 'B', 'value: 'C'}, {'name': 'D', 'value': 'E'}]}

into:

{'name': 'A', 'attributes': {'B': 'C', 'D': 'E'}}
ke-zhang-rd commented 4 years ago

ValueError was raised by mismatching of owner value in argument and server's return(server always use current login user as owner). owner won't be in put_property api argument, removed its test

ke-zhang-rd commented 4 years ago

@danielballan Could you review this before I put new pattern to all other methods?

shroffk commented 4 years ago

Yes, Currently, the server treats all property attributes as strings...Most rest services do follow this pattern. It also simplifies the mapping in elastic.

If the concern is with sorting that can be added on the server side.

ke-zhang-rd commented 4 years ago

Thanks @shroffk @danielballan

I updated docstring and add some comments on code.

ke-zhang-rd commented 4 years ago

If no more comments, please merge!