Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Creating a load job in a project other than the client's project results in error #473

Closed

Description

@tchang-f5

The following code

    bq_client = bigquery.Client("project_A")
    job = bq_client.load_table_from_json(data, table, job_config=job_config, project="project_B")

would give the error 400 "Value project_B in content does not agree with value project_A. This can happen when a value set through a parameter is inconsistent with a value set in the request."

It seems the upload URL is always set to the client's project.

upload_url = _MULTIPART_URL_TEMPLATE.format(project=self.project)

Activity

  1. added
    api: bigquery
    on Jan 18, 2021
  2. added
    type: question
    on Jan 19, 2021
  3. plamut commented on Jan 21, 2021

    @plamut
    Contributor

    I can confirm the reported behavior. The load_table_from_file() receives the target project name, sets it on the job, but then the _do_multipart_upload() indeed just uses the project configured by the client in the URL. Ditto for resumable uploads.

    Thanks for catching and reporting that!

  4. self-assigned this
    on Jan 21, 2021
  5. added
    priority: p2
    type: bug
    and removed
    type: question
    on Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigquerypriority: p2type: bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions