ERR: stricter checks on Index construction when tz is passed #14093
Labels
API Design
Constructors
Series/DataFrame/Index/pd.array Constructors
Error Reporting
Incorrect or improved errors from pandas
Timezones
Timezone data dtype
Milestone
from comment on #13981
[1] is fine/expected
[2] should be disallowed (e.g. integer construction)
[3] is ok, maybe should disallow to be consistent.
I am not sure what this would break. But we don't necessarily want to force datetime construction on a generic
Index
(as opposed to using.to_datetime
or a constructor, e.g.pd.date_range
). This is a bit too much inference.So the rule would be that it has to be actual datetimes/Timestamps, if tz is provided (which is a form of dtype).
The text was updated successfully, but these errors were encountered: