0

I user to Airflow GCStoBigqueryOperator N write Query with f-string

Already my Data in GCS N use Query n Select data Driven Bigquery

My Data in GCS enter image description here

My Operator Query

puuid = _puuid()
sql = f'SELECT * FROM game WHERE puuid={puuid};'

Then error occur column

column"ptQZI4tcQ7a9KCL74omce0ctYCf4--6csx6j1CBgFUmuyB0XrGZElURF0K3_0ym9TVbykLVi_mqh9w"does not exists Line 1: SELECT * FROM game where puuid=ptQZI4tcQ7a9KCL74omce0ctYCf4--6csx6j1CBgFUmuyB0XrGZElURF0K3_0ym9TVbykLVi_mqh9w

I think

SELECT * FROM game WHERE puuid='ptQZI4tcQ7a9KCL74omce0ctYCf4--6csx6j1CBgFUmuyB0XrGZElURF0K3_0ym9TVbykLVi_mqh9w' 

is not error

how to change my code??

lima
  • 89
  • 3
  • 8
  • It's more about this line, I think: _"sql = f'SELECT * FROM game WHERE puuid={puuid};'"_, see also https://stackoverflow.com/questions/3410455/how-do-i-use-sql-parameters-with-python – Stefan Wuebbe Sep 17 '22 at 14:46

1 Answers1

0

String values has to be surrounded by qoutes. I guess it should be like this:

puuid = _puuid()
sql = f"SELECT * FROM game WHERE puuid='{puuid}'"
kol
  • 126
  • 1
  • 5