-
Notifications
You must be signed in to change notification settings - Fork 436
Clean up hidden_views by making it an attribute of WorkbookItem #617
8000 New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hidden views is sort of a property of the publish -- This is the kind of hidden where you 'unselect' the checkbox in the Desktop dialog. The hidden that is permanent is controlled by the XML inside the workbook itself. This might be a better way, it might not... I'm not sure. |
@shinchris and @RussTheAerialist please review. |
Alright I'm convinced that this is a good way to do it, I'll re-review |
@t8y8 what were your thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t8y8 what were your thoughts?
You made a good point before, that hidden_views is a property of the publish. Plus it's not something we return as a property of the workbook, unlike show_tabs.
The use case of reusing the parameters across multiple publishes (like a batch publish across sites or something) seemed reasonable, but you're right, this isn't returned for the workbook model so maybe comparisons to 'show_tabs' aren't apt. I also got that passing the parameters down felt weird (include_usage is similar where it feels slightly out of place andhas to be passed through multiple layers).
This is something that's actually been a pain in many small ways for a while, if you 'don't publish' those sheets, but open them in Web Authoring, they will still be there, because they're still part of the workbook. This 'unpublished' property of the sheet is just a weird little wart from our Desktop dominant days.
So I could be convinced either way, but maybe I should stick with my original gut, that putting it on the model is the wrong place :)
@@ -236,8 +236,7 @@ def delete_permission(self, item, capability_item): | |||
@parameter_added_in(connections='2.8') | |||
def publish( | |||
self, workbook_item, file_path, mode, | |||
connection_credentials=None, connections=None, as_job=False, | |||
hidden_views=None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should at minimum throw a warning here, and possibly keep it working both ways for a release.
@RussTheAerialist usually has good opinions on back compat.
I could be convinced it's not worth it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used the new hidden_views in the publish. What we do is migrate from our UAT server to our Prod server. The developer publishes to UAT for testing and hides not-for-display views. What I have a problem with is that I don't know how to get a complete list of views from the UAT workbook because the request only returns unhidden views. I end up doing two publishes. The first publishes the workbook without hidden views and exposes all available views in Prod. I then get a list of all the views from UAT and compare. I then publish to Prod with the minus of the views comparison as hidden_views.
Is there a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the back compat answer here is that if you include hidden_views as a publish parameter, it will override anything already set on the workbook model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the embedding API has isHidden as an attribute on each sheet. Given the choice, we should move the models closer together rather than farther apart, so that seems like the right design here as well.
I have used the new hidden_views in the publish. What we do is migrate from our UAT server to our Prod server. The developer publishes to UAT for testing and hides not-for-display views. What I have a problem with is that I don't know how to get a complete list of views from the UAT workbook because the request only returns unhidden views. I end up doing two publishes. The first publishes the workbook without hidden views and exposes all available views in Prod. I then get a list of all the views from UAT and compare. I then publish to Prod with the minus of the views comparison as hidden_views. Is there a better way? |
Thanks for the contribution! Before we can merge this, we need @scuml to sign the Salesforce.com Contributor License Agreement. |
In a following commit I'll add back handling for the old way, so it's easy to remove after it's been deprecated for a release. |
commit ad57851 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Nov 11 15:55:01 2021 -0600 Jorwoods/type hint revisions (tableau#956) Add type hints and tests for workbook and data source revisions commit bb0feb8 Author: elsherif <selsherif@tableau.com> Date: Wed Nov 10 01:21:16 2021 +0100 Add support to datasource and workbook revisions (tableau#931) * add support to datasource and workbook revisions (get all item revisions / downlad item by revision number) * add type hints * remove wrong type hints commit 31d420f Author: Stephen Mitchell <scum@mac.com> Date: Tue Nov 9 01:02:14 2021 -0500 Clean up hidden_views by making it an attribute of WorkbookItem (tableau#617) * Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml commit 7443f68 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Sun Nov 7 05:57:42 2021 -0600 Add type hints to `Job` (tableau#939) commit c8170ae Author: Tyler Doyle <doyle.tyler@gmail.com> Date: Mon Nov 1 20:36:17 2021 -0400 Fix slack once and for all (tableau#946) The red X keeps coming back so I'd like to mark this as allowably fail-able -- that way the innards of Slack/OAuth/Tableau credentials don't keep polluting test run reports :)
commit ad57851 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Nov 11 15:55:01 2021 -0600 Jorwoods/type hint revisions (tableau#956) Add type hints and tests for workbook and data source revisions commit bb0feb8 Author: elsherif <selsherif@tableau.com> Date: Wed Nov 10 01:21:16 2021 +0100 Add support to datasource and workbook revisions (tableau#931) * add support to datasource and workbook revisions (get all item revisions / downlad item by revision number) * add type hints * remove wrong type hints commit 31d420f Author: Stephen Mitchell <scum@mac.com> Date: Tue Nov 9 01:02:14 2021 -0500 Clean up hidden_views by making it an attribute of WorkbookItem (tableau#617) * Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml commit 7443f68 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Sun Nov 7 05:57:42 2021 -0600 Add type hints to `Job` (tableau#939)
commit ed940a2 Author: Jac <jacalata@users.noreply.github.com> Date: Thu Jan 27 20:16:31 2022 -0800 make tests run even if code style fails (tableau#980) commit fb49f31 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Jan 27 21:54:31 2022 -0600 Jorwoods/type hint flows (tableau#937) * Type hint Flows * Type hint request_factory for flows * Add ConnectionItem type hints on to Flow publish request * Clean up flows publish signature * Fix flow update_permissions type hint * Fix update_permissions type hint * Add workbook.hidden_views type hint * Update permissions only accepts an iterable * Fix formatting commit f40d4bc Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Jan 27 21:47:53 2022 -0600 Jorwoods/type hint favorites (tableau#936) * Type hint Favorites * Type hint FavoriteRequest commit 4d0142d Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Jan 27 21:45:14 2022 -0600 Jorwoods/type hint data alert (tableau#934) * Type hint data alerts * Type hint DataAlertRequest * Remove type annotations from Frequency namespace * Update test_dataalert.py commit b836f33 Author: Brian Cantoni <bcantoni@salesforce.com> Date: Thu Jan 27 19:29:50 2022 -0800 WIP: Enable Black for CI and add as dependency (tableau#935) * Enable Black for CI and add as dependency * Bulk reformat with Black, line length 120 Co-authored-by: Jac Fitzgerald <jac.fitzgerald@salesforce.com> commit ad57851 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Nov 11 15:55:01 2021 -0600 Jorwoods/type hint revisions (tableau#956) Add type hints and tests for workbook and data source revisions commit bb0feb8 Author: elsherif <selsherif@tableau.com> Date: Wed Nov 10 01:21:16 2021 +0100 Add support to datasource and workbook revisions (tableau#931) * add support to datasource and workbook revisions (get all item revisions / downlad item by revision number) * add type hints * remove wrong type hints commit 31d420f Author: Stephen Mitchell <scum@mac.com> Date: Tue Nov 9 01:02:14 2021 -0500 Clean up hidden_views by making it an attribute of WorkbookItem (tableau#617) * Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml commit 7443f68 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Sun Nov 7 05:57:42 2021 -0600 Add type hints to `Job` (tableau#939) commit c8170ae Author: Tyler Doyle <doyle.tyler@gmail.com> Date: Mon Nov 1 20:36:17 2021 -0400 Fix slack once and for all (tableau#946) The red X keeps coming back so I'd like to mark this as allowably fail-able -- that way the innards of Slack/OAuth/Tableau credentials don't keep polluting test run reports :) commit 946469c Author: jorwoods <jorwoods@users.noreply.github.com> Date: Mon Nov 1 14:33:22 2021 -0500 Type hinting on Datasources and Workbooks (tableau#804) Adds types to function signatures for Workbook and Data Source endpoints. Co-authored-by: Jordan Woods <Jordan.Woods@mkcorp.com> commit feed39c Author: Brian Cantoni <bcantoni@tableau.com> Date: Tue Oct 26 08:04:10 2021 -0700 Switch to release Python 3.10 release for CI (tableau#927) * Switch to release Python 3.10 release for CI commit 4007d3d Author: Jac <jacalata@users.noreply.github.com> Date: Fri Oct 22 19:06:20 2021 -0700 Jac/publish samples (tableau#918) * add publish-samples option to create/update project commit a899a95 Author: mmuttreja-tableau <87720143+mmuttreja-tableau@users.noreply.github.com> Date: Thu Oct 21 12:10:37 2021 -0400 Adjusting changelog to include missing updates for release 0.17 (tableau#922) commit f81039a Merge: fefd6f1 46bbe2e Author: mmuttreja-tableau <87720143+mmuttreja-tableau@users.noreply.github.com> Date: Wed Oct 20 17:43:50 2021 -0400 Merge pull request tableau#921 from tableau/development Merging Development to Main branch for releasing v 0.17 commit 46bbe2e Author: mmuttreja-tableau <87720143+mmuttreja-tableau@users.noreply.github.com> Date: Wed Oct 20 17:26:45 2021 -0400 Update contributors and Changelog for Release 0.17 (tableau#920) * Update CONTRIBUTORS.md & changelog for v 0.17 Update contributors & changelog for v 0.17 commit 428eb55 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Tue Oct 19 12:32:51 2021 -0500 Add FlowRun Item and Endpoints. (tableau#884) * Add tests for fetching flow runs * Implement basics of FlowRuns * Add tests for cancel flow run * Make FlowRuns a Queryset endpoint for easier filtering * Add test for flow refresh endpoint * Align to naming conventions * Apply name change consistently * Change flowrun_id into flow_run_id * Add wait_for_job to FlowRun * Tag wait_for_job with version number * Rewrite flow_run to use ExponentialBackoffTimer * Test flow run wait with backoff * Remove 3.5 from test matrix * Standardize spelling of cancelled Co-authored-by: Jordan Woods <Jordan.Woods@mkcorp.com> commit fefd6f1 Merge: 1d8a9be 0845b7b Author: Jac <jacalata@users.noreply.github.com> Date: Thu Sep 2 17:49:07 2021 -0700 Merge pull request tableau#880 from tableau/upgrade-slack-action Upgrade to newer Slack action provider commit 0845b7b Author: Brian Cantoni <bcantoni@tableau.com> Date: Wed Sep 1 14:22:53 2021 -0700 Upgrade to newer Slack action provider commit 1d8a9be Merge: 5cbfc34 770d48a Author: Ovini Nanayakkara <44311587+ovinis@users.noreply.github.com> Date: Fri Jul 16 12:42:30 2021 -0400 Merge pull request tableau#864 from tableau/development Merging Development to Main branch commit 5cbfc34 Merge: ec3cc50 ffefd80 Author: Jac <jacalata@users.noreply.github.com> Date: Wed Jun 23 23:33:47 2021 -0700 Merge pull request tableau#851 from tableau/jacalata-patch-1 Create slack.yml action commit ffefd80 Author: Jac <jacalata@users.noreply.github.com> Date: Mon May 24 13:34:07 2021 -0700 whitespace change to re-try PR commit 0c4fd4a Author: Jac <jacalata@users.noreply.github.com> Date: Mon May 24 13:15:49 2021 -0700 Create slack.yml Created a new action from https://github.com/marketplace/actions/send-message-to-slack
commit ad57851 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Nov 11 15:55:01 2021 -0600 Jorwoods/type hint revisions (tableau#956) Add type hints and tests for workbook and data source revisions commit bb0feb8 Author: elsherif <selsherif@tableau.com> Date: Wed Nov 10 01:21:16 2021 +0100 Add support to datasource and workbook revisions (tableau#931) * add support to datasource and workbook revisions (get all item revisions / downlad item by revision number) * add type hints * remove wrong type hints commit 31d420f Author: Stephen Mitchell <scum@mac.com> Date: Tue Nov 9 01:02:14 2021 -0500 Clean up hidden_views by making it an attribute of WorkbookItem (tableau#617) * Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml commit 7443f68 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Sun Nov 7 05:57:42 2021 -0600 Add type hints to `Job` (tableau#939) commit c8170ae Author: Tyler Doyle <doyle.tyler@gmail.com> Date: Mon Nov 1 20:36:17 2021 -0400 Fix slack once and for all (tableau#946) The red X keeps coming back so I'd like to mark this as allowably fail-able -- that way the innards of Slack/OAuth/Tableau credentials don't keep polluting test run reports :)
commit ad57851 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Nov 11 15:55:01 2021 -0600 Jorwoods/type hint revisions (tableau#956) Add type hints and tests for workbook and data source revisions commit bb0feb8 Author: elsherif <selsherif@tableau.com> Date: Wed Nov 10 01:21:16 2021 +0100 Add support to datasource and workbook revisions (tableau#931) * add support to datasource and workbook revisions (get all item revisions / downlad item by revision number) * add type hints * remove wrong type hints commit 31d420f Author: Stephen Mitchell <scum@mac.com> Date: Tue Nov 9 01:02:14 2021 -0500 Clean up hidden_views by making it an attribute of WorkbookItem (tableau#617) * Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml commit 7443f68 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Sun Nov 7 05:57:42 2021 -0600 Add type hints to `Job` (tableau#939) commit c8170ae Author: Tyler Doyle <doyle.tyler@gmail.com> Date: Mon Nov 1 20:36:17 2021 -0400 Fix slack once and for all (tableau#946) The red X keeps coming back so I'd like to mark this as allowably fail-able -- that way the innards of Slack/OAuth/Tableau credentials don't keep polluting test run reports :)
commit ad57851 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Thu Nov 11 15:55:01 2021 -0600 Jorwoods/type hint revisions (tableau#956) Add type hints and tests for workbook and data source revisions commit bb0feb8 Author: elsherif <selsherif@tableau.com> Date: Wed Nov 10 01:21:16 2021 +0100 Add support to datasource and workbook revisions (tableau#931) * add support to datasource and workbook revisions (get all item revisions / downlad item by revision number) * add type hints * remove wrong type hints commit 31d420f Author: Stephen Mitchell <scum@mac.com> Date: Tue Nov 9 01:02:14 2021 -0500 Clean up hidden_views by making it an attribute of WorkbookItem (tableau#617) * Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml commit 7443f68 Author: jorwoods <jorwoods@users.noreply.github.com> Date: Sun Nov 7 05:57:42 2021 -0600 Add type hints to `Job` (tableau#939) commit c8170ae Author: Tyler Doyle <doyle.tyler@gmail.com> Date: Mon Nov 1 20:36:17 2021 -0400 Fix slack once and for all (tableau#946) The red X keeps coming back so I'd like to mark this as allowably fail-able -- that way the innards of Slack/OAuth/Tableau credentials don't keep polluting test run reports :)
* Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml
* Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml
* Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml
* Clean up hidden views and make it an attribute of workbookitem * Pycodestyle error fix for one letter variable Co-authored-by: Jac <jacalata@users.noreply.github.com> Co-authored by: Stephen Mitchell https://github.com/scuml
Makes
hidden_views
an attribute of WorkbookItems. This better follows the pattern set byshow_tabs
, keeps publish from getting too many parameters, and keepshidden_views
from being passed along from submethod to submethod to get to its destination.