can we create a authorized bigquery view in a google cloud project A which has source data present in a different cloud project B from a python API.
i can create the above said process manually from the BQ UI, but i want to automate the process of creating around 800 auth. views from a python process.
the issue i am facing is at a given time , i can only call a single bigquery service credentials, so whenever i trigger my process/code, i am getting the source dataset or view dataset credentials missing
from google.cloud import bigquery
import os
from config_files import config
from config_files import db2_table_config
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = config.bq_service_account #service credentials of project B
client = bigquery.Client()
project = 'project_A'
source_dataset_id = 'dataset_b' # which is in different project
source_table_id = 'table' # which is in different project
shared_dataset_ref = client.dataset('dataset_a') #target dataset for project B
view_ref = shared_dataset_ref.table("my_shared_view") #need to be created in project B
view = bigquery.Table(view_ref)
view.view_query = "select query"
view = client.create_table(view) # API request
print("Successfully created view at {}".format(view.full_table_id))