'get Forbidden: 403 Access Denied when do request to transfer data from google cloud storage to bigquery using python

I'm owner in google cloud console. I want transfer data from gcs to Bigquery, but I get "Forbidden: 403 Access Denied: File gs://data/silver/rates/nbu_rates/nbu_rates.parquet: Access Denied". I can change this file. I follow the https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-parquet#python. I try to run script from local machine. My script:

def connect_to_gbq_client(config_path, project_id):
    config = Config(config_path)
    my_service_account_link = config.get_config('gcp_my_service_account_file_link')
    credentials = service_account.Credentials.from_service_account_file(
        my_service_account_link)
    client = bigquery.Client(credentials=credentials,
                             project=project_id)
bq_client = connect_to_gbq_client(config_path, bq_project_id)
job_config = bigquery.LoadJobConfig(source_format=bigquery.SourceFormat.PARQUET,)
uri = "gs://data/silver/rates/nbu_rates/nbu_rates.parquet"
table_id = 'enhanced-cursor-XXXXXX.rates.nbu_rates'
load_job = bq_client.load_table_from_uri(uri,
                                         table_id,
                                         job_config=job_config
                                     )
load_job.result()

Who know why Does it happens?



Solution 1:[1]

Solved. I didn't put the name of bucket to the url.

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 Oleksandr Halaburda