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

(Some) API calling functions don't properly parse Python boolean values as parameters #508

Open
BryanBaird opened this issue Jan 23, 2025 · 0 comments

Comments

@BryanBaird
Copy link

BryanBaird commented Jan 23, 2025

Current behavior

When calling a list() function or similar, the API often accepts a boolean parameter for filtering results. For example, the \REPORTS\ GET endpoint allows a boolean filter for archived status.

When the results are returned with the Python client, these fields are properly cast as Python boolean values. But when trying to pass in the parameter to the query, the client requires the value to be passed as a string instead.

Example

This fails:

import civis
client = civis.APIClient()
client.reports.list(limit=10, archived = False)

CivisAPIError: (400) Invalid archived status 'False'.

But this succeeds:

import civis
client = civis.APIClient()
client.reports.list(limit=10, archived = "false")

Expected behavior

Use the native data type(s) for the language, and parse those into whatever structure is needed for the url path on the API call.

Image

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

No branches or pull requests

1 participant