Commit 37554fa
committed
Add test for range_timestamp_dtype in type_mapper
This commit adds a new test case to `tests/unit/test__pandas_helpers.py`
to cover the `range_timestamp_dtype` branch in the `default_types_mapper`
function.
Due to issues importing `RangeTIMESTAMPDtype` directly, a mock class
(`MockRangeTSDtype`) was used to simulate the necessary `pyarrow_dtype`
attribute for the test. This ensures the logic of the `default_types_mapper`
for `range_timestamp_dtype` is correctly tested.
The `pragma: NO COVER` comment associated with this branch in
`google/cloud/bigquery/_pandas_helpers.py` has been removed as the
branch is now covered by this new test.
All existing tests continue to pass.1 parent b863291 commit 37554fa
File tree
2 files changed
+47
-1
lines changed- google/cloud/bigquery
- tests/unit
2 files changed
+47
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
1294 | 1295 | | |
1295 | 1296 | | |
1296 | 1297 | | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1297 | 1343 | | |
1298 | 1344 | | |
1299 | 1345 | | |
| |||
0 commit comments