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

PERF: changed default value of cache parameter to True in to_datetime function #26043

Merged
merged 22 commits into from Jul 4, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

fix bug when 'check_count' == 0

  • Loading branch information...
anmyachev committed Jun 10, 2019
commit 14ef1f23f8593dd63a81cf0f6dc6b531db32534b
@@ -54,18 +54,21 @@ def should_cache(arg, check_count: int, unique_share: float):
----------
arg: listlike, tuple, 1-d array, Series
check_count: int
0 < check_count <= len(arg)
0 <= check_count <= len(arg)
unique_share: float
This conversation was marked as resolved by anmyachev

This comment has been minimized.

Copy link
@jreback

jreback Jun 9, 2019

Contributor

give bounds on these values

0 < unique_share < 1
Returns
-------
do_caching: bool
"""
assert 0 < check_count <= len(arg), ('check_count must be in next bounds: '
'(0; len(arg)]')
assert 0 <= check_count <= len(arg), ('check_count must be in next bounds:'
' [0; len(arg)]')
assert 0 < unique_share < 1, 'unique_share must be in next bounds: (0; 1)'

if check_count == 0:
return False

do_caching = True

unique_elements = unique(arg[:check_count])
@@ -2044,7 +2044,7 @@ def test_should_cache(listlike, do_caching):


@pytest.mark.parametrize('check_count,unique_share, err_message', [
(11, 0.5, r'check_count must be in next bounds: \(0; len\(arg\)]'),
(11, 0.5, r'check_count must be in next bounds: [0; len\(arg\)]'),
(10, 2, r'unique_share must be in next bounds: \(0; 1\)')
])
def test_should_cache_errors(check_count, unique_share, err_message):
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.