metabase / metabase/metabase

Exclude Python transforms from check entity task

Open
#74,157 0 comments 0 reactions 0 assignees View on GitHub
.Auto triaged .Backend .Team/Graphy Dependencies Priority:P2 Transforms Transforms/Python Type:Bug
Dominant language
Clojure
Stars
49.3k
Forks
6.8k
Avg merge
1d 13h
Merged PRs (30d)
653

Description

## Description of the bug

The check entity task repeatedly logs updates for transforms and cards because Python transforms are being analyzed in a path that expects query-shaped entities. In the current flow, `instance-db-id` returns `nil` for Python transforms, which causes the `when-let` around the analysis upsert to skip marking them correctly.

This appears to happen when card/transform analysis runs on Python transforms. It may also be worth checking whether this is part of a broader class of dependency-analysis issues for non-query entities stored alongside query-shaped ones.

## Reproduction steps

1. Run the check entity task.
2. Include Python transforms in the analyzed entities.
3. Observe repeated log lines for `:transform` and `:card` updates.
4. Confirm the affected transform sources are of type `python`.

## Expected behavior

Python transforms should be excluded from the check entity task, or otherwise handled correctly so they do not cause repeated logging or skipped analysis upserts.

## Logs

The logs show repeated entries from `metabase-enterprise.dependencies.task.entity-check` such as updates to 41 entities of type `:transform` and 1 entity of type `:card`.

image.png

## Diagnostic information

Affects recent versions.

## Severity

p2

Contributor guide

Open the contributing guide

Research direction

Start with metabase-enterprise.dependencies.task.entity-check and trace the instance-db-id path used during analysis upserts. Run the check entity task with Python transforms included and verify that Python transforms no longer produce repeated transform or card updates and are handled consistently by the analysis flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.