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

Remove is_json Call #179

Closed
davidvonthenen opened this issue Nov 14, 2023 · 1 comment
Closed

Remove is_json Call #179

davidvonthenen opened this issue Nov 14, 2023 · 1 comment
Assignees

Comments

@davidvonthenen
Copy link
Contributor

What is the current behavior?

Reported by @jjmaldonis:
I think the is_json method in helpers.py should be removed and the calling-code should be updated to use try/except. When is_json returns True, the json data gets deserialized twice: once by is_json and a 2nd time by the calling code. JSON deserialization is quite slow, so only running it once should make a noticeable difference (although I guess the HTTP requests will probably always by 100x slower, so ... maybe ignore ... but it's likely to be a criticism of anyone reading the code).

Steps to reproduce

NA

Expected behavior

NA

Please tell us about your environment

NA

Other information

NA

@davidvonthenen davidvonthenen added this to the Python SDK v3 Release milestone Nov 14, 2023
@davidvonthenen davidvonthenen self-assigned this Nov 14, 2023
@davidvonthenen
Copy link
Contributor Author

This PR should address this issue. We handle the JSON exception inline with the other ones.
#182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants