rusackas opened a new pull request, #44546: URL: https://github.com/apache/superset/pull/44546
### SUMMARY Adds testcontainers coverage that runs Superset's actual BigQuery string-literal escaping (`_monkeypatch_bigquery_string_literal` in `superset/db_engine_specs/bigquery.py`) against a real GoogleSQL engine (the [`goccy/bigquery-emulator`](https://github.com/goccy/bigquery-emulator), via the new `BigQueryContainer` in [testcontainers/testcontainers-python#1121](https://github.com/testcontainers/testcontainers-python/pull/1121)), instead of only reasoning about it from the `sqlalchemy-bigquery` dialect source and the BigQuery DBAPI's `pyformat` handling. This grew out of chasing down whether #35857/#38835 (apostrophes breaking BigQuery filter values) is still correctly fixed, and whether the DBAPI's `%`-doubling behavior for percent signs is safe given Superset's actual execution path (`cursor.execute(query)`, no separate bind parameters). Both turned out fine, this locks it in with a real engine rather than leaving it as a one-time manual check. Covers: apostrophe values, percent-sign values, apostrophe+percent combined, and a documentation test that reproduces the exact syntax error BigQuery gives for the doubled-single-quote escape convention the old code used to emit (`'Armando''s'`), so it's clear *why* the fix in #38835 was needed if anyone's tempted to revert it. ### TESTING INSTRUCTIONS Gated behind `pytest.mark.testcontainers` (excluded from the default test run via `pytest.ini`) and `require_driver("testcontainers.community.google")`, matching the existing `tests/testcontainers/db_engine_specs/` convention. Needs Docker running locally, or runs via `.github/workflows/testcontainers.yml`: ```bash pytest tests/testcontainers/db_engine_specs/test_bigquery.py -v -m testcontainers ``` All 4 tests pass locally against `superset/db_engine_specs/bigquery.py` unmodified. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
