Skip to content
Permalink
Browse files
fix: remove dependency on pytz (#472)
  • Loading branch information
busunkim96 committed Aug 13, 2021
1 parent 9e9d068 commit 972cc163f5a1477b37a5ab7e329faf1468637fa2
Showing with 2 additions and 4 deletions.
  1. +1 −2 google/cloud/pubsub_v1/subscriber/message.py
  2. +1 −2 tests/unit/pubsub_v1/subscriber/test_message.py
@@ -17,7 +17,6 @@
import datetime as dt
import json
import math
import pytz
import time

from google.cloud.pubsub_v1.subscriber._protocol import requests
@@ -110,7 +109,7 @@ def __init__(self, message, ack_id, delivery_attempt, request_queue):
self._data = message.data
self._publish_time = dt.datetime.fromtimestamp(
message.publish_time.seconds + message.publish_time.nanos / 1e9,
tz=pytz.UTC,
tz=dt.timezone.utc,
)
self._ordering_key = message.ordering_key
self._size = message.ByteSize()
@@ -17,7 +17,6 @@
import time

import mock
import pytz

from google.api_core import datetime_helpers
from google.cloud.pubsub_v1.subscriber import message
@@ -26,7 +25,7 @@
from google.pubsub_v1 import types as gapic_types


RECEIVED = datetime.datetime(2012, 4, 21, 15, 0, tzinfo=pytz.utc)
RECEIVED = datetime.datetime(2012, 4, 21, 15, 0, tzinfo=datetime.timezone.utc)
RECEIVED_SECONDS = datetime_helpers.to_milliseconds(RECEIVED) // 1000
PUBLISHED_MICROS = 123456
PUBLISHED = RECEIVED + datetime.timedelta(days=1, microseconds=PUBLISHED_MICROS)

0 comments on commit 972cc16

Please sign in to comment.