690e68a542
Funciones CRUD completas para BigQuery: auth, datasets, tables, queries, jobs, routines, load/export. Tipo BQClient como wrapper del SDK oficial.
1.7 KiB
1.7 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bq_delete_table | function | py | infra | 1.0.0 | impure | def bq_delete_table(client: BQClient, dataset_id: str, table_id: str) -> None | Elimina permanentemente una tabla de BigQuery. IRREVERSIBLE. Usa client._client.delete_table() del SDK oficial. |
|
true | error_go_core |
|
|
None. Lanza excepcion si la tabla no existe o no hay permisos | false | python/functions/bigquery/tables.py |
Ejemplo
from bigquery import bq_auth, bq_delete_table
client = bq_auth("mi-proyecto")
# Eliminar tabla temporal
bq_delete_table(client, "mi_dataset", "tabla_temporal_2024")
# Verificar que no existe (capturar excepcion)
from google.api_core.exceptions import NotFound
try:
bq_delete_table(client, "mi_dataset", "tabla_que_no_existe")
except NotFound as e:
print(f"No encontrada: {e}")
Notas
La eliminacion es PERMANENTE — BigQuery no tiene papelera de reciclaje para tablas. Considerar exportar los datos a GCS antes de eliminar si hay posibilidad de necesitarlos. Si el dataset tiene defaultTableExpirationMs configurado, las tablas se pueden dejar expirar automaticamente en vez de eliminar manualmente. Requiere permiso bigquery.tables.delete sobre el dataset.