Skip to content

Commit 6836467

Browse files
authored
Merge pull request #61 from knqyf263/fix/annotation_bug
Fix bug: rename annotation_mask
2 parents e1db352 + 8c408da commit 6836467

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

psqlextra/query.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ def rename_annotations(self, annotations) -> None:
4040
' is no annotation named "{old_name}".'
4141
).format(old_name=old_name, new_name=new_name))
4242

43-
del self.annotations[old_name]
44-
self.annotations[new_name] = annotation
43+
self._annotations = OrderedDict(
44+
[(new_name, v) if k == old_name else (k, v) for k, v in self._annotations.items()])
45+
self.set_annotation_mask(
46+
(new_name if v == old_name else v for v in self.annotation_select_mask))
4547

4648
def add_join_conditions(self, conditions: Dict[str, Any]) -> None:
4749
"""Adds an extra condition to an existing JOIN.

0 commit comments

Comments
 (0)