dbt-labs / dbt-labs/metricflow

Remove InstanceSpecVisitor

Open
#865 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.8k
Forks
202
Avg merge
1d 8h
Merged PRs (30d)
14

Description

The InstanceSpecVisitor interface is an incredibly generic wrapper around a complicated class that does exactly one thing - resolve column names from instance specs.

The logic for this varies by spec, but with one exception everything boils down to calling the resolver on spec.qualified_name.

I just did this today:

"what do we actually need in this other visitor to do the work here, let's see, we have a spec, what do we need it for...... accept.... ugh.... another visitor, ok, let's look at that, right.... we just need the name. This visitor is dumb, we should delete it from the codebase."

I'd like to not do it again, especially when we have this wrapper function that takes in a boilerplate-heavy interface implementation with a generic return type with an implementation that almost entirely duplicates the logic of calling a single common property on the input objects.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.