altair-viz / vega_datasets

A Python package for online & offline access to vega datasets
MIT License
173 stars 57 forks source link

Some datasets are images and throw a ValueError #46

Open tcdejong opened 2 years ago

tcdejong commented 2 years ago

Some datasets like ffox are images (.png) and thus throw a ValueError

To reproduce in vega-datasets-0.9.0 (current version on pip):

from vega_datasets import data
data.ffox()

Raises:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
c:\Users\redacted\Repositories\altair-demos\basic_chart.py in <module>
----> 1 data.ffox()

~\AppData\Local\Programs\Python\Python39\lib\site-packages\vega_datasets\core.py in __call__(self, use_local, **kwargs)
    244             return pd.read_csv(datasource, **kwds)
    245         else:
--> 246             raise ValueError(
    247                 "Unrecognized file format: {0}. "
    248                 "Valid options are ['json', 'csv', 'tsv']."

ValueError: Unrecognized file format: png. Valid options are ['json', 'csv', 'tsv'].