duneanalytics / dune-client

A framework for interacting with Dune Analytics' officially supported API service
Apache License 2.0
85 stars 22 forks source link

FileIO Refactor -- Make More Dynamic/Robust #46

Closed bh2smith closed 1 year ago

bh2smith commented 1 year ago

The previous version of this uses Enums with a switch cases, also it had hard-coded file extensions baked into the file type (which was undesired - for reasons). While speaking with @nlordell about this, he mentioned that "I manually implemented Dynamic Dispatch" and gave some very good suggestions similar to what we see here.

Now, there are three structures here:

There is still a bit of awkwardness in this code that I would love to get suggestions on

Test Plan

All the existing tests were adapted to work with this new setup (but logically they are the same). A few additional tests were added to demonstrate the new capabilities (specifically that you can save any file format with whatever extension you may want).

Follow Up Ideas