-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Helper API for per-request pipeline configuration #6378
Comments
We need a design review before updating the code. |
The basic ideas is to move the responsibility for calling
Each thing (pipeline, policy, etc) that needs to pop kwargs defines one of these subclasses for itself, then:
One question that needs a little thought is what to do about default values for names that are not in the passed-in kwargs. Is it OK to just always set to None? That's what the above does, but if more flexibility is needed, default values could also be specified on the subclass along with the names in a variety of ways. From here you could get more fancy to any degree you want:
E.g. Bokeh does all of the above but also already had a typed property system that could be leveraged to implement things. Since this is all for use internally inside functions, I'd suggest starting simple and then it could always be expanded upon later without disrupting anything. |
This is a good suggestion. But the problem is different transports/policies may vary a lot on how to consume the kwargs. e.g. in RequestIdPolicy, we may consume "request_id", "auto_request_id", "x-ms-client-request-id". We cannot give it a default value because we have different behaviors on it sets to None vs it is not set. Another example is CustomHookPolicy, we need to pop up "raw_response_hook" in on_request (because transport does not like it) and add it back in "on_response" (or we will lose the information) |
Just to clarify, I was not trying to suggest a single "options" class for all of
It's up to the policy to decide what to do with that information. An options class only needs to convey it. Off the top of my head, maybe:
Then, e.g.
That leaves the policy with knowledge that As I said before there are lots of possible approaches, e.g. if you want to lessen the burden on azure devs, you could interpret single values as having
Seems orthogonal. |
This needs to revisit policies/transports one by one. |
Hi @chlowell, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support. |
The pipeline API supports arbitrary per-run configuration of everything from policies to transport implementations via kwargs. This requires policies and transport abstractions to pop their expected configuration from kwargs before passing the collection to the next pipeline node. Failure to do so (e.g. by using
get
instead ofpop
) has been the root cause of several bugs.A suggestion for preventing this in the future comes from this comment:
The text was updated successfully, but these errors were encountered: