COMPAT: avoid invalid buffer comparisions
closes #18064

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=h1) Report
> Merging [#18252](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/6b8474a0f52ce04fa7225fe3aff67ce64a9734cb?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18252      +/-   ##
==========================================
+ Coverage    91.4%   91.41%   +<.01%     
==========================================
  Files         164      164              
  Lines       50100    50100              
==========================================
+ Hits        45796    45799       +3     
+ Misses       4304     4301       -3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.23% <ø> (+0.02%)` | :arrow_up: |
| #single | `39.52% <ø> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `65.2% <0%> (+1.81%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18252?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/18252?src=pr&el=footer). Last update [6b8474a...b5ca2e1](https://codecov.io/gh/pandas-dev/pandas/pull/18252?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/18252?src=pr&el=h1) Report
> Merging [#18252](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/6b8474a0f52ce04fa7225fe3aff67ce64a9734cb?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #18252      +/-   ##
==========================================
+ Coverage    91.4%   91.41%   +<.01%     
==========================================
  Files         164      164              
  Lines       50100    50100              
==========================================
+ Hits        45796    45799       +3     
+ Misses       4304     4301       -3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.23% <ø> (+0.02%)` | :arrow_up: |
| #single | `39.52% <ø> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.8% <0%> (-0.1%)` | :arrow_down: |
| [pandas/plotting/\_converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=tree#diff-cGFuZGFzL3Bsb3R0aW5nL19jb252ZXJ0ZXIucHk=) | `65.2% <0%> (+1.81%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18252?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/18252?src=pr&el=footer). Last update [6b8474a...b5ca2e1](https://codecov.io/gh/pandas-dev/pandas/pull/18252?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
 I don't see merged pull request #18252 in the 0.22.0 milestone even though @jreback said he added it to that milestone.  Did I miss this pull request in the 0.22.0 milestone?  The [Tax-Calculator project](https://github.com/open-source-economics/Tax-Calculator) is having difficulties with this and is looking forward to a fix in the 0.22.0 release of Pandas.

@hdoupe If you scroll up you will see that this PR is tagged with the 0.22 milestone. Or do you mean something else? 
But, as far as I know this is a rather internal fix-up PR, without reported user facing problems. If that is the case, can you specify the issues you have with this? (because if that is the case, we could consider tagging this for 0.21.1) @jorisvandenbossche,  Thanks for you quick response in which you said:
> If you scroll up you will see that this PR is tagged with the 0.22 milestone. Or do you mean something else?

Yes, I see the mention of 0.22  in the pull request, but I didn't see it listed in the 0.22 milestone list [here](https://github.com/pandas-dev/pandas/milestone/53).
Maybe I missed it or I'm confused. @jorisvandenbossche, Sorry for my confusion, but I now see #18252 on the fifth page of the merged pull requests in the 0.22 milestone.  Guess 0.22 is scheduled for early January 2018 distribution.

@hdoupe But still, how is this affecting your code? 
That would be interesting to know, so we can actually test for that @jorisvandenbossche asked:
> But still, how is this affecting your code? 
> That would be interesting to know, so we can actually test for that.

We are having what I hope are just cosmetic problems: we are getting the following kind of **ignored** error message:
```
ValueError: Buffer dtype mismatch, expected 'Python object' but got 'long'
Exception ValueError: "Buffer dtype mismatch, expected 'Python object' but got 'long'" in 'pandas._libs.lib.is_bool_array' ignored
```
 OK, then it is the same issue, but there is no problem in the actual behaviour. @jorisvandenbossche said:
> OK, then it is the same issue, **but there is no problem in the actual behaviour**.

Yes, that's what we hope.  We'll see if the Pandas change in #18252 makes the ignored error messages go away when we move to Pandas 0.22.  If they don't, then we'll have to look at our code more carefully.

Thanks for your quick and thorough responses to my questions.

cc @hdoupe
 I'm still getting the error.  :( @bplant17 if you still have a problem, please open an new issue with more information