-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: adds JSON.RESP command #2451
Conversation
5752e2a
to
d66d8ae
Compare
Some of my comments caused by improper understanding of how command works.
That what's GLIDE core should return:
and a GLIDE client should return a map/dict then. Example (expected): object = {"firstName":"John","lastName":"Smith","age":27,"address":{"street":"21 2nd Street","city":"New York","state":"NY","zipcode":"10021-3100"}}
await json.set(glide_client, key, ".", OuterJson.dumps(json_value))
response = await json.resp(glide_client, key, ".address")
assert response == object["address"] |
I dont understand why? we have |
As discussed with the team, no value conversion needed. |
Optional[Union[bytes, int, List[Optional[Union[bytes, int]]]]] | ||
]: | ||
""" | ||
Retrieve the JSON value at the specified `path` within the JSON document stored at `key`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please return \n
s from docs.
ohh missed that |
Optional[Union[bytes, int, List[Optional[Union[bytes, int]]]]] | ||
]: | ||
""" | ||
Retrieve the JSON value at the specified `path` within the JSON document stored at `key`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no external docs to refer to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, valkey doesnt have docs for the modules commands
we do have the aws docs tho https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/json-resp.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add, won't hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add it later with the rest of the commands, as no one has any external doc currently
async def test_json_resp(self, glide_client: TGlideClient): | ||
key = get_random_string(5) | ||
|
||
json_value = '{"obj":{"a":1, "b":2}, "arr":[1,2,3], "str": "foo", "bool": true, "int": 42, "float": 3.14, "nullVal": null}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we randomize it a bit?
Signed-off-by: Shoham Elias <[email protected]>
Signed-off-by: Shoham Elias <[email protected]>
Signed-off-by: Shoham Elias <[email protected]>
c1f20d1
to
b9a0bda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment. Looks good!!
Issue link
This Pull Request is linked to issue (URL): #645
Checklist
Before submitting the PR make sure the following are checked: