Home > Software engineering >  UsageError: Line magic function `%%bigquery` not found
UsageError: Line magic function `%%bigquery` not found

Time:03-02

I am very new to Big query. I am trying to load data from a Big query table to pandas dataframe. I followed the syntax given in the documentation enter image description here

I read a stackoverflow solution enter image description here

Then, I tried separating the code lines, but I get a new error UsageError: Line magic function %%bigquery not found.

enter image description here

I have been trying for a couple of hours to resolve this. Even restarting the kernel is not working. This works the very first time you run it but not if you run it twice. I have no clue what's going on. Any thoughts?

CodePudding user response:

This can be solved by removing the comments

#-----------------------
#Loading the bigquery ..
#-----------------------

and just retaining the %%bigquery magic syntax as shown below

%%bigquery personas_raw
SELECT * FROM `project-id.dataset.table`

Here is the screenshot of my testing using a sample public dataset WITH COMMENTS and got the same error message as your post. enter image description here

And here is the screenshot of the same syntax when the comment is removed. enter image description here

  • Related