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

Added Script API in python. #860

Merged
merged 2 commits into from
Feb 1, 2024
Merged

Conversation

adanWattad
Copy link
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@adanWattad adanWattad requested a review from a team as a code owner January 24, 2024 13:51
@adanWattad adanWattad changed the title eifjcbeclighiehcugntcjrvtcghctcifrthtlfchbevAdded Script API in python. Added Script API in python. Jan 24, 2024
@@ -228,6 +228,30 @@ async def execute_transaction(
await response_future
return response_future.result()

async def execute_script(
Copy link
Contributor

Choose a reason for hiding this comment

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

execute_script => _execute_script

to communicate a private function in python

Copy link
Contributor

Choose a reason for hiding this comment

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

please also fix execute_transaction => _execute_transaction

request.script_invocation.args[:] = args if args is not None else []
request.script_invocation.keys[:] = keys if keys is not None else []
set_protobuf_route(request, route)
# Create a response future for this request and add it to the available
Copy link
Contributor

Choose a reason for hiding this comment

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

since the lines from here to the end of the function are repeating both in execute_command and execute_pipeline, lets move it to a separate function:

    async def _write_request_await_response(self, request: RedisRequest):
        # Create a response future for this request and add it to the available
        # futures map
        response_future = self._get_future(request.callback_idx)
        self._create_write_task(request)
        await response_future
        return response_future.result()

Copy link
Contributor

@barshaul barshaul left a comment

Choose a reason for hiding this comment

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

Fix & merge

@adanWattad adanWattad merged commit 2ea5d6c into aws:main Feb 1, 2024
11 checks passed
@adanWattad adanWattad deleted the pythonScripts branch February 1, 2024 11:07
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.

None yet

3 participants