Skip to content

fix: type warning on new_context#558

Merged
marandaneto merged 2 commits intoPostHog:mainfrom
itsaphel:main
May 9, 2026
Merged

fix: type warning on new_context#558
marandaneto merged 2 commits intoPostHog:mainfrom
itsaphel:main

Conversation

@itsaphel
Copy link
Copy Markdown
Contributor

@itsaphel itsaphel commented May 9, 2026

💡 Motivation and Context

When using a strict Python typechecker, Posthog's new_context function raises a type warning:

Type of "new_context" is partially unknown
  Type of "new_context" is "(fresh: bool = False, capture_exceptions: bool = True, client: Unknown | None = None) -> _GeneratorContextManager[None, None, None]" (basedpyright reportUnknownVariableType)

This fixes that by assigning a type to client

💚 How did you test it?

Type fix only, ran typechecker

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran sampo add to generate a changeset file

@itsaphel itsaphel requested a review from a team as a code owner May 9, 2026 12:30
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 9, 2026

Reviews (1): Last reviewed commit: "fix type warning on `new_context`" | Re-trigger Greptile

@itsaphel itsaphel changed the title fix type warning on new_context fix: type warning on new_context May 9, 2026
@marandaneto
Copy link
Copy Markdown
Member

@itsaphel can you add a changeset with sampo?

@marandaneto marandaneto enabled auto-merge (squash) May 9, 2026 22:08
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 9, 2026

Reviews (2): Last reviewed commit: "changeset" | Re-trigger Greptile

@marandaneto marandaneto merged commit f6c8ede into PostHog:main May 9, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants