Skip to content
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

pandas-0.15.0 test failure test_string_index_alias_tz_aware (pandas.tseries.tests.test_timezones.TestTimeZoneSupportDateutil) #8639

Closed
jlec opened this issue Oct 26, 2014 · 19 comments · Fixed by #9123
Labels
Timezones Timezone data dtype
Milestone

Comments

@jlec
Copy link
Contributor

jlec commented Oct 26, 2014

ERROR: test_string_index_alias_tz_aware (pandas.tseries.tests.test_timezones.TestTimeZoneSupportDateutil)

Traceback (most recent call last):
File "/var/tmp/portage/dev-python/pandas-0.15.0/work/pandas-0.15.0-python3_3/lib/pandas/tseries/tests/test_timezones.py", line 606, in test_string_index_alias_tz_aware
self.assertAlmostEqual(result, ts[2])
File "/usr/lib64/python3.3/unittest/case.py", line 665, in assertAlmostEqual
if first == second:
File "/var/tmp/portage/dev-python/pandas-0.15.0/work/pandas-0.15.0-python3_3/lib/pandas/core/generic.py", line 692, in nonzero
.format(self.class.name))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

@jreback
Copy link
Contributor

jreback commented Oct 26, 2014

pls pd.show_versions()

@jlec
Copy link
Contributor Author

jlec commented Dec 6, 2014

pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 2.7.8.final.0
python-bits: 64
OS: Linux
OS-release: 3.17.4-lh-nvidia
machine: x86_64
processor: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
byteorder: little
LC_ALL: en_GB.UTF-8
LANG: en_GB.utf8

pandas: 0.15.0
nose: 1.3.4
Cython: 0.21.1
numpy: 1.9.1
scipy: 0.14.0
statsmodels: None
IPython: 2.3.0
sphinx: 1.2.3
patsy: None
dateutil: 2.2
pytz: 2014.10
bottleneck: 0.8.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: 2.0.2
xlrd: 0.9.3
xlwt: 0.7.5
xlsxwriter: None
lxml: 3.4.1
bs4: None
html5lib: 0.999
httplib2: None
apiclient: None
rpy2: None
sqlalchemy: None
pymysql: None
psycopg2: None

@jreback
Copy link
Contributor

jreback commented Dec 6, 2014

this works with latest master so not sure what the problem is (I matched your installed versions).

Here are some windows builds of a test version of 0.15.2 (0.15.1 is officially the current release)

https://github.com/pydata/pandas/releases

@jreback jreback closed this as completed Dec 6, 2014
@jreback jreback added the Timezones Timezone data dtype label Dec 6, 2014
@jlec
Copy link
Contributor Author

jlec commented Dec 7, 2014

I see the same error with current HEAD.

@jreback
Copy link
Contributor

jreback commented Dec 7, 2014

the error report you have doesn't match the show versions

first is in py3.3 and 2nd says py2.7

which is it??

@jlec
Copy link
Contributor Author

jlec commented Dec 7, 2014

it is with every python version

INSTALLED VERSIONS

commit: None
python: 3.4.2.final.0
python-bits: 64
OS: Linux
OS-release: 3.17.4-lh-nvidia
machine: x86_64
processor: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
byteorder: little
LC_ALL: en_GB.UTF-8
LANG: en_GB.utf8

pandas: 0.15.1-196-ge51eb9e
nose: 1.3.4
Cython: 0.21.1
numpy: 1.9.1
scipy: 0.14.0
statsmodels: 0.6.1
IPython: 2.3.1
sphinx: 1.2.3
patsy: 0.3.0
dateutil: 2.3
pytz: 2014.10
bottleneck: 0.8.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: 1.6.2
xlrd: 0.9.3
xlwt: None
xlsxwriter: 0.6.4
lxml: 3.4.1
bs4: 4.3.2
html5lib: 0.999
httplib2: 0.8
apiclient: None
rpy2: None
sqlalchemy: 0.9.8
pymysql: 0.6.2.None
psycopg2: None
None

ERROR: test_string_index_alias_tz_aware (test_timezones.TestTimeZoneSupportDateutil)

Traceback (most recent call last):
File "/var/tmp/portage/dev-python/pandas-9999/work/pandas-9999-python3_4/lib/pandas/tseries/tests/test_timezones.py", line 606, in test_string_index_alias_tz_aware
self.assertAlmostEqual(result, ts[2])
File "/usr/lib64/python3.4/unittest/case.py", line 821, in assertAlmostEqual
if first == second:
File "/var/tmp/portage/dev-python/pandas-9999/work/pandas-9999-python3_4/lib/pandas/core/generic.py", line 698, in nonzero
.format(self.class.name))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

INSTALLED VERSIONS

commit: None
python: 2.7.8.final.0
python-bits: 64
OS: Linux
OS-release: 3.17.4-lh-nvidia
machine: x86_64
processor: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
byteorder: little
LC_ALL: en_GB.UTF-8
LANG: en_GB.utf8

