migrate all time env vars to timedelta - #7138
benedikt-bartscher wants to merge 13 commits into
Conversation
|
Merging this PR will degrade performance by 3.05%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_var_access[mutable_dict] |
45.6 ms | 47 ms | -3.05% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing benedikt-bartscher:migrate-envvar-timedelta (f513515) with main (bc651dc)
Footnotes
-
9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Review follow-ups for the timedelta migration of the duration env vars: - Treat a blank value as unset, matching EnvVar semantics, so a templated `REFLEX_STATE_MANAGER_DISK_DEBOUNCE=` no longer shadows the old name and a blank old name no longer warns. - Name the exact replacement in the deprecation message (`REFLEX_AUTO_RELOAD_COOLDOWN=5000ms`), since renaming the variable without its unit would silently read the value as seconds. - Warn once per process rather than once per call site, and read the auto-reload cooldown during app setup so its deprecation shows at startup instead of on the first matching frontend error. - Reject a negative opportunistic lock hold time instead of clamping it to one millisecond. - Skip bracketed pseudo-filenames when locating the user frame for a deprecation. A code object with no source file carries `<string>` (exec, a generated dataclass `__init__`) or `<frozen importlib._bootstrap>` rather than a path, and both were reported as the deprecation's location. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gg8XKw3GThDkGC2L4y5ZSH
There was a problem hiding this comment.
All reported issues were addressed across 10 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
- Build the suggested replacement from the parsed value rather than the raw text. A bare int or float accepts forms the duration parser rejects, so `REFLEX_STATE_MANAGER_DISK_DEBOUNCE_SECONDS=.5` suggested `.5s`, which fails to parse. `1_000` and `1e3` had the same problem. - Skip only `<string>` and `<frozen ...>` when locating the user frame for a deprecation, instead of every bracketed name. `<stdin>` and an `<ipython-input-N-...>` cell are real user call sites, and swallowing them pushed the reported location up into the interpreter's own frames. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gg8XKw3GThDkGC2L4y5ZSH
There was a problem hiding this comment.
All reported issues were addressed across 10 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
follow-up of #7131