Set the mask of annotations that will be returned by the SELECT.
(self, names)
| 2547 | self.deferred_loading = frozenset(field_names), False |
| 2548 | |
| 2549 | def set_annotation_mask(self, names): |
| 2550 | """Set the mask of annotations that will be returned by the SELECT.""" |
| 2551 | if names is None: |
| 2552 | self.annotation_select_mask = None |
| 2553 | else: |
| 2554 | self.annotation_select_mask = set(names) |
| 2555 | if self.selected: |
| 2556 | # Prune the masked annotations. |
| 2557 | self.selected = { |
| 2558 | key: value |
| 2559 | for key, value in self.selected.items() |
| 2560 | if not isinstance(value, str) |
| 2561 | or value in self.annotation_select_mask |
| 2562 | } |
| 2563 | # Append the unmasked annotations. |
| 2564 | for name in names: |
| 2565 | self.selected[name] = name |
| 2566 | self._annotation_select_cache = None |
| 2567 | |
| 2568 | def append_annotation_mask(self, names): |
| 2569 | if self.annotation_select_mask is not None: |
no test coverage detected