Skip to content

"403 Exceeded rate limits: too many table update operations for this table" when uploading just 2 hours every hour. #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Aug 9, 2021 · 6 comments
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. type: question Request for information or clarification. Not an issue.

Comments

@ghost
Copy link

ghost commented Aug 9, 2021

  • Programming language: Python
  • OS: Linux / Google Cloud Function
  • Language runtime version: 3.7
  • Package version: 0.14.1

Error message:
pandas_gbq.gbq.GenericGBQException: Reason: 403 Exceeded rate limits: too many table update operations for this table. For more information, see https://cloud.google.com/bigquery/docs/troubleshoot-quotas

I am uploading a very small amount of rows (less than 20) to a BQ table every hour through a cloud function running on a schedule. I'm receiving the error quite frequently. There are no other scripts writing to that table.
I get the error after a log that says:

2 out of 2 rows loaded.
1 out of 1 rows loaded.

Both those logs are for a single upload command.

@ghost ghost added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Aug 9, 2021
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-pandas API. label Aug 9, 2021
@max-sixty
Copy link
Contributor

Is this specific to pandas-gbq? That sounds like a general BQ error

@ghost
Copy link
Author

ghost commented Aug 9, 2021

I'm only using pandas-gbq to to push rows to a bq table.

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. and removed 🚨 This issue needs some love. labels Nov 8, 2021
@tswast tswast added type: question Request for information or clarification. Not an issue. and removed type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 4, 2022
@tswast tswast self-assigned this Jan 4, 2022
@tswast
Copy link
Collaborator

tswast commented Jan 4, 2022

Can you share more about your workload? Is the schema changing?

How many to_gbq calls is your script making? Is it one per row or are all the rows bundled together into a single dataframe?

@tswast
Copy link
Collaborator

tswast commented Jan 4, 2022

You'll have the best results if you can minimize the number of calls to to_gbq. It uses BigQuery "load jobs" which have a limited quota, though once an hour should be well within that.

@ghost
Copy link
Author

ghost commented Jan 11, 2022

I don't recall which of my pipeline this was. I believe I moved on to Google's Datastore because of the Rate limit errors.
What I can tell you is that the schema was not changing. I was adding to a BigQuery table every hour or so, about 20 rows that I was getting from an API.
Sadly there is no way for me to reproduce this ATM.

@tswast
Copy link
Collaborator

tswast commented Jan 11, 2022

Thanks for getting back to us.

There is a feature request open at #300 to use the streaming API for writes, which avoids some rate limits with load jobs (but at the expense of some complexity around writing to new/recreated tables). This hasn't been implemented in pandas-gbq yet, but is available in the google-cloud-bigquery library with the insert_rows_from_dataframe method.

I'll close this issue as it isn't reproducible, but feel free to follow #300 or open a new issue if you have a reproducible example.

@tswast tswast closed this as completed Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants