10000 Merging Development to Main branch for releasing v 0.17 by mmuttreja-tableau · Pull Request #921 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

Merging Development to Main branch for releasing v 0.17 #921

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

Merged
merged 43 commits into from
Oct 20, 2021

Conversation

mmuttreja-tableau
Copy link
Contributor

No description provided.

sfarr15 and others added 30 commits March 26, 2020 11:59
This is the only pagetype not available via tableau api for PDF. The 'Unspecified' pagetype is available for download using tableau online and desktop so I really don't see an issue adding this. Can this kindly be amended as the workaround for this requires downloading an image and converting to pdf which results in poorer quality and larger data size.
This will allow request parameters like timeout
to be set by user. Because the metadata api use
post_request endpoint, that endpoint will also
support adding request parameters.
This feature was already present in the GET
endpoint
Also add support for Pythong 3.10 RC
Update CI pipeline to test on Mac and Win, add early support for Python 3.10
I don't have the time to figure out a fix for the moment, this might be the fastest way
Revert slack.yml to unblock open PRs
…ame (#888)

I don't have access to the `Default` project on my Tableau server. Still I
want to be able to run this sample...
The official MIME type for JSON is `application/json`, not `text/json`.
I am pretty new to TSC, and wanted to run some sample scripts to get an
understanding of the library. Doing so, I realized that every sample
had a slightly different command line, even for common arguments:
* Some expected `site`, some `site-id`, some were lacking site-support
  completely (and thereby unusable for Tableau Online)
* Some had a short option `-i`, some had the short option `-S` for the
  site name
* Some expected password-based authentication, some expected personal
  access tokens

This commit fixes all those inconsistencies, so that users don't have
to re-learn the command line options for each individual script.
We had at least two independent re-implementations [1, 2] of file uploads
within the last 4 months. And this was despite the fact that both projects
already used TSC which would offer this functionality.

Currently, the upload functionality in TSC is hard to discover as it is not
exposed like all other REST functions. Instead of `server.fileuploads`, one
has to first create an instance of the (undocumented) `Fileuploads` class.

The upload functionality was probably because it should be usually unnecessary:
The uploaded files are usually part of publishing a workbook/datasource/...
and the corresponding `datasources.publish` (and similar) already take care of
the upload internally.
However, TSC isn't always up-to-date with new REST APIs, and by exposing file
uploads directly we can make sure to offer the best possible experience to
users of TSC also in those transition periods.

This commit:
* turns the `Fileuploads` class into a normal endpoint class which is not tied
  to one upload (So far, `Fileuploads` was not stateless. Now it is)
* adds the endpoint to `server`, such that file uploads are available as
  `server.fileuploads`
* adjusts all other users to use `server.fileuploads` instead of constructing
  an ad hoc instance of the `Fileuploads` class

Documentation will be added in a separate commit.

[1] https://github.com/jharris126/tableau-data-update-api-samples/blob/41f51ae4d220de55caf63e91fe9eff5694b9456a/basic/basic_incremental_load.py#L23
[2] https://github.com/tableau/hyper-api-samples/blob/382e66481ec8339407cf9cfa5d41fcdcf3f6a0fb/Community-Supported/clouddb-extractor/tableau_restapi_helpers.py#L165
feat: accept parameters for post endpoint
Expose the `fileuploads` API endpoint and improve exception safety
Add handling for workbooks in personal spaces which will not have pro…
This commit adds support for the `datasources/<id>/data` endpoint
through which one can schedule jobs to update the data within a
published live-to-Hyper datasource on the server.

The new `datasources.update_data` expects the arguments:
* a datasource or a connection: If the datasource only contains a
  single connections, the datasource is sufficient to identify which
  Hyper file should be updated. Otherwise, for datasources with
  multiple connections, the connections has to be provided. This
  distinction happens on the server, so the client library only needs
  to provide a way to specify either of both.
* a `request_id` which will be used to ensure idempotency on the server.
  This parameter is simply passed as a HTTP header .
* an `actions` list, specifying how exactly the data on the server
  should be modified. We expect the caller to provide list following
  the structure documented in the REST API documentation. TSC does not
  validate this object and simply passes it through to the server.
* an optional `payload` file: For actions like `insert`, one can
  provide a Hyper file which contains the newly inserted tuples or
  other payload data. TSC will upload this file to the server and then
  hand it over to the update-API endpoint.

Besides the addition of the `datasources.update_data` itself, this
commit also adds some infrastructure changes, e.g., to enable sending
PATCH requests and HTTP headers.
vogelsgesang and others added 13 commits October 4, 2021 13:24
This commit adds a `wait_for_job` method which will repeatedly poll
a job's status until that job is finished.

Internally, it uses an exponential backoff for the polling intervals.
That way, it is snappy for fast-running jobs without putting too
much load on the server for long-running jobs.

It returns the successfully finished `JobItem` object which might be
of interest to the caller, e.g. to inspect the reported `started_at`
`finished_at` times or the `notes`.

For failed jobs, `wait_for_job` raises an exception. That way, we
ensure that errors in jobs don't accidentally go unnoticed. The
`jobs` object can still be retrieved from the exception object, if
required.
TSC only supports Python 3.5+ and Python 2.7 reached end-of-life already on Jan 1st, 2020.
Let's remove that hack from our code, and move on...
Should have been part of #903, but I forgot to `git add` them :/
Python 3.5 is already end-of-life and no longer receives security patches for over a year now.
Also, I recently added an f-string because all Python versions which are still in support, also
support f-strings. I was unpleasantly surprised when I had to realize that we still claim to
support Python 3.5 which doesn't have f-strings...
Remove `basestring` hack for Python 2.x compatibility
Unspecified PDF request option
Adds description to datasource item
* 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>
* Update CONTRIBUTORS.md & changelog for v 0.17

Update contributors & changelog for v 0.17
@mmuttreja-tableau mmuttreja-tableau merged commit f81039a into master Oct 20, 2021
jorwoods added a commit to jorwoods/server-client-python that referenced this pull request Jan 28, 2022
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 
57AE
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
0