Files
fn_registry/python/functions/metabase/metabase_update_dashboard.md
T
egutierrez be5a7b582e feat: funciones Python para API Metabase
Añade módulo Python con funciones para la API de Metabase en dominio infra.
Incluye cliente HTTP, auth, y CRUD de cards, dashboards y users.
Proyecto gestionado con uv (pyproject.toml).
2026-03-28 20:32:28 +01:00

1.2 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, 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 tested tests test_file_path file_path
metabase_update_dashboard function py infra 1.0.0 impure def metabase_update_dashboard(client: MetabaseClient, dashboard_id: int, **fields) -> dict Actualiza dashboard incluyendo metadata, cards y tabs via kwargs. dashcards es el estado completo deseado: nuevas con ID negativo, existentes con positivo, omitidas se eliminan. Endpoint: PUT /api/dashboard/:id.
metabase
dashboard
update
cards
api
python
false error_go_core
httpx
false
python/functions/metabase/dashboards.py

Ejemplo

# Agregar card
dash = metabase_get_dashboard(client, 1)
cards = list(dash["dashcards"])
cards.append({"id": -1, "card_id": 55, "size_x": 6, "size_y": 4, "col": 0, "row": 0})
metabase_update_dashboard(client, 1, dashcards=cards)

# Archivar
metabase_update_dashboard(client, 1, archived=True)

Notas

dashcards = estado completo. ID negativo = nueva, positivo = existente, omitida = eliminada. Campos: name, description, archived, dashcards, tabs, parameters, collection_id.