Skip to content

Commit 0e4254d

Browse files
committed
docs: add 56.0.0 upgrade note for ExecutionOptions::time_zone
1 parent 84a92d3 commit 0e4254d

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

  • docs/source/library-user-guide/upgrading

‎docs/source/library-user-guide/upgrading/56.0.0.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,31 @@ let mut config = SessionConfig::new();
228228
config.options_mut().execution.enable_nlj_coordinated_fallback = false;
229229
```
230230

231+
### `ExecutionOptions::time_zone` is now a validated `ConfigTimeZone`
232+
233+
`ExecutionOptions::time_zone` changed from `Option<String>` to
234+
`Option<ConfigTimeZone>`. The value is now checked when it is set, so
235+
`SET TIME ZONE = 'Asia/Taipei2'` fails immediately instead of on a later query.
236+
The string is kept exactly as written (`+08` stays `+08`).
237+
238+
**Who is affected:**
239+
240+
- Code that reads or assigns `ExecutionOptions::time_zone` directly.
241+
- Code that sets the value through SQL `SET` or `ConfigOptions::set` needs no
242+
code changes, but invalid time zones are now rejected immediately.
243+
244+
**Migration guide:**
245+
246+
```rust,ignore
247+
// Before
248+
options.execution.time_zone = Some("America/Denver".to_string());
249+
let tz: Option<String> = options.execution.time_zone.clone();
250+
251+
// After
252+
options.execution.time_zone = Some("America/Denver".parse()?);
253+
let tz: Option<&str> = options.execution.time_zone.as_ref().map(|tz| tz.as_str());
254+
```
255+
231256
### `datafusion.optimizer.use_statistics_registry` is deprecated and ignored
232257

233258
The `datafusion.optimizer.use_statistics_registry` config flag is deprecated and

0 commit comments

Comments
 (0)