gemini-code-assist[bot] commented on code in PR #37775:
URL: https://github.com/apache/beam/pull/37775#discussion_r2906224878


##########
sdks/java/io/influxdb/src/test/java/org/apache/beam/sdk/io/influxdb/GenerateData.java:
##########
@@ -40,13 +41,13 @@ static List<String> getMetric(String metric, int number) {
       m.addField("field2", random.nextInt(100));
       LocalDateTime time =
           LocalDateTime.of(
-              LocalDate.now(),
+              LocalDate.now(ZoneId.of("America/Los_Angeles")),
               LocalTime.of(
                   random.nextInt(24),
                   random.nextInt(60),
                   random.nextInt(60),
                   random.nextInt(999999999 + 1)));
-      ZonedDateTime zdt = time.atZone(ZoneId.of("America/Los_Angeles"));
+      ZonedDateTime zdt = time.atZone(ZoneOffset.UTC);

Review Comment:
   ![high](https://www.gstatic.com/codereviewagent/high-priority.svg)
   
   There seems to be a logic inconsistency here. The `LocalDateTime` `time` is 
constructed using a date from the `America/Los_Angeles` timezone (line 44), but 
then it's interpreted as being in UTC here. This is likely not the intended 
behavior.
   
   To maintain consistency, you should probably use the same timezone for 
`atZone` as you used for `LocalDate.now`. The original code 
`time.atZone(ZoneId.of("America/Los_Angeles"))` seems more correct in this 
context.
   
   ```suggestion
         ZonedDateTime zdt = time.atZone(ZoneId.of("America/Los_Angeles"));
   ```



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

Reply via email to