Repository navigation
feat: deprecate analytics environment routing - #16
Conversation
3eb3d11 to
6c955aa
Compare
|
Rebased on the updated audience PR. |
| if environment is not None: | ||
| warnings.warn("The environment is determined by your API key. Remove the `environment` argument.", DeprecationWarning, stacklevel=2) | ||
| # Kept for existing callers; it no longer controls routing or appears in requests. | ||
| self.environment = "production" if environment is None else environment |
There was a problem hiding this comment.
Not sure about this TBH I think it's confusing and rather return a magic string or just remove, it's not a real breaking change I think
There was a problem hiding this comment.
yeah, just remove everything (both the value and the warning)
There was a problem hiding this comment.
Done: removed both the environment attribute and the DeprecationWarning. The constructor still accepts the argument (positionally too) so existing calls keep working, but it is ignored and never sent. I also removed the one-time RuntimeWarning for ignored identify/alias calls in #15, since we do not log on the backend.
6c955aa to
d87da45
Compare
d87da45 to
d7589fe
Compare
What
Ignore the
environmentconstructor argument. It is nowOptional[str]and still accepted positionally or by name so existing calls keep working, but it is ignored, not stored on the client, and emits no warning. A single helper strips top-levelenvironmentfrom track, identify, and alias requests, including raw batches, without mutating caller dictionaries or removing nested business properties. README gains a short note on the deprecation.Why
An environment-bound Product Analytics API key now selects the destination. Callers using unbound legacy keys must replace them before upgrading.
Stacked on #15 (audience collection); this PR contains only the environment slice.
Checklist
environmentfrom track/identify/alias and batch requests, preserved nested properties, and caller input ownership.