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

LIU-368: Add CategoryType support to Palettes #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

myxie
Copy link
Contributor

@myxie myxie commented May 20, 2024

Summary 📝

Write an overview about it.

Details

Describe more what you did on changes.

  1. (...)
  2. (...)

Bugfixes 🐛 (delete if dind't have any)

Checks

  • Closed #798
  • Tested Changes
  • Stakeholder Approval

Copy link

@sourcery-ai sourcery-ai bot left a 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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
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":
Copy link

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.

Suggested change
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:
Copy link

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.

Suggested change
if value not in KNOWN_CATEGORY_TYPES:
if value.lower() not in (category.lower() for category in KNOWN_CATEGORY_TYPES):

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

Successfully merging this pull request may close these issues.

1 participant