Errhandling non dict values#3463
Merged
antgonza merged 4 commits intoqiita-spots:devfrom Mar 7, 2025
Merged
Conversation
…_job with values "", which is not a dict and also not None
Member
|
Good catch! That hasn't occurred to me! Do you think fixing the inserts by replacing the '' with '{}' would be a better solution? |
Contributor
Author
|
I did so for my local DB and now have proper dicts as entries. This will raise the expected missing parameter errors, tough. IMHO it's not worth patching the test DB, but it might be good service to the user of the function to move the error management from a non-speaking python trace to a slightly more informative type of error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When in test mode, you populate the database with
""values forcommand_parametersof tableqiita.processing_jobhereqiita/qiita_db/support_files/patches/test_db_sql/92.sql
Lines 7 to 11 in fdad618
Thus, when logged in as
admin@foo.bar, qiita will raise AttributeErrors like:This problem might not occur in a production environment, but since the
loadfunction already handles wrong use of parameters, I thought it might complement the current mechanism to also raise a more speaking error in this situation.