GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BUG: NotFoundException from to_gbq when replacing table in project different from project_id parameter · Issue #377 · googleapis/python-bigquery-pandas

This repository was archived by the owner on Sep 2, 2026. It is now read-only.
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

BUG: NotFoundException from to_gbq when replacing table in project different from project_id parameter #377

Copy link
Copy link
Closed
#455
Closed
BUG: NotFoundException from to_gbq when replacing table in project different from project_id parameter#377
#455
Copy link
Assignees
tswast
Labels
api: bigqueryIssues related to the googleapis/python-bigquery-pandas API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@wnojopra
wnojopra
opened on Aug 24, 2021
Issue body actions

Environment details

  • Programming language: python3
  • OS: Linux
  • Language runtime version: 3.9.2
  • Package version: 0.15.0

Steps to reproduce

Code Sample, a copy-pastable example

import pandas as pd

df = pd.DataFrame(
  {
    "A": pd.Series(1, index=list(range(2)))
  }
)

# 0) Start with an empty test_dataset. test_table does not exist at this point.


# 1) This successfully creates a table named test_table in dataset test_dataset in project willyn_data_project
df.to_gbq('willyn_data_project.test_dataset.test_table', project_id='willyn_job_project')

# 2) This fails with pandas_gbq.gbq.NotFoundException: Table does not exist
df.to_gbq('willyn_data_project.test_dataset.test_table', project_id='willyn_job_project', if_exists='replace')

Problem description

I am working on a project where researchers can write to a dataset in one GCP project, but must run query jobs in another. In the above code example, willyn_data_project is the name of the project that contains the dataset, and willyn_job_project is the name of the project where query jobs are executed.

When attempting to use if_exists='replace', we get the error pandas_gbq.gbq.NotFoundException: Table does not exist. I believe what is happening is we are attempting to delete a table from willyn_job_project, when we should be deleting a table in willyn_data_project.

My best guess would be this line in delete_and_recreate_table needs to be updated to use the correct project.

Expected Output

No error.

Reacted by Tim Sweña (Swast)

Activity

  1. wnojopra
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Aug 24, 2021
  2. product-auto-label
    added
    api: bigqueryIssues related to the googleapis/python-bigquery-pandas API.
    on Aug 24, 2021
  3. tswast commented on Aug 25, 2021

    @tswast
    tswast
    on Aug 25, 2021
    Contributor
    More actions

    Thanks for the report! I think you are right in that the wrong project ID is being used.

  4. yoshi-automation
    added
    🚨This issue needs some love.
    and removed
    🚨This issue needs some love.
    on Nov 23, 2021
  5. tswast
    self-assigned this
    on Jan 5, 2022
  6. tswast
    closed this as completedin #455on Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tswast
    tswast

Labels

api: bigqueryIssues related to the googleapis/python-bigquery-pandas API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.