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

PRO-211: Add support for is_private in upload_csv #98

Merged
merged 1 commit into from
Oct 7, 2023
Merged
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
10 changes: 9 additions & 1 deletion dune_client/api/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,20 @@ def download_csv(self, query: Union[QueryBase, str, int]) -> ExecutionResultCSV:
############################
# Plus Subscription Features
############################
def upload_csv(self, table_name: str, data: str, description: str = "") -> bool:
def upload_csv(
self,
table_name: str,
data: str,
description: str = "",
is_private: bool = False,
) -> bool:
"""
https://dune.com/docs/api/api-reference/upload-data/?h=data+upload#endpoint
The write API allows you to upload any .csv file into Dune. The only limitations are:

- File has to be < 200 MB
- Column names in the table can't start with a special character or digits.
- Private uploads require a Premium subscription.

Below are the specifics of how to work with the API.
"""
Expand All @@ -149,6 +156,7 @@ def upload_csv(self, table_name: str, data: str, description: str = "") -> bool:
"table_name": table_name,
"description": description,
"data": data,
"is_private": is_private,
},
)
try:
Expand Down
Loading