Merge pull request #84 from CartoDB/use-observatory-account-meta

simpler access to metadata via observatory.cartodb.com
This commit is contained in:
Mario de Frutos 2016-05-18 08:14:49 +02:00
commit fe3a6759f7
2 changed files with 4 additions and 4 deletions

View File

@ -16,4 +16,4 @@ to the test Observatory account.
Run automated tests against a hostname:
(venv) OBS_HOSTNAME=<hostname.cartodb.com> OBS_API_KEY=foobar OBS_META_HOSTNAME=<meta hostname> OBS_META_API_KEY=<meta api_key> nosetests scripts/autotest.py
(venv) OBS_HOSTNAME=<hostname.cartodb.com> OBS_API_KEY=<api_key> OBS_META_HOSTNAME=observatory.cartodb.com OBS_META_API_KEY= nosetests scripts/autotest.py

View File

@ -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']]