-
Notifications
You must be signed in to change notification settings - Fork 1
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
LIU-368: Add CategoryType support to Palettes #5
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @myxie - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
@@ -370,6 +384,11 @@ def create_palette_node_from_params(params) -> tuple: | |||
text = value | |||
elif key == "description": | |||
comp_description = value | |||
elif key == "categorytype": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider normalizing key names
To avoid potential issues with inconsistent key names, consider normalizing the key names (e.g., converting them to lowercase) before comparison.
elif key == "categorytype": | |
elif key.lower() == "categorytype": |
@@ -370,6 +384,11 @@ | |||
text = value | |||
elif key == "description": | |||
comp_description = value | |||
elif key == "categorytype": | |||
if value not in KNOWN_CATEGORY_TYPES: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider case-insensitive comparison for category types
To make the category type comparison more robust, consider performing a case-insensitive comparison. This can be achieved by converting both value
and the elements in KNOWN_CATEGORY_TYPES
to lowercase before comparison.
if value not in KNOWN_CATEGORY_TYPES: | |
if value.lower() not in (category.lower() for category in KNOWN_CATEGORY_TYPES): |
Summary 📝
Write an overview about it.
Details
Describe more what you did on changes.
Bugfixes 🐛 (delete if dind't have any)
Checks