def _do_action(self): layers = self.selected_layers() try: default = layers[0].data except (AttributeError, TypeError, IndexError): default = None SubsetFacet.facet(self._layer_tree.data_collection, parent=self._layer_tree, default=default)