Skip to content

Commit 8d38006

Browse files
authored
Fixed _s2_get_with_retrying multiple values issue (#1018)
1 parent d8c075e commit 8d38006

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

paperqa/clients/semantic_scholar.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ def make_url_params( # noqa: PLR0911
122122
async def _s2_get_with_retrying(url: str, **get_kwargs) -> dict[str, Any]:
123123
return await _get_with_retrying(
124124
url=url,
125-
headers=get_kwargs.get("headers") or semantic_scholar_headers(),
125+
headers=get_kwargs.pop("headers", {}) or semantic_scholar_headers(),
126126
timeout=(
127-
get_kwargs.get("timeout")
128-
or aiohttp.ClientTimeout(SEMANTIC_SCHOLAR_API_REQUEST_TIMEOUT)
127+
get_kwargs.pop(
128+
"timeout", aiohttp.ClientTimeout(SEMANTIC_SCHOLAR_API_REQUEST_TIMEOUT)
129+
)
129130
),
130131
# On 7/21/2025, flaky ClientResponseError was seen with 'citations' traversals on
131132
# paper ID 3516396ffa1fd32d4327e199d9b97ec67dc0439a with DOI 10.1126/science.2821624

0 commit comments

Comments
 (0)