Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhong5297 committed Nov 28, 2023
1 parent e3c6ac2 commit 3a77dfe
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 13 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/update_from_dune.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
- name: Update all queries from Dune
env:
DUNE_API_KEY: ${{ secrets.DUNE_API_KEY }}
run: python -u github_workflows/update_to_dune.py

- name: Print name
run: echo "Hello ${{ secrets.ENV_TEST }}"
run: python -u scripts/update_to_dune.py


5 changes: 1 addition & 4 deletions .github/workflows/update_to_dune.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- name: Update all queries from Dune
env:
DUNE_API_KEY: ${{ secrets.DUNE_API_KEY }}
run: python -u github_workflows/update_to_dune.py

- name: Print name
run: echo "Hello ${{ secrets.ENV_TEST }}"
run: python -u scripts/update_to_dune.py


27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# Query Repo

A template for creating repos to manage your Dune queries using the CRUD API.

### Setup

1. First, go to the dashboard you want to create a repo for (must be owned by you/your team). Click on the "github" icon in the top right to get a popup which will display all your query ids for said dashboard. Or, just get the list queries you want to track in general.

2. Copy and paste that list into the `queries.yml` file.

3. Install the python requirements and run the `update_from_dune.py` script.

```
pip install -r requirements.txt
python scripts/update_from_dune.py
```

This will bring in your query ids into `query_{id}.sql` files within the `queries` folder. You can run that same python script again anytime you need to update your work from Dune into this repo.

4. Make any changes you need to directly in the repo, and any time you push a commit, `update_to_dune.py` will run and save your changes into Dune directly.

### For Contributors

I've set up four types of issues right now:
- `bugs`: This is for data quality issues like miscalculations or broken queries.
- `chart_improvements`: This is for suggesting improvements to the visualizations.
- `query_improvements`: This is for suggesting improvements to the query itself, such as adding an extra column or table that enhances the results.
- `generic`: This is a catch all for other questions or suggestions you may have about the dashboard.

If you want to contribute, either start an issue or go directly into making a PR (using the same labels as above). Once the PR is merged, the queries will get updated in the frontend.
1 change: 0 additions & 1 deletion queries.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

query_ids:
- 3237721
- 3237738
Expand Down
2 changes: 0 additions & 2 deletions queries/query_3237721.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
-- DEX by volume 🏦
-- https://dune.com/queries/3237721

--andrew is testing actions

WITH
seven_day_volume AS (
SELECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
if os.path.exists(file_path):
# Update existing file
with open(file_path, 'r+', encoding='utf-8') as file:
content = file.read()
file.seek(0, 0)
file.truncate(0) # Delete all file contents
file.write(f'-- {query.base.name}\n-- https://dune.com/queries/{query.base.query_id}\n\n\n{query.sql}')
else:
# Create new file and directories if they don't exist
Expand Down
File renamed without changes.

0 comments on commit 3a77dfe

Please sign in to comment.