Title: Fix _is_tensorflow_array. by anntzer · Pull Request #30114 · matplotlib/matplotlib · GitHub
Open Graph Title: Fix _is_tensorflow_array. by anntzer · Pull Request #30114 · matplotlib/matplotlib
X Title: Fix _is_tensorflow_array. by anntzer · Pull Request #30114 · matplotlib/matplotlib
Description: The previous implementation was clearly wrong (the isinstance check would raise TypeError as the second argument would be a bool), but the tests didn't catch that because the bug led to _is_tensorflow_array returning False, then _unpack_to_numpy returning the original input, and then assert_array_equal implicitly converting result by calling __array__ on it. Fix the test by explicitly checking that result is indeed a numpy array, and also fix _is_tensorflow_array with more restrictive exception catching (also applied to _is_torch_array, _is_jax_array, and _is_pandas_dataframe, while we're at it). PR summary PR checklist "closes #0000" is in the body of the PR description to link the related issue new and changed code is tested Plotting related features are demonstrated in an example New Features and API Changes are noted with a directive and release note Documentation complies with general and docstring guidelines
Open Graph Description: The previous implementation was clearly wrong (the isinstance check would raise TypeError as the second argument would be a bool), but the tests didn't catch that because the bug led to _is_ten...
X Description: The previous implementation was clearly wrong (the isinstance check would raise TypeError as the second argument would be a bool), but the tests didn't catch that because the bug led to _is...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/30114
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0eba1ba8-c0b1-d329-9dbe-47c3096f0950 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A52C:13B2CF:72C986:9A906C:6A51D600 |
| html-safe-nonce | eb68cdc6a227579a2b64b4d389cc33ac1a181b564a1ed8c5ee1145eea9991a09 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTJDOjEzQjJDRjo3MkM5ODY6OUE5MDZDOjZBNTFENjAwIiwidmlzaXRvcl9pZCI6Ijg5MjM3MzU4MDU2MDE2MzM3OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8626224453ed1b124e361bbea11fa3f3262bba36519372f4ce7221901c942787 |
| hovercard-subject-tag | pull_request:2546488018 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/30114/files |
| twitter:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1322974?s=400&v=4 |
| og:image:alt | The previous implementation was clearly wrong (the isinstance check would raise TypeError as the second argument would be a bool), but the tests didn't catch that because the bug led to _is_ten... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width