pandas: 0.15.1-196-ge51eb9e
nose: 1.3.4
Cython: 0.21.1
numpy: 1.9.1
scipy: 0.14.0
statsmodels: 0.6.1
IPython: 2.3.1
sphinx: 1.2.3
patsy: 0.3.0
dateutil: 2.3
pytz: 2014.10
bottleneck: 0.8.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: 1.6.2
xlrd: 0.9.3
xlwt: 0.7.5
xlsxwriter: 0.6.4
lxml: 3.4.1
bs4: 4.3.2
html5lib: 0.999
httplib2: 0.8
apiclient: None
rpy2: None
sqlalchemy: 0.9.8
pymysql: 0.6.2.None
psycopg2: None
None

ERROR: test_string_index_alias_tz_aware (test_timezones.TestTimeZoneSupportDateutil)

Traceback (most recent call last):
File "/var/tmp/portage/dev-python/pandas-9999/work/pandas-9999-python2_7/lib/pandas/tseries/tests/test_timezones.py", line 606, in test_string_index_alias_tz_aware
self.assertAlmostEqual(result, ts[2])
File "/usr/lib64/python2.7/unittest/case.py", line 537, in assertAlmostEqual
if first == second:
File "/var/tmp/portage/dev-python/pandas-9999/work/pandas-9999-python2_7/lib/pandas/core/generic.py", line 698, in nonzero
.format(self.class.name))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().


INSTALLED VERSIONS

commit: None
python: 3.3.5.final.0
python-bits: 64
OS: Linux
OS-release: 3.17.4-lh-nvidia
machine: x86_64
processor: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
byteorder: little
LC_ALL: en_GB.UTF-8
LANG: en_GB.utf8

pandas: 0.15.1-196-ge51eb9e
nose: 1.3.4
Cython: 0.21.1
numpy: 1.9.1
scipy: 0.14.0
statsmodels: 0.6.1
IPython: 2.3.1
sphinx: 1.2.3
patsy: 0.3.0
dateutil: 2.3
pytz: 2014.10
bottleneck: 0.8.0
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.4.2
openpyxl: 1.6.2
xlrd: 0.9.3
xlwt: None
xlsxwriter: 0.6.4
lxml: 3.4.1
bs4: 4.3.2
html5lib: 0.999
httplib2: 0.8
apiclient: None
rpy2: None
sqlalchemy: 0.9.8
pymysql: 0.6.2.None
psycopg2: None

None

ERROR: test_string_index_alias_tz_aware (test_timezones.TestTimeZoneSupportDateutil)

Traceback (most recent call last):
File "/var/tmp/portage/dev-python/pandas-9999/work/pandas-9999-python3_3/lib/pandas/tseries/tests/test_timezones.py", line 606, in test_string_index_alias_tz_aware
self.assertAlmostEqual(result, ts[2])
File "/usr/lib64/python3.3/unittest/case.py", line 665, in assertAlmostEqual
if first == second:
File "/var/tmp/portage/dev-python/pandas-9999/work/pandas-9999-python3_3/lib/pandas/core/generic.py", line 698, in nonzero
.format(self.class.name))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

@jreback
Copy link
Contributor

jreback commented Dec 7, 2014

for dateutil 2.3 might be related to #9021

@jlec you are showing several different versions of dateutil here, so very confusing. I think that this may be broken on your linux version. You can provide a debug output (e.g. run nosetests with --pdb --pdb-failure and show the variables that are being compared (you have to go up a couple of levels).

@jreback jreback added this to the 0.15.2 milestone Dec 7, 2014
@jreback jreback reopened this Dec 7, 2014
@jreback
Copy link
Contributor

jreback commented Dec 7, 2014

ok, this is ONLY on >= 2.3. The attached PR #9036 now shows the issues (was being suppressed somehow on windows).

I think the API changed in 2.3

@jlec
Copy link
Contributor Author

jlec commented Dec 8, 2014

Do you need anything from me, or is the issue clear?

@jlec
Copy link
Contributor Author

jlec commented Dec 8, 2014

This issue is also present with dateutil-2.2

https://gist.github.com/jlec/3a196d98bdf540fdda44

@jlec
Copy link
Contributor Author

jlec commented Dec 8, 2014

The requested values from the test:

result -> 2000-01-03 00:00:00-05:00 -1.566048 Freq: D, dtype: float64
ts[2] -> -1.56604761311

@jreback
Copy link
Contributor

jreback commented Dec 9, 2014

@jlec ok, give #9047 a try.

This fixes everything I have tried on windows (e.g. 2.2/2.3).

There were certain operations using dateutil timezones that were giving incorrect results (in certain cases) as the tests were not exercising all the cases. and their are a lot!.

lmk

@jreback
Copy link
Contributor

jreback commented Dec 9, 2014

@jlec did you get a chance to try #9047?

@jlec
Copy link
Contributor Author

jlec commented Dec 10, 2014

Latest HEAD plus #9047 with python-dateutil-2.3: https://gist.github.com/jlec/ca1f2fb9d383faacaef6
Latest HEAD plus #9047 with python-dateutil-2.2: https://gist.github.com/jlec/a4a3930d174327458c1e

@jlec
Copy link
Contributor Author

jlec commented Dec 10, 2014

With dateutil-2.3 there is

test_append_with_timezones_dateutil (pandas.io.tests.test_pytables.TestHDFStore) ... /usr/lib64/python2.7/site-packages/dateutil/zoneinfo/init.py:36: UserWarning: I/O error(2): No such file or directory
warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))
FAIL

which is a simple FAIL with 2.2

Beside that the testfailures are the same for both dateutil versions

@jlec
Copy link
Contributor Author

jlec commented Dec 10, 2014

PR #9047 doesn't change anything in the test result. I tested all combinations of HEAD+/-#9047 with dateutil-2.2/2.3. The failures are always the same.

@jreback
Copy link
Contributor

jreback commented Dec 10, 2014

import dateutil
print dateutil.__version__

from dateutil.tz import gettz
from dateutil.zoneinfo import gettz as gettz2

print gettz('US/Eastern')
print gettz2('US/Eastern')

pls run this and report on 2.2 and 2.3 under python 2.7

@jreback jreback modified the milestones: 0.16.0, 0.15.2 Dec 10, 2014
@jreback
Copy link
Contributor

jreback commented Dec 11, 2014

@jlec see this report as well: #9059

I suspect that your kernel moved around tz files and dateutil is not finding them (as compared to an older version of the kernel).

@jlec jlec changed the title veriosn 0.15.0 test failure test_string_index_alias_tz_aware (pandas.tseries.tests.test_timezones.TestTimeZoneSupportDateutil) pandas-0.15.0 test failure test_string_index_alias_tz_aware (pandas.tseries.tests.test_timezones.TestTimeZoneSupportDateutil) Dec 19, 2014
jlec added a commit to jlec/pandas that referenced this issue Dec 21, 2014
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue Feb 23, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
@jreback jreback modified the milestones: 0.16.0, 0.16.1 Mar 6, 2015
@jreback jreback modified the milestones: 0.17.0, 0.16.1 Apr 21, 2015
jlec added a commit to jlec/pandas that referenced this issue May 10, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 10, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 12, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 12, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 13, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 13, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 15, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 15, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 15, 2015
zoneinfo.gettz() seems to have problems (1 & 2) on system which do not install
the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system
zoneinfo files. This results in test failures (3 & 4)
tz.gettz() doesn't suffer from this problem.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 15, 2015
python-dateutil provides two implementations for gettz(), tz.gettz() and
zoneinfo.gettz(). The former tries first to use system provided timezone data,
where as the later always uses a bundled tarball. Upstreams recommandation
for library consumers is only using tz.gettz() (1 & 2). Further more, on
system which do not install the zoninfo tarball (e.g. Debian, Gentoo and
Fedora) but rely on the system zoneinfo files the direct usage of
zoneinfo.gettz() creates problems which result in test failures (3 - 6).

For compatibility in pandas code

    pandas.tslib._dateutil_gettz()

should be used.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639
5 pandas-dev#10121
6 pandas-dev#9663

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 15, 2015
python-dateutil provides two implementations for gettz(), tz.gettz() and
zoneinfo.gettz(). The former tries first to use system provided timezone data,
where as the later always uses a bundled tarball. Upstreams recommandation
for library consumers is only using tz.gettz() (1 & 2). Further more, on
system which do not install the zoninfo tarball (e.g. Debian, Gentoo and
Fedora) but rely on the system zoneinfo files the direct usage of
zoneinfo.gettz() creates problems which result in test failures (3 - 6).

For compatibility in pandas code

    pandas.tslib._dateutil_gettz()

should be used.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639
5 pandas-dev#10121
6 pandas-dev#9663

Signed-off-by: Justin Lecher <jlec@gentoo.org>
jlec added a commit to jlec/pandas that referenced this issue May 15, 2015
python-dateutil provides two implementations for gettz(), tz.gettz() and
zoneinfo.gettz(). The former tries first to use system provided timezone data,
where as the later always uses a bundled tarball. Upstreams recommandation
for library consumers is only using tz.gettz() (1 & 2). Further more, on
system which do not install the zoninfo tarball (e.g. Debian, Gentoo and
Fedora) but rely on the system zoneinfo files the direct usage of
zoneinfo.gettz() creates problems which result in test failures (3 - 6).

For compatibility in pandas code

    pandas.tslib._dateutil_gettz()

should be used.

1 dateutil/dateutil#8
2 dateutil/dateutil#11
3 pandas-dev#9059
4 pandas-dev#8639
5 pandas-dev#10121
6 pandas-dev#9663

Signed-off-by: Justin Lecher <jlec@gentoo.org>
@jorisvandenbossche jorisvandenbossche modified the milestones: 0.17.0, 0.16.2 Jun 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants