English
Open in Telegram

Post🚀 New issue to wemake-services/django-modern-rest by @vyhuholl

27 September 2026
W
wps_forward_bot
🚀 New issue to wemake-services/django-modern-rest by @vyhuholl 📝 Seeded OpenAPI examples of `datetime` and `time` change with the current time (#1632) What's wrong? Found while working on #1629. With DMR_SETTINGS = {'openapi_examples_seed': 1} and the same PYTHONHASHSEED, examples of datetime and time fields are different on every run: class _Event(msgspec.Struct): created_at: dt.datetime day: dt.date at: dt.time duration: dt.timedelta class _EventController(Controller[MsgspecSerializer]): def get(self) -> _Event: raise NotImplementedError Two runs 3 seconds apart, both with PYTHONHASHSEED=0: 02:18:43 {"created_at": "2000-10-08T03:39:12.378838", "day": "2025-09-16", "at": "18:36:00.366279", "duration": "P0D"} 02:18:46 {"created_at": "2000-10-08T03:39:16.378838", "day": "2025-09-16", "at": "18:36:03.421377", "duration": "P0D"} polyfactory generates these with Faker, and Faker's defaults end at the current time: datetime uses date_time_between, which ends at "now", and time uses time_object, which picks a time between 1970 and now. The seed fixes the random part, but the range moves with the clock, so the value moves too. date uses date_this_decade, which ends at today, so it changes once a day. So a schema with such fields is never the same on two runs, even though the seed_example_factory docstring says that seeding per build "keeps a schema reproducible on its own". How it should be? The same openapi_examples_seed should give the same examples at any time. _ExampleFactory in dmr/openapi/mappers/example.py can override get_provider_map() and give datetime, date and time fixed bounds instead of "now". timedelta could get a range there too: its examples are always P0D now, because time_delta() without end_datetime starts and ends at "now". Used versions django-modern-rest 0.15.0, polyfactory 3.3.0, faker 40.39.0 Reproduced on c35128a. OS information macOS 27.0 #bug #good_first_issue #help_wanted #openapi #opensource_september #django_modern_rest sent via relator
1 · 377 ·

Nearby in the feed

Wwps_forward_bot🚀 New issue to wemake-services/wemake-python-styleguide by @sobolevn 📝 Incorrect Jones complexity for formatted strings (#3820) These two lines: • tuple(f'/{preWwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `Settings.throttling_allow_unsafe_cache` is a bad design (#1611) After #1600 we moved the throt
this message
Wwps_forward_bot🚀 New issue to wemake-services/wemake-python-styleguide by @sobolevn 📝 `WPS235`: ignore imports from `typing` (#3824) I can't limit the number of types I importWwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @Izcarmt95 📝 OpenAPI: duplicated tags when both Router(tags=...) and @modify(tags=...) set the same tag (#1
ННаходки в опенсорсе: PythonНаходки в опенсорсе: Python@opensource_findings_python · channel · Tech
1 052subscribers346average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count