Copilot commented on code in PR #15388:
URL: https://github.com/apache/iotdb/pull/15388#discussion_r2055741837


##########
iotdb-client/client-py/tests/integration/test_tablemodel_query.py:
##########
@@ -352,6 +355,15 @@ def test_query_data():
                             values[row][i],
                             rel_tol=1e-6,
                         )
+                    elif data_types[i] == TSDataType.TIMESTAMP:
+                        actual = 
row_record.get_fields()[i].get_timestamp_value()
+                        expected = convert_to_timestamp(
+                            values[row][i], "ms", get_localzone_name()

Review Comment:
   Verify that using get_localzone_name() to obtain the expected timestamp 
timezone is consistent with the session configuration. If the session 
explicitly uses 'Asia/Shanghai', consider updating the test to use the fixed 
timezone to avoid discrepancies between different environments.
   ```suggestion
                               values[row][i], "ms", "Asia/Shanghai"
   ```



##########
iotdb-client/client-py/iotdb/utils/rpc_utils.py:
##########
@@ -67,3 +75,36 @@ def 
verify_success_with_redirection_for_multi_devices(status: TSStatus, devices:
             if status.subStatus[i].redirectNode is not None:
                 device_to_endpoint[devices[i]] = 
status.subStatus[i].redirectNode
         raise RedirectException(device_to_endpoint)
+
+
+def convert_to_timestamp(time: int, precision: str, timezone: str):
+    try:
+        return pd.Timestamp(time, unit=precision, tz=timezone)
+    except OutOfBoundsDatetime:
+        return pd.Timestamp(time, unit=precision).tz_localize(timezone)
+    except ValueError:
+        logger.warning(
+            f"Timezone string '{timezone}' cannot be recognized by pandas. "

Review Comment:
   [nitpick] Review the fallback warning message in the ValueError handler; the 
closing quotation in 'Falling back to use auto timespec'.' appears misplaced. 
Consider revising it for clarity.



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