[FIX] Variable: Fix Variable.copy for StringVariable and TimeVariable#1589
Merged
lanzagar merged 1 commit intobiolab:masterfrom Sep 23, 2016
Merged
[FIX] Variable: Fix Variable.copy for StringVariable and TimeVariable#1589lanzagar merged 1 commit intobiolab:masterfrom
lanzagar merged 1 commit intobiolab:masterfrom
Conversation
Current coverage is 88.66% (diff: 100%)@@ master #1589 diff @@
==========================================
Files 78 78
Lines 8121 8126 +5
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 7200 7205 +5
Misses 921 921
Partials 0 0
|
kernc
reviewed
Sep 23, 2016
Orange/widgets/gui.py
Outdated
| (vartype(TimeVariable()), | ||
| "T", (68, 170, 255)), | ||
| (vartype(Variable), | ||
| "?", (128, 128, 128)), |
Contributor
There was a problem hiding this comment.
But isn't Variable just a base class? Won't this open the door for certain errors to pass silently?
Contributor
Author
There was a problem hiding this comment.
Yes it would. I removed it.
9bbbca0 to
6aaf362
Compare
astaric
reviewed
Sep 23, 2016
Orange/data/variable.py
Outdated
|
|
||
| def copy(self, compute_value=None): | ||
| copy = super().copy(compute_value=compute_value) | ||
| copy.have_data = self.have_date |
Contributor
Author
There was a problem hiding this comment.
Thanks. Fixed.
Due to static constructors in Variable.copy and ContinuousVariable.copy the StringVariable.copy and TimeVariable.copy used to return Variable and ContinuousVariable instances respectively. Fix this by dispatching on `type(self)`.
6aaf362 to
a5c2d26
Compare
astaric
approved these changes
Sep 23, 2016
lanzagar
approved these changes
Sep 23, 2016
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.
Due to static constructors in Variable.copy and ContinuousVariable.copy
the StringVariable.copy and TimeVariable.copy used to return Variable
and ContinuousVariable instances respectively.
Fix this by dispatching on
type(self).Also add the missing entry for
vartype(Variable)ingui.attributeIconDict