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
047c8b0943
remove six dependency ( #6091 )
2018-10-13 09:38:46 -07:00
timifasubaa
5c5be825d9
remove future imports ( #6050 )
2018-10-11 09:46:25 -07:00
John Bodley
1ee08fc216
[select-star] Adding optional schema to view ( #6051 )
2018-10-08 10:32:40 -07:00
Junda Yang
b6d7d57c40
Add schema level access control on csv upload ( #5787 )
...
* Add schema level access control on csv upload
* add db migrate merge point
* fix flake 8
* fix test
* remove unnecessary db migration
* fix flake
* nit
* fix test for test_schemas_access_for_csv_upload_endpoint
* fix test_csv_import test
* use security_manager to check whether schema is allowed to be accessed
* bring security manager to the party
* flake8 & repush to retrigger test
* address comments
* remove trailing comma
2018-09-20 11:21:11 -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
michellethomas
bf0afef7a9
Fix form data issue switching viz types ( #5100 )
...
* Fixing issue with extra params in formData
* Pass in param use_slice_data to decide whether to use slice data
* Fixing core_tests to not use explore_json overrides
2018-08-15 11:25:06 -07:00
Maxime Beauchemin
51bd17d6f6
Improve URLs for Chart and Dashboard ModelViews ( #5544 )
...
* Improve URLs for Chart and Dashboard ModelViews
Prior to this, the ModelView for Chart and Dashboard would be
at `/slicemodelview/list/` and `/dashboardmodelview/list/`.
Now we have cleaner URLs at `/chart/list/` and `/dashboard/list/`
* Fix unrelated js lint
* addressing comments
2018-08-03 12:46:48 -07:00
John Bodley
7fcc2af68f
[sql] Correct SQL parameter formatting ( #5178 )
2018-07-21 12:01:26 -07:00
Maxime Beauchemin
777d876a52
Improve database type inference ( #4724 )
...
* Improve database type inference
Python's DBAPI isn't super clear and homogeneous on the
cursor.description specification, and this PR attempts to improve
inferring the datatypes returned in the cursor.
This work started around Presto's TIMESTAMP type being mishandled as
string as the database driver (pyhive) returns it as a string. The work
here fixes this bug and does a better job at inferring MySQL and Presto types.
It also creates a new method in db_engine_specs allowing for other
databases engines to implement and become more precise on type-inference
as needed.
* Fixing tests
* Adressing comments
* Using infer_objects
* Removing faulty line
* Addressing PrestoSpec redundant method comment
* Fix rebase issue
* Fix tests
2018-06-27 21:35:12 -07:00
Chris Williams
c065319508
[wip] dashboard builder v2 ( #4528 )
...
* [dashboard builder] Add dir structure for dashboard/v2, simplified Header, split pane, Draggable side panel
[grid] add <DashboardGrid />, <ResizableContainer />, and initial grid components.
[grid] gridComponents/ directory, add fixtures/ directory and test layout, add <Column />
[grid] working grid with gutters
[grid] design tweaks and polish, add <Tabs />
[header] add gradient header logo and favicon
[dnd] begin adding dnd functionality
[dnd] add util/isValidChild.js
[react-beautiful-dnd] iterate on dnd until blocked
[dnd] refactor to use react-dnd
[react-dnd] refactor to use composable <DashboardComponent /> structure
[dnd] factor out DashboardComponent, let components render dropInidcator and set draggableRef, add draggable tabs
[dnd] refactor to use redux, add DashboardComponent and DashboardGrid containers
[dragdroppable] rename horizontal/vertical => row/column
[builder] refactor into HoverMenu, add WithPopoverMenu
[builder] add editable header and disableDragDrop prop for Dragdroppable's
[builder] make tabs editable
[builder] add generic popover dropdown and header row style editability
[builder] add hover rowStyle dropdown, make row styles editable
[builder] add some new component icons, add popover with delete to charts
[builder] add preview icons, add popover menu to rows.
[builder] add IconButton and RowStyleDropdown
[resizable] use ResizableContainer instead of DimensionProvider, fix resize and delete bugs
[builder] fix bug with spacer
[builder] clean up, header.size => header.headerSize
[builder] support more drag/drop combinations by wrapping some components in rows upon drop. fix within list drop index. refactor some utils.
[builder][tabs] fix broken add tab button
[dashboard builder] don't pass dashboard layout to all dashboard components, improve drop indicator logic, fix delete component pure component bug
[dnd] refactor drop position logic
* fix rebase error, clean up css organization and use @less vars
* [dashboard-builder] add top-level tabs + undo-redo (#4626 )
* [top-level-tabs] initial working version of top-level tabs
* [top-level-tabs] simplify redux and disable ability to displace top-level tabs with other tabs
* [top-level-tabs] improve tab drag and drop css
* [undo-redo] add redux undo redo
* [dnd] clean up dropResult shape, add new component source id + type, use css for drop indicator instead of styles and fix tab indicators.
* [top-level-tabs] add 'Collapse tab content' to delete tabs button
* [dnd] add depth validation to drag and drop logic
* [dashboard-builder] add resize action, enforce minimum width of columns, column children inherit column size when necessary, meta.rowStyle => meta.background, add background to columns
* [dashboard-builder] make sure getChildWidth returns a number
* [dashboard builder] static layout + toasts (#4763 )
* [dashboard-builder] remove spacer component
* [dashboard-builder] better transparent indicator, better grid gutter logic, no dragging top-level tabs, headers are multiples of grid unit, fix row height granularity, update redux state key dashboard => dashboardLayout
* [dashboard-builder] don't blast column child dimensions on resize
* [dashboard-builder] ResizableContainer min size can't be smaller than size, fix row style, role=none on WithPopoverMenu container
* [edit mode] add edit mode to redux and propogate to all <DashboardComponent />s
* [toasts] add Toast component, ToastPresenter container and component, and toast redux actions + reducers
* [dashboard-builder] add info toast when dropResult overflows parent
* [dashboard builder] git mv to src/ post-rebase
* Dashboard builder rebased + linted (#4849 )
* define dashboard redux state
* update dashboard state reducer
* dashboard layout converter + grid render
* builder pane + slice adder
* Dashboard header + slice header controls
* fix linting
* 2nd code review comments
* [dashboard builder] improve perf (#4855 )
* address major perf + css issues
[dashboard builder] fix dashboard filters and some css
[dashboard builder] use VIZ_TYPES, move stricter .eslintrc to dashboard/, more css fixes
[builder] delete GridCell and GridLayout, remove some unused css. fix broken tabs.
* [builder] fix errors post-rebase
* [builder] add support for custom DragDroppable drag layer and add AddSliceDragPreview
* [AddSliceDragPreview] fix type check
* [dashboard builder] add prettier and update all files
* [dashboard builder] merge v2/ directory int dashboard/
* [dashboard builder] move component/*Container => containers/*
* add sticky tabs + sidepane, better tabs perf, better container hierarchy, better chart header (#4893 )
* dashboard header, slice header UI improvement
* add slider and sticky
* dashboard header, slice header UI improvement
* make builder pane floating
* [dashboard builder] add sticky top-level tabs, refactor for performant tabs
* [dashboard builder] visually distinct containers, icons for undo-redo, fix some isValidChild bugs
* [dashboard builder] better undo redo <> save changes state, notify upon reaching undo limit
* [dashboard builder] hook up edit + create component actions to saved-state pop.
* [dashboard builder] visual refinement, refactor Dashboard header content and updates into layout for undo-redo, refactor save dashboard modal to use toasts instead of notify.
* [dashboard builder] refactor chart name update logic to use layout for undo redo, save slice name changes on dashboard save
* add slider and sticky
* [dashboard builder] fix layout converter slice_id + chartId type casting, don't change grid size upon edit (perf)
* [dashboard builder] don't set version key in getInitialState
* [dashboard builder] make top level tabs addition/removal undoable, fix double sticky tabs + side panel.
* [dashboard builder] fix sticky tabs offset bug
* [dashboard builder] fix drag preview width, css polish, fix rebase issue
* [dashboard builder] fix side pane labels and hove z-index
* Markdown for dashboard (#4962 )
* fix dashboard server-side unit tests (#5009 )
* Dashboard save button (#4979 )
* save button
* fix slices list height
* save custom css
* merge save-dash changes from dashboard v1
https://github.com/apache/incubator-superset/pull/4900
https://github.com/apache/incubator-superset/pull/5051
* [dashboard v2] check for default_filters before json_loads-ing them (#5064 )
[dashboard v2] check for default_filters before json-loads-ing them
* [dashboard v2] fix bugs from rebase
* [dashboard v2] tests! (#5066 )
* [dashboard v2][tests] add tests for newComponentFactory, isValidChild, dropOverflowsParent, and dnd-reorder
* [dashboard v2][tests] add tests for componentIsResizable, findParentId, getChartIdsFromLayout, newEntitiesFromDrop, and getDropPosition
* [dashboard v2][tests] add mockStore, mockState, and tests for DragDroppable, DashboardBuilder, DashboardGrid, ToastPresenter, and Toast
* [dashboard builder][tests] separate files for state tree fixtures, add ChartHolder, Chart, Divider, Header, Row tests and WithDragDropContext helper
* [dashboard v2][tests] fix dragdrop context with util/getDragDropManager, add test for menu/* and resizable/*, and new components
* [dashboard v2][tests] fix and re-write Dashboard tests, add getFormDataWithExtraFilters_spec
* [dashboard v2][tests] add reducer tests, fix lint error
* [dashboard-v2][tests] add actions/dashboardLayout_spec
* [dashboard v2] fix some prop bugs, open side pane on edit, fix slice name bug
* [dashboard v2] fix slice name save bug
* [dashboard v2] fix lint errors
* [dashboard v2] fix filters bug and add test
* [dashboard v2] fix getFormDataWithExtraFilters_spec
* [dashboard v2] logging updates (#5087 )
* [dashboard v2] initial logging refactor
* [dashboard v2] clean up logger
* [logger] update explore with new log events, add refresh dashboard + refresh dashboard chart actions
* [logging] add logger_spec.js, fix reducers/dashboardState_spec + gridComponents/Chart_spec
* [dashboard v2][logging] refactor for bulk logging in python
* [logging] tweak python, fix and remove dup start_offset entries
* [dashboard v2][logging] add dashboard_first_load event
* [dashboard v2][logging] add slice_ids to dashboard pane load event
* [tests] fix npm test script
* Fix: update slices list when add/remove multiple slices (#5138 )
* [dashboard v2] add v1 switch (#5126 )
* [dashboard] copy all dashboard v1 into working v1 switch
* [dashboard] add functional v1 <> v2 switch with messaging
* [dashboard] add v2 logging to v1 dashboard, add read-v2-changes link, add client logging to track v1 <> v2 switches
* [dashboard] Remove default values for feedback url + v2 auto convert date
* [dashboard v2] fix misc UI/UX issues
* [dashboard v2] fix Markdown persistance issues and css, fix copy dash title, don't enforce shallow hovering with drop indicator
* [dashboard v2] improve non-shallow drop target UX, fix Markdown drop indicator, clarify slice adder filter/sort
* [dashboard v2] delete empty rows on drag or delete events that leave them without children, add test
* [dashboard v2] improve v1<>v2 switch modals, add convert to v2 badge in v1, fix unsaved changes issue in preview mode, don't auto convert column child widths for now
* [dashboard v2][dnd] add drop position cache to fix non-shallow drops
* [dashboard] fix test script with glob instead of recurse, fix tests, add temp fix for tab nesting, ignore v1 lint errors
* [dashboard] v2 badge style tweaks, add back v1 _set_dash_metadata for v1 editing
* [dashboard] fix python linting and tests
* [dashboard] lint tests
* add slice from explore view (#5141 )
* Fix dashboard position row data (#5131 )
* add slice_name to markdown
(cherry picked from commit 14b01f1)
* set min grid width be 1 column
* remove empty column
* check total columns count <= 12
* scan position data and fix rows
* fix dashboard url with default_filters
* [dashboard v2] better grid drop ux, fix tab bugs 🐛 (#5151 )
* [dashboard v2] add empty droptarget to dashboard grid for better ux and update test
* [dashboard] reset tab index upon top-level tab deletion, fix findparentid bug
* [dashboard] update v1<>v2 modal link for tracking
* Fix: Should pass slice_can_edit flag down (#5159 )
* [dash builder fix] combine markdown and slice name, slice picker height (#5165 )
* combine markdown code and markdown slice name
* allow dynamic height for slice picker cell
* add word break for long datasource name
* [fix] new dashboard state (#5213 )
* [dashboard v2] ui + ux fixes (#5208 )
* [dashboard v2] use <Loading /> throughout, small loading gif, improve row/column visual hierarchy, add cached data pop
* [dashboard v2] lots of polish
* [dashboard v2] remove markdown padding on edit, more opaque slice drag preview, unsavedChanges=true upon moving a component, fix initial load logging.
* [dashboard v2] gray loading.gif, sticky header, undo/redo keyboard shortcuts, fix move component saved changes update, v0 double scrollbar fix
* [dashboard v2] move UndoRedoKeylisteners into Header, render only in edit mode, show visual feedback for keyboard shortcut, hide hover menu in top-level tabs
* [dashboard v2] fix grid + sidepane height issues
* [dashboard v2] add auto-resize functionality, update tests. cache findParentId results.
* [dashboard v2][tests] add getDetailedComponentWidth_spec.js
* [dashboard v2] fix lint
* [fix] layout converter fix (#5218 )
* [fix] layout converter fix
* add changed_on into initial sliceEntity data
* add unit tests for SliceAdder component
* remove old fixtures file
* [dashboard v2] remove webpack-cli, fresh yarn.lock post-rebase
* [dashboard v2] lint javascript
* [dashboard v2] fix python tests
* [Fix] import/export dash in V2 (#5273 )
* [dashboard v2] add markdown tests (#5275 )
* [dashboard v2] add Markdown tests
* [dashboard v2][mocks] fix markdown mock
2018-06-25 09:17:22 -07:00
Tamika Tannis
dc21e0dd78
URL shortner for dashboards ( #4760 )
...
* Added support for URLShortLinkButton to work for the dashboard case
* Fix lint errors and test
* Change references to 'slice' to 'chart'.
* Add unit tests to improve coverage
* Fixing lint errors
* Refactor to make URLShortLink more generic. Remove history modification code, redirect should be handling this.
* Remove history modification code, redirect should be handling this
* Generate a shorter link without the directory, and delegate default linked to the contents of window.location
* Fix lint errors
* Fix test_shortner test to check for new pattern
* Remove usage of addHistory to manipulate explore shortlink redirection
* Address build failure and using better practices for shortlink defaults
* Fixing alphabetical order
* More syntax mistakes
* Revert explore view history changes
* Fix use of component props, & rebase
2018-06-02 11:08:43 -07:00
Beto Dealmeida
973c661501
Rename "slice" to "chart" and update translations ( #5008 )
...
* Rename slice to chart and update translations
* Fix unit tests
2018-05-21 17:49:02 -07:00
Beto Dealmeida
459cb701fb
Visualization for multiple line charts ( #4819 )
...
* Initial test
* Save
* Working version
* Use since/until from payload
* Option to prefix metric name
* Rename LineMultiLayer to MultiLineViz
* Add more styles
* Explicit nulls
* Add more x controls
* Refactor to reuse nvd3_vis
* Fix x ticks
* Fix spacing
* Fix for druid datasource
* Rename file
* Small fixes and cleanup
* Fix margins
* Add proper thumbnails
* Align yaxis1 and yaxis2 ticks
* Improve code
* Trigger tests
* Move file
* Small fixes plus example
* Fix unit test
* Remove SQL and Filter sections
2018-05-21 17:47:21 -07:00
Maxime Beauchemin
627bdb2eb3
[dashboard] open in edit mode when adding a chart ( #4772 )
...
* [dashboard] open in edit mode when adding a chart
* Move dashboard unit tests to their own file
* fix tests
* Better URL management
2018-04-07 12:55:05 -07:00
timifasubaa
8dd052de4b
[security] Refactor security code into SupersetSecurityManager ( #4565 )
...
* move access permissions methods to security manager
* consolidate all security methods into SupersetSecurityManager
* update security method calls
* update calls from tests
* move get_or_create_main_db to utils
* raise if supersetsecuritymanager is not extended
* rename sm to security_manager
2018-03-27 16:46:02 -07:00
John Bodley
ef4e5ecedf
[bugfix] Fixing regression from #4500 ( #4549 )
2018-03-06 21:19:13 -08:00
John Bodley
7440d34936
[payload] Fixing regression introducted in ##4396
2018-02-28 14:23:20 -08:00
Maxime Beauchemin
83524f97d7
[WiP] Cleanup & fix URL scheme for the explore view ( #4490 )
...
* Improve URLs
* Fix js tests
2018-02-27 15:08:06 -08:00
John Bodley
d57a37e341
[flake8] Adding flake8-coding ( #4477 )
2018-02-25 15:06:11 -08:00
Ville Brofeldt
d6c197f8ac
Remove comments from queries in SQL Lab that break Explore view ( #4413 )
...
* Remove comments from queries in SQL Lab that break Explore view
This fixes an issue where comments on the last line of the source query comment out the closing parenthesis of the subquery.
* Add test case for SqlaTable with query with comment
This test ensures that comments in the query are removed when calling SqlaTable.get_from_clause().
* Add missing blank line class definition (PEP8)
2018-02-18 16:30:11 -08:00
timifasubaa
fa0aa33767
Disable user access request ( #4405 )
...
* add feature flag to config
* wrap check around a feature flag
* add flag to the model view
* remove access request from seurity tests
2018-02-14 14:49:22 -08:00
Grace Guo
342180b263
[Explore view] Use POST method for charting requests ( #3993 )
...
* [Explore view] Use POST method for charting requests
* fix per code review comments
* more code review fixes
* code review fix: remove duplicated calls for getting values from request
* [Explore view] Use POST method for charting requests
* fix per code review comments
* more code review fixes
* code review fix: remove duplicated calls for getting values from request
2018-02-13 17:21:15 -08:00
michellethomas
19a0827d1f
Adding dashboard add view ( #4344 )
...
* Adding DashboardAddView and setting show_columns on SLiceAddView
* Adding tests for sliceaddview read api
* Dedupe show_columns
2018-02-06 12:38:07 -08:00
timifasubaa
6d37d97ba5
Refactor import csv ( #4298 )
...
* move helpers to utils
* make form use queryselector
* refactor exception throwing and handling
* update db_connection access point
* nits
2018-02-03 20:22:06 -08:00
Maxime Beauchemin
e4a95f9428
Use the query_obj as the basis for the cache key ( #4260 )
...
* Use the query_obj as the basis for the cache key
When we recently moved from hashing form_data to define the cache_key
towards using the rendered query instead,
it made is such that non deterministic form
control values like relative times specified in "from" and "until" time
bound resulted in making those miss cache 100% of the time.
Here we move away from using the rendered query and using the query_obj
instead.
* Deprecating using form_data in templates
2018-01-28 09:46:13 -08:00
John Bodley
a7a6678d5c
[cache] Using the query as the basis of the cache key ( #4016 )
2018-01-12 12:05:12 -08:00
fabianmenges
23c98294bd
Moving the custom_password_store out of Database class ( #4182 )
2018-01-09 13:14:20 -08:00
Maxime Beauchemin
37205099db
Fix USA's state geojson for 'Country Map' visualization ( #4121 )
...
* Fix USA's state geojson for 'Country Map' visualization
Turns out the ISO codes were missing from the geojson file, this adds it
and uses human-readable indents.
* using proper ISO codes
* Linting
New linting rules started applying, I'm guessing a new version of
pylint?
2018-01-02 20:21:33 -08:00
Hugh A. Miles II
c84211ec44
Change reference for slices to chart ( #4049 )
...
* change reference for slices to chart
* change profile page reference
* change reference for Associated Slices
* change back to single quotes
* fix other single quotes
* linting
* last one
* fix test
2017-12-12 18:02:17 -08:00
timifasubaa
268edcfedd
Import CSV ( #3643 )
...
* add upload csv button to sources dropdown
* upload csv to non-hive datasources
* upload csv to hive datasource
* update FAQ page
* add tests
* fix linting errors and merge conflicts
* Update .travis.yml
* Update tox.ini
2017-11-27 21:07:12 -08:00
bolkedebruin
4ae77ba8af
Workaround pandas bug in datetimes with time zones ( #3910 )
...
A bug in to_dict(orient="records") in pandas/core/frame.py prevents
datetimes with time zones to be worked with. This works around the
issue in superset by re-implementing the logic of pandas in the
correct way. Until pandas fixes the issue this code should stay.
https://github.com/pandas-dev/pandas/issues/18372
This closes #1929
2017-11-20 08:33:18 -08:00
John Bodley
ac57780607
[flake8] Resolving Q??? errors ( #3847 )
2017-11-13 21:06:51 -08:00
John Bodley
1b4f128f55
[flake8] Resolving F5?? errors ( #3846 )
2017-11-12 11:09:22 -08:00
John Bodley
ba96984048
[flake8] Resolving E3?? errors ( #3814 )
2017-11-10 17:52:34 -08:00
John Bodley
690de862e8
[flake8] Resolve E1?? errors ( #3805 )
2017-11-10 12:06:22 -08:00
John Bodley
1ea4521d0c
[flake8] Resolving E7?? errors ( #3816 )
2017-11-09 20:23:59 -08:00
Hugh A. Miles II
ae8b249dc2
Added /healthcheck endpoint for integrations with envoy ( #3819 )
...
* fixed mergeconflicts
* fixed mergeconflicts forreal this time
* added healthcheck test
2017-11-09 20:23:28 -08:00
John Bodley
17623f71d4
[flake8] Resolving C??? errors ( #3787 )
2017-11-07 21:32:45 -08:00
John Bodley
e822fb50d8
[flake8] Resolving W??? errors ( #3784 )
2017-11-07 20:25:10 -08:00
John Bodley
e2bca47421
[flake8] Resolve I??? errors ( #3797 )
2017-11-07 20:23:40 -08:00
John Bodley
02cbad59de
[flake8] Resolving F8?? errors ( #3778 )
2017-11-06 21:15:36 -08:00
John Bodley
63a49983eb
[falke8] Resolving F6?? errors ( #3783 )
2017-11-06 16:56:03 -08:00
Alejandro Fernandez
adef519583
DI-1113. Authentication: Enable user impersonation for Superset to HiveServer2 using hive.server2.proxy.user (a.fernandez) ( #3652 )
2017-10-16 20:15:16 -07:00
Riccardo Magliocchetti
f438ccbcb1
Add support for column specific fillna to viz ( #3066 )
...
Fix #3029
2017-09-27 17:51:04 -07:00
Jeff Niu
7d934e7246
Feature: query string API endpoint ( #3513 )
...
* exposed API endpoint to get querystring for a slice
* Added unit tests for endpoint
* fixed test case for python3
* moved get querystring logic into its own func
* renamed query string endpoint
2017-09-26 09:03:03 -07:00
fabianmenges
fdee06bbf2
Adding hook for external password store for databases ( #3436 )
2017-09-13 20:59:03 -07:00
Maxime Beauchemin
e53f3032bb
[dashboard] adding an option to duplicate slices when "Saving AS" ( #3391 )
...
* [dashboard] adding an option to duplicate slices when "Saving AS"
* Fix tests
2017-08-30 14:09:29 -07:00