Skip to content

Commit 7428cae

Browse files
fix: add type ignore for requests import and sync baseline
Add type: ignore[import-untyped] comment for the local requests import in _setup_sse_connection to suppress mypy warning about missing stubs. Update mypy-baseline.txt to reflect the 3 fixed violations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent f7e693a commit 7428cae

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

mypy-baseline.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ posthog/client.py:0: note: Hint: "python3 -m pip install types-six"
2323
posthog/client.py:0: error: Name "queue" already defined (by an import) [no-redef]
2424
posthog/client.py:0: error: Need type annotation for "queue" [var-annotated]
2525
posthog/client.py:0: error: Incompatible types in assignment (expression has type "Any | list[Any]", variable has type "None") [assignment]
26-
posthog/client.py:0: error: Incompatible types in assignment (expression has type "dict[Any, Any]", variable has type "None") [assignment]
2726
posthog/client.py:0: error: "None" has no attribute "__iter__" (not iterable) [attr-defined]
2827
posthog/client.py:0: error: Statement is unreachable [unreachable]
2928
posthog/client.py:0: error: Right operand of "and" is never evaluated [unreachable]
3029
posthog/client.py:0: error: Incompatible types in assignment (expression has type "Poller", variable has type "None") [assignment]
3130
posthog/client.py:0: error: "None" has no attribute "start" [attr-defined]
32-
posthog/client.py:0: error: Statement is unreachable [unreachable]
33-
posthog/client.py:0: error: Statement is unreachable [unreachable]
3431
posthog/client.py:0: error: Name "urlparse" already defined (possibly by an import) [no-redef]
3532
posthog/client.py:0: error: Name "parse_qs" already defined (possibly by an import) [no-redef]

posthog/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2267,7 +2267,7 @@ def _setup_sse_connection(self):
22672267

22682268
try:
22692269
# Use requests with stream=True for SSE
2270-
import requests
2270+
import requests # type: ignore[import-untyped]
22712271

22722272
url = f"{self.host}/flags/definitions/stream?api_key={self.api_key}"
22732273
headers = {

0 commit comments

Comments
 (0)