Skip to content

Commit 6f278d4

Browse files
Merge remote-tracking branch 'upstream/master' into typing
2 parents 2f38139 + 656db16 commit 6f278d4

35 files changed

+594
-484
lines changed

ci/deps/travis-36-cov.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies:
2929
- python-snappy
3030
- python=3.6.*
3131
- pytz
32-
- s3fs
32+
- s3fs<0.3
3333
- scikit-learn
3434
- scipy
3535
- sqlalchemy

ci/deps/travis-36-slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- python-dateutil
1919
- python=3.6.*
2020
- pytz
21-
- s3fs
21+
- s3fs<0.3
2222
- scipy
2323
- sqlalchemy
2424
- xlrd

ci/deps/travis-37.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
- pytest-xdist>=1.29.0
1818
- pytest-mock
1919
- hypothesis>=3.58.0
20-
- s3fs
20+
- s3fs<0.3
2121
- pip
2222
- pyreadstat
2323
- pip:

doc/source/whatsnew/v1.0.0.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Timezones
199199
Numeric
200200
^^^^^^^
201201
- Bug in :meth:`DataFrame.quantile` with zero-column :class:`DataFrame` incorrectly raising (:issue:`23925`)
202-
-
202+
- :class:`DataFrame` inequality comparisons with object-dtype and ``complex`` entries failing to raise ``TypeError`` like their :class:`Series` counterparts (:issue:`28079`)
203203
-
204204

205205
Conversion
@@ -279,6 +279,7 @@ Reshaping
279279

280280
- Bug in :meth:`DataFrame.apply` that caused incorrect output with empty :class:`DataFrame` (:issue:`28202`, :issue:`21959`)
281281
- Bug in :meth:`DataFrame.stack` not handling non-unique indexes correctly when creating MultiIndex (:issue: `28301`)
282+
- Bug :func:`merge_asof` could not use :class:`datetime.timedelta` for ``tolerance`` kwarg (:issue:`28098`)
282283

283284
Sparse
284285
^^^^^^

pandas/_libs/tslibs/conversion.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ cdef _TSObject convert_str_to_tsobject(object ts, object tz, object unit,
519519
try:
520520
ts = parse_datetime_string(ts, dayfirst=dayfirst,
521521
yearfirst=yearfirst)
522-
except Exception:
522+
except (ValueError, OverflowError):
523523
raise ValueError("could not convert string to Timestamp")
524524

525525
return convert_to_tsobject(ts, tz, unit, dayfirst, yearfirst)

pandas/_libs/tslibs/parsing.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ cdef parse_datetime_string_with_reso(date_string, freq=None, dayfirst=False,
309309
parsed, reso = dateutil_parse(date_string, _DEFAULT_DATETIME,
310310
dayfirst=dayfirst, yearfirst=yearfirst,
311311
ignoretz=False, tzinfos=None)
312-
except Exception as e:
312+
except (ValueError, OverflowError) as err:
313313
# TODO: allow raise of errors within instead
314-
raise DateParseError(e)
314+
raise DateParseError(err)
315315
if parsed is None:
316316
raise DateParseError("Could not parse {dstr}".format(dstr=date_string))
317317
return parsed, parsed, reso

pandas/core/arrays/datetimes.py

+3
Original file line numberDiff line numberDiff line change
@@ -1918,6 +1918,9 @@ def sequence_to_dt64ns(
19181918
tz = validate_tz_from_dtype(dtype, tz)
19191919

19201920
if isinstance(data, ABCIndexClass):
1921+
if data.nlevels > 1:
1922+
# Without this check, data._data below is None
1923+
raise TypeError("Cannot create a DatetimeArray from a MultiIndex.")
19211924
data = data._data
19221925

19231926
# By this point we are assured to have either a numpy array or Index

pandas/core/indexes/datetimelike.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ def equals(self, other):
198198
elif not isinstance(other, type(self)):
199199
try:
200200
other = type(self)(other)
201-
except Exception:
201+
except (ValueError, TypeError, OverflowError):
202+
# e.g.
203+
# ValueError -> cannot parse str entry, or OutOfBoundsDatetime
204+
# TypeError -> trying to convert IntervalIndex to DatetimeIndex
205+
# OverflowError -> Index([very_large_timedeltas])
202206
return False
203207

204208
if not is_dtype_equal(self.dtype, other.dtype):

0 commit comments

Comments
 (0)