Skip to content
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: add JSON.TYPE command #2409

Merged
merged 9 commits into from
Oct 9, 2024
Merged

Python: add JSON.TYPE command #2409

merged 9 commits into from
Oct 9, 2024

Conversation

Muhammad-awawdi-amazon
Copy link
Collaborator

No description provided.

Signed-off-by: Muhammad Awawdi <[email protected]>
Signed-off-by: Muhammad Awawdi <[email protected]>
Signed-off-by: Muhammad Awawdi <[email protected]>
Signed-off-by: Muhammad Awawdi <[email protected]>
result = await json.type(glide_client, key, "$.key6")
assert result == [b"bool"]

# Check for non-existent path $.key7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a similar test for legacy path which will return None

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a test for legacy + multiple path match

127.0.0.1:6379> json.set k1 . '{"a": 1, "nested": {"a": 2, "b": 3}}'
OK
127.0.0.1:6379> json.type k1 ..a
integer


# Check for invalid path format
result = await json.type(glide_client, key, "$.key1.key2") # Invalid path
assert result == []
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a test for non existing key with 2 types of path

Co-authored-by: Shoham Elias <[email protected]>
Signed-off-by: Muhammad-awawdi-amazon <[email protected]>
Co-authored-by: Shoham Elias <[email protected]>
Signed-off-by: Muhammad-awawdi-amazon <[email protected]>
Signed-off-by: Muhammad Awawdi <[email protected]>
@shohamazon shohamazon merged commit 667d93a into main Oct 9, 2024
18 checks passed
@shohamazon shohamazon deleted the python/json.type branch October 9, 2024 14:54
prateek-kumar-improving pushed a commit that referenced this pull request Oct 9, 2024
---------

Signed-off-by: Muhammad Awawdi <[email protected]>
Signed-off-by: Muhammad-awawdi-amazon <[email protected]>
Co-authored-by: Shoham Elias <[email protected]>
@shohamazon shohamazon mentioned this pull request Oct 28, 2024
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants