feat(auto_metabase): push-all + describe/sql + auto-inject de dashcards

- push_all(): pushea todos los YAMLs de un proyecto (cards primero,
  dashboards despues), solo CREATE/UPDATE, resiliente a fallos por item
- explore.py: comandos describe (schema de DB) y sql (query ad-hoc con
  limite, cap 5MB, bloqueo de escrituras destructivas)
- payload.py: auto-inyecta id:-N, visualization_settings:{} y
  parameter_mappings:[] en dashcards nuevas para evitar 500 en push
- test_local: 11 cards + 3 dashboards sobre Sample Database de Metabase
- registry.db regenerado con auto_metabase_py_analytics indexada

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 13:14:05 +02:00
parent 386a5471e0
commit 310b409ae0
32 changed files with 3116 additions and 0 deletions
@@ -0,0 +1,31 @@
_meta:
kind: dashboard
id: 2
slug: auto_metabase_test_dashboard
synced_at: '2026-04-13T10:50:00Z'
remote_updated_at: '2026-04-13T09:43:33.289419Z'
dashcards_count: 2
tabs_count: 0
parameters_count: 0
_refs:
collection: null
payload:
description: Dashboard de prueba para auto_metabase
archived: false
dashcards:
- size_x: 6
col: 0
size_y: 4
row: 0
card: test_count_users
- size_x: 6
col: 6
size_y: 4
row: 0
card: test_users_by_locale
tabs: []
enable_embedding: false
name: auto_metabase test dashboard
width: fixed
parameters: []
auto_apply_filters: true
@@ -0,0 +1,51 @@
_meta:
kind: dashboard
id: 4
slug: compras_y_clientes
synced_at: '2026-04-13T10:50:00Z'
remote_updated_at: '2026-04-13T10:40:30.171442Z'
dashcards_count: 6
tabs_count: 0
parameters_count: 0
_refs:
collection: null
payload:
description: Vista general de compras (ORDERS) y clientes (PEOPLE) del Sample Database
archived: false
dashcards:
- size_x: 12
col: 12
size_y: 6
row: 3
card: clientes_por_estado
- size_x: 12
col: 0
size_y: 6
row: 3
card: compras_por_mes
- size_x: 8
col: 0
size_y: 3
row: 0
card: clientes_total
- size_x: 8
col: 8
size_y: 3
row: 0
card: compras_total
- size_x: 8
col: 16
size_y: 3
row: 0
card: ingresos_totales
- size_x: 24
col: 0
size_y: 7
row: 9
card: top_clientes
tabs: []
enable_embedding: false
name: Compras y Clientes
width: fixed
parameters: []
auto_apply_filters: true
@@ -0,0 +1,36 @@
_meta:
kind: dashboard
id: 5
slug: kpis_minimal
synced_at: '2026-04-13T10:50:00Z'
remote_updated_at: '2026-04-13T10:47:00.301085Z'
dashcards_count: 3
tabs_count: 0
parameters_count: 0
_refs:
collection: null
payload:
description: Dashboard test del auto-inject — YAML sin id/viz/param_mappings en dashcards
archived: false
dashcards:
- size_x: 8
col: 0
size_y: 3
row: 0
card: clientes_total
- size_x: 8
col: 8
size_y: 3
row: 0
card: compras_total
- size_x: 8
col: 16
size_y: 3
row: 0
card: ingresos_totales
tabs: []
enable_embedding: false
name: KPIs Minimal
width: fixed
parameters: []
auto_apply_filters: true
@@ -0,0 +1,56 @@
_meta:
kind: dashboard
id: 6
slug: panel_clientes
synced_at: '2026-04-13T10:50:00Z'
remote_updated_at: '2026-04-13T10:50:00.213836Z'
dashcards_count: 7
tabs_count: 0
parameters_count: 0
_refs:
collection: null
payload:
description: Vista 360 de los clientes (PEOPLE) del Sample Database — total, altas, canal, geografia, edad y registros recientes.
archived: false
dashcards:
- size_x: 24
col: 0
size_y: 3
row: 0
card: clientes_total
- size_x: 24
col: 0
size_y: 6
row: 3
card: clientes_nuevos_por_mes
- size_x: 12
col: 0
size_y: 6
row: 9
card: clientes_por_source
- size_x: 12
col: 12
size_y: 6
row: 9
card: clientes_por_edad
- size_x: 12
col: 0
size_y: 6
row: 15
card: clientes_por_estado
- size_x: 12
col: 12
size_y: 6
row: 15
card: clientes_top_ciudades
- size_x: 24
col: 0
size_y: 8
row: 21
card: clientes_recientes
tabs: []
enable_embedding: false
name: Panel de Clientes
width: fixed
parameters: []
auto_apply_filters: true