Skip to content
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

Development to master branch merge #1511

Merged
merged 29 commits into from
Oct 24, 2024
Merged

Conversation

renoyjohnm
Copy link
Contributor

Features:

  • Adding project permissions handling for databases, tables and virtual connections
  • Adding PulseMetricDefine & VizqlDataApiAccess capabilities
  • Adding support for exporting custom views as pdf & csv

Bug Fixes:

bcantoni and others added 29 commits September 18, 2024 23:46
Make urllib3 dependency more flexible

Per discussion in #1445
* chore(versions): Upgrade minimum python version

As of October, 2024, Python 3.8 is out of support. Upgrading syntax to target Python 3.9. Adds builds for Python 3.13.
---------

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* chore(typing): include samples in type checks

Including the sample scripts in type checking will allow more
thorough testing to validate the samples work as expected, as
well as more testing around how a library consumer may use the
library.

---------

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
Co-authored-by: Jac <jacalata@users.noreply.github.com>
* fix: queryset support for flowruns

FlowRun's get endpoint does not return a PaginationItem. This
provides a tweak to QuerySet to provide a workaround so all items
matching whatever filters are supplied.

It also corrects the return types of flowruns.get and fixes the XML
test asset to reflect what is really returned by the server.

* fix: set unknown size to sys.maxsize

Users may length check a QuerySet as part of a normal workflow. A len of
0 would be misleading, indicating to the user that there are no matches
for the endpoint and/or filters they supplied. __len__ must return a
non-negative int. Sentinel values such as -1 or None do not work. This
only leaves maxsize as the possible flag.

* fix: docstring on QuerySet

* refactor(test): extract error factory to _utils

* chore(typing): flowruns.cancel can also accept a FlowRunItem

* style: black

---------

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
Add docs mention of boolean values for filtering
Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* feat(exceptions): separate failed signin error

Closes #1472

This makes sign in failures their own class of exceptions, while still
inheriting from NotSignedInException to not break backwards
compatability for any existing client code. This should allow users
to get out more specific exceptions more easily on what failed with
their authentication request.

* fix(error): raise exception when ServerInfo.get fails

If ServerInfoItem.from_response gets invalid XML, raise the error
immediately instead of suppressing the error and setting an invalid
version number

* fix(test): add missing test asset

---------

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* docs: add docstrings to auth objects and endpoints

* docs: add parameters and examples to methods

---------

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* add TSC_FILESIZE_LIMIT_MB environment variable

* add hard limit for filesize limit at 64MB

* fix formatting

---------

Co-authored-by: Jac <jacalata@users.noreply.github.com>
Update permissions_item.py

added PulseMetricDefine cap

Co-authored-by: Jac <jacalata@users.noreply.github.com>
Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* refactor request_options, add language param

I have refactored the classes to separate options that can be used in querying content, and options that can be used for exporting data. "language" is only available for data exporting.
* docs: docstrings for user item and endpoint

* docs: add serverresponseerror details

---------

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
Now that python 3.13 has released, test builds on actual
3.13 instead of the 3.13-dev build

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
Add detailed docstrings to workbook item and endpoint
Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
Resource is not currently an actual type, but an enum-like
holder for literal values. Added a Union for str types to
make mypy happy.

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* fix: handle 0 item response in querysets

A flaw in the __iter__ logic introduced to handle scenarios
where a pagination element is not included in the response xml
resulted in an infinite loop. This PR introduces a few changes
to protect against this:

1. After running QuerySet._fetch_all(), if the result_cache is
empty, return instead of performing other comparisons.
2. Ensure that any non-None total_available is returned from
the PaginationItem's object.
3. In _fetch_all, check if there is a PaginationItem that has been
populated so as to not call the server side endpoint muliple times
before returning.

* fix: null out PaginationItem._page_number

Tests were failing because the fetch_all method added a second
check before fetching the next page. This fix will allow the
next page to be retrieved when used normally

---------

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* ci: cache dependencies for faster builds

* ci: cache for mypy and black

---------

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
Adding custom views PDF & CSV export endpoints
Favor list comprehensions for readability, consistency, and
performance

Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* Replace obsolete env package with os.environ
* Python 2.x to 3.x updates
* Fix some comments
* Remove workbook data acceleration; feature was removed in 2022
* Remove switch_site() example which is confusing in this context of demonstrating login
Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
* Remove sample code showing group name encoding

This is no longer needed - ran the sample and verified that it works now.
Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
Merge branch 'development' into rjohn/development-to-master-merge
@jacalata jacalata merged commit 6798b9e into master Oct 24, 2024
25 checks passed
@jacalata jacalata deleted the rjohn/development-to-master-merge branch October 24, 2024 05:07
@renoyjohnm renoyjohnm restored the rjohn/development-to-master-merge branch October 24, 2024 18:44
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.

7 participants