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

Fix the FlowsClient.get_run() include_flow_description parameter #778

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

kurtmckee
Copy link
Member

@kurtmckee kurtmckee commented Jul 6, 2023

Fixed

  • Adjust the FlowsClient.get_run() include_flow_description parameter
    so it is sent as a lowercase string (true or false).

📚 Documentation preview 📚: https://globus-sdk-python--778.org.readthedocs.build/en/778/

Copy link
Member

@sirosen sirosen left a 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 bools 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?

Comment on lines 590 to 598
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,
)
Copy link
Member

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 😉 )

Copy link
Member Author

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.

Copy link
Contributor

@derek-globus derek-globus left a comment

Choose a reason for hiding this comment

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

Yikes

Copy link
Member

@sirosen sirosen left a 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. 😄

@kurtmckee kurtmckee merged commit 9f10a63 into main Jul 6, 2023
25 checks passed
@kurtmckee kurtmckee deleted the fix-include_flow_description-parameter-sc-25534 branch July 6, 2023 17:59
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.

3 participants