superset/tests
Maxime Beauchemin b839608c32
[sql lab] a better approach at limiting queries (#4947)
* [sql lab] a better approach at limiting queries

Currently there are two mechanisms that we use to enforce the row
limiting constraints, depending on the database engine:
1. use dbapi's `cursor.fetchmany()`
2. wrap the SQL into a limiting subquery

Method 1 isn't great as it can result in the database server storing
larger than required result sets in memory expecting another fetch
command while we know we don't need that.

Method 2 has a positive side of working with all database engines,
whether they use LIMIT, ROWNUM, TOP or whatever else since sqlalchemy
does the work as specified for the dialect. On the downside though
the query optimizer might not be able to optimize this as much as an
approach that doesn't use a subquery.

Since most modern DBs use the LIMIT syntax, this adds a regex approach
to modify the query and force a LIMIT clause without using a subquery
for the database that support this syntax and uses method 2 for all
others.

* Fixing build

* Fix lint

* Added more tests

* Fix tests
2018-05-14 14:44:05 -05:00
..
fixtures [DeckGL] Added fixtures and Deck test (#4798) 2018-04-12 17:20:39 -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 [tests] cleaning up test configuration (#4806) 2018-04-11 14:09:20 -07:00
cache_tests.py Cache the query string (#4633) 2018-03-21 13:13:36 -07:00
celery_tests.py [sql lab] a better approach at limiting queries (#4947) 2018-05-14 14:44:05 -05:00
core_tests.py [dashboard] open in edit mode when adding a chart (#4772) 2018-04-07 12:55:05 -07:00
dashboard_tests.py [dashboard] open in edit mode when adding a chart (#4772) 2018-04-07 12:55:05 -07:00
db_engine_specs_test.py [sql lab] a better approach at limiting queries (#4947) 2018-05-14 14:44:05 -05:00
dict_import_export_tests.py [flake8] Adding flake8-coding (#4477) 2018-02-25 15:06:11 -08:00
druid_func_tests.py Add extraction function support for Druid queries (#4740) 2018-05-08 22:00:06 -07:00
druid_tests.py [druid] Updating Druid refresh metadata tests (#4887) 2018-05-03 18:14:40 -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 [bugfix] temporal columns with expression fail (#4890) 2018-04-26 21:13:52 -07:00
security_tests.py [logs] Dropping dt column (#4587) 2018-04-10 18:34:32 -07:00
sql_parse_tests.py [flake8] Resolving Q??? errors (#3847) 2017-11-13 21:06:51 -08:00
sqllab_tests.py Force lowercase column names for Snowflake and Oracle (#4994) 2018-05-14 13:43:13 -05:00
superset_test_config.py Cache the query string (#4633) 2018-03-21 13:13:36 -07:00
utils.py [DeckGL] Added fixtures and Deck test (#4798) 2018-04-12 17:20:39 -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 [Explore] Adding Adhoc Filters (#4909) 2018-05-10 10:41:10 -07:00