Skip to content

Python: Add Script commands#2208

Merged
tjzhang-BQ merged 11 commits intovalkey-io:mainfrom
Bit-Quill:python/VALKEY-187-script-flush
Sep 9, 2024
Merged

Python: Add Script commands#2208
tjzhang-BQ merged 11 commits intovalkey-io:mainfrom
Bit-Quill:python/VALKEY-187-script-flush

Conversation

@tjzhang-BQ
Copy link
Copy Markdown
Contributor

@tjzhang-BQ tjzhang-BQ commented Aug 28, 2024

Inheriting the changes from PR: #2094 & addressing existing comments

putting transactions out of scope for this PR since script_invocation and script_invocation_pointers seem to be parallel with transactions and more investigation might be needed for the implementation of invoke_script.

@tjzhang-BQ tjzhang-BQ added the python 🐍 Python wrapper label Aug 28, 2024
@tjzhang-BQ tjzhang-BQ force-pushed the python/VALKEY-187-script-flush branch 2 times, most recently from 78ef000 to a735a8d Compare September 3, 2024 23:48
@tjzhang-BQ tjzhang-BQ marked this pull request as ready for review September 4, 2024 00:37
@tjzhang-BQ tjzhang-BQ requested a review from a team as a code owner September 4, 2024 00:37
@tjzhang-BQ tjzhang-BQ force-pushed the python/VALKEY-187-script-flush branch from 65c6cb5 to 0147334 Compare September 4, 2024 00:40
@tjzhang-BQ tjzhang-BQ force-pushed the python/VALKEY-187-script-flush branch 3 times, most recently from b2b699b to 2cd39fe Compare September 5, 2024 00:58
Copy link
Copy Markdown

@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.

Transaction?

case the client will route the command to the nodes defined by `route`. Defaults to None.

Returns:
List[bool]: A list of boolean values indicating the existence of each script.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
List[bool]: A list of boolean values indicating the existence of each script.
TClusterResponse[List[bool]]: A list of boolean values indicating the existence of each script.
When specifying a route other than a single node, response will be:
{Address (bytes) : response (List[bool]) , ... } with type of Dict[bytes, List[bool]].

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

are we sure this is the response type? when you specify all nodes ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe if we specify to all nodes, the results across different nodes are just aggregated using a logical AND, according to cluster_routing.rs in redis.rs, and still returns a list of booleans.

@tjzhang-BQ tjzhang-BQ force-pushed the python/VALKEY-187-script-flush branch from 3b25b91 to 1a21f57 Compare September 6, 2024 01:09
@tjzhang-BQ tjzhang-BQ force-pushed the python/VALKEY-187-script-flush branch from d2efeb2 to 97e537c Compare September 6, 2024 20:58
Copy link
Copy Markdown
Contributor

@jonathanl-bq jonathanl-bq left a comment

Choose a reason for hiding this comment

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

Spotted some small documentation mistakes. Please fix those first.

Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
@tjzhang-BQ tjzhang-BQ force-pushed the python/VALKEY-187-script-flush branch from 522e4fd to 30969fc Compare September 9, 2024 18:27
Signed-off-by: TJ Zhang <tj.zhang@improving.com>
@tjzhang-BQ tjzhang-BQ merged commit 986b8c9 into valkey-io:main Sep 9, 2024
@tjzhang-BQ tjzhang-BQ deleted the python/VALKEY-187-script-flush branch September 9, 2024 20:01
janhavigupta007 pushed a commit to janhavigupta007/glide-for-redis that referenced this pull request Sep 11, 2024
* Python: Add Script commands

Signed-off-by: TJ Zhang <tj.zhang@improving.com>
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.

5 participants