Skip to content

dtype validation from 24024 #24478

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

Merged
merged 2 commits into from
Dec 29, 2018
Merged

Conversation

jbrockmendel
Copy link
Member

Fix tests in tests_datetimelike that are passing incorrect freqs

Implements some but not all of the dtype-validation tests in #24024; retains extant error messages instead of those raises in 24024.

Some stream-lining could be done if we change the behavior of validate_tz_from_dtype, which includes:

            try:
                dtype = DatetimeTZDtype.construct_from_string(dtype)
            except TypeError:
                # Things like `datetime64[ns]`, which is OK for the
                # constructors, but also nonsense, which should be validated
                # but not by us. We *do* allow non-existent tz errors to
                # go through
                pass

We could merge _validate_dt64_dtype into this really easily by changing these lines to just call dtype = pandas_dtype(dtype), but that would raise on non-existent tz, which current policy allows.

@codecov
Copy link

codecov bot commented Dec 29, 2018

Codecov Report

Merging #24478 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24478      +/-   ##
==========================================
- Coverage   92.32%   92.32%   -0.01%     
==========================================
  Files         166      166              
  Lines       52298    52305       +7     
==========================================
+ Hits        48285    48288       +3     
- Misses       4013     4017       +4
Flag Coverage Δ
#multiple 90.74% <100%> (-0.01%) ⬇️
#single 43.07% <66.66%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/reshape/tile.py 94.82% <100%> (ø) ⬆️
pandas/core/arrays/datetimes.py 97.59% <100%> (-0.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80295f9...999f34f. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 29, 2018

Codecov Report

Merging #24478 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24478      +/-   ##
==========================================
- Coverage   92.32%   92.31%   -0.01%     
==========================================
  Files         166      166              
  Lines       52328    52335       +7     
==========================================
+ Hits        48310    48313       +3     
- Misses       4018     4022       +4
Flag Coverage Δ
#multiple 90.73% <100%> (-0.01%) ⬇️
#single 43.05% <66.66%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/reshape/tile.py 94.82% <100%> (ø) ⬆️
pandas/core/arrays/datetimes.py 97.77% <100%> (-0.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f83627...24755d6. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Dec 29, 2018

can you merge master

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays. labels Dec 29, 2018
@jreback jreback added this to the 0.24.0 milestone Dec 29, 2018
@jreback
Copy link
Contributor

jreback commented Dec 29, 2018

lgtm ping on green.

@jbrockmendel
Copy link
Member Author

ping

@jreback jreback merged commit 70bc919 into pandas-dev:master Dec 29, 2018
@jbrockmendel jbrockmendel deleted the dtype_check branch December 29, 2018 16:49
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants