jessie-ross opened a new issue, #26390: URL: https://github.com/apache/superset/issues/26390
## [SIP] Proposal for Google Sheets Export ### Motivation One-click export to Google Sheets is an important usability improvement that's desired at my company, as well as generally by Superset users: - https://github.com/apache/superset/issues/10332 - https://github.com/apache-superset/superset-roadmap/issues/99 - https://github.com/apache/superset/issues/8840 - https://github.com/apache/superset/issues/7904 - https://github.com/apache/superset/issues/6796 Uploading the data directly to Google Sheets removes a barrier for less technical users, allowing them to work with data in a more familiar way, and is a major workflow improvement for users that have to frequently upload data to Google Sheets to share. ### Proposed Change I propose adding Google Sheets as an export option for SqlLab results, as well as providing a bit more of a framework for future export extensions, both for the UI and code. See the implementation in this PR (will create the PR once this has been posted - for now see [this branch comparison](https://github.com/apache/superset/compare/master...jessie-ross:superset:add/gsheets-export).) **New UI:**  https://github.com/apache/superset/assets/971886/c495dcb4-84ee-4d5c-9353-decefd71cbf0 ### New or Changed Public Interfaces - **UI:** Replacing "Download to CSV" with "Export" dropdown menu in the results toolbar. - **UI:** New `/export/:clientId/google-sheets/` page that performs the export and navigates to the Google Sheet. - **API Endpoint**: New `/api/v1/sqllab/export/<string:client_id>/google-sheets/` - **API Endpoint**: For existing CSV endpoint: - Added matching `/api/v1/sqllab/export/<string:client_id>/csv/` - Keeping existing `/api/v1/sqllab/export/<string:client_id>/` (I would like to deprecate this somehow, I've changed all internal references.) - **Feature flag:** `GOOGLE_SHEETS_EXPORT`. - **Configuration:** `GOOGLE_SHEETS_EXPORT_SERVICE_ACCOUNT_JSON_PATH`. - **Configuration:** `GOOGLE_SHEETS_EXPORT_SHARE_PERMISSIONS`. - **Optional Dependency** New `superset[gsheets-export]` - Note we have the existing `superset[gsheets]` that provides Google Sheets as a database. ### New dependencies New pypi packages: - [`gspread`](https://github.com/burnash/gspread) - Under an MIT license. - Over 10 years old, actively maintained (last release 2 days ago.) - The existing `gsheets` package does not allow writing of data, only reading, making this package necessary. ### Migration Plan and Compatibility No migrations necessary, backwards compatible. Slight UI change: - CSV is now hidden behind export menu. ### Rejected Alternatives Alternate UI: - Adding a button next to "Download to CSV" instead of adding a dropdown - too wide, not evolvable. - Moving the "Copy to clipboard" under the "Export" dropdown - I'd like to do it, but it isn't obvious. - Using a modal for the Google Sheet export instead of a page - would need to provide a link as it would be blocked by popup blockers, and it isn't as decoupled as a separate page that performs the export. - If there is a single export method available, show that as a button instead of the dropdown - providing just one approach is much simpler, the dropdown is a hover menu so the extra barrier to use is negligible. Front-end API: - Could use `/sqllab/export/:clientId/google-sheets/` instead of `/export/:clientId/google-sheets/` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
