diff --git a/caravel/utils.py b/caravel/utils.py index 718b3641e607..36dc6eb431fc 100644 --- a/caravel/utils.py +++ b/caravel/utils.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals from datetime import datetime +import decimal import functools import json import logging @@ -229,6 +230,8 @@ def base_json_conv(obj): return int(obj) elif isinstance(obj, set): return list(obj) + elif isinstance(obj, decimal.Decimal): + return float(obj) def json_iso_dttm_ser(obj): diff --git a/caravel/viz.py b/caravel/viz.py index 87e4bf0180b2..8dd3004a0df3 100644 --- a/caravel/viz.py +++ b/caravel/viz.py @@ -103,7 +103,7 @@ def reassignments(self): def get_url(self, **kwargs): """Returns the URL for the viz""" - d = self.form_data.copy() + d = self.orig_form_data.copy() if 'json' in d: del d['json'] if 'action' in d: diff --git a/tests/core_tests.py b/tests/core_tests.py index e67329d13578..183329e71242 100644 --- a/tests/core_tests.py +++ b/tests/core_tests.py @@ -8,6 +8,7 @@ import doctest import json import imp +import logging import os import unittest from mock import Mock, patch @@ -149,7 +150,7 @@ def test_slices(self): (slc.slice_name, 'csv_endpoint', slc.viz.csv_endpoint), ] for name, method, url in urls: - print("[name]/[{method}]: {url}".format(**locals())) + logging.info("[{name}]/[{method}]: {url}".format(**locals())) self.client.get(url) def test_dashboard(self):