690e68a542
Funciones CRUD completas para BigQuery: auth, datasets, tables, queries, jobs, routines, load/export. Tipo BQClient como wrapper del SDK oficial.
1.6 KiB
1.6 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_auth | function | py | infra | 1.0.0 | impure | def bq_auth(project_id: str = '', credentials_path: str = '') -> BQClient | Autentica contra Google BigQuery con ADC o service account JSON. Retorna un BQClient listo para usar con todas las funciones CRUD. |
|
false | error_go_core |
|
|
BQClient: cliente autenticado con proyecto resuelto | false | python/functions/bigquery/client.py |
Ejemplo
from bigquery import bq_auth
# ADC (gcloud auth application-default login)
client = bq_auth()
# Proyecto explicito
client = bq_auth("my-project-id")
# Service account
client = bq_auth(credentials_path="/path/to/service-account.json")
# Context manager
with bq_auth() as client:
# client se cierra automaticamente
pass
Notas
Tres modos de autenticacion:
- Sin argumentos: usa Application Default Credentials (ADC) — requiere
gcloud auth application-default login - Con project_id: usa ADC pero fuerza el proyecto
- Con credentials_path: lee el JSON de service account directamente
El BQClient wrappea google.cloud.bigquery.Client y expone _client para que las funciones del modulo lo usen internamente.