Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(dataclasses): call dataclass directly in frozen (#116525)

Raúl Negrón-Otero0115cb9a3e34
diff --git a/posthog/dataclasses.py b/posthog/dataclasses.py
index 0fc7af6f408e..c61f65127205 100644
--- a/posthog/dataclasses.py
+++ b/posthog/dataclasses.py
@@ -34,8 +34,4 @@ def frozen(cls: Any = None, /, **kwargs: Any) -> Any:
flag can be overridden per class, e.g. @frozen(slots=False) when the class needs
functools.cached_property, or @frozen(frozen=False) for a mutable builder.
"""
- kwargs.setdefault("frozen", True)
- kwargs.setdefault("kw_only", True)
- kwargs.setdefault("slots", True)
- wrap = dataclass(**kwargs)
- return wrap if cls is None else wrap(cls)
+ return dataclass(cls, **{"frozen": True, "kw_only": True, "slots": True, **kwargs})