davidgasquez / gitcoin-grants-data-portal

🌲 Open source, serverless, and local-first data hub for Gitcoin Grants data!
https://grantsdataportal.xyz/
MIT License
25 stars 3 forks source link

feat: ⚡️ add job for dune upload #42

Closed DistributedDoge closed 6 months ago

DistributedDoge commented 6 months ago

This PR builds an op and three jobs to see if we can play nicely with new dagster primitives and address #38.

It does not modify existing workflow in any way (or at least I hope it doesn't), but allows us to use new CLI commands:

dagster job list -m ggdp
dagster job execute -m ggdp -j build_indexer_assets

For dagster UI navigate to Overview =>Jobs to see new additions:

To succeed job needs envar DUNE_API_KEY to be set first.

image

Once uploaded, dataset becomes accessible like so.

DistributedDoge commented 6 months ago

I think it is ready to merge. I really do apperciate the notes tough! Seem very in-line with dagster way, for future refactor:

What I'd love to have and I don't know how easy it would be is for us to generate these Dune assets dynamically basically on previous assets tags. Similar to how the new dbt integration treats dbt assets.

This is something I can test for Flipside where we can actually afford to load multiple tables without hitting upload limit.

davidgasquez commented 6 months ago

One thing before merging. Do you mind checking if re-uploading to Dune the same or new data is possible? I think it might give an error and we might need to do an upsert or something like that.

DistributedDoge commented 6 months ago

Last time I tried, was working as-is. The data branch of DuneAPI ` is limited to single POST endpoint, where you either:

Note that currently, there is no way to actually remove dataset, except for using interface.

davidgasquez commented 6 months ago

Alright! Will try to clear some time tomorrow morning (generate API keys and stuff) and get this deployed! :rocket: