Abdulrehman-PIAIC80387 commented on PR #40285: URL: https://github.com/apache/superset/pull/40285#issuecomment-4496621952
@codeant-ai-for-open-source Good catch — addressed in 5f9291512e: - Added a `@cached_property _send_time` on `EmailNotification` so the timestamp is captured **once per instance** and reused for subject + CSV/PDF attachment filenames. - `_parse_name` now uses `self._send_time` instead of calling `datetime.now()` per access. - Added a second regression test (`test_email_subject_datetime_consistent_within_single_send`) that patches `datetime.now` between two `_name` reads on the same instance and asserts both reads return the construct-time value — guarding against the boundary-crossing inconsistency you flagged. Existing test `test_email_subject_datetime_evaluated_per_send` was updated to construct two separate `EmailNotification` instances (matching the new per-send semantics) instead of two calls on one instance. `pytest tests/unit_tests/reports/notifications/email_tests.py -v`: 4 passed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
