【问题标题】:BigQuery Python cannot delete dataset: Dataset is still in use [duplicate]BigQuery Python 无法删除数据集:数据集仍在使用中 [重复]
【发布时间】:2018-01-16 18:48:48
【问题描述】:

我正在使用google-cloud-bigquery python 库编写集成测试。

我的测试遵循以下步骤:

  • 创建新数据集
  • 在数据集中创建表
  • 向表中插入行
  • 做一些事情,确保事情有意义
  • 删除数据集

但是,当我尝试删除数据集时,我收到错误 google.api_core.exceptions.BadRequest: 400 DELETE {url}: Dataset {dataset} is still in use

查看 BigQuery 用户界面,我看到了 This table has records in the streaming buffer that may not be visible in the preview.

显然,BigQuery 需要完成它的工作才能删除。

在我能够删除数据集之前,是否有合理的阻止方法?

【问题讨论】:

  • 先删除此表再删除数据集

标签: python google-bigquery


【解决方案1】:

做一个这样的功能

Def closedataset():
    Close the dataset

Def deletedataset():
    Delete the dataset

Dostuff()
closedataset()
Deletedataset()

这可能有效,也可能无效。我没有你的代码

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-09-27
    • 2015-10-13
    • 2019-02-16
    • 2015-03-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多