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
As reported at pendulum, there are cases where creating a date_range fails with a segfault: pendulum issues 131.
Code Sample
fromdatetimeimportdatetime, timedeltafrompendulum.tz.timezoneimportUTCTimezonefrompendulum.tz.timezone_infoimportUTCimportpandasaspdtomorrow=datetime.now() +timedelta(hours=24)
now=datetime.now()
r=pd.date_range(now, tomorrow, freq='1H')
r.tz=UTC# prints out the current date and timeprint(r[0])
r.tz=UTCTimezone# seg faultsprint(r[0])
Problem description
As I understand it is allowed for tzinfo objects to return None for utcoffset according to the Python docs. However, in _get_dst_info of tslib it is assumed not to return None. As I understand from the aforementioned pendulum ticket, it is correct to return None in this case.
@jreback sorry, missed that one. Still think that it would be good if pandas doesn't segfault on a valid response from a timezone object (valid as in that according to the python docs a timezone object is allowed to return None).
@frensjan if you want to make a PR that uses a mock timezone object would be great.
Still think that it would be good if pandas doesn't segfault on a valid response from a timezone object (valid as in that according to the python docs a timezone object is allowed to return None).
As reported at pendulum, there are cases where creating a
date_range
fails with a segfault: pendulum issues 131.Code Sample
Problem description
As I understand it is allowed for
tzinfo
objects to returnNone
forutcoffset
according to the Python docs. However, in _get_dst_info oftslib
it is assumed not to returnNone
. As I understand from the aforementionedpendulum
ticket, it is correct to returnNone
in this case.Output of
pd.show_versions()
pandas: 0.20.3
pytest: 3.1.3
pip: 9.0.1
setuptools: 25.1.1
Cython: None
numpy: 1.13.1
scipy: 0.19.1
xarray: None
IPython: 6.1.0
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.6.0
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: