dbt-labs / dbt-labs/dbt

[CT-2028] A general solution for setting attributes in flag objects to consistent types

Open
#6,857 0 comments 0 reactions 1 assignee Claimed by @aranke View on GitHub
engine:v1 spike type:tech-debt
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

In the [flag consolidation work done](https://github.com/dbt-labs/dbt-core/pull/6788/files#diff-3e5c2add494f2ffa25c42dd0ea6ea0d4cc43875474b110506dff44385adb81acR46-R54) in API-ification phase 1, we introduced a method `convert_config` that converts the `warn_error_options` param as provided from a user config to the appropriate `WarnErrorOptions`.

Given that we define which type a param should be in cli.params, we can implement this casting more generally based on the click-configured type of the param instead of hardcoding it. This should apply for other params and types as well, so that they are consistently represented between `Flags` and params (e.g. Path params)

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.