'BigQuery "Parameterized query job" using the python client library

I have been trying to run a parameterized query using the client libraries in Python and I have tried both the named parameters and the positional parameters methods in the documentation, but neither of them worked.

Here's the positional parameters method:

enter image description here

And the output:

enter image description here

The code compiles with no error when I remove the last line of code:

enter image description here

I have a different function that does not use a parameterized query and works just fine:

enter image description here

How can I parameterize it with "id"?

I have tried the named parameters and the positional parameters methods described in the documentation but neither of them worked. I'm expecting to get data for the specific id parameter and put it in a data frame.



Solution 1:[1]

Try removing squar brackets from table name clause.

change

  • select * from [ Table_name ]

to this

  • select * from Table_name

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ozair