-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix the FlowsClient.get_run()
include_flow_description
parameter
#778
Fix the FlowsClient.get_run()
include_flow_description
parameter
#778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good for what it is, but is fixing this client-side the correct approach?
I would prefer that we allow for the "normal python encoding" (requests
) of bool
s for any bool parameters in our APIs. I know that's conforming our services to a particular client, but a pretty important one for our usages.
If we fix the API, will we then revert this change in order to simplify the client?
consolidated_query_params = query_params or {} | ||
if include_flow_description is not None: | ||
value = str(include_flow_description).lower() # "true" or "false" | ||
consolidated_query_params["include_flow_description"] = value | ||
|
||
return self.get( | ||
f"/runs/{run_id}", | ||
query_params={ | ||
"include_flow_description": include_flow_description, | ||
**additional_query_params, | ||
}, | ||
query_params=consolidated_query_params, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason not to simply call it query_params
?
i.e.
if query_params is None:
query_params = {}
(or inline that if line count is the enemy 😉 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is fixing this client-side the correct approach
Yes, because requests
does not produce the documented values, and responses
won't match unless the capitalization is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes!
We'll evolve things to a place where we're both happy. 😄
Fixed
FlowsClient.get_run()
include_flow_description
parameterso it is sent as a lowercase string (
true
orfalse
).📚 Documentation preview 📚: https://globus-sdk-python--778.org.readthedocs.build/en/778/