Skip to content

add timedelta env var - #7131

Merged
masenf merged 6 commits into
reflex-dev:mainfrom
benedikt-bartscher:add-timedelta-envvar
Sep 14, 2026
Merged

masenf merged 6 commits into
reflex-dev:mainfrom
benedikt-bartscher:add-timedelta-envvar

Conversation

@benedikt-bartscher

@benedikt-bartscher benedikt-bartscher commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Review in cubic

@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no outstanding findings.

Summary

  • Parses bare numeric values as seconds and supports us, ms, s, m, h, and d suffixes.
  • Serializes durations without losing microsecond precision, including boundary values.
  • Normalizes malformed and out-of-range durations to EnvironmentVarValueError.
  • Adds module-level tests covering parsing, validation, defaults, and round trips.

Reviews (9) · Last reviewed commit: "Update packages/reflex-base/news/+envvar..."

Comment thread packages/reflex-base/src/reflex_base/environment.py Outdated
Comment thread tests/units/test_environment.py Outdated
@codspeed

codspeed Bot commented Sep 13, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 40 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing benedikt-bartscher:add-timedelta-envvar (f255933) with main (1d038c0)

Open in CodSpeed

Footnotes

  1. 8 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.

@benedikt-bartscher
benedikt-bartscher marked this pull request as ready for review September 13, 2026 21:05
@benedikt-bartscher
benedikt-bartscher requested a review from a team as a code owner September 13, 2026 21:05

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/reflex-base/src/reflex_base/environment.py
Comment thread tests/units/test_environment.py
Comment thread packages/reflex-base/src/reflex_base/environment.py Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/units/test_environment.py
@benedikt-bartscher

Copy link
Copy Markdown
Contributor Author

i would migrate some reflex EnvVar usages in a follow-up

Comment thread packages/reflex-base/src/reflex_base/environment.py Outdated

@masenf masenf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great quality of life improvement for env vars, will be much easier to specify things like REFLEX_REDIS_LOCK_EXPIRATION=2h.

Comment thread packages/reflex-base/news/+envvar-timedelta.feature.md Outdated
@masenf
masenf enabled auto-merge (squash) September 14, 2026 16:42
@masenf
masenf merged commit 7638935 into reflex-dev:main Sep 14, 2026
114 checks passed
@benedikt-bartscher

Copy link
Copy Markdown
Contributor Author

thanks for the feedback and quick merge @masenf - follow-up in #7138

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