Skip to content

Update require-dbt-version when config.get / require is migrated to meta_get / meta_require #265

@dbeatty10

Description

@dbeatty10

What

Whenever config.get / require is migrated to meta_get / meta_require (via #250), then the require-dbt-version should also be bumped at the same time.

Why

@jtcohen6 said the following in dbt-labs/dbt-fusion#745 (comment) (emphasis mine):

  1. Versioning / Rollout
    • ...
    • Packages using config.get / config.require to access custom configs should update to more-defensive code (config.meta_get(...) or config.get(...)), and update require-dbt-version to >=1.10.x (where x is the next patch release including these methods)

How

Within dbt_project.yml:

require-dbt-version: [">=1.10.18", "<3.0.0"]

Consequence

If this autofix is applied to a dbt package, then users that install that package will only be able to use versions of dbt that align with require-dbt-version, and they will get an error otherwise.

💥 Using the autofix in #250 will already raise errors like the following for dbt versions less than 1.10.18:

'dbt.context.providers.RuntimeConfigObject object' has no attribute 'meta_get'
'dbt.context.providers.RuntimeConfigObject object' has no attribute 'meta_require'

⚠️ Package maintainers that want to support dbt versions less than 1.10.18 will not be able to use this autofix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions