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 UnparsedVersion.__lt__ order-agnostic #8559

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
make UnparsedVersion.__lt__ order-agnostic
  • Loading branch information
MichelleArk committed Sep 5, 2023
commit 874ee1c99c78be77f3a86663ee427c32e1d10d73
9 changes: 2 additions & 7 deletions core/dbt/contracts/graph/unparsed.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,9 @@ class UnparsedVersion(dbtClassMixin):

def __lt__(self, other):
try:
v = type(other.v)(self.v)
return v < other.v
return float(self.v) < float(other.v)
except ValueError:
try:
other_v = type(self.v)(other.v)
return self.v < other_v
except ValueError:
return str(self.v) < str(other.v)
return str(self.v) < str(other.v)

@property
def include_exclude(self) -> dbt.helper_types.IncludeExclude:
Expand Down