diff --git a/datasetter/api.py b/datasetter/api.py index eea7b75..afaf4ec 100644 --- a/datasetter/api.py +++ b/datasetter/api.py @@ -38,7 +38,7 @@ def add_dataset(fast_api, uri, dataset): @fast_api.get(uri + "/") def get_metadata(): - return as_json(dataset.metadata) + return as_json(dataset.metadata()) @fast_api.get(uri + "/count") @forge.sign(*kwargs) diff --git a/test/test_api.py b/test/test_api.py index 3e662eb..46b33b2 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -24,13 +24,14 @@ metadata = { "description": "A simple dataset to make tests.", "facets": ['letter', 'greek'], + "name": "Random letters", "columns": [ {"name": "letter", "type": "string", "description": "A column with letters."}, {"name": "greek", "type": "string", "description": "A column with greek letters."}, {"name": "number", "type": "integer", "description": "A column with numbers."}, ]} -dataset = PandasDataset(df, ['letter', 'greek'], metadata=metadata) +dataset = PandasDataset(df, **metadata) app = FastAPI() add_dataset(app, 'pandas-dataset', dataset) diff --git a/test/test_dataset.py b/test/test_dataset.py index ed39057..eac53fb 100644 --- a/test/test_dataset.py +++ b/test/test_dataset.py @@ -1,5 +1,4 @@ import pytest -import pandas as pd from datasetter.dataset import Dataset diff --git a/tox.ini b/tox.ini index b96937e..2d35aa4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,7 @@ [flake8] max-line-length = 100 +exclude = .git,__pycache__,datasetter.egg-info,.eggs,.tox,.ipynb_checkpoints + [tox] envlist = py38,py39