kunwp1 commented on code in PR #9550:
URL: https://github.com/apache/texera/pull/9550#discussion_r4670723159
##########
amber/src/main/python/core/runnables/heartbeat.py:
##########
@@ -110,7 +110,6 @@ def stop(self):
os.kill(child.pid, signal.SIGKILL)
except Exception as e:
logger.warning(
- "Exception during process termination "
- f"PID {str(child.pid)}: {e} "
+ f"Exception during process termination PID
{child.pid!s}: {e} "
Review Comment:
`!s` is redundant here, since an int in an f-string is formatted with
`str()` already: `{child.pid}`.
##########
amber/src/main/python/core/models/schema/attribute_type.py:
##########
@@ -124,7 +124,7 @@ def _local_wall_clock(moment):
# machine's standard offset. Before 1900 the engine reads every zone at
# its standard offset, where a named zone would give its local mean time.
zone = _named_local_zone()
- utc = moment.astimezone(datetime.timezone.utc).replace(tzinfo=None)
+ utc = moment.astimezone(datetime.UTC).replace(tzinfo=None)
Review Comment:
`datetime.UTC` only exists from Python 3.11. The computing-unit images
install `python3` on `eclipse-temurin:17-jdk-jammy` (Ubuntu 22.04, Python
3.10), and `PythonUtils` falls back to that `python3` when `udf.python.path` is
unset, so parsing any timestamp with an offset in a deployed worker would raise
`AttributeError` here. CI doesn't catch it because pyamber runs on 3.11 to
3.13. Keeping `datetime.timezone.utc` avoids it; moving the images to 3.11
would be a separate change.
--
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]