Skip to content

Commit 33346ab

Browse files
sfc-gh-stakedaankit-bhatnagar167
authored andcommitted
SNOW-86947: Update converter test case
1 parent 483296c commit 33346ab

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

arrow_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def TIMESTAMP_TZ_to_python_windows(self, microseconds, tz):
6868
tzinfo = _generate_tzinfo_from_tzoffset(tz - 1440)
6969
t = ZERO_EPOCH + timedelta(seconds=microseconds)
7070
if pytz.utc != tzinfo:
71-
t += tzinfo.utcoffset(t, is_dst=False)
71+
t += tzinfo.utcoffset(t)
7272
return t.replace(tzinfo=tzinfo)
7373

7474
def TIMESTAMP_NTZ_to_python(self, microseconds):

converter_issue23517.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def conv0(encoded_value):
4141
microseconds = float(value)
4242
t = ZERO_EPOCH + timedelta(seconds=microseconds)
4343
if pytz.utc != tzinfo:
44-
t += tzinfo.utcoffset(t, is_dst=False)
44+
t += tzinfo.utcoffset(t)
4545
return t.replace(tzinfo=tzinfo)
4646

4747
def conv(encoded_value):
@@ -50,7 +50,7 @@ def conv(encoded_value):
5050
microseconds = float(value[0:-scale + 6])
5151
t = ZERO_EPOCH + timedelta(seconds=microseconds)
5252
if pytz.utc != tzinfo:
53-
t += tzinfo.utcoffset(t, is_dst=False)
53+
t += tzinfo.utcoffset(t)
5454
return t.replace(tzinfo=tzinfo)
5555

5656
return conv if scale > 6 else conv0

converter_snowsql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def conv0(encoded_value):
162162
"OSError occurred but falling back to datetime: %s", e)
163163
t = ZERO_EPOCH + timedelta(seconds=microseconds)
164164
if pytz.utc != tzinfo:
165-
t += tzinfo.utcoffset(t, is_dst=False)
165+
t += tzinfo.utcoffset(t)
166166
t = t.replace(tzinfo=tzinfo)
167167
fraction_of_nanoseconds = _adjust_fraction_of_nanoseconds(
168168
value, max_fraction, scale)
@@ -180,7 +180,7 @@ def conv(encoded_value):
180180
"OSError occurred but falling back to datetime: %s", e)
181181
t = ZERO_EPOCH + timedelta(seconds=microseconds)
182182
if pytz.utc != tzinfo:
183-
t += tzinfo.utcoffset(t, is_dst=False)
183+
t += tzinfo.utcoffset(t)
184184
t = t.replace(tzinfo=tzinfo)
185185

186186
fraction_of_nanoseconds = _adjust_fraction_of_nanoseconds(

test/test_converter_more_timestamp.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_fetch_various_timestamps(conn_cnx):
4242
except OSError:
4343
ts = ZERO_EPOCH + timedelta(seconds=float(et))
4444
if pytz.utc != tzinfo:
45-
ts += tzinfo.utcoffset(ts, is_dst=False)
45+
ts += tzinfo.utcoffset(ts)
4646
ts = ts.replace(tzinfo=tzinfo)
4747
data.append({
4848
'scale': 0,
@@ -60,7 +60,7 @@ def test_fetch_various_timestamps(conn_cnx):
6060
except OSError:
6161
ts0 = ZERO_EPOCH + timedelta(seconds=float(et))
6262
if pytz.utc != tzinfo:
63-
ts0 += tzinfo.utcoffset(ts0, is_dst=False)
63+
ts0 += tzinfo.utcoffset(ts0)
6464
ts0 = ts0.replace(tzinfo=tzinfo)
6565
ts0_str = ts0.strftime(
6666
'%Y-%m-%d %H:%M:%S.{ff}{tz}'.format(
@@ -76,7 +76,7 @@ def test_fetch_various_timestamps(conn_cnx):
7676
# WIP. this test work in edge case
7777
tzinfo = pytz.timezone(PST_TZ)
7878
ts0 = datetime.fromtimestamp(float(et))
79-
ts0 = pytz.utc.localize(ts0, is_dst=False).astimezone(tzinfo)
79+
ts0 = pytz.utc.localize(ts0).astimezone(tzinfo)
8080
ts0_str = ts0.strftime('%Y-%m-%d %H:%M:%S')
8181
ts1 = ts0
8282
data.append({
@@ -87,8 +87,7 @@ def test_fetch_various_timestamps(conn_cnx):
8787
})
8888
for idx in range(len(fractions)):
8989
ts0 = datetime.fromtimestamp(float(et))
90-
ts0 = pytz.utc.localize(ts0, is_dst=False).astimezone(
91-
tzinfo)
90+
ts0 = pytz.utc.localize(ts0).astimezone(tzinfo)
9291
ts0_str = ts0.strftime(
9392
'%Y-%m-%d %H:%M:%S.{ff}'.format(
9493
ff=fractions[:idx + 1]

test/test_unit_arrow_chunk_iterator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def expected_data_transform_tz_impl(data, scale=_scale):
479479
if platform.system() == 'Windows':
480480
t = datetime.datetime.utcfromtimestamp(0) + datetime.timedelta(seconds=(float(microsec)))
481481
if pytz.utc != tzinfo:
482-
t += tzinfo.utcoffset(t, is_dst=False)
482+
t += tzinfo.utcoffset(t)
483483
return t.replace(tzinfo=tzinfo)
484484
else:
485485
return datetime.datetime.fromtimestamp(float(microsec), tz=tzinfo)

0 commit comments

Comments
 (0)