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

feat(framework) Introduce new client_fn signature passing the Context #3779

Merged
merged 14 commits into from
Jul 13, 2024

Conversation

jafermarq
Copy link
Contributor

@jafermarq jafermarq commented Jul 11, 2024

Update, again, the client_fn signature. Adjust the functions to support the previous signature (i.e. client_fn(cid: str)).

Merge at some point after #3780


if not all(key in client_fn_args for key in ["node_id", "partition_id"]):
if len(client_fn_args) != 1 or client_fn_args[first_arg].annotation is not Context:
Copy link
Member

Choose a reason for hiding this comment

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

The first arg might not have a Context annotation - we want users to allow def client_fn(context):, right?

Maybe we should just check the name: if the name is cid, or if it has a type annotation str, we use compat mode. Otherwise we assume Context.

Copy link
Member

Choose a reason for hiding this comment

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

What should in the case where we have a type annotation, but it's neither str or Context?

@jafermarq jafermarq marked this pull request as ready for review July 12, 2024 18:05
@danieljanes danieljanes merged commit 64dd325 into main Jul 13, 2024
28 checks passed
@danieljanes danieljanes deleted the update-client-fn-again branch July 13, 2024 06:39
chongshenng pushed a commit that referenced this pull request Jul 16, 2024
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.

2 participants