Commit Graph

49 Commits

Author SHA1 Message Date
Bogdan 19a9bcc9c5
chore: ci Initial hive support (#10593)
* Initial hive support

* Clone hive setup

* Make hive tests work locally

* Debugging presto failure

* sleep in dataset test

* Address comments

* Address comments

* Pin ipython, exclude new pylint rules

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-08-27 09:49:18 -07:00
Bogdan 62b873e3da
feat: welcome presto to the suite of tested databases (#10498)
* Add presto to the CI

Sample test data

Datetime conversion

Sample test data

Fix tests

* TODO to switch to timestamps

* Address feedback

* Update requirements

* Add TODOs

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-08-06 12:07:22 -07:00
Bogdan ab404ea2cf
Sample test data (#10487)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-08-03 09:08:49 -07:00
Bogdan 77b36783e7
s/assertEqual/assertEquals (#10195)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-06-29 16:38:06 -07:00
Bogdan 4e340c8368
feat: Switch from nosetest to pytest (#10177)
* Switch from nosetest to pytest

Fix schedule tests

Collect pytest coverage

Move pytest config into pytest.ini

Move cov to the pytest.ini

* Append coverage for the 2nd run

* Add coverage to all commands

* Coverage only for tests

* Get coverage from 1 place

* Rename classes to be  pytest compatible

* Test coverage for examples and tests

* Max diff to -1

* Explain how to run pytest for the whole project

* Do not append code coverage for the main run

* Do not run coverage on examples

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-06-29 15:36:06 -07:00
Erik Ritter f80fadff0e
Reduce dashboard bootstrap payload (#9284) 2020-03-13 12:18:22 -07:00
John Bodley 8a138fbd03
[tox] Allowing running of specific tests (#9097) 2020-02-06 16:45:37 -08:00
John Bodley 2d456e88eb
[fix] Enforce the query result to contain a data-frame (#8935) 2020-01-08 11:50:26 -08:00
Marcus 4cfd6b3ce1 [tests] Fix, removing deprecated function for future Python release compatibility. (#8353)
* removing deprecated function for future Python release compatibility.

* also removed assertNotEquals per @dpgaspar
2019-10-21 15:49:12 +01:00
John Bodley 9fc37ea9f1 [ci] Deprecate flake8 (#8409)
* [ci] Deprecate flake8

* Addressing @villebro's comments
2019-10-18 14:44:27 -07:00
serenajiang 876d329474 [fix] make names non-nullable (#8371) 2019-10-15 16:51:04 -07:00
serenajiang 7e7ea3d9a0 Revert "[fix] make datasource names non-nullable (#8332)" (#8363)
This reverts commit 65a05ca47e.
2019-10-09 11:38:57 -07:00
serenajiang 65a05ca47e [fix] make datasource names non-nullable (#8332) 2019-10-04 09:13:25 -07:00
Maxime Beauchemin 68c4c3a0b9
Prevent 'main' database connection creation (#8038)
* prevent 'main' database connection creation

* fix tests

* removing get_main_database

* Kill get_main_database

* Point to examples tables
2019-09-08 10:18:09 -07:00
Ville Brofeldt 4e1e54b538
[bugfix] Correctly quote table and schema in select_star (#8181)
* Fix select_star table quoting bug

* Add unit test for fully qualified names in select_star

* Rename main_db to db

* Rename test function
2019-09-05 22:44:34 +03:00
Gianluca Ciccarelli e23920b8ba 7620: Start removing dependencies on requests (#7643)
* 7620: Start removing dependencies on requests

* Patch urllib.request.urlopen instead of requests.get

* Try to fix flake8

* More work on flake8 import errors

* First attempt at using urllib with cookies

* Fix pylint/flake8

* Fix test_deliver_slice_csv_attachment

* Fix test_deliver_slice_csv_inline

* Import requests and pydruid conditionally, remove dependency on prison

* Fix flake errors

* Fix load_examples

* Please flake

* Skip tests depending on optional deps

* Try to please flake

* Address review comments

* Remove Druid-related UI

* Revert "Remove Druid-related UI"

This reverts commit d7e0f166cc3f3dd2496b4a666e177f0c191aeb0f.

* Skip a few tests more

* Put imports in right order

* Apply black patch

* Please flake

* Please black, silence flake

* Use flake8 silencing the right way

* Add deps for CI
2019-08-02 10:01:28 -07:00
John Bodley af462fe79f
[revert] Partial revert of #7888 (#7933) 2019-07-29 09:19:21 -07:00
Ville Brofeldt 07a76f83b1
[Bugfix] Remove prequery properties from query_obj (#7896)
* Create query_obj for every filter

* Deprecate is_prequery and prequeries from query_obj

* Fix tests

* Fix typos and remove redundant ; from sql

* Add typing to namedtuples and move all query str logic to one place

* Fix unit test
2019-07-23 22:13:58 +03:00
John Bodley ccedbea506
[fix] Adding space after -- for SQL comments (#7897) 2019-07-18 13:17:26 -07:00
John Bodley 2b3e7fe4de
[sqla] Adding check for invalid filter columns (#7888) 2019-07-18 08:51:41 -07:00
Maxime Beauchemin d65b039219
Improve examples & related tests (#7773)
* [WiP] improve load_examples

related to #7472, longer term we will generate the examples by exporting
them into tarball as in #7472. In the meantime, we need this subset of
the features:

* allowing specifying an alternate database connection for examples
* allowing a --only-metadata flag to `load_examples` to load only
  dashboard and chart definitions, no actual data is loaded

* Improve logging

* Rename data->examples

* Load only if not exist

* By default do not load, add a force flag

* fix build

* set published to true
2019-07-16 21:36:56 -07:00
John Bodley 5c58fd1802
[format] Using Black (#7769) 2019-06-25 13:34:48 -07:00
Maxime Beauchemin 859d6e7c6a
chore: taking db dependencies out of requirements-dev.txt (#7605)
* chore: taking db dependencies out of requirements-dev.txt

The deps on mysqlclient and psycopg2

* Fix unit tests

* fix tox.ini

* fix tests
2019-06-23 22:37:41 -07:00
Ville Brofeldt 34407e8962
Make timestamp expression native SQLAlchemy element (#7131)
* Add native sqla component for time expressions

* Add unit tests and remove old tests

* Remove redundant _grains_dict method

* Clarify time_grain logic

* Add docstrings and typing

* Fix flake8 errors

* Add missing typings

* Rename to TimestampExpression

* Remove redundant tests

* Fix broken reference to db.database_name due to refactor
2019-05-30 08:28:37 +03:00
Ville Brofeldt ea9d22b2ec Force quotes on non-expression time grains on Postgres (#6897)
* Force quotes on non-expression time grains on postgres

* Change to or semantics

* Return lower case column name as unmutated

* Add testcases for postgres time grains

* Make expression MixedCase
2019-02-21 13:16:28 -08:00
agrawaldevesh fc4042a28b SelectControl hackery: Fixing freeform select and allowing group by and non group-by column selectors to take in arbitrary expressions including select-all semantics. (#6722)
Summary: We want to allow grouping by on expressions, including the
ability to select expressions (without group-by). The UI ain't good yet
.. it is not at the feature parity of say adhoc filters/metrics that
come with a nice text-box to edit the SQL. But
this suffices for my usecase for now.

(The UI would have to be redone ... but that would require some refactoring
to merge the AdhocFilter/Metric/Popover stuff such that it can be used
for this use case too.)

Also fixed a bug in the SelectControl freeForm selection.

Allow selecting all columns easily: Added a new Select-All special item
that users can select to make all the options in the selectable show
up.

The ability to group by arbitrary expressions is useful because now two
users don't need to create custom computed-fields for this.
2019-02-04 12:34:24 -08:00
Maxime Beauchemin 1dd4d7a587
Apply ASF licenses throughout the code base (#5800)
* Add license headers

* reabased

* lint

* Removing licenses from vendors folder
2019-01-15 15:53:27 -08:00
Maxime Beauchemin cc3a625a4b
Use py3's f-strings instead of s.format(**locals()) (#6448)
* Use py3's f-strings instead of s.format(**locals())

In light of the bug reported here
https://github.com/apache/incubator-superset/issues/6347, which seems
like an odd `.format()` issue in py3, I greped and replaced all
instances of `.format(**locals())` using py3's f-strings

* lint

* fix tests
2018-12-02 13:50:49 -08:00
timifasubaa 91b758f3bc
Reduce data loaded before loading tests (#6298)
* reduce data loaded before loading tests

* make cypress only load needed tests
2018-11-19 15:27:25 -08:00
Maxime Beauchemin bbfd69a138 [utils.py] gathering/refactoring into a "utils/" folder (#6095)
* [utils] gathering/refactoring into a "utils/" folder

Moving current utils.py into utils/core.py and moving other *util*
modules under this new "utils/" as well.

Following steps include eroding at "utils/core.py" and breaking it down
into smaller modules.

* Improve tests

* Make loading examples in scope for tests

* Remove test class attrs examples_loaded and requires_examples
2018-10-16 17:59:34 -07:00
timifasubaa 46c86672c8 remove utf8 declaration (#6096) 2018-10-15 11:53:24 -07:00
timifasubaa 5c5be825d9
remove future imports (#6050) 2018-10-11 09:46:25 -07:00
michellethomas 657993d609 Moving get_main_db out of tests and into superset utils (#5864) 2018-09-11 22:50:14 -07:00
michellethomas d40ded0be8 Adding simple Cypress tests (#5693)
* Adding simple Cypress tests

* Changing visitChart into multiple commands

* Adding Cypress to tox
2018-09-06 14:55:48 -07:00
Maxime Beauchemin 94cb20cf96
Apply SQL_QUERY_MUTATOR to explore & dashboard (#5493)
* Apply SQL_QUERY_MUTATOR kn explore & dashboard

* Add unit test
2018-07-26 15:20:23 -07:00
John Bodley 0511d1f38d
[get_df] Adding support for multi-statement SQL (#5086) 2018-05-29 14:20:17 -07:00
John Bodley 3207116535
Revert "[get_df] Adding support for multi-statement SQL" (#5078) 2018-05-24 14:59:34 -07:00
John Bodley 17d6464aa9
[get_df] Adding support for multi-statement SQL (#5060) 2018-05-23 11:40:25 -07:00
Maxime Beauchemin 3f48c005df
[bugfix] temporal columns with expression fail (#4890)
* [bugfix] temporal columns with expression fail

error msg: "local variable 'literal' referenced before assignment"

Error occurs [only] when using temporal column defined as a SQL
expression.

Also noticed that examples were using `granularity` instead of using
`granularity_sqla` as they should. Fixed that here.

* Add tests
2018-04-26 21:13:52 -07:00
Maxime Beauchemin a98c3cfdef
Fix time granularity-related issues (#4821)
* Fixing time grain

* Add tests
2018-04-18 16:17:28 -07:00
John Bodley 2900ca345d
[travis] Fixing environments (#4828) 2018-04-15 16:21:33 -07:00
Maxime Beauchemin 93ec76f757
[sql lab] reduce the number of metadata calls when loading a table (#4593) 2018-03-15 17:53:34 -07:00
John Bodley d57a37e341 [flake8] Adding flake8-coding (#4477) 2018-02-25 15:06:11 -08:00
John Bodley e112e4417c [flake8] Adding future-import check (#4476) 2018-02-23 16:42:09 -08:00
Dmitry Goryunov c988080990 Feature: "Impersonate user" setting on Datasource (#3404)
* Add "Impersonate user" setting to Datasource

* Add tests

* Use g.user.username for all the sync cases

* use uri.username instead of uri.user

* Small refactoring
2017-09-18 09:52:29 -07:00
Maxime Beauchemin 91fe02cdc8 Setting adjust_database_uri for HiveEngineSpec (#2636)
* Setting adjust_database_uri for HiveEngineSpec

* fix tests
2017-04-18 12:29:13 -07:00
Maxime Beauchemin ac84fc2b65 Fixing confusion when selecting schema across engines (#2572) 2017-04-10 15:36:58 -07:00
Maxime Beauchemin 2969cc9993 Refactoring Druid & SQLa into a proper "Connector" interface (#2362)
* Formalizing the Connector interface

* Checkpoint

* Fixing views

* Fixing tests

* Adding migrtion

* Tests

* Final

* Addressing comments
2017-03-10 09:11:51 -08:00
Sungju Jin d4b59b36a8 Fixed a bug when querying with schema path to Redshift/Postgresql (#1789) 2017-02-26 22:54:48 -08:00