8000 chore(versions): Upgrade minimum python version by jorwoods · Pull Request #1465 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content

chore(versions): Upgrade minimum python version #1465

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 6 commits into from
Sep 19, 2024

Conversation

jorwoods
Copy link
Contributor

(Redo of #1461, which got messed up when I was trying to rebase development)

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

@jorwoods
Copy link
Contributor Author

@bcantoni Apologies, the other PR got closed when I was trying to fix my branches. This one has the same changes successfully rebased on development. I have noticed that the tests appear to run considerably faster with this branch and the syntax upgraded.

@jorwoods
Copy link
Contributor Author

Copying comment from the original PR here:

I'm a little concerned about the volume of changes, especially with all those format strings. Was that a scripted change you made? (I.e. how confident are we nothing broke?)

This was a scripted change. In a year when the minimum version is bumped to 3.10, the volume of change should be lower. It is a lot of change, but I have noticed that some areas of the codebase use f-strings, some use .format, and some use the older python2 style %s string substitution. So while it is a lot of change, hopefully it brings more consistency in these small details across the codebase. Personally, I find the f-strings easier to read. f-strings are also faster than .format or %s, but not in a way that will be meaningful with the main purpose being around API calls.

By upgrading the syntax to target 3.9, will the library still work for 3.8 or will this be a breaking change?

This would be a breaking change, but not because of the f-strings. The main syntax change I see that will cause it to not work for 3.8 would be the change from Dict to dict, List to list, Set to set, and Tuple to tuple.

My comment about 3.8 being out of support is that the Python Software Foundation will stop releasing security fixes for 3.8 in October 2024, as it is considered "End of Life." Obviously we could continue to support older versions of python past their end of life, but I think it would hold back adopting newer syntax, features, and quality of life changes.

Copy link
Contributor Author
@jorwoods jorwoods left a comment

Choose a reason for hiding this comment

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

I reviewed all of the changes made by the script. The changes fall into a few main categories:

  • Converting .format and %s to f-strings
  • Removing unnecessary explicit inheritance from object
  • Removing unnecessary explicit parameters being passed to super
  • Switching to shorthand to define sets instead of creating a collection then passing to the set constructor
  • Changing errors to OSError.

I tested the error handling locally, and it shouldn't have any impact to end users. The following reproducible example demonstrates these are interchangeable now.

try:
   raise IOError
except OSError:
   print('caught IOError')
except Exception:
   print('whoops')
   
try:
   raise OSError
except IOError:
   print('caught OSError')
except Exception:
   print('whoops')

try:
   raise EnvironmentError
except OSError:
   print('caught EnvironmentError')
except Exception:
   print('whoops')
   
try:
   raise OSError
except EnvironmentError:
   print('caught OSError')
except Exception:
   print('whoops')

@jorwoods
Copy link
Contributor Author

@jacalata I went through and fixed the f-strings the script missed. Should be good to go now.

@jacalata jacalata merged commit ac8dccd into tableau:development Sep 19, 2024
22 checks passed
@jorwoods jorwoods deleted the jorwoods/min39 branch September 20, 2024 22:56
jacalata added a commit that referenced this pull request Oct 24, 2024
* Feature: export custom views #999 (#1506)
* feat(exceptions): separate failed signin error (#1478)
* refactor request_options, add language param (#1481)
* Set FILESIZE_LIMIT_MB via environment variables (#1466)
* added PulseMetricDefine cap (#1490)
* Adding project permissions handling for databases, tables and virtual connections (#1482)
* fix: queryset support for flowruns (#1460)
* fix: set unknown size to sys.maxsize
* fix: handle 0 item response in querysets (#1501)
* chore: support VizqlDataApiAccess capability (#1504)
* refactor(test): extract error factory to _utils
* chore(typing): flowruns.cancel can also accept a FlowRunItem
* chore: type hint default permissions endpoints (#1493)
* chore(versions): update remaining f-strings (#1477)
* Make urllib3 dependency more flexible (#1468)
* Update requests library for CVE CVE-2024-35195 (#1507)

* chore(versions): Upgrade minimum python version (#1465)
* ci: cache dependencies for faster builds (#1497)
* ci: build on python 3.13 (#1492)
* Update samples for Python 3.x compatibility (#1479)
* chore: remove  py2 holdover code (#1496)
* #Add 'description' to datasource sample code (#1475)
* Remove sample code showing group name encoding (#1486)
* chore(typing): include samples in type checks (#1455)

* fix: docstring on QuerySet
* docs: add docstrings to auth objects and endpoints (#1484)
* docs: docstrings for Server and ServerInfo (#1494)
* docs: docstrings for user item and endpoint (#1485)
* docs: docstrings for site item and endpoint (#1495)
* docs: workbook docstrings (#1488)
* #1464 - docs update for filtering on boolean values (#1471)

---------
Co-authored-by: Brian Cantoni <bcantoni@salesforce.com>
Co-authored-by: Jordan Woods <jorwoods@users.noreply.github.com>
Co-authored-by: Jordan Woods <13803242+jorwoods@users.noreply.github.com>
Co-authored-by: Jac <jacalata@users.noreply.github.com>
Co-authored-by: Henning Merklinger <henning.merklinger@gmail.com>
Co-authored-by: AlbertWangXu <albert.xuwang@yahoo.com>
Co-authored-by: TrimPeachu <77048868+TrimPeachu@users.noreply.github.com>
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.

2 participants
0