Skip to content

Commit

Permalink
Testing resample with a different timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
attilapiros committed Aug 8, 2023
1 parent 2a23c7a commit 630bbce
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/pyspark/pandas/tests/test_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import unittest
import inspect
import datetime
import os
import numpy as np
import pandas as pd

Expand All @@ -32,6 +33,23 @@


class ResampleTestsMixin:

timezone = None

@classmethod
def setUpClass(cls):
tz_string = datetime.datetime.now(datetime.timezone.utc).astimezone().tzname()
print("timezone:", tz_string)
cls.timezone = os.environ.get("TZ")
os.environ["TZ"] = 'America/New_York'


@classmethod
def tearDownClass(cls):
if cls.timezone:
os.environ["TZ"] = cls.timezone


@property
def pdf1(self):
np.random.seed(11)
Expand Down

0 comments on commit 630bbce

Please sign in to comment.