Skip to content

Commit 60fdac1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 77b1ec3 commit 60fdac1

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

sde_collections/sinequa_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,11 @@ def get_full_texts(self, collection_config_folder: str, source: str = None, coll
232232

233233
@staticmethod
234234
def _process_full_text_response(batch_data: dict):
235-
if 'Rows' not in batch_data or not isinstance(batch_data['Rows'], list):
235+
if "Rows" not in batch_data or not isinstance(batch_data["Rows"], list):
236236
raise ValueError("Expected 'Rows' key with a list of data.")
237237

238238
processed_data = []
239-
for row in batch_data['Rows']:
239+
for row in batch_data["Rows"]:
240240
# Ensure each row has exactly three elements (url, full_text, title)
241241
if len(row) != 3:
242242
raise ValueError("Each row must contain exactly three elements (url, full_text, title).")

sde_collections/tests/api_tests.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,15 @@ def test_sql_query_pagination(self, mock_process_response, api_instance, collect
171171

172172
def test_process_full_text_response(self, api_instance):
173173
"""Test that _process_full_text_response correctly processes the data."""
174-
batch_data = {"Rows": [
175-
["http://example.com", "Example text", "Example title"],
176-
["http://example.net", "Another text", "Another title"]
177-
]}
174+
batch_data = {
175+
"Rows": [
176+
["http://example.com", "Example text", "Example title"],
177+
["http://example.net", "Another text", "Another title"],
178+
]
179+
}
178180
expected_output = [
179181
{"url": "http://example.com", "full_text": "Example text", "title": "Example title"},
180-
{"url": "http://example.net", "full_text": "Another text", "title": "Another title"}
182+
{"url": "http://example.net", "full_text": "Another text", "title": "Another title"},
181183
]
182184
result = api_instance._process_full_text_response(batch_data)
183185
assert result == expected_output

0 commit comments

Comments
 (0)