Is there an existing issue for this?
Current Behavior
The _round_datetime method always adds 1 day to the input datetime when the direction is "up", even if the input is already exactly at midnight (e.g., 2025-08-07 00:00:00).
This can lead to incorrect rounding behavior and off-by-one-day results in edge cases, especially when using the output to define data quality thresholds or ranges.
Expected Behavior
If the input datetime is already at midnight (00:00:00), the method should return the input as-is instead of adding 1 day.
Steps To Reproduce
- Call
_round_datetime(datetime(2025, 8, 7, 0, 0, 0), "up")
- Observe that it returns
2025-08-08 00:00:00, which is incorrect.
- Expected: it should return the same value
2025-08-07 00:00:00
Cloud
Azure
Operating System
Linux
Relevant log output
N/A — logic bug does not produce log output, but can lead to incorrect DQ rule configuration.
Is there an existing issue for this?
Current Behavior
The
_round_datetimemethod always adds 1 day to the input datetime when thedirectionis"up", even if the input is already exactly at midnight (e.g.,2025-08-07 00:00:00).This can lead to incorrect rounding behavior and off-by-one-day results in edge cases, especially when using the output to define data quality thresholds or ranges.
Expected Behavior
If the input datetime is already at midnight (
00:00:00), the method should return the input as-is instead of adding 1 day.Steps To Reproduce
_round_datetime(datetime(2025, 8, 7, 0, 0, 0), "up")2025-08-08 00:00:00, which is incorrect.2025-08-07 00:00:00Cloud
Azure
Operating System
Linux
Relevant log output