Skip to content

TST: tests for outputing ambiguous times, #11619, fixed already in #11301 #11641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.17.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Bug Fixes
- Prevent adding new attributes to the accessors ``.str``, ``.dt`` and ``.cat``. Retrieving such
a value was not possible, so error out on setting it. (:issue:`10673`)
- Bug in tz-conversions with an ambiguous time and ``.dt`` accessors (:issue:`11295`)
- Bug in output formatting when using an index of ambiguous times (:issue:`11619`)
- Bug in comparisons of Series vs list-likes (:issue:`11339`)
- Bug in ``DataFrame.replace`` with a ``datetime64[ns, tz]`` and a non-compat to_replace (:issue:`11326`, :issue:`11153`)
- Bug in list-like indexing with a mixed-integer Index (:issue:`11320`)
Expand Down
23 changes: 21 additions & 2 deletions pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -15449,8 +15449,8 @@ def test_to_csv_date_format(self):
assert_frame_equal(test, nat_frame)

def test_to_csv_with_dst_transitions(self):
pname = '__tmp_to_csv_date_format_with_dst__'
with ensure_clean(pname) as path:

with ensure_clean('csv_date_format_with_dst') as path:
# make sure we are not failing on transitions
times = pd.date_range("2013-10-26 23:00", "2013-10-27 01:00",
tz="Europe/London",
Expand All @@ -15468,6 +15468,25 @@ def test_to_csv_with_dst_transitions(self):
result.index = pd.to_datetime(result.index).tz_localize('UTC').tz_convert('Europe/London')
assert_frame_equal(result,df)

# GH11619
idx = pd.date_range('2015-01-01', '2015-12-31', freq = 'H', tz='Europe/Paris')
df = DataFrame({'values' : 1, 'idx' : idx},
index=idx)
with ensure_clean('csv_date_format_with_dst') as path:
df.to_csv(path,index=True)
result = read_csv(path,index_col=0)
result.index = pd.to_datetime(result.index).tz_localize('UTC').tz_convert('Europe/Paris')
result['idx'] = pd.to_datetime(result['idx']).astype('datetime64[ns, Europe/Paris]')
assert_frame_equal(result,df)

# assert working
df.astype(str)

with ensure_clean('csv_date_format_with_dst') as path:
df.to_pickle(path)
result = pd.read_pickle(path)
assert_frame_equal(result,df)


def test_concat_empty_dataframe_dtypes(self):
df = DataFrame(columns=list("abc"))
Expand Down