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

[Feature] Introducing CRUD Operations #59

Merged
merged 7 commits into from
Aug 7, 2023
Merged

[Feature] Introducing CRUD Operations #59

merged 7 commits into from
Aug 7, 2023

Conversation

bh2smith
Copy link
Collaborator

@bh2smith bh2smith commented Jul 11, 2023

Dune recently added endpoints and documentation for their Queries Editing Support via the API. This PR introduces new functionality

  • Create: create_query
  • Read (Get): get_query
  • Update update_query
  • Delete (Archive) archive_query

as well as make_private

Unfortunately these operations require Premium membership, so I can not add tests yet.

*the the model DuneQuery should really make use of a real json serialization library (as well as any model implementing to/from dict), but this is a separate refactoring task.

Note that the tests failing here are related to a previous PR. #58

cc @grkhr - I may have to revert those changes until this feature is working as expected. I tried with CURL and it was fine

curl -X POST "https://api.dune.com/api/v1/query/2704703/execute" -H x-dune-api-key:${DUNE_API_KEY}  -d '{"performance": "large"}'

cc @grkhr

@grkhr
Copy link
Contributor

grkhr commented Jul 11, 2023

Hey @bh2smith answering here as conversation "has been locked and limited to collaborators"

That's happening because it's trying to run this query which is deprecated for running on large cluster. Replace the sample query to any written on Trino and it'll be fine.

@bh2smith
Copy link
Collaborator Author

Replace the sample query to any written on Trino and it'll be fine.

Awesome thanks!

@bh2smith bh2smith requested review from a team and msf July 11, 2023 14:57
Copy link

@gentrexha gentrexha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some general comments and questions regarding implementations.

dune_client/client.py Show resolved Hide resolved
dune_client/client.py Outdated Show resolved Hide resolved
dune_client/client.py Outdated Show resolved Hide resolved
dune_client/client.py Show resolved Hide resolved
dune_client/client.py Show resolved Hide resolved
dune_client/client.py Outdated Show resolved Hide resolved
tests/e2e/test_client.py Show resolved Hide resolved
@bh2smith bh2smith merged commit 395f826 into main Aug 7, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2023
@bh2smith bh2smith deleted the crud-ops branch September 5, 2023 11:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants