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

Fixing crash when json.loads returns str #248

Merged
merged 1 commit into from
Mar 8, 2024
Merged

Conversation

jamesbraza
Copy link
Collaborator

@jamesbraza jamesbraza commented Mar 8, 2024

Check this:

import json

assert isinstance(json.loads('"M. Thompson et al. (2021) studied mRNA-based COVID-19 vaccines in adults 50 years and older, finding high effectiveness against SARS-CoV-2 infection leading to severe outcomes. They indicated the need for completing vaccination for mRNA vaccines and noted potential effectiveness of the Ad26.COV2.S vaccine. Despite increased concern about SARS-CoV-2 variants during the study, most observations relate to the dominant B.1.1.7 (alpha) variant regionally. However, potential biases exist in vaccine effectiveness estimates due to possible misclassifications. The report\'s findings emphasize the importance of widespread vaccination to tackle COVID-19. Morbi blandit, nunc id pharetra volutpat. 8."'), dict)

The issue is that json.loads can return a string, which causes a crash when the downstream code assumes the return of json.loads is a dict. This PR fixes the issue

@jamesbraza jamesbraza added the bug Something isn't working label Mar 8, 2024
@jamesbraza jamesbraza requested a review from whitead March 8, 2024 05:30
@jamesbraza jamesbraza self-assigned this Mar 8, 2024
@jamesbraza jamesbraza force-pushed the fixing-failed-process branch from 2cca774 to 925d0a2 Compare March 8, 2024 06:06
@whitead whitead merged commit 8b46829 into main Mar 8, 2024
1 check failed
@whitead whitead deleted the fixing-failed-process branch March 8, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants