Open ludaavics opened 1 year ago
bump on this. another example
import pandas as pd
df_1 = pd.DataFrame({"ts":["2023-10-30T11:27:20.082372+01:00",
"2023-10-30T10:02:24.800916+01:00",
"2023-10-30T07:37:01.052617+01:00",
"2023-10-30T07:03:02.975448+01:00",
"2023-10-27T15:37:25.562608+02:00",
"2023-10-27T15:10:05.190293+02:00",
"2023-10-27T12:44:23.609281+02:00",
"2023-10-27T12:32:16.41568+02:00"]})
pd.to_datetime(df_1['ts']) # succeeds
from pandera import Column, DataFrameSchema, Timestamp
schema = DataFrameSchema(
{
"ts": Column(Timestamp)
},
coerce=True
)
schema.validate(df_1) # raises
df_2 = pd.DataFrame({"ts":["2023-10-30T11:27:20.082372+01:00",
"2023-10-30T10:02:24.800916+01:00",
"2023-10-30T07:37:01.052617+01:00",
"2023-10-30T07:03:02.975448+01:00",]})
schema.validate(df_2) # succeeds
Validating a column of time zone aware datetimes fail when there are multiple time zones.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Expected behavior
All the timezoe get converted ot the target time zone
Desktop (please complete the following information):
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.