@@ -154,7 +154,9 @@ def set_data(self, data):
154154 self .target_var = None
155155
156156 self .__attributes = self .__filter_attributes (domain .attributes , self .table .X )
157- self .__class_vars = self .__filter_attributes (domain .class_vars , self .table ._Y )
157+ # We disable pylint warning because the `Y` property squeezes vectors,
158+ # while we need a 2d array, which `_Y` provides
159+ self .__class_vars = self .__filter_attributes (domain .class_vars , self .table ._Y ) # pylint: disable=protected-access
158160 self .__metas = self .__filter_attributes (domain .metas , self .table .metas )
159161
160162 self .n_attributes = len (self .variables )
@@ -349,7 +351,7 @@ def sortColumnData(self, column):
349351 var_name_indices = np .argsort (self ._variable_names )
350352
351353 # Prepare vartype indices so ready when needed
352- disc_idx , cont_idx , time_idx , str_idx = self ._attr_indices (self .variables )
354+ disc_idx , _ , time_idx , str_idx = self ._attr_indices (self .variables )
353355
354356 # Sort by: (type)
355357 if column == self .Columns .ICON :
@@ -395,6 +397,8 @@ def sortColumnData(self, column):
395397 elif column == self .Columns .MISSING :
396398 return self ._missing
397399
400+ return None
401+
398402 def _sortColumnData (self , column ):
399403 """Allow sorting with 2d arrays."""
400404 data = np .asarray (self .sortColumnData (column ))
@@ -437,10 +441,16 @@ def headerData(self, section, orientation, role):
437441 if role == Qt .DisplayRole :
438442 return self .Columns .from_index (section ).name
439443
444+ return None
445+
440446 def data (self , index , role ):
441447 # type: (QModelIndex, Qt.ItemDataRole) -> Any
448+ # Text formatting for various data simply requires a lot of branches.
449+ # This is much better than overengineering various formatters...
450+ # pylint: disable=too-many-branches
451+
442452 if not index .isValid ():
443- return
453+ return None
444454
445455 row , column = self .mapToSourceRows (index .row ()), index .column ()
446456 # Make sure we're not out of range
@@ -660,6 +670,9 @@ def paint(self, painter, option, index):
660670
661671 scene .render (painter , target = QRectF (option .rect ), mode = Qt .IgnoreAspectRatio )
662672
673+ # pylint complains about inconsistent return statements
674+ return None
675+
663676
664677class OWFeatureStatistics (widget .OWWidget ):
665678 name = 'Feature Statistics'
@@ -812,7 +825,11 @@ def _format_variables_string(self, variables):
812825 ('time' , TimeVariable ),
813826 ('string' , StringVariable )
814827 ]:
815- var_type_list = [v for v in variables if type (v ) is var_type ]
828+ # Disable pylint here because a `TimeVariable` is also a
829+ # `ContinuousVariable`, and should be labelled as such. That is why
830+ # it is necessary to check the type this way instead of using
831+ # `isinstance`, which would fail in the above case
832+ var_type_list = [v for v in variables if type (v ) is var_type ] # pylint: disable=unidiomatic-typecheck
816833 if var_type_list :
817834 shown = var_type in self .model .HIDDEN_VAR_TYPES
818835 agg .append ((
0 commit comments