Commit 74f7a41
authored
fix(sqlalchemy-bigquery): update literal binds test for SQLAlchemy 2.0 (googleapis#17029)
This PR fixes the sqlalchemy-bigquery portion of Issue googleapis#16042.
Problem:
`test_compiled_query_literal_binds` was skipped for SQLAlchemy >= 2.0
because it was failing. The failure occurs because in SQLAlchemy 2.0,
`Connection.execute()` expects an executable object or a string (wrapped
in `text()`), and passing a `Compiled` object directly is no longer
supported.
Fix:
- Removed the skip condition for SQLAlchemy >= 2.0.
- Modified the test to wrap the compiled query string in
`sqlalchemy.text()` before passing it to `conn.execute()`.
This allows the test to run and pass on SQLAlchemy 2.0.1 parent 9f1e4e2 commit 74f7a41
1 file changed
Lines changed: 8 additions & 6 deletions
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | 484 | | |
489 | 485 | | |
490 | 486 | | |
491 | 487 | | |
492 | 488 | | |
493 | 489 | | |
494 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
495 | 494 | | |
496 | 495 | | |
497 | 496 | | |
498 | 497 | | |
499 | 498 | | |
500 | 499 | | |
501 | 500 | | |
502 | | - | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
| |||
0 commit comments