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

Handle insert_table errors #129

Merged
merged 5 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion dune_client/api/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def insert_table(
headers={"Content-Type": content_type},
data=data,
)
return InsertTableResult.from_dict(result_json)
try:
return InsertTableResult.from_dict(result_json)
except KeyError as err:
raise DuneError(result_json, "ResultsResponse", err) from err

def delete_table(self, namespace: str, table_name: str) -> DeleteTableResult:
"""
Expand Down
1 change: 1 addition & 0 deletions dune_client/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ class InsertTableResult(DataClassJsonMixin):
"""

rows_written: int
bytes_written: int


@dataclass
Expand Down
Loading