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 - Implement JSON.MGET command #2507

Merged
merged 13 commits into from
Nov 14, 2024
Merged

Python - Implement JSON.MGET command #2507

merged 13 commits into from
Nov 14, 2024

Conversation

BoazBD
Copy link
Collaborator

@BoazBD BoazBD commented Oct 23, 2024

This Pull Request is linked to issue (URL): $645

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Destination branch is correct - main or release
  • Commits will be squashed upon merging.

@BoazBD BoazBD changed the base branch from main to release-1.2 October 23, 2024 07:15
@BoazBD BoazBD marked this pull request as ready for review October 23, 2024 09:41
@BoazBD BoazBD requested a review from a team as a code owner October 23, 2024 09:41
@BoazBD BoazBD requested a review from shohamazon October 23, 2024 09:41
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

You need to update glide core to send this command to multiple nodes if multiple keys given and then aggregate the response (same as for mget command).
Please do that or wait for my implementation of json.mget for java with that change (coming soon)

Co-authored-by: Shoham Elias <116083498+shohamazon@users.noreply.github.com>
Signed-off-by: BoazBD <50696333+BoazBD@users.noreply.github.com>
Signed-off-by: BoazBD <boazbd@amazon.com>
Signed-off-by: BoazBD <boazbd@amazon.com>
glide_client,
[key1, key2],
)
assert result == [None]
Copy link
Collaborator

Choose a reason for hiding this comment

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

path (Optional[TEncodable]): The path within the JSON documents. Default is root `$`.

If path really defaults to root, wouldn't the expected result of this test be the same as the one with $ as path, on linie 191?

If this test is indeed passing, maybe it is the doc that need to be fixed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

After investigation, this is straight up wrong. path should be required, not optional. Please see comment on parameter path of the mget function for detail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

youre right, lets stick with Defaults to None.

Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

Please update tests too

python/python/glide/async_commands/server_modules/json.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/server_modules/json.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/server_modules/json.py Outdated Show resolved Hide resolved
glide_client,
[key1, key2],
)
assert result == [None]
Copy link
Collaborator

Choose a reason for hiding this comment

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

After investigation, this is straight up wrong. path should be required, not optional. Please see comment on parameter path of the mget function for detail.

python/python/glide/async_commands/server_modules/json.py Outdated Show resolved Hide resolved
Signed-off-by: BoazBD <boazbd@amazon.com>
@BoazBD BoazBD merged commit 664cc8e into release-1.2 Nov 14, 2024
21 checks passed
@BoazBD BoazBD deleted the python/json.mget branch November 14, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants