ENH: Support multiple opening hours intervals for BusinessHour
State: closed

- [x] closes #15481
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I'm not sure why, but after rebasing on latest master my previous PR #26400 is automatically closed. So I created a new PR here. I have edited as per all the comments there.

Labels:
name: Enhancement
name: Datetime
description: Datetime data dtype

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=h1) Report
> Merging [#26628](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/23b0788118bd95bdf1adb8f86d667fa54a033423?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26628/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #26628   +/-   ##
=======================================
  Coverage   91.88%   91.88%           
=======================================
  Files         174      174           
  Lines       50692    50729   +37     
=======================================
+ Hits        46576    46610   +34     
- Misses       4116     4119    +3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.41% <100%> (ø)` | :arrow_up: |
| #single | `41.83% <33.67%> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/26628/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `96.87% <100%> (+0.18%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26628/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26628/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97% <0%> (-0.12%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=footer). Last update [23b0788...170d08b](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@deffee6`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26628/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master   #26628   +/-   ##
=========================================
  Coverage          ?   91.72%           
=========================================
  Files             ?      178           
  Lines             ?    50808           
  Branches          ?        0           
=========================================
  Hits              ?    46605           
  Misses            ?     4203           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.32% <100%> (?)` | |
| #single | `41.23% <32.63%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/26628/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `96.85% <100%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=footer). Last update [deffee6...6b72cea](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Can you reopen the original PR and push this back there? Would be preferable to maintain comment history
Unfortunately I don't have the permission to reopen PR.
Hmm OK. Doesn't look like I can reopen either. Not sure entirely what happened but I do see it was pushed to your master there - would be best practice going forward to not push to master as an FYI
@WillAyd thanks for the advice. Any comment on the code changes?
cc @gfyoung and @mroeschke  who were already looking at original PR
Hello @howsiwei! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-06-28 12:36:49 UTC
we need to split test_offsets.py as its getting huge (can be after this PR).

cc @pandas-dev/pandas-core 
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@de22a48`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `98.92%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26628/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master   #26628   +/-   ##
=========================================
  Coverage          ?   92.04%           
=========================================
  Files             ?      180           
  Lines             ?    50741           
  Branches          ?        0           
=========================================
  Hits              ?    46704           
  Misses            ?     4037           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.68% <98.92%> (?)` | |
| #single | `41.88% <30.1%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/26628/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `96.45% <98.92%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=footer). Last update [de22a48...71f82c3](https://codecov.io/gh/pandas-dev/pandas/pull/26628?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Minor comments, generally looks good.
@howsiwei small change and can you merge master; ping on green.
thanks @howsiwei nice patch!