You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This currently works a bit for datetime values in the index (not in the columns, reason for this is that is then are object columns: #9085).
I say 'a bit', as it does give a 'timestamp with time zone' type (example for postgresql), but it is the time localized in your local timezone (I suppose because this is the way numpy works on input/output of datetimes).
This causes problems with MS SQL Server, which can only have one timestamp column per table. If I try to write a table with two datetime(64) columns to SQL, I get this error:
"[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]A table can only have one timestamp column. Because table 'close_data_temp' already has one, the column 'time_known' cannot be added. (2738) (SQLExecDirectW)"
SQLAlchemy says of this type (in dialects/mssql/base.py):
I think the correct type to use for timezone-aware datetimes on SQL Server would be DATETIMEOFFSET, which is supported by SQLAlchemy. I can change this mapping locally by subclassing SQLTable and overriding _sqlalchemy_type, but it might be useful to support this natively if a SQL Server dialect is detected.
This currently works a bit for datetime values in the index (not in the columns, reason for this is that is then are object columns: #9085).
I say 'a bit', as it does give a 'timestamp with time zone' type (example for postgresql), but it is the time localized in your local timezone (I suppose because this is the way numpy works on input/output of datetimes).
In any case, also the code here (https://github.com/pydata/pandas/blob/v0.15.2/pandas/io/sql.py#L916) is not working (as columns never have a
tzinfo
attribute), and there are also no tests for this.So in practice, timezones are not yet supported.
The text was updated successfully, but these errors were encountered: