Commit 51e64c3
authored
## Which issue does this PR close?
* Closes #18219.
---
## Rationale for this change
The deprecated `NowFunc::new()` constructor previously initialized its
timezone using the shorthand offset `"+00"`, which was inconsistent with
the canonical UTC offset format `"+00:00"` used by
`ConfigOptions::default()`. This mismatch could cause subtle
inconsistencies in `ScalarValue` comparisons or downstream timezone
handling.
This PR ensures backward compatibility while aligning `NowFunc::new()`
with the canonical default configuration, making behavior consistent
across both constructors. It also improves documentation to clarify this
relationship and provides a regression test to confirm parity between
the two initialization paths.
---
## What changes are included in this PR?
* Updated the deprecated `NowFunc::new()` to delegate to
`NowFunc::new_with_config(&ConfigOptions::default())`.
* Added detailed doc comments explaining the rationale and proper usage
of the constructors.
* Introduced a new test module verifying that `NowFunc::new()` and
`NowFunc::new_with_config()` produce identical return fields and scalar
values.
* Updated user documentation (`scalar_functions.md`) to note the
constructor preference and clarify the canonical default timezone format
(`+00:00`).
---
## Are these changes tested?
✅ Yes. A new test `now_func_default_matches_config` was added to confirm
functional equivalence between the legacy and configuration-based
constructors, including matching field outputs and scalar timezones.
---
## Are there any user-facing changes?
* **Yes**, but backward-compatible:
* `NowFunc::new()` remains available but now mirrors the canonical
timezone offset (`+00:00`).
* Documentation has been updated to guide users toward the preferred
`NowFunc::new_with_config()` method.
No breaking API or behavior changes are expected, as this update
standardizes the default timezone while maintaining prior function
signatures.
1 parent a393fc7 commit 51e64c3
1 file changed
+48
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
0 commit comments