Skip to content

Commit 3e8ab67

Browse files
committed
fix(perplexity): silence mypy union-attr after dropping None guards
After removing the redundant 'if self._client is None: raise RuntimeError' blocks, mypy can no longer narrow the type since warm_up()'s side effect is invisible to it. Add # type: ignore[union-attr] on the .post() calls in run / run_async (per sjrl review).
1 parent a89aac3 commit 3e8ab67

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

integrations/perplexity/src/haystack_integrations/components/websearch/perplexity/perplexity_websearch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def run(
128128
if self._client is None:
129129
self.warm_up()
130130

131-
response = self._client.post(
131+
response = self._client.post( # type: ignore[union-attr]
132132
PERPLEXITY_SEARCH_URL,
133133
headers=self._build_headers(),
134134
json=self._build_body(query, search_params),
@@ -156,7 +156,7 @@ async def run_async(
156156
if self._async_client is None:
157157
self.warm_up()
158158

159-
response = await self._async_client.post(
159+
response = await self._async_client.post( # type: ignore[union-attr]
160160
PERPLEXITY_SEARCH_URL,
161161
headers=self._build_headers(),
162162
json=self._build_body(query, search_params),

0 commit comments

Comments
 (0)