Fix emoji_keywords not being generated in SQLite export#684
Open
LJSigersmith wants to merge 1 commit intoscribe-org:mainfrom
Open
Fix emoji_keywords not being generated in SQLite export#684LJSigersmith wants to merge 1 commit intoscribe-org:mainfrom
LJSigersmith wants to merge 1 commit intoscribe-org:mainfrom
Conversation
Excludes emoji_keywords from the standard data type branch, which expected dict values but emoji_keywords JSON contains lists. Also caps the emoji loop with min() to avoid IndexError when a word has fewer than 3 emojis. Fixes scribe-org#683
Contributor
Thank you for the pull request! 💙🩵The Scribe-Data team will do our best to address your contribution as soon as we can. The following are some important points:
Note Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible. |
Contributor
Maintainer ChecklistThe following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) |
Contributor
There was a problem hiding this comment.
First PR Commit Check
- The commit messages for the remote branch of a new contributor should be checked to make sure their email is set up correctly so that they receive credit for their contribution
- The contributor's name and icon in remote commits should be the same as what appears in the PR
- If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for
git config user.emailin their local Scribe-Data repo (can be set withgit config --global user.email "GITHUB_EMAIL")
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.
Excludes emoji_keywords from the standard data type branch, which expected dict values but emoji_keywords JSON contains lists. Also caps the emoji loop with min() to avoid IndexError when a word has fewer than 3 emojis.
Fixes #683
Contributor checklist
pytestcommand as directed in the testing section of the contributing guideDescription
This fixes a bug where
emoji_keywordsdata was not being written to SQLite databases during the convert process.Root cause:
emoji_keywordswas falling into the standard data type processing branch indata_to_sqlite.py, which calls.keys()on each JSON entry assuming it's a dict, like nouns/verbs:However,
emoji_keywordsJSON values are lists of dicts:causing an
AttributeErrorbefore any table was created.Changes in
src/scribe_data/load/data_to_sqlite.py:emoji_keywordsfrom the standard branch so it correctly falls through to its ownelifhandlerelifbranch to usemin(len(json_data[row]), len(cols) - 1)— previouslyrange(len(json_data[row]))would raise anIndexErrorfor any word with fewer than 3 emojisTesting: Ran the full test suite (
pytest) and confirmed all 378 tests pass. Manually verified thatemoji_keywordstables are now generated in the SQLite output.Related issue
Closes #683