Copilot commented on code in PR #18017:
URL: https://github.com/apache/datafusion/pull/18017#discussion_r2427099487


##########
datafusion/functions/src/datetime/now.rs:
##########
@@ -54,6 +57,15 @@ impl NowFunc {
         Self {
             signature: Signature::nullary(Volatility::Stable),
             aliases: vec!["current_timestamp".to_string()],
+            timezone: Some(Arc::from("+00")),

Review Comment:
   The hardcoded timezone '+00' should use a named constant to avoid magic 
values and ensure consistency across the codebase.



##########
datafusion/functions/src/datetime/now.rs:
##########
@@ -106,8 +118,16 @@ impl ScalarUDFImpl for NowFunc {
             .execution_props()
             .query_execution_start_time
             .timestamp_nanos_opt();
+
+        let timezone = info
+            .execution_props()
+            .config_options
+            .as_ref()
+            .map(|opts| opts.execution.time_zone.as_str())

Review Comment:
   The fallback timezone '+00' should use the same constant as used in the 
constructor to maintain consistency.
   ```suggestion
               .map(|opts| opts.execution.time_zone.as_str())
               .or(self.timezone.as_deref())
   ```



-- 
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]

Reply via email to