Commit Graph

396 Commits

Author SHA1 Message Date
Maxime Beauchemin
e8088d5c9a More improvements to SQL Lab (#1104)
* Handling timeouts

* Fixing timer on non-utc server

* Allowing async with results

* [bugfix] database is not selected

* Making sure the session is up and running

* Cleaning up query results and query objects

* Picking a groupby and metric field on visualize flow

* Showing local time in query history

* Using pull-left pull-right instead of grid layout for table metdata

Long column name were looking weird and icons were wrapping oddly

* Linting

* Eliminating east buttons under the sql editor

* Sort database dropdown by name

* Linting

* Allowing non-SELECT statements to run

* Adding a db config

* Making sqla checkout check cross-db
2016-09-19 15:28:10 -07:00
Riccardo Magliocchetti
8081080709 log: be more robust against malformed input (#1127)
Refs #1113
2016-09-19 15:26:57 -07:00
Riccardo Magliocchetti
8c619e8383 models: fix slice creation (#1130)
Fix #1128
2016-09-19 15:23:15 -07:00
Maxime Beauchemin
1c544c9845 Enable list with checkboxes only on Table->Columns view (#1138) 2016-09-19 15:22:37 -07:00
Dennis O'Brien
ca66ba4893 Fix initialization of Database sqlalchemy_uri and password (#1137)
* move initialization of Database sqlalchemy_uri and password from DatabaseView.pre_add to utils.get_or_create_main_db.
Unit tests for mysql and postgres include username and password in the SQLALCHEMY_DATABASE_URI.

* modified test_testconn to work with sqlalchemy uri with a username and password.
2016-09-19 15:14:00 -07:00
Riccardo Magliocchetti
afa1f0916b Make sql test connection work with saved Database instance (#694)
Fix #596
2016-09-17 12:32:41 -07:00
Riccardo Magliocchetti
69d37d8b2a Fix double escaping of dttm expressions (#744) (#1103)
If ddtm_expr is an expression with special characters then timestamp_grain escapes
the special characters already escaped.

Solution discussed with sqlalchemy upstream:
https://bitbucket.org/zzzeek/sqlalchemy/issues/3737/literal_column-given-a-specific-sql

Fix #617
2016-09-17 12:30:50 -07:00
Maxime Beauchemin
b62d7e3e8e [security] prevent XSS on FAB list views (#1125)
* [security] prevent XSS on FAB list views

* addressing comments
2016-09-16 16:25:42 -07:00
Maxime Beauchemin
e8f1baba43 [explore] giving more room to Slice title (#1118)
* [explore] giving more room to Slice title

* h2->h3 for slice title
2016-09-16 15:41:34 -07:00
vera-liu
ffe6fb849f Apply stretchMargin only to distribution bar (#1124)
* When the label size is too short, the constant for calculating
margin_size does not apply. Also nvd3 auto-adjust font-size of axis
labels.
Temporary solution here: Setting a fixed font-size on nvd3 axis labels
and a minimum threshold for label size.

* Only stretch margin for dist_bar
2016-09-16 15:39:50 -07:00
Maxime Beauchemin
3602d940eb [hotfix] lint 2016-09-16 09:47:21 -07:00
Maxime Beauchemin
9389f89889 [welcome] removing calendar heatmap from welcome page (#1119) 2016-09-16 08:32:59 -07:00
Maxime Beauchemin
edcc2a11c6 Fixing druid culster perms to mirror sqla databases (#1123) 2016-09-16 08:32:37 -07:00
Maxime Beauchemin
2adc8a0274 [explore] clarifying force-refresh message 2016-09-16 08:20:06 -07:00
vera-liu
2432c3155a Associate version to entry files (#1060)
* Associate version to entry files

* Modified path joins for configs

* Made changes based on comments
2016-09-15 17:20:18 -07:00
vera-liu
2132f6715e When the label size is too short, the constant for calculating (#1120)
margin_size does not apply. Also nvd3 auto-adjust font-size of axis
labels.
Temporary solution here: Setting a fixed font-size on nvd3 axis labels
and a minimum threshold for label size.
2016-09-15 16:48:35 -07:00
Maxime Beauchemin
e895807158 [bugfix] namespacing the mapbox css 2016-09-14 21:24:06 -07:00
Maxime Beauchemin
17a317554c [bugfix] filter_immune_slices doesn't work (#1110) 2016-09-14 14:19:37 -07:00
Bogdan
a871ee7858 Clean up the druid sync api. (#1101) 2016-09-13 17:30:36 -07:00
Ryan Ye
2e6b4b121f Time grain support for unix-timestamp columns (#1093)
* Add time grain support for time columnd in unix timestamp

* Fix datetime parsing for unix epoch

Since we've already converted unix epoch to datetime type,
we shouldn't specify 'unit' parameter in pandas.to_datetime

* Fix SQLite timestamp to datetime conversion
2016-09-13 11:58:47 -07:00
Maxime Beauchemin
df533d30fc [sql lab] specify schema name when generating vanila query (#1096)
* [sql lab] specify schema name when generating vanila query

* Fixing some react warnings
2016-09-12 23:09:18 -07:00
vera-liu
1f761c61dd Single quote filter values with comma (#1084)
* Single quote filter values with comma

* refactor for codeclimate limite

* Added unit tests and tooltip
2016-09-12 13:41:05 -07:00
Maxime Beauchemin
9bf5620887 [sqllab] hide SqlEditor textarea to prevent flicker 2016-09-12 09:23:14 -07:00
Maxime Beauchemin
1971bf653c Numerous improvements to SQL Lab (#1088)
* Improving the Visualize flow

* Fixed the timer

* CTAS

* Expiclit engine handling

* make tab full height, stretch for longer content (#1081)

* Better error handling for queries

* Hooked and fixed CSV export

* Linting

* Tying in the dttm in the viz flow

* Indicator showing when going offline

* Addressing comments, fixing the build

* Fixing unit tests
2016-09-11 07:39:07 -07:00
Bogdan
c20ee0c129 Filter Druid Datasources by user permissions. (#1090) 2016-09-09 17:12:09 -07:00
Maxime Beauchemin
6aadc6ec13 Simplifying the flow to add a table (#1068)
When specifying a table reference that can not be found, the system used
to still create the object, which would result in confusion and bad
error messages down the line. Now it will fail and not create the
object.

I also removed fields that are not necessary to worry about when
initially creating the table.
2016-09-09 16:39:11 -07:00
Alanna Scott
8eb4cbf66e only show the reset state button if location param (#1075) 2016-09-08 13:54:00 -07:00
Alanna Scott
0e0eaa0ccd [sql-lab] ui polish (#1079)
* we don't need tooltips on accordion menu, known ui pattern

* use consistent type sizes, bump body type down to 14px

* make editor same height as 3 selects

* table meta data accordion menu

- prevent default on accordion clicks
- always show table actions, they are more discoverable like that
- polish spacing/layout

* remove hover effect on table actions
2016-09-08 12:31:45 -07:00
Bogdan
d454fb402b Add refresh druid datasources endpoint. (#1065) 2016-09-07 17:27:35 -07:00
vera-liu
9ae231aeb8 adjust bottom margin according to label sizes on x-axis (#1029)
* adjust bottom margin according to label sizes on x-axis
Note: same as the method in heatmap.js

* add default bottom_margin to dropdown

* Change default to auto
2016-09-07 14:07:02 -07:00
Bogdan
e783219a76 Add cache warmup endpoint (#1063)
* Refactor permissions in the views.py.

* Add get_viz to the slice.

* Add warm up cache endpoint.

* Resolve comments.
2016-09-06 13:58:09 -07:00
Maxime Beauchemin
62c71110df Adding a ShrinkSql component (#1058) 2016-09-06 11:20:58 -07:00
vera-liu
9914901099 Change the font on axis (#1028)
A minor css change to make histogram viz look consistent
2016-09-02 10:01:13 -07:00
Maxime Beauchemin
badac7379e [touchup] using input-sm on text fields in explore view 2016-09-01 14:59:28 -07:00
Maxime Beauchemin
7dd01cff6f [bugfix] btn timer contianer was left behind 2016-09-01 14:44:20 -07:00
Maxime Beauchemin
4b77710016 [SQL Lab] Adding DB options for SQL LAb (#1054)
* [SQL Lab] Adding DB options for SQL LAb

each db can be exposed or not in SQL Lab
CTAS is an option
target_schema placeholder (not hooked yet, but would force the CTAS to
target a specific schema)

* Addressing comments
2016-09-01 14:21:46 -07:00
Chris Williams
bae21194c1 Chris/remove redirect from slice id endpoint (#1044)
* call explore() directly from '/caravel/slice/id/' endpoint instead of redirecting to it.

* pass slice_id instead of slice_params in 'caravel/slice/id/' endpoint to avoid logging errors. add fix for MultiDict bug

* address max's comments

* remove the /slice/id/ endpoint in preference of /datasource_type/datasource_id/slice_id/

* pep8
2016-08-31 16:45:03 -07:00
Bogdan
f300ee1010 Small codeclimate fixes. (#1033) 2016-08-31 13:28:42 -07:00
Bogdan
85d03f5e18 Set up istanbul with codeclimate and travis. (#1046)
* Set up istanbul with codeclimate and travis.

* Put the codeclimate tocken inside .travis.yml
2016-08-31 09:27:07 -07:00
Maxime Beauchemin
3f889492f9 Fixing the build [that I broke] 2016-08-30 23:27:56 -07:00
maxime.beauchemin@airbnb.com
508feb2bad [hotfix] getting presto on track 2016-08-31 00:11:00 +00:00
Maxime Beauchemin
9f8eef498c [theme] a little bit less blue (#1024)
* [theme] a little bit less blue

* Addressing comments
2016-08-30 15:02:09 -07:00
Maxime Beauchemin
561828c2f8 [SQL Lab] moving the db/schema/table select to the left (#1038) 2016-08-30 11:08:41 -07:00
Maxime Beauchemin
38b8db8051 SQL Lab - A multi-tab SQL editor (#514)
* Carapal react mockup

This is really just a mock up written in React to try different
components. It could become scaffolding to build a prototype, or not.

* Merging in Alanna's theme tweaks for SQL lab

* Tweak the display of the alert message in navbar

* Sketching the middleware refresh for Queries

* Adjustments

* Implement timer sync.

* CTAS

* Refactor the queries to be stored as a dict. (#994)

* Download csv endpoint. (#992)

* CSV download engdpoint.

* Use lower case booleans.

* Replcate loop with the object lookup by key.

* First changes for the sync

* Address comments

* Fix query deletions. Update only the queries from the store.

* Sync queries using tmp_id.

* simplify

* Fix the tests in the carapal. (#1023)

* Sync queries using tmp_id.

* Fix the unit tests

* Bux fixes. Pass 2.

* Tweakin' & linting

* Adding alpha label to the SQL LAb navbar entry

* Fixing the python unit tests
2016-08-29 21:55:31 -07:00
Maxime Beauchemin
f17cfcbfa2 [filter box] making filter order matches the dropdown (#1007)
fixes https://github.com/airbnb/caravel/issues/1005
2016-08-26 15:22:43 -07:00
Maxime Beauchemin
7eceb140be [bugfix] slice description makes charts overflow (#993) (#1010) 2016-08-26 15:21:16 -07:00
Maxime Beauchemin
b93f9ec598 [line chart] adding option for circle markers (#1006) 2016-08-26 11:45:46 -07:00
Alanna Scott
36a6714e9e slice/explore header (#996)
* move slice header to partial, show datasource in slice title area if no slice is saved

* change partial name, and use same styling as slice title

* use jinja style guide spacing rule

* use [datasource] - untitled
2016-08-25 11:22:11 -07:00
Shashank Shekhar
30071eef09 Reduced number of ticks provided as hint to d3.ticks (#1012)
The number of the ticks suggested scales with 3 times as much
as the number of bins. This is unwanted since the number
of ticks is a hint to d3 as per (https://github.com/d3/d3-3.x-api-reference/blob/master/Quantitative-Scales.md#identity_ticks) The high number of suggesting ticks leads to a congested y-axis.
2016-08-25 08:18:22 -07:00
Alanna Scott
e85978a7ed add if enableAddSlice is truthy (#1015) 2016-08-25 00:03:46 -07:00