cfdf515228
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.9 KiB
2.9 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_create_table | function | py | infra | 1.0.0 | impure | def bq_create_table(client: BQClient, dataset_id: str, table_id: str, schema: list[dict], partitioning: dict | None = None, clustering: list[str] | None = None, description: str = '', labels: dict | None = None) -> dict | Crea una tabla en BigQuery con schema, particionamiento opcional y clustering. Usa client._client.create_table() del SDK oficial. |
|
false | error_go_core |
|
|
dict con metadata de la tabla creada: table_id, dataset_id, project, full_id, schema, num_rows, num_bytes, created, modified, type, partitioning, clustering, description, labels | false | python/functions/bigquery/tables.py |
Ejemplo
from bigquery import bq_auth, bq_create_table
client = bq_auth("mi-proyecto")
tabla = bq_create_table(
client,
dataset_id="ventas_ds",
table_id="transacciones",
schema=[
{"name": "id", "type": "INTEGER", "mode": "REQUIRED", "description": "ID unico"},
{"name": "fecha", "type": "DATE", "mode": "NULLABLE", "description": "Fecha de la transaccion"},
{"name": "monto", "type": "FLOAT", "mode": "NULLABLE", "description": "Monto en USD"},
{"name": "pais", "type": "STRING", "mode": "NULLABLE", "description": "Codigo de pais"},
],
partitioning={"type": "MONTH", "field": "fecha"},
clustering=["pais"],
description="Transacciones de ventas por mes",
labels={"env": "prod", "team": "data"},
)
print(tabla["full_id"])
Notas
El schema se convierte internamente de dicts a objetos bigquery.SchemaField. El particionamiento TIME soporta DAY, MONTH, YEAR y HOUR sobre columnas DATE/DATETIME/TIMESTAMP. Si field se omite en partitioning, BigQuery usa la pseudo-columna _PARTITIONTIME. El clustering requiere que las columnas existan en el schema y mejora rendimiento en filtros frecuentes.