Skip to content

Commit

Permalink
make UnparsedVersion.__lt__ order-agnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 5, 2023
1 parent a0e1356 commit 874ee1c
Showing 1 changed file with 2 additions and 7 deletions.
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

0 comments on commit 874ee1c

Please sign in to comment.