You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "jessie-ross (via GitHub)" <gi...@apache.org> on 2024/01/02 10:04:49 UTC
[I] [SIP] Google Sheets Export [superset]
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: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1939655884
Ah, thanks... it was [the mailing list thread](https://lists.apache.org/thread/rml7mmj11vjlvtmxywdbl8zdgnxvo1w1) I didn't find :)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "kasiazjc (via GitHub)" <gi...@apache.org>.
kasiazjc commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-2260923236
> @kasiazjc I think there are a number of places where we save as or export csv/xls/pdf, whatever. I wonder if there's a need to audit and consolidate this as a pattern more globally. Or am I worrying too much?
I think the most noticeable/used cases were the ones in alerts and reports and they are already gone as the screenshot that I posted is already implemented :) so I would say - let's not worry about it now.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "jessie-ross (via GitHub)" <gi...@apache.org>.
jessie-ross commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1929267124
Hi @betodealmeida, just wondering if there was any feedback on this
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP] Proposal for Google Sheets Export [superset]
Posted by "jessie-ross (via GitHub)" <gi...@apache.org>.
jessie-ross commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1874925235
> Note that even though the optional dependency name in Superset is called gsheets, the actual dependency is on the shillelagh package, instead of the old gsheets package, which does allow writing data to Google Sheets.
Ah interesting, seems I got mixed up in my search, I think I did look into Shillelagh too and it seemed to unable to create a new sheet.
> How hard do you think would it be to reuse the GSheetsEngineSpec.df_to_sql method in the [Google Sheets DB engine spec](https://github.com/apache/superset/blob/29633e7d8cad7b52669a9e6f5e064cd34da803a3/superset/db_engine_specs/gsheets.py#L340) instead of adding the gspread dependency?
It looks like we aren't actually using Shillelagh, and are instead using it's internal requests session to make authenticated calls to the Google API directly, I can look into using this method, I would likely need to do some re-factoring with this code, and look into how using the Google Sheets engine authentication secrets for export would work.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "jessie-ross (via GitHub)" <gi...@apache.org>.
jessie-ross commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-2160371938
Thanks Evan, this is next on my list :)On 11 Jun 2024, at 3:31 AM, Evan Rusackas ***@***.***> wrote:
This issue is being closed since the vote passed, and the SIP has served its purpose. Anyone (especially @jessie-ross ) is now clear to move forward with any implementation.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-3608021889
Calling this an extension candidate, because even though that Extension Interface isn't present (yet) I could see this proliferating to export any number of formats (PPT, Arrow, Parquet, whatever)
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP] Proposal for Google Sheets Export [superset]
Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1874296257
> The existing gsheets package does not allow writing of data, only reading, making this package necessary.
Note that even though the optional dependency name in Superset is called `gsheets`, the actual dependency is on the `shillelagh` package, instead of the old `gsheets` package, which **does** allow writing data to Google Sheets.
How hard do you think would it be to reuse the `GSheetsEngineSpec.df_to_sql` method in the [Google Sheets DB engine spec](https://github.com/apache/superset/blob/29633e7d8cad7b52669a9e6f5e064cd34da803a3/superset/db_engine_specs/gsheets.py#L340) instead of adding the `gspread` dependency?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "jessie-ross (via GitHub)" <gi...@apache.org>.
jessie-ross commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1938322001
Hi @rusackas, just in case it was missed, I replied here on slack:
https://apache-superset.slack.com/archives/C015WAR4SDV/p1707473597565419?thread_ts=1704263733.082299&cid=C015WAR4SDV
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1941829767
> For our use-case we'd want separate authentication, as we wouldn't want an extra DB engine to show up (we don't use Google Sheets as an adaptor.)
Ah, makes sense.
> I could detect if a service account is available with a Google Sheets engine to automatically enable Google Sheets export, but this becomes complicated if setup has more than one Google Sheets engine, and auto-enable like this might lead to unintended issues if an admin isn't expecting it.
Yeah, I agree.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP] Proposal for Google Sheets Export [superset]
Posted by "jessie-ross (via GitHub)" <gi...@apache.org>.
jessie-ross commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1874927291
Note there is also an ongoing discussion in the PR on the UX for loading the export (new page vs same page):
https://github.com/apache/superset/pull/26391#discussion_r1439663162
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-2260876477
@kasiazjc I think there are a number of places where we save as or export csv/xls/pdf, whatever. I wonder if there's a need to audit and consolidate this as a pattern more globally. Or am I worrying too much?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "jessie-ross (via GitHub)" <gi...@apache.org>.
jessie-ross commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1888661507
**Amendment to the SIP:**
I would like to add a matching Google Sheets export option for Reports:

- Also behind the same feature flag, and behaves the same.
I've updated the issue to add this in.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1930474574
> ...just wondering if there was any feedback on this
Hi @jessie-ross - I think with a SIP, the goal is to get feedback from as many people as possible to iron out any wrinkles in the proposal. You'll need to kick off a discussion on the Superset dev mailing list to get the official process started. Let me know if you need any help with that. Thanks!
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-3608018354
There has not been a PR for this as far as I know. Anyone intending to work on this? If not, it may be closed as Discarded, but many of us would sure prefer to see it happen!
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP] Proposal for Google Sheets Export [superset]
Posted by "jessie-ross (via GitHub)" <gi...@apache.org>.
jessie-ross commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-1874940333
> [...] look into how using the Google Sheets engine authentication secrets for export would work [...]
The question here is if we want to use the same authentication or separate authentication for export.
For our use-case we'd want separate authentication, as we wouldn't want an extra DB engine to show up (we don't use Google Sheets as an adaptor.)
I'm not really familiar with the UI based configuration system as we exclusively use `superset_config.py`, but from my perspective it seems simple enough to have a separate config variable for `GOOGLE_SHEETS_EXPORT_SERVICE_ACCOUNT_JSON_PATH`.
I could code to detect if a service account is available with a Google Sheets engine to automatically enable Google Sheets export, but this becomes complicated if setup has more than one Google Sheets engine, and auto-enable like this might lead to unintended issues if an admin isn't expecting it.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-2159139442
This issue is being closed since the vote passed, and the SIP has served its purpose. Anyone (especially @jessie-ross ) is now clear to move forward with any implementation.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #26390: [SIP-114] Proposal for Google Sheets Export
URL: https://github.com/apache/superset/issues/26390
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "kasiazjc (via GitHub)" <gi...@apache.org>.
kasiazjc commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-2257547968
@jessie-ross thanks for the SIP! It looks great :) I think there is one thing that has changed in the meantime, which is reports/alerts modal (screenshot below). Instead of radio buttons we now use a simple select field, so not sure how it will affect your work

--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [SIP-114] Proposal for Google Sheets Export [superset]
Posted by "fabiomartins87 (via GitHub)" <gi...@apache.org>.
fabiomartins87 commented on issue #26390:
URL: https://github.com/apache/superset/issues/26390#issuecomment-3524220208
Hello. I was looking for this feature in Superset and I am bit confused with this thread. Was this actually accepted and merged? Is it under any experimental feature flag?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org