Ignore magic cells in jupytext percent formatted notebooks

132 Views Asked by At

My team uses a bigquery specific iPython magic command to query and return data from BigQuery: https://cloud.google.com/python/docs/reference/bigquery/latest/magics

We also use jupytext to convert jupyter notebooks into percent formatted notebooks.

Black cannot parse the BigQuery iPython magic commands. Even when using # fmt: on/off or #fmt: skip as suggested in the comments and https://stackoverflow.com/a/58584557/7350094

black has cannot parse the following:

# %%
%%bigquery df
SELECT * FROM schema.table_name
error: cannot format filename.py: Cannot parse 2:0 %%bigquery df
0

There are 0 best solutions below