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

Recreate dbt_utils specs with require_dbt_version #1770

Closed
wants to merge 1 commit into from

Conversation

jtcohen6
Copy link
Contributor

@jtcohen6 jtcohen6 commented Aug 15, 2022

Created programmatically using: dbt-labs/hubcap#146

In order to test: dbt-labs/dbt-core#5651

# packages.yml
packages:
  - package: dbt-labs/dbt_utils
    version: 0.6.5
$ export DBT_PACKAGE_HUB_URL="https://deploy-preview-1770--flamboyant-mcclintock-92ba2d.netlify.app/"
$ dbt deps
15:57:07  Running with dbt=1.3.0-b1
15:57:09  Encountered an error:
Could not find a matching compatible version for package dbt-labs/dbt_utils
  Requested range: =0.6.5, =0.6.5
  Compatible versions: ['0.0.1', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.1.10', '0.1.11', '0.1.12', '0.1.13', '0.1.14', '0.1.15', '0.1.16', '0.1.17', '0.1.18', '0.1.19', '0.1.20', '0.1.21', '0.1.22', '0.1.23', '0.1.24', '0.1.25', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.3.0', '0.4.0', '0.4.1', '0.5.0', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6']
  (Not shown: versions incompatible with installed version of dbt-core)

(All those very old versions of dbt-utils are considered "compatible" because they do not define require-dbt-version.)

@github-actions github-actions bot added the automerge auto-assigned label for all PRs on packages label Aug 15, 2022
@jtcohen6 jtcohen6 removed the automerge auto-assigned label for all PRs on packages label Aug 15, 2022
@dbeatty10
Copy link
Contributor

I'm seeing three cases:

  1. No require-dbt-version within dbt_project.yml:
    • Ex. "require_dbt_version": [],
  2. Lower and upper bounds for require-dbt-version within dbt_project.yml:
    • Ex. "require_dbt_version": [">=0.18.0", "<0.19.0"],
  3. Lower bound for require-dbt-version within dbt_project.yml:
    • Ex. "require_dbt_version": ">=0.14.0",

The first two have a list/array. The last has just a string. Is that the intent? I'm guessing "yes" because both strings and lists are supported for require-dbt-version.

Side question out of curiosity: are lists/CSV limited to two items for require-dbt-version? Or can it have more than that too?

@jtcohen6
Copy link
Contributor Author

The first two have a list/array. The last has just a string. Is that the intent? I'm guessing "yes" because both strings and lists are supported for require-dbt-version.

Yes! The way we've documented this is, you can provide a single version requirement as a string. As soon as you need multiple, they should be in a list of strings.

Side question out of curiosity: are lists/CSV limited to two items for require-dbt-version? Or can it have more than that too?

In theory, you can have as many as you want. You don't generally need more than two to define a range. E.g. this is redundant:

require-dbt-version: [">=0.18.0", "<1.4.0", ">1.0.0"]

For pip, you can exclude specific entries via !=, and there is sometimes a point to doing that. But it looks like we don't support this syntax just yet:

require-dbt-version: [">=0.18.0", "<1.4.0", "!=1.0.0"]
dbt.exceptions.DbtProjectError: Runtime Error
  "!=1.0.0" is not a valid semantic version.

@jtcohen6
Copy link
Contributor Author

Closing in favor of #1779, which is the "real" version of this (though at risk of getting stale)

@jtcohen6 jtcohen6 closed this Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants