Skip to content

Commit 6ff559a

Browse files
hagen-danswerRichard Kuo [bot]
authored andcommitted
fixed label filter (#2978)
* added old error handling to comment fetching * Not * properly escaped cql labels * reverted changes
1 parent 1201ed5 commit 6ff559a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

backend/danswer/connectors/confluence/connector.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,13 @@ def __init__(
9191
cql_page_query += f" and id='{page_id}'"
9292

9393
self.cql_page_query = cql_page_query
94-
self.cql_label_filter = ""
9594
self.cql_time_filter = ""
95+
96+
self.cql_label_filter = ""
9697
if labels_to_skip:
9798
labels_to_skip = list(set(labels_to_skip))
98-
comma_separated_labels = ",".join(labels_to_skip)
99-
self.cql_label_filter = f"&label not in ({comma_separated_labels})"
99+
comma_separated_labels = ",".join(f"'{label}'" for label in labels_to_skip)
100+
self.cql_label_filter = f" and label not in ({comma_separated_labels})"
100101

101102
def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:
102103
# see https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/rest_client.py
@@ -125,7 +126,8 @@ def _get_comment_string_for_page_id(self, page_id: str) -> str:
125126
for comment in comments:
126127
comment_string += "\nComment:\n"
127128
comment_string += extract_text_from_confluence_html(
128-
confluence_client=self.confluence_client, confluence_object=comment
129+
confluence_client=self.confluence_client,
130+
confluence_object=comment,
129131
)
130132

131133
return comment_string

0 commit comments

Comments
 (0)