metabase / metabase/macaw

Use an explicit list of "placeholder" tables instead of a magical substring

Open
#46 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
Clojure
Stars
23
Forks
4
PR merge metrics
No merged PRs in 30d

Description

When analyzing Metabase queries with references to logical views (aka models), Macaw is passed a query with "sentinel" names in place of actual tables. In order for find-replace to work correctly, [we treat such qualifiers as if they were missing](https://github.com/metabase/macaw/pull/43), so that we can cascade down to the entry qualified by the actual table.

This trick currently relies on Metabase's naming convention, and could have false positives, or break if this convention changes.

A more robust solution would be to take a set of placeholder names to be treated like this. Checking membership in this set should also be faster than searching for substrings too.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace the qualifier handling used when analyzing queries with logical views, and locate the current substring-based placeholder check. Replace that convention-dependent check with membership in an explicit set of placeholder names, then verify that cascading still reaches the entry qualified by the actual table and that unrelated qualifiers are unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
databases
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.