Skip to content

Commit

Permalink
fix naming and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith committed Mar 25, 2024
1 parent 9d0409e commit 8a5047a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dune_client/api/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import List, Dict, IO

from dune_client.api.base import BaseRouter
from dune_client.models import DuneError, InsertTableResult, CreateTableResponse
from dune_client.models import DuneError, InsertTableResult, CreateTableResult


class TableAPI(BaseRouter):
Expand Down Expand Up @@ -54,7 +54,7 @@ def create_table(
schema: List[Dict[str, str]],
description: str = "",
is_private: bool = False,
) -> CreateTableResponse:
) -> CreateTableResult:
"""
https://docs.dune.com/api-reference/tables/endpoint/create
The create table endpoint allows you to create an empty table
Expand All @@ -76,7 +76,7 @@ def create_table(
},
)

return CreateTableResponse.from_dict(result_json)
return CreateTableResult.from_dict(result_json)

def insert_table(
self,
Expand Down
2 changes: 1 addition & 1 deletion dune_client/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def __add__(self, other: ResultsResponse) -> ResultsResponse:


@dataclass
class CreateTableResponse(DataClassJsonMixin):
class CreateTableResult(DataClassJsonMixin):
"""
Data type returned by table/create operation
"""
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
ExecutionStatusResponse,
DuneError,
InsertTableResult,
CreateTableResponse,
CreateTableResult,
)
from dune_client.types import QueryParameter
from dune_client.client import DuneClient
Expand Down Expand Up @@ -127,7 +127,7 @@ def test_parameters_recognized(self):
{
"text_field": "different word",
"number_field": 22,
"date_field": "1991-01-01T00:00:00Z",
"date_field": "1991-01-01 00:00:000",
"list_field": "Option 2",
}
],
Expand Down Expand Up @@ -258,7 +258,7 @@ def test_create_table_success(self):
],
is_private=False,
),
CreateTableResponse.from_dict(
CreateTableResult.from_dict(
{
"namespace": namespace,
"table_name": table_name,
Expand Down Expand Up @@ -354,7 +354,7 @@ def test_download_csv_success_by_id(self):
{
"text_field": "different word",
"number_field": 22,
"date_field": "1991-01-01T00:00:00Z",
"date_field": "1991-01-01 00:00:00.000",
"list_field": "Option 2",
}
],
Expand All @@ -376,7 +376,7 @@ def test_download_csv_success_with_params(self):
pandas.read_csv(result_csv.data).to_dict(orient="records"),
[
{
"date_field": "2022-05-04T00:00:00Z",
"date_field": "2022-05-04 00:00:00.000",
"list_field": "Option 1",
"number_field": 3.1415926535,
"text_field": "Plain Text",
Expand Down

0 comments on commit 8a5047a

Please sign in to comment.