Python Custom With Statement Bigquery