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

REF: Fix maybe_promote #25425

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
bf05e4c
TST: add test coverage for maybe_promote
h-vetinari Feb 24, 2019
60889ea
REF: refactor and fix maybe_promote
h-vetinari Feb 24, 2019
6792a54
Fix remaining failures
h-vetinari Feb 24, 2019
c6043cb
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Feb 24, 2019
8d9a3b7
Forgot to flake
h-vetinari Feb 24, 2019
b903d2e
Another try at int2int...
h-vetinari Feb 24, 2019
91e6673
Last one?
h-vetinari Feb 24, 2019
1a9d6a1
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Mar 10, 2019
c0a3a4e
Review (jbrockmendel)
h-vetinari Mar 10, 2019
2d3a3ba
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Jun 23, 2019
ce0efda
lint
h-vetinari Jun 23, 2019
e67dd99
reduce diff
h-vetinari Jun 23, 2019
7cec643
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Jun 28, 2019
321f08d
review (jbrockmendel)
h-vetinari Jun 28, 2019
5c5e0f1
fix isort
h-vetinari Jun 28, 2019
bfb8a2f
fix docstring example
h-vetinari Jun 28, 2019
088787e
remove unicode from possible returns of infer_dtype
h-vetinari Jun 28, 2019
bf12d67
perf: only compute max if necessary
h-vetinari Jun 28, 2019
d9bbf07
update comment
h-vetinari Jun 28, 2019
0f1ff5f
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Jul 26, 2019
076926e
format with black
h-vetinari Jul 26, 2019
06e22a3
remove usage of deprecated .real/.imag
h-vetinari Jul 26, 2019
0f8f064
lint
h-vetinari Jul 26, 2019
98c584e
work around GH 27610
h-vetinari Jul 26, 2019
231d8a6
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Jul 28, 2019
2fa6831
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Sep 9, 2019
1cbd5c0
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Sep 21, 2019
32d8a2b
Review (jbrockmendel)
h-vetinari Sep 21, 2019
2a8691a
minor comment improvements/cleanups
h-vetinari Sep 21, 2019
d5aa77b
exploration: check if array-case is required
h-vetinari Sep 22, 2019
fa347b6
Revert "exploration: check if array-case is required"
h-vetinari Sep 22, 2019
8aab981
A painful merge
h-vetinari Oct 28, 2019
82ec973
adapt array-path to new test behaviour
h-vetinari Oct 28, 2019
3c5c3e0
Merge remote-tracking branch 'upstream/master' into fix_maybe_promote
h-vetinari Oct 29, 2019
b5eb1c4
lint: isort
h-vetinari Oct 29, 2019
3976220
catch irrelevant warning
h-vetinari Oct 29, 2019
b8cd4f0
fix outdated iNaT-documentation
h-vetinari Oct 29, 2019
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
65 changes: 58 additions & 7 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,28 +367,39 @@ def unique_nulls_fixture(request):
TIMEZONES = [None, 'UTC', 'US/Eastern', 'Asia/Tokyo', 'dateutil/US/Pacific',
'dateutil/Asia/Singapore', tzutc(), tzlocal(), FixedOffset(300),
FixedOffset(0), FixedOffset(-300)]
TIMEZONE_IDS = ['None', 'UTC', 'US/Eastern', 'Asia/Tokyp',
'dateutil/US/Pacific', 'dateutil/Asia/Singapore',
'dateutil.tz.tzutz()', 'dateutil.tz.tzlocal()',
'pytz.FixedOffset(300)', 'pytz.FixedOffset(0)',
'pytz.FixedOffset(-300)']


@td.parametrize_fixture_doc(str(TIMEZONES))
@pytest.fixture(params=TIMEZONES)
@td.parametrize_fixture_doc(str(TIMEZONE_IDS))
@pytest.fixture(params=TIMEZONES, ids=TIMEZONE_IDS)
def tz_naive_fixture(request):
"""
Fixture for trying timezones including default (None): {0}
"""
return request.param


@td.parametrize_fixture_doc(str(TIMEZONES[1:]))
@pytest.fixture(params=TIMEZONES[1:])
@td.parametrize_fixture_doc(str(TIMEZONE_IDS[1:]))
@pytest.fixture(params=TIMEZONES[1:], ids=TIMEZONE_IDS[1:])
def tz_aware_fixture(request):
"""
Fixture for trying explicit timezones: {0}
"""
return request.param


# Generate cartesian product of tz_aware_fixture:
tz_aware_fixture2 = tz_aware_fixture


# ----------------------------------------------------------------
# Dtypes


UNSIGNED_INT_DTYPES = ["uint8", "uint16", "uint32", "uint64"]
UNSIGNED_EA_INT_DTYPES = ["UInt8", "UInt16", "UInt32", "UInt64"]
SIGNED_INT_DTYPES = [int, "int8", "int16", "int32", "int64"]
Expand All @@ -400,16 +411,16 @@ def tz_aware_fixture(request):
COMPLEX_DTYPES = [complex, "complex64", "complex128"]
STRING_DTYPES = [str, 'str', 'U']

DATETIME_DTYPES = ['datetime64[ns]', 'M8[ns]']
TIMEDELTA_DTYPES = ['timedelta64[ns]', 'm8[ns]']
DATETIME64_DTYPES = ['datetime64[ns]', 'M8[ns]']
TIMEDELTA64_DTYPES = ['timedelta64[ns]', 'm8[ns]']

BOOL_DTYPES = [bool, 'bool']
BYTES_DTYPES = [bytes, 'bytes']
OBJECT_DTYPES = [object, 'object']

ALL_REAL_DTYPES = FLOAT_DTYPES + ALL_INT_DTYPES
ALL_NUMPY_DTYPES = (ALL_REAL_DTYPES + COMPLEX_DTYPES + STRING_DTYPES
+ DATETIME_DTYPES + TIMEDELTA_DTYPES + BOOL_DTYPES
+ DATETIME64_DTYPES + TIMEDELTA64_DTYPES + BOOL_DTYPES
+ OBJECT_DTYPES + BYTES_DTYPES * PY3) # bytes only for PY3


Expand All @@ -424,6 +435,46 @@ def string_dtype(request):
return request.param


@pytest.fixture(params=BYTES_DTYPES)
def bytes_dtype(request):
"""Parametrized fixture for bytes dtypes.

* bytes
* 'bytes'
"""
return request.param


@pytest.fixture(params=OBJECT_DTYPES)
def object_dtype(request):
"""Parametrized fixture for object dtypes.

* object
* 'object'
"""
return request.param


@pytest.fixture(params=DATETIME64_DTYPES)
def datetime64_dtype(request):
"""Parametrized fixture for datetime/timedelta dtypes.

* 'datetime64[ns]'
* 'M8[ns]'
"""
return request.param


@pytest.fixture(params=TIMEDELTA64_DTYPES)
def timedelta64_dtype(request):
"""Parametrized fixture for datetime/timedelta dtypes.

* 'timedelta64[ns]'
* 'm8[ns]'
"""
return request.param


@pytest.fixture(params=FLOAT_DTYPES)
def float_dtype(request):
"""
Expand Down
Loading