Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
varunmittal91 committed Dec 5, 2023
1 parent 94497cb commit a618e1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/attributes/test_datetime_column_load_from_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def test_load_column_with_valid_datetime_utc(self):

with tempfile.NamedTemporaryFile(suffix=".csv", mode="w") as temp_file:
sample_df.to_csv(temp_file)
temp_file.seek(0)
read_df = pd.read_csv(temp_file.name)

self.__assert_values__(
Expand All @@ -102,8 +103,9 @@ def test_load_column_with_valid_datetime_naive(self):

sample_df = pd.DataFrame([{random_column_id: naive_datetime}])

with tempfile.NamedTemporaryFile(suffix=".csv", mode="w") as temp_file:
with tempfile.NamedTemporaryFile(suffix=".csv", mode="w+") as temp_file:
sample_df.to_csv(temp_file)
temp_file.seek(0)
read_df = pd.read_csv(temp_file.name)

self.__assert_values__(
Expand All @@ -129,6 +131,7 @@ def test_load_column_with_valid_datetime_not_utc(self):
with tempfile.NamedTemporaryFile(suffix=".csv", mode="w") as temp_file:
# write csv to temporary location and read to simulate df read
sample_df.to_csv(temp_file)
temp_file.seek(0)
read_df = pd.read_csv(temp_file.name)

self.__assert_values__(
Expand All @@ -153,6 +156,7 @@ def test_load_column_with_invalid_datetime(self):
with tempfile.NamedTemporaryFile(suffix=".csv", mode="w") as temp_file:
# write csv to temporary location and read to simulate df read
sample_df.to_csv(temp_file)
temp_file.seek(0)
read_df = pd.read_csv(temp_file.name)

self.__assert_values__(
Expand Down

0 comments on commit a618e1f

Please sign in to comment.