Skip to content

Conversation

@jorwoods
Copy link
Contributor

This PR enables the mypy type checking, as well as adds type hints to datasource and workbook endpoints and items. Through testing, I noticed deprecation errors on python 3.5, and that new releases of pip no longer support it, so that was removed as well.

Development of distutils has stopped. Removing refs to it.
https://pypi.org/project/Distutils2/
commit 2609e27
Merge: d107c48 3a8ec6c
Author: Chris Shin <[email protected]>
Date:   Wed Feb 17 16:00:42 2021 -0800

    Merge pull request tableau#803 from tableau/release-0.15

    syncing development branch with v0.15 changelog

commit d107c48
Author: Tyler Doyle <[email protected]>
Date:   Wed Feb 17 15:38:14 2021 -0800

    Add Mypy to CI runs (tableau#802)

    Add mypy runs to CI, but skip misc errors, so we only see the important stuff. For now these are non blocking.

commit 3a8ec6c
Merge: 004ab31 a5b9252
Author: Chris Shin <[email protected]>
Date:   Tue Feb 16 16:51:37 2021 -0800

    Merge branch 'master' into release-0.15

commit 004ab31
Author: Chris Shin <[email protected]>
Date:   Tue Feb 16 16:49:19 2021 -0800

    Updates changelog and contributors list for v0.15

commit 6c7a87b
Author: Chris Shin <[email protected]>
Date:   Tue Feb 16 15:09:45 2021 -0800

    Removes travis and adds linting/testing into github action (tableau#798)

    * Removes travis and adds github workflow

    * Addressing code review feedback

commit 9179637
Author: Lee Boynton <[email protected]>
Date:   Tue Feb 16 23:09:22 2021 +0000

    Add support for getting groups that a user belongs to (tableau#799)

    * Add support for getting groups that a user belongs to

    * Use more descriptive name for pager function

commit fe992ee
Author: Chris Shin <[email protected]>
Date:   Tue Feb 16 14:33:59 2021 -0800

    [Tasks] Translate task type from server to TSC enum (tableau#796)

    * Adds task type mapping to translate server response

    * Updates tests to match server response for task type

    * Fixes pycodestyle error

commit f64fcf9
Author: John Vandenberg <[email protected]>
Date:   Wed Feb 17 01:21:46 2021 +0800

    MANIFEST.in: Add docs and test data (tableau#780)

    * Update publish_workbook.py (tableau#694)

    * Update publish_workbook.py

    Added below arguments, without this there is a sign-in error on publishing a test file to Tableau Online

    parser.add_argument('--sitename', '-S', default='', help='sitename required')
    tableau_auth = TSC.TableauAuth(args.username, password,site_id=args.sitename)

    * Update publish_workbook.py

    Edits (as requested) to publish workbooks on Tableau Online which removes the Sign-in Error.

    * Update publish_workbook.py

    * Merge pull request tableau#745 from tableau/fix_732

    Server versions before 2020.1 do not accept encoded query param delimiters

    * Merge pull request tableau#757 from tableau/fix_754

    Fixes issue tableau#754 by moving file read logic inside generator

    * Updates changelog for v0.14.1

    * MANIFEST.in: Add docs and test data

    Closes tableau#779

    Co-authored-by: Chris Shin <[email protected]>
    Co-authored-by: Madhura Selvarajan <[email protected]>

commit 88a0188
Author: Chris Shin <[email protected]>
Date:   Tue Feb 16 09:17:35 2021 -0800

    [Subscriptions] Add new fields and ability to update (tableau#794)

    * Add fields and parsing logic

    * Update subscription create request

    * Adds update request to subscriptions

    * Changes subscription change request creation to use tsrequest annotation

    * Update tests for parsing new fields

    * Fixes codestyle issues

    * Removes user and schedule name

    * Fixes test failure

commit 026bca8
Author: Chris Shin <[email protected]>
Date:   Thu Feb 11 15:34:08 2021 -0800

    Adds skipConnectionCheck to publish workbook (tableau#791)

    * Adds skipConnectionCheck flag to publish workbook

    * Removes unnecessary lines

    * Fixes style error

commit 857199b
Author: tjones-commits <[email protected]>
Date:   Fri Feb 5 17:09:32 2021 -0500

    Update site properties and functions (tableau#777)

    * Update publish_workbook.py (tableau#694)

    * Update publish_workbook.py

    Added below arguments, without this there is a sign-in error on publishing a test file to Tableau Online

    parser.add_argument('--sitename', '-S', default='', help='sitename required')
    tableau_auth = TSC.TableauAuth(args.username, password,site_id=args.sitename)

    * Update publish_workbook.py

    Edits (as requested) to publish workbooks on Tableau Online which removes the Sign-in Error.

    * Update publish_workbook.py

    * Merge pull request tableau#745 from tableau/fix_732

    Server versions before 2020.1 do not accept encoded query param delimiters

    * Merge pull request tableau#757 from tableau/fix_754

    Fixes issue tableau#754 by moving file read logic inside generator

    * Updates changelog for v0.14.1

    * update the site item to reflect api response

    * update test model

    * remove extra test assets

    * trimming line length

    * unit test all properties. fix some properties. Remove extra code

    * make requested changes

    * make requested changes

    Co-authored-by: Chris Shin <[email protected]>
    Co-authored-by: Madhura Selvarajan <[email protected]>
    Co-authored-by: Terrence Jones <[email protected]>

commit a5b9252
Merge: bcb881c 1fc349c
Author: Chris Shin <[email protected]>
Date:   Thu Dec 10 09:29:42 2020 -0800

    Merge pull request tableau#759 from tableau/0.14.0-patch

    v0.14.1 patch release
    * Fixed filter query issue for server version below 2020.1 (tableau#745)
    * Fixed large workbook/datasource publish issue (tableau#757)

commit 1fc349c
Author: Chris Shin <[email protected]>
Date:   Wed Dec 9 16:30:03 2020 -0800

    Updates changelog for v0.14.1

commit 41fd8f2
Author: Chris Shin <[email protected]>
Date:   Wed Dec 9 15:49:48 2020 -0800

    Merge pull request tableau#757 from tableau/fix_754

    Fixes issue tableau#754 by moving file read logic inside generator

commit 138476f
Author: Chris Shin <[email protected]>
Date:   Wed Dec 9 15:49:23 2020 -0800

    Merge pull request tableau#745 from tableau/fix_732

    Server versions before 2020.1 do not accept encoded query param delimiters

commit bcb881c
Merge: 8d51355 1e089b4
Author: Chris Shin <[email protected]>
Date:   Mon Nov 9 09:19:23 2020 -0800

    Merge pull request tableau#725 from tableau/development

    Syncing master with v0.14.0 changes from development.

commit 8d51355
Author: Madhura Selvarajan <[email protected]>
Date:   Wed Sep 23 10:45:27 2020 -0400

    Update publish_workbook.py (tableau#694)

    * Update publish_workbook.py

    Added below arguments, without this there is a sign-in error on publishing a test file to Tableau Online

    parser.add_argument('--sitename', '-S', default='', help='sitename required')
    tableau_auth = TSC.TableauAuth(args.username, password,site_id=args.sitename)

    * Update publish_workbook.py

    Edits (as requested) to publish workbooks on Tableau Online which removes the Sign-in Error.

    * Update publish_workbook.py

commit 273af7a
Merge: 43e1b06 168489c
Author: Chris Shin <[email protected]>
Date:   Wed Sep 2 14:39:13 2020 -0700

    Merge pull request tableau#685 from tableau/development

    [v0.13] Merge development into master

    Added notes field to JobItem (tableau#571)
    Added webpage_url field to WorkbookItem (tableau#661)
    Added support for switching between sites (tableau#655)
    Added support for querying favorites for a user (tableau#656)
    Added support for Python 3.8 (tableau#659)
    Added support for Data Alerts (tableau#667)
    Added support for basic Extract operations - Create, Delete, en/re/decrypt for site (tableau#672)
    Added support for creating and querying Active Directory groups (tableau#674)
    Added support for asynchronously updating a group (tableau#674)
    Improved handling of invalid dates (tableau#529)
    Improved consistency of update_permission endpoints (tableau#668)
    Documentation updates (tableau#658, tableau#669, tableau#670, tableau#673, tableau#683)
Copy link
Collaborator

@t8y8 t8y8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress!

A few things I noticed:

  1. The CI didn't run on this at all... I'm not sure why, can you double check it's rebased against development and happy?
  2. Some of the types look a little crazy still, maybe auto generated (long optional/union/any)

And then specific feedback:

  • I want to try and avoid all the ignore: type comments on properties, I silenced that error in github actions... what do you think?
  • I see a few instances where a type that is Thing or None isn't marked Optional, do they all have to be? I'd expect so to make mypy happy
  • Formatting, we're making some function signatures big

@jorwoods
Copy link
Contributor Author

@t8y8 Added the missing pull_request trigger so the CI tests will run on PRs.

Copy link
Collaborator

@t8y8 t8y8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even closer

Copy link
Collaborator

@t8y8 t8y8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@t8y8
Copy link
Collaborator

t8y8 commented Oct 27, 2021

@vogelsgesang and @jorwoods I'm happy with the current state at this point -- should we check it in so it doesn't sit forever?

@jorwoods
Copy link
Contributor Author

@t8y8 I'm good with it as is.

@jorwoods jorwoods requested a review from vogelsgesang October 29, 2021 01:27
@t8y8 t8y8 merged commit 946469c into tableau:development Nov 1, 2021
@jorwoods jorwoods deleted the jorwoods/mypy branch November 17, 2021 01:03
jorwoods added a commit to jorwoods/server-client-python that referenced this pull request Jan 28, 2022
commit ed940a2
Author: Jac <[email protected]>
Date:   Thu Jan 27 20:16:31 2022 -0800

    make tests run even if code style fails (tableau#980)

commit fb49f31
Author: jorwoods <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>

commit ad57851
Author: jorwoods <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
    Co-authored by: Stephen Mitchell https://github.com/scuml

commit 7443f68
Author: jorwoods <[email protected]>
Date:   Sun Nov 7 05:57:42 2021 -0600

    Add type hints to `Job` (tableau#939)

commit c8170ae
Author: Tyler Doyle <[email protected]>
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 <[email protected]>
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 <[email protected]>

commit feed39c
Author: Brian Cantoni <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>

commit fefd6f1
Merge: 1d8a9be 0845b7b
Author: Jac <[email protected]>
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 <[email protected]>
Date:   Wed Sep 1 14:22:53 2021 -0700

    Upgrade to newer Slack action provider

commit 1d8a9be
Merge: 5cbfc34 770d48a
Author: Ovini Nanayakkara <[email protected]>
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 <[email protected]>
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 <[email protected]>
Date:   Mon May 24 13:34:07 2021 -0700

    whitespace change to re-try PR

commit 0c4fd4a
Author: Jac <[email protected]>
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
jacalata pushed a commit that referenced this pull request Mar 30, 2022
Adds types to function signatures for Workbook and Data Source endpoints.
Co-authored-by: Jordan Woods <[email protected]>
jacalata pushed a commit that referenced this pull request Mar 30, 2022
Adds types to function signatures for Workbook and Data Source endpoints.
Co-authored-by: Jordan Woods <[email protected]>
jacalata added a commit that referenced this pull request Mar 30, 2022
* Type hinting on Datasources and Workbooks (#804)

Adds types to function signatures for Workbook and Data Source endpoints.
Co-authored-by: Jordan Woods <[email protected]>

* add http_options to server constructor, update samples to show it

* update docs
jacalata pushed a commit that referenced this pull request Mar 31, 2022
Adds types to function signatures for Workbook and Data Source endpoints.
Co-authored-by: Jordan Woods <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants