move-coop / parsons

A python library of connectors for the progressive community.
https://www.parsonsproject.org/
Other
257 stars 125 forks source link

Parameterization of Bigquery queries is not possible, documentation is wrong #929

Closed austinweisgrau closed 7 months ago

austinweisgrau commented 7 months ago

Documentation docstring in BigQuery client query() method is copied from the parsons.Redshift.query() method docstring and is not fully modified to reflect differences.

The example is based on parsons.Redshift.query() syntax and does not demonstrate how to parametrize a query using the BigQuery client.

https://github.com/move-coop/parsons/blob/90c0f43b2a0207991f58d22dcad4c08aef81223e/parsons/google/google_bigquery.py#L199

austinweisgrau commented 7 months ago

Parameterization of queries is actually not currently possible with the current implementation

austinweisgrau commented 7 months ago

This issue is not resolved by the changes to the BigQuery connector query method in #938

austinweisgrau commented 7 months ago

This issue is not an issue! My bad! Parameterization works with the standard SQLAlchemy %s and %(parameter_name)s formats, as documented.

There is a small typo in the documentation using rs.query( rather than BigQuery().query( but it's not a big deal.