From 73200df38bd4ccc832654f50e051d291cf2651f3 Mon Sep 17 00:00:00 2001 From: John Krauss Date: Tue, 17 May 2016 13:32:46 -0400 Subject: [PATCH] simpler access to metadata via observatory.cartodb.com --- scripts/README.md | 2 +- scripts/autotest.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index 3127ea6..64e1000 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -16,4 +16,4 @@ to the test Observatory account. Run automated tests against a hostname: - (venv) OBS_HOSTNAME= OBS_API_KEY=foobar OBS_META_HOSTNAME= OBS_META_API_KEY= nosetests scripts/autotest.py + (venv) OBS_HOSTNAME= OBS_API_KEY= OBS_META_HOSTNAME=observatory.cartodb.com OBS_META_API_KEY= nosetests scripts/autotest.py diff --git a/scripts/autotest.py b/scripts/autotest.py index 622686d..9c2105e 100644 --- a/scripts/autotest.py +++ b/scripts/autotest.py @@ -25,19 +25,19 @@ def query(q, is_meta=False, **options): return requests.get(url, params=params) MEASURE_COLUMNS = [(r['id'], ) for r in query(''' -SELECT id FROM observatory.obs_column +SELECT id FROM obs_column WHERE type ILIKE 'numeric' AND weight > 0 ''', is_meta=True).json()['rows']] CATEGORY_COLUMNS = [(r['id'], ) for r in query(''' -SELECT id FROM observatory.obs_column +SELECT id FROM obs_column WHERE type ILIKE 'text' AND weight > 0 ''', is_meta=True).json()['rows']] BOUNDARY_COLUMNS = [(r['id'], ) for r in query(''' -SELECT id FROM observatory.obs_column +SELECT id FROM obs_column WHERE type ILIKE 'geometry' AND weight > 0 ''', is_meta=True).json()['rows']]