Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make version configs optional #7060

Merged
merged 15 commits into from
Mar 10, 2023
Merged

Make version configs optional #7060

merged 15 commits into from
Mar 10, 2023

Conversation

dave-connors-3
Copy link
Contributor

@dave-connors-3 dave-connors-3 commented Feb 27, 2023

resolves #7054

Description

This makes the version: 2 config in resource schema.yml files and the config-version: 2 in dbt_project.yml files optional for end users.

More than open to feedback, especially on the testing setup. Needed to add some ability to remove keys from the project config dictionary, which felt a little code-smelly.

Checklist

@dave-connors-3 dave-connors-3 requested review from a team as code owners February 27, 2023 15:13
@cla-bot cla-bot bot added the cla:yes label Feb 27, 2023
@dave-connors-3 dave-connors-3 added the ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering label Feb 27, 2023
Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we wouldn't go further and just stop checking the version at all, since it's now pretty meaningless. I'd remove "check_format_version" entirely, and remove config_version from the project.

As far as tests, you don't have to remove the config-version from project config, you can just use a dbt_project_yml fixture to replace it entirely. But I'd just remove the "config-version" key entirely in the project fixture.

@gshank gshank merged commit 9090268 into main Mar 10, 2023
@gshank gshank deleted the make-version-configs-optional branch March 10, 2023 15:32
peterallenwebb pushed a commit that referenced this pull request Mar 14, 2023
peterallenwebb added a commit that referenced this pull request Mar 22, 2023
* ct-2198: clean up some type names and uses

* CT-2198: Unify constraints and constraints_check properties on columns

* Make mypy version consistently 0.981 (#7134)

* CT 1808 diff based partial parsing (#6873)

* model contracts on models materialized as views (#7120)

* first pass

* rename tests

* fix failing test

* changelog

* fix functional test

* Update core/dbt/parser/base.py

* Update core/dbt/parser/schemas.py

* Create method for env var deprecation (#7086)

* update to allow adapters to change model name resolution in py models (#7115)

* update to allow adapters to change model name resolution in py models

* add changie

* fix newline adds

* move quoting into macro

* use single quotes

* add env DBT_PROJECT_DIR support #6078 (#6659)

Co-authored-by: Jeremy Cohen <[email protected]>

* Add new index.html and changelog yaml files from dbt-docs (#7141)

* Make version configs optional (#7060)

* [CT-1584] New top level commands: interactive compile (#7008)

Co-authored-by: Github Build Bot <[email protected]>

* CT-2198: Add changelog entry

* CT-2198: Fix tests which broke after merge

* CT-2198: Add explicit validation of constraint types w/ unit test

* CT-2198: Move access property, per code review

* CT-2198: Remove a redundant macro

* CT-1298: Rework constraints to be adapter-generated in Python code

* CT-2198: Clarify function name per review

---------

Co-authored-by: Gerda Shank <[email protected]>
Co-authored-by: Emily Rockman <[email protected]>
Co-authored-by: Stu Kilgore <[email protected]>
Co-authored-by: colin-rogers-dbt <[email protected]>
Co-authored-by: Leo Schick <[email protected]>
Co-authored-by: Jeremy Cohen <[email protected]>
Co-authored-by: FishtownBuildBot <[email protected]>
Co-authored-by: dave-connors-3 <[email protected]>
Co-authored-by: Kshitij Aranke <[email protected]>
Co-authored-by: Github Build Bot <[email protected]>
mirnawong1 added a commit to dbt-labs/docs.getdbt.com that referenced this pull request Jun 19, 2024
## What are you changing in this pull request and why?
<!---
Describe your changes and why you're making them. If related to an open 
issue or a pull request on dbt Core, then link to them here! 

To learn more about the writing conventions used in the dbt Labs docs,
see the [Content style
guide](https:/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md).
-->
The [config-version
documentation](https://docs.getdbt.com/reference/project-configs/config-version)
is not clear about what the default value is. It states that the
parameter is optional and that the old version, version 1, is not in
use. This implies that the default version should be 2, but the default
is explicitly stated here as version 1.
```md
## Default
Without this configuration, dbt will assume your dbt_project.yml uses the version 1 syntax, which was deprecated in dbt v0.19.0.
```

As per PR dbt-labs/dbt-core#7060, the default
version is in-fact version 2, so this documentation needs to be updated.

## Checklist
- [x] Review the [Content style
guide](https:/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [x] For [docs
versioning](https:/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning),
review how to [version a whole
page](https:/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and [version a block of
content](https:/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content).
- [x] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."

---------

Co-authored-by: Mirna Wong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-2189] Remove required version: 2 and config-version: 2
3 participants