Skip to content

Commit 1c61574

Browse files
author
Richard Kuo (Onyx)
committed
reformatted again
1 parent 6968f0b commit 1c61574

File tree

28 files changed

+112
-123
lines changed

28 files changed

+112
-123
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 23.3.0
3+
rev: 25.1.0
44
hooks:
55
- id: black
66
language_version: python3.11
77

88
- repo: https://github.com/asottile/reorder_python_imports
9-
rev: v3.9.0
9+
rev: v3.14.0
1010
hooks:
1111
- id: reorder-python-imports
1212
args: ['--py311-plus', '--application-directories=backend/']
@@ -18,14 +18,14 @@ repos:
1818
# These settings will remove unused imports with side effects
1919
# Note: The repo currently does not and should not have imports with side effects
2020
- repo: https://github.com/PyCQA/autoflake
21-
rev: v2.2.0
21+
rev: v2.3.1
2222
hooks:
2323
- id: autoflake
2424
args: [ '--remove-all-unused-imports', '--remove-unused-variables', '--in-place' , '--recursive']
2525

2626
- repo: https://github.com/astral-sh/ruff-pre-commit
2727
# Ruff version.
28-
rev: v0.0.286
28+
rev: v0.11.4
2929
hooks:
3030
- id: ruff
3131
- repo: https://github.com/pre-commit/mirrors-prettier

backend/ee/onyx/server/oauth/google_drive.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ def handle_google_drive_oauth_callback(
195195
credential_dict: dict[str, str] = {}
196196
credential_dict[DB_CREDENTIALS_DICT_TOKEN_KEY] = oauth_creds_sanitized_json_str
197197
credential_dict[DB_CREDENTIALS_PRIMARY_ADMIN_KEY] = session.email
198-
credential_dict[
199-
DB_CREDENTIALS_AUTHENTICATION_METHOD
200-
] = GoogleOAuthAuthenticationMethod.OAUTH_INTERACTIVE.value
198+
credential_dict[DB_CREDENTIALS_AUTHENTICATION_METHOD] = (
199+
GoogleOAuthAuthenticationMethod.OAUTH_INTERACTIVE.value
200+
)
201201

202202
credential_info = CredentialBase(
203203
credential_json=credential_dict,

backend/onyx/agents/agent_search/deep_search/main/nodes/generate_validate_refined_answer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ def generate_validate_refined_answer(
244244
revision_question_efficiency = (
245245
len(total_answered_questions) / len(initial_answered_sub_questions)
246246
if initial_answered_sub_questions
247-
else 10.0
248-
if refined_answered_sub_questions
249-
else 1.0
247+
else 10.0 if refined_answered_sub_questions else 1.0
250248
)
251249

252250
sub_question_answer_str = "\n\n------\n\n".join(

backend/onyx/agents/agent_search/deep_search/main/states.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ class SubQuestionResultsUpdate(LoggerUpdate):
112112
list[InferenceSection], dedup_inference_sections
113113
] = []
114114
context_documents: Annotated[list[InferenceSection], dedup_inference_sections] = []
115-
cited_documents: Annotated[
116-
list[InferenceSection], dedup_inference_sections
117-
] = [] # cited docs from sub-answers are used for answer context
115+
cited_documents: Annotated[list[InferenceSection], dedup_inference_sections] = (
116+
[]
117+
) # cited docs from sub-answers are used for answer context
118118
sub_question_results: Annotated[
119119
list[SubQuestionAnswerResults], dedup_question_answer_results
120120
] = []

backend/onyx/agents/agent_search/deep_search/shared/expanded_retrieval/states.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ class DocVerificationUpdate(LoggerUpdate, BaseModel):
4444

4545
class DocRetrievalUpdate(LoggerUpdate, BaseModel):
4646
query_retrieval_results: Annotated[list[QueryRetrievalResult], add] = []
47-
retrieved_documents: Annotated[
48-
list[InferenceSection], dedup_inference_sections
49-
] = []
47+
retrieved_documents: Annotated[list[InferenceSection], dedup_inference_sections] = (
48+
[]
49+
)
5050

5151

5252
class DocRerankingUpdate(LoggerUpdate, BaseModel):
@@ -64,9 +64,9 @@ class ExpandedRetrievalUpdate(LoggerUpdate, BaseModel):
6464
class ExpandedRetrievalOutput(LoggerUpdate, BaseModel):
6565
expanded_retrieval_result: QuestionRetrievalResult = QuestionRetrievalResult()
6666
base_expanded_retrieval_result: QuestionRetrievalResult = QuestionRetrievalResult()
67-
retrieved_documents: Annotated[
68-
list[InferenceSection], dedup_inference_sections
69-
] = []
67+
retrieved_documents: Annotated[list[InferenceSection], dedup_inference_sections] = (
68+
[]
69+
)
7070

7171

7272
## Graph State

backend/onyx/agents/agent_search/shared_graph_utils/operators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def dedup_question_answer_results(
2323
question_answer_results_1: list[SubQuestionAnswerResults],
2424
question_answer_results_2: list[SubQuestionAnswerResults],
2525
) -> list[SubQuestionAnswerResults]:
26-
deduped_question_answer_results: list[
27-
SubQuestionAnswerResults
28-
] = question_answer_results_1
26+
deduped_question_answer_results: list[SubQuestionAnswerResults] = (
27+
question_answer_results_1
28+
)
2929
utilized_question_ids: set[str] = set(
3030
[x.question_id for x in question_answer_results_1]
3131
)

backend/onyx/background/indexing/run_indexing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ def _run_indexing(
423423
unresolved_only=True,
424424
db_session=db_session_temp,
425425
)
426-
doc_id_to_unresolved_errors: dict[
427-
str, list[IndexAttemptError]
428-
] = defaultdict(list)
426+
doc_id_to_unresolved_errors: dict[str, list[IndexAttemptError]] = (
427+
defaultdict(list)
428+
)
429429
for error in unresolved_errors:
430430
if error.document_id:
431431
doc_id_to_unresolved_errors[error.document_id].append(error)

backend/onyx/chat/answer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ def citations(self) -> list[CitationInfo]:
212212
return citations
213213

214214
def citations_by_subquestion(self) -> dict[SubQuestionKey, list[CitationInfo]]:
215-
citations_by_subquestion: dict[
216-
SubQuestionKey, list[CitationInfo]
217-
] = defaultdict(list)
215+
citations_by_subquestion: dict[SubQuestionKey, list[CitationInfo]] = (
216+
defaultdict(list)
217+
)
218218
basic_subq_key = SubQuestionKey(level=BASIC_KEY[0], question_num=BASIC_KEY[1])
219219
for packet in self.processed_streamed_output:
220220
if isinstance(packet, CitationInfo):

backend/onyx/chat/process_message.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ def _translate_citations(
172172
citation_to_saved_doc_id_map: dict[int, int] = {}
173173
for citation in citations_list:
174174
if citation.citation_num not in citation_to_saved_doc_id_map:
175-
citation_to_saved_doc_id_map[
176-
citation.citation_num
177-
] = doc_id_to_saved_doc_id_map[citation.document_id]
175+
citation_to_saved_doc_id_map[citation.citation_num] = (
176+
doc_id_to_saved_doc_id_map[citation.document_id]
177+
)
178178

179179
return MessageSpecificCitations(citation_map=citation_to_saved_doc_id_map)
180180

backend/onyx/connectors/confluence/onyx_confluence.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,9 @@ def __getattr__(self, name: str) -> Any:
397397
return attr
398398

399399
# wrap the method with our retry handler
400-
rate_limited_method: Callable[
401-
..., Any
402-
] = self._make_rate_limited_confluence_method(name, self._credentials_provider)
400+
rate_limited_method: Callable[..., Any] = (
401+
self._make_rate_limited_confluence_method(name, self._credentials_provider)
402+
)
403403

404404
def wrapped_method(*args: Any, **kwargs: Any) -> Any:
405405
return rate_limited_method(*args, **kwargs)

0 commit comments

Comments
 (0)