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: adds JSON.ARRPOP command #2407

Open
wants to merge 1 commit into
base: release-1.2
Choose a base branch
from

Conversation

shohamazon
Copy link
Collaborator

No description provided.

@shohamazon shohamazon requested a review from a team as a code owner October 9, 2024 08:53
@shohamazon shohamazon changed the base branch from main to release-1.2 October 10, 2024 13:14
@shohamazon shohamazon mentioned this pull request Oct 10, 2024
22 tasks
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.

Add changelog please

key: TEncodable,
options: Optional[JsonArrPopOptions] = None,
) -> Optional[TJsonResponse[bytes]]:
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tell how command behaves if no options given and show such examples

assert await json.set(glide_client, key, "$", json_value) == OK

assert await json.arrpop(
glide_client, key, JsonArrPopOptions(path="$.a", index=1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Test without options

options: Optional[JsonArrPopOptions] = None,
) -> Optional[TJsonResponse[bytes]]:
"""
Pops the last element from the array located at the specified path within the JSON document stored at `key`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

remote "last"

self.path = path
self.index = index

def get_options(self) -> List[TEncodable]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

rename to toArgs or to_args to align with other option classes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants