Example #1
0
    def to_pb(self):
        """Converts the :class:`TimestampRange` to a protobuf.

        :rtype: :class:`.data_v2_pb2.TimestampRange`
        :returns: The converted current object.
        """
        timestamp_range_kwargs = {}
        if self.start is not None:
            timestamp_range_kwargs['start_timestamp_micros'] = (
                _microseconds_from_datetime(self.start))
        if self.end is not None:
            timestamp_range_kwargs['end_timestamp_micros'] = (
                _microseconds_from_datetime(self.end))
        return data_v2_pb2.TimestampRange(**timestamp_range_kwargs)
Example #2
0
def _TimestampRangePB(*args, **kw):
    from google.cloud.bigtable._generated import (data_pb2 as data_v2_pb2)
    return data_v2_pb2.TimestampRange(*args, **kw)