The Simplest Way to Make Luigi and Metabase Work Like They Should
Teams pair luigi and metabase to build data pipelines and view business charts. Luigi runs batch jobs in Python, while Metabase reads the final tables for dashboards. This setup splits heavy data processing from daily chart building. Data engineers write Python tasks to clean raw records and load clean tables. Business teams then ask questions and build reports without writing complex queries. How data and permissions flow between luigi and metabase These two tools do not talk to each other
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams pair luigi and metabase to build data pipelines and view business charts. Luigi runs batch jobs in Python, while Metabase reads the final tables for dashboards.
This setup splits heavy data processing from daily chart building. Data engineers write Python tasks to clean raw records and load clean tables. Business teams then ask questions and build reports without writing complex queries.
How data and permissions flow between luigi and metabase
These two tools do not talk to each other over a direct network link. Instead, they share a central SQL database or data warehouse as their common ground. Luigi acts as the writer, and Metabase acts as the reader.
A scheduled Luigi worker wakes up, pulls raw data, and runs transformation tasks. It checks if prior steps finished before it writes new rows into the database. When the batch job ends, the clean tables sit ready for analysis.
Metabase logs in to that same database using its own separate credentials. It scans the table structure and lets users build visual charts. You can also trigger a Metabase sync step after a Luigi task finishes. This ensures that new columns or tables show up in your dashboards right away.
Common failure modes with shared accounts and broad permissions
Many teams take shortcuts when they first set up their data stack. They often use one database account for both the pipeline worker and the dashboard app. This mistake creates big security and stability risks in production.
If Metabase uses a role with write rights, a bad query can drop tables. A user who writes raw SQL in the dashboard tool could change production records. On the flip side, Luigi workers often get full admin rights to the whole database. If a worker node gets breached, the attacker gains access to every table.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged queries also cause major headaches during an audit. When five engineers and two apps share one login, the database log shows one name. You cannot tell if a slow query came from a batch job or a user. Plus, sensitive fields like emails, phone numbers, and card numbers stay exposed in raw tables.
How to scope roles and network paths for your data stack
You can fix these issues by splitting roles and tightening network rules. Start by creating two distinct database users with strict permission boundaries. Give the Luigi role write access only to the specific schemas it must update. Give the Metabase role read-only access to the final reporting tables alone.
Keep raw staging tables hidden from the reporting role at all times. If raw tables hold national IDs or card numbers, mask them during the batch run. Alternatively, use dynamic data masking to rewrite matched fields in query results.
Next, lock down the network paths between your servers and the database. Place the Luigi workers and the Metabase app in private subnets. Set up firewall rules so only those specific server addresses can reach the database port. Finally, rotate your database keys on a regular schedule and log every single query.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Does Metabase trigger Luigi pipelines directly?
No, Metabase only reads data and does not start batch jobs. A scheduler starts Luigi, and Luigi can tell Metabase to sync when tasks finish.
What database permissions should the Metabase role have?
Give the Metabase database role read-only permissions on your clean reporting schemas. Never grant it rights to write, update, or drop tables in your database.
How do we handle sensitive data in this workflow?
Filter or hash sensitive columns during your Luigi tasks before writing final tables. You can also apply masking rules that rewrite emails and phone numbers in query results.
Related guides
In this post