Skip to content

Commit

Permalink
type hint fix
Browse files Browse the repository at this point in the history
bh2smith committed Aug 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 50a99bb commit cbd6eeb
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/models.py
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ class TimeUnit(Enum):
@classmethod
def options(cls) -> list[str]:
"""Returns a list of all available enum items"""
return [e.value for e in cls]
return [str(e.value) for e in cls]


class LeftBound:
@@ -85,7 +85,9 @@ def as_query_parameters(self) -> list[QueryParameter]:
"""Returns DuneQueryParameters for object instance"""
return [
QueryParameter.enum_type(
name="TimeUnits", value=self.units.value, options=TimeUnit.options()
name="TimeUnits",
value=str(self.units.value),
options=TimeUnit.options(),
),
QueryParameter.number_type(name="Offset", value=self.offset),
]
2 changes: 1 addition & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ def test_as_query_params(self):
[
QueryParameter.enum_type(
name="TimeUnits",
value=TimeUnit.MINUTES.value,
value=str(TimeUnit.MINUTES.value),
options=TimeUnit.options(),
),
QueryParameter.number_type(name="Offset", value=1),

0 comments on commit cbd6eeb

Please sign in to comment.