-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[FIX] Feature Constructor: no fail when no values #2417
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2417 +/- ##
=========================================
- Coverage 74.25% 73.9% -0.36%
=========================================
Files 320 320
Lines 55786 55799 +13
=========================================
- Hits 41425 41236 -189
- Misses 14361 14563 +202 |
@@ -244,7 +244,7 @@ def setEditorData(self, data, domain): | |||
def editorData(self): | |||
values = self.valuesedit.text() | |||
values = re.split(r"(?<!\\),", values) | |||
values = tuple(v.replace(r"\,", ",").strip() for v in values) | |||
values = tuple(filter(None, [v.replace(r"\,", ",").strip() for v in values])) |
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.
You can use generators instead of list comprehension, that is
values = tuple(filter(None, (v.replace(r",", ",").strip() for v in values)))
@@ -292,7 +292,7 @@ def data(self, index, role=Qt.DisplayRole): | |||
return super().data(index, role) | |||
|
|||
|
|||
class FeatureConstructorSettingsHandler(DomainContextHandler): | |||
class FeatureConstructorHandler(DomainContextHandler): |
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.
I preferred the original name. In fact, I'd call it FeatureConstructorContextHandler
and disable the pylint's warning. The current name suggest that it handles the feature constructor, not its contexts.
Issue
Error occurs when Values box is empty.
Description of changes
Includes