superset/tests
Maxime Beauchemin f6fe11f76e
[bugfix] convert metrics to numeric in dataframe (#4726)
* [bugfix] convert metrics to numeric in dataframe

It appears sometimes the dbapi driver and pandas's read_sql fail at
returning the proper numeric types for metrics and they show up as
`object` in the dataframe. This results in "No numeric types to
aggregate" errors when trying to perform aggregations or pivoting in
pandas.

This PR looks for metrics in dataframes that are typed as "object"
and uses pandas' to_numeric to convert.

* Fix tests

* Remove all iteritems
2018-04-02 21:48:14 -07:00
..
__init__.py Forgot to add some files for unit tests 2015-09-26 15:56:08 -07:00
access_tests.py [security] Refactor security code into SupersetSecurityManager (#4565) 2018-03-27 16:46:02 -07:00
base_tests.py [security] Refactor security code into SupersetSecurityManager (#4565) 2018-03-27 16:46:02 -07:00
cache_tests.py Cache the query string (#4633) 2018-03-21 13:13:36 -07:00
celery_tests.py [security] Refactor security code into SupersetSecurityManager (#4565) 2018-03-27 16:46:02 -07:00
core_tests.py [security] Refactor security code into SupersetSecurityManager (#4565) 2018-03-27 16:46:02 -07:00
db_engine_specs_test.py [flake8] Adding flake8-coding (#4477) 2018-02-25 15:06:11 -08:00
dict_import_export_tests.py [flake8] Adding flake8-coding (#4477) 2018-02-25 15:06:11 -08:00
druid_func_tests.py [BugFix] Allowing limit ordering by post-aggregation metrics (#4646) 2018-04-02 21:37:00 -07:00
druid_tests.py [security] Refactor security code into SupersetSecurityManager (#4565) 2018-03-27 16:46:02 -07:00
email_tests.py [flake8] Adding flake8-coding (#4477) 2018-02-25 15:06:11 -08:00
form_tests.py forms: make csv import parse dates accepts a list of columns (#4639) 2018-03-23 14:16:02 -07:00
import_export_tests.py [flake8] Adding flake8-coding (#4477) 2018-02-25 15:06:11 -08:00
model_tests.py [sql lab] reduce the number of metadata calls when loading a table (#4593) 2018-03-15 17:53:34 -07:00
security_tests.py [security] Refactor security code into SupersetSecurityManager (#4565) 2018-03-27 16:46:02 -07:00
sql_parse_tests.py [flake8] Resolving Q??? errors (#3847) 2017-11-13 21:06:51 -08:00
sqllab_tests.py [security] Refactor security code into SupersetSecurityManager (#4565) 2018-03-27 16:46:02 -07:00
superset_test_config.py Cache the query string (#4633) 2018-03-21 13:13:36 -07:00
utils_tests.py Added new exception class and start of better exception/error handling (#4514) 2018-03-11 22:07:51 -07:00
viz_tests.py [bugfix] convert metrics to numeric in dataframe (#4726) 2018-04-02 21:48:14 -07:00