Skip to content

[CT-2174] [Regression] Package max version range throwing error #7039

Closed
@fivetran-joemarkiewicz

Description

@fivetran-joemarkiewicz

Is this a regression in a recent version of dbt-core?

  • I believe this is a regression in dbt-core functionality
    I have searched the existing issues, and I could not find an existing issue for this regression

Current Behavior

On the latest 1.4.2 version of dbt-core when installing a dbt package with the range including a range with a max of 0.10.0 you will receive an erroneous failure. For example:

packages:
   - package: fivetran/google_ads_source
     version: [">=0.9.0", "<0.10.0"]

Will result in

Version error for package fivetran/google_ads_source: Could not find a satisfactory version from options: ['>=0.9.0', '<0.10.0']

However, the latest version of fivetran/google_ads is 0.9.0 and should be fine with that version range.

If I then adjust the range to just not include 0.10.0 it will succeed:

packages:
   - package: fivetran/google_ads_source
     version: [">=0.9.0", "<0.9.9"]

Result

22:28:23  Installing fivetran/google_ads_source
22:28:24    Installed from version 0.9.0
22:28:24    Up to date!

Expected/Previous Behavior

The range would succeed with 0.10.0.

Steps To Reproduce

  1. Install the google_ads_source package with the following range
packages:
   - package: fivetran/google_ads_source
     version: [">=0.9.0", "<0.10.0"]
  1. Run dbt deps
  2. See the following error:
Version error for package fivetran/google_ads_source: Could not find a satisfactory version from options: ['>=0.9.0', '<0.10.0']

Relevant log output

Version error for package fivetran/google_ads_source: Could not find a satisfactory version from options: ['>=0.9.0', '<0.10.0']

Environment

- OS: Mac OS
- Python: 3.9.6
- dbt (working version): 1.4.1
- dbt (regression version): 1.4.2

Which database adapter are you using with dbt?

bigquery

Additional Context

Here is a slack thread where a user experienced a similar issue when trying to install the fivetran/ad_reporting package.

Activity

changed the title [-][Regression] Package Max Version Range Throwing Error[/-] [+][CT-2174] [Regression] Package Max Version Range Throwing Error[/+] on Feb 23, 2023
changed the title [-][CT-2174] [Regression] Package Max Version Range Throwing Error[/-] [+][CT-2174] [Regression] Package max version range throwing error[/+] on Feb 23, 2023
jtcohen6

jtcohen6 commented on Feb 23, 2023

@jtcohen6
Contributor

@fivetran-joemarkiewicz Thanks for opening!

I'm guessing this must be related somehow to the change in #6838. Taking a look

jtcohen6

jtcohen6 commented on Feb 23, 2023

@jtcohen6
Contributor

dbt-core/core/dbt/semver.py

Lines 154 to 158 in 5ddd408

else: # major/minor/patch, should all be numbers
if a > b:
return 1
elif a < b:
return -1

Drop a breakpoint after line 154:

            else:  # major/minor/patch, should all be numbers
                if key == "minor":
                    first = a
                    second = b
                    import ipdb; ipdb.set_trace()
ipdb> first
'9'
ipdb> second
'10'
ipdb> first > second
True

should all be numbers

let's make sure of it :)

added
depsdbt's package manager
and removed on Feb 23, 2023
fivetran-joemarkiewicz

fivetran-joemarkiewicz commented on Feb 24, 2023

@fivetran-joemarkiewicz
ContributorAuthor

Brilliant, @jtcohen6 thanks for working so quickly to address this! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdepsdbt's package managerregression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @jtcohen6@fivetran-joemarkiewicz

      Issue actions

        [CT-2174] [Regression] Package max version range throwing error · Issue #7039 · dbt-labs/dbt-core