Closed jsstevenson closed 1 month ago
I guess there could be a world where you really just want the raw GraphQL, but the Pandas export methods perform a conversion that is probalby useful even if you don't want the Pandas. I'd say we should only perform the transform to pandas/other DF methods as a final step. Would subsume #17.
My thought on this right now is to have some kind of exporter
or converter
module with to_pandas
methods that constrains the import to only happen in the method, and then puts pandas into an optional dependency group
Actually, we should just target the Python dataframe standard
Currently, Pandas has to be included as a dependency because it's imported in
dgipy.dgidb
. However, some users might not want to use Pandas at all. This is sort of possible by settinguse_pandas
to False, but you'd still need to have Pandas installed.It might be more elegant to refactor pandas output (the
_process_output
method) into a separate module that imports pandas in a protected way (i.e. wrapsimport pandas
in a try/except block) and then includes pandas as an optional dependency. Could also provide other kinds of data outputs (eg Polars, Dask, or maybe dumping to sqlite or something?) in this way as well.