Skip to content

MAINT: Condense TIMEZONE_IDS construction #26600

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 1 commit into from
Jun 6, 2019

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Jun 1, 2019

Follow-up to #26596

@gfyoung gfyoung added Testing pandas testing functions or related to the test suite Clean labels Jun 1, 2019
@gfyoung gfyoung added this to the 0.25.0 milestone Jun 1, 2019
@codecov
Copy link

codecov bot commented Jun 1, 2019

Codecov Report

Merging #26600 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26600      +/-   ##
==========================================
- Coverage   91.87%   91.86%   -0.01%     
==========================================
  Files         174      174              
  Lines       50661    50661              
==========================================
- Hits        46547    46542       -5     
- Misses       4114     4119       +5
Flag Coverage Δ
#multiple 90.4% <ø> (ø) ⬆️
#single 41.76% <ø> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 97% <0%> (-0.12%) ⬇️
pandas/util/testing.py 90.6% <0%> (-0.11%) ⬇️

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 891a419...d51f7e2. Read the comment docs.

@h-vetinari
Copy link
Contributor

@gfyoung @jreback this is IMO a step back - several of these objects don't have nice str/reprs, and it really makes sense to invest the extra 4(!) lines to have a clean output of pytest -v.

Comparing master vs this PR with the following dummy test:

def test_demo_tz_id(tz_aware_fixture):
    pass

this is the state of master:

test_demo_tz_id[UTC] PASSED                                                                   [  7%]
test_demo_tz_id[US/Eastern] PASSED                                                            [ 15%]
test_demo_tz_id[Asia/Tokyp] PASSED                                                            [ 23%]
test_demo_tz_id[dateutil/US/Pacific] PASSED                                                   [ 30%]
test_demo_tz_id[dateutil/Asia/Singapore] PASSED                                               [ 38%]
test_demo_tz_id[dateutil.tz.tzutz()] PASSED                                                   [ 46%]
test_demo_tz_id[dateutil.tz.tzlocal()] PASSED                                                 [ 53%]
test_demo_tz_id[pytz.FixedOffset(300)] PASSED                                                 [ 61%]
test_demo_tz_id[pytz.FixedOffset(0)] PASSED                                                   [ 69%]
test_demo_tz_id[pytz.FixedOffset(-300)] PASSED                                                [ 76%]
test_demo_tz_id[datetime.timezone.utc] PASSED                                                 [ 84%]
test_demo_tz_id[datetime.timezone.+1] PASSED                                                  [ 92%]
test_demo_tz_id[datetime.timezone.-1.named] PASSED                                            [100%]

resp. of this PR:

test_demo_tz_id[UTC] PASSED                                                                   [  7%]
test_demo_tz_id[US/Eastern] PASSED                                                            [ 15%]
test_demo_tz_id[Asia/Tokyo] PASSED                                                            [ 23%]
test_demo_tz_id[dateutil/US/Pacific] PASSED                                                   [ 30%]
test_demo_tz_id[dateutil/Asia/Singapore] PASSED                                               [ 38%]
test_demo_tz_id[tzutc()] PASSED                                                               [ 46%]
test_demo_tz_id[tzlocal()] PASSED                                                             [ 53%]
test_demo_tz_id[pytz.FixedOffset(300)] PASSED                                                 [ 61%]
test_demo_tz_id[<UTC>] PASSED                                                                 [ 69%]
test_demo_tz_id[pytz.FixedOffset(-300)] PASSED                                                [ 76%]
test_demo_tz_id[datetime.timezone.utc] PASSED                                                 [ 84%]
test_demo_tz_id[datetime.timezone(datetime.timedelta(seconds=3600))] PASSED                   [ 92%]
test_demo_tz_id[datetime.timezone(datetime.timedelta(days=-1, seconds=82800), 'foo')] PASSED  [100%]

In tests with more fixtures (like I'm working on in #25637), this would make the output absurdly wide.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments

@gfyoung gfyoung force-pushed the condense-timezone-ids branch from c7293f4 to ebf7069 Compare June 1, 2019 17:47
@gfyoung gfyoung force-pushed the condense-timezone-ids branch from ebf7069 to 8fba225 Compare June 1, 2019 18:27
@gfyoung
Copy link
Member Author

gfyoung commented Jun 1, 2019

@jreback : If you could have another look. The failures seem unrelated...

(e.g. see this build here for a branch that I made off of master just now)

@gfyoung gfyoung force-pushed the condense-timezone-ids branch from 26f3b8a to 9e799cb Compare June 2, 2019 18:00
@gfyoung
Copy link
Member Author

gfyoung commented Jun 2, 2019

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=12180

Really not sure why numpy and scipy aren't playing nice together. They're the same versions as in this passing build on latest master:

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=12180

@jreback
Copy link
Contributor

jreback commented Jun 2, 2019

@gfyoung weird, can you merge master and repush and see

@gfyoung gfyoung force-pushed the condense-timezone-ids branch from 9e799cb to 1ab924e Compare June 3, 2019 00:19
@gfyoung
Copy link
Member Author

gfyoung commented Jun 3, 2019

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=12207

@jreback : Alas, no luck after merging and repushing

@gfyoung gfyoung force-pushed the condense-timezone-ids branch 4 times, most recently from 6bfa177 to a7ec6bd Compare June 5, 2019 00:10
@gfyoung
Copy link
Member Author

gfyoung commented Jun 5, 2019

@jreback : It seems that dropping the fixture decorator is causing issues with that one Azure case. Why that's the case? No idea - it's quite bizarre.

I'm inclined to just use repr to generate TIMEZONE_IDS for the time being, and we can then see later what's happening with that decorator.

Thoughts?

@jreback
Copy link
Contributor

jreback commented Jun 5, 2019

@gfyoung sounds fine

@gfyoung gfyoung force-pushed the condense-timezone-ids branch from 4d496cc to bb12ff5 Compare June 5, 2019 19:47
@gfyoung gfyoung force-pushed the condense-timezone-ids branch from bb12ff5 to d51f7e2 Compare June 6, 2019 00:34
@gfyoung
Copy link
Member Author

gfyoung commented Jun 6, 2019

@jreback : Everything is cleaned up and green. PTAL.

@jreback jreback merged commit 78ba7fc into pandas-dev:master Jun 6, 2019
@jreback
Copy link
Contributor

jreback commented Jun 6, 2019

thanks @gfyoung

@gfyoung gfyoung deleted the condense-timezone-ids branch June 6, 2019 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants