Skip to content

Commit 855d787

Browse files
authored
Remove Optional on Query Name (#33)
Remove optional on Query.name field (was unnecessary and annoying - since it has a default value). Also closes #30 (adding is_complete to ExecutionState).
1 parent 55d5f92 commit 855d787

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

dune_client/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def terminal_states(cls) -> set[ExecutionState]:
5151
"""
5252
return {cls.COMPLETED, cls.CANCELLED, cls.FAILED}
5353

54+
def is_complete(self) -> bool:
55+
"""Returns True is state is completed, otherwise False."""
56+
return self == ExecutionState.COMPLETED
57+
5458

5559
@dataclass
5660
class ExecutionResponse:

dune_client/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Query:
1313
"""Basic data structure constituting a Dune Analytics Query."""
1414

1515
query_id: int
16-
name: Optional[str] = "unnamed"
16+
name: str = "unnamed"
1717
params: Optional[List[QueryParameter]] = None
1818

1919
def base_url(self) -> str:

0 commit comments

Comments
 (0)