def encode_attribute_event_time(dt: datetime.datetime) -> str: ts = Timestamp() ts.FromDatetime(dt) return ts.ToJsonString()
def _proto_timestamp_to_pandas_time( timestamp: timestamp_pb2.Timestamp, ) -> pd.Timestamp: """Convert a protobuf Timestamp to a pandas Timestamp.""" pts = pd.Timestamp(timestamp.ToJsonString()) return TimeSeriesApi._convert_utc(pts)