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

Update type annotations in pool.py #431

Merged
merged 5 commits into from
May 9, 2023

Conversation

RA80533
Copy link
Contributor

@RA80533 RA80533 commented May 1, 2023

What do these changes do?

  • Added missing dsn kwarg to create_pool(), _create_pool(), and Pool's __init__ method1
  • Updated forward ref'd types to use postponed evaluation2

Are there changes in behavior for the user?

Users will notice that dsn is now a required keyword argument for create_pool() and Pool's __init__ method. It was previously a required kwarg for normal operability with pooling but was not defined as such on either of the aforementioned callables.

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.

Footnotes

  1. https://github.com/aio-libs/aioodbc/pull/431#discussion_r1184518065

  2. https://peps.python.org/pep-0563/

@jettify jettify marked this pull request as ready for review May 4, 2023 18:55
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #431 (b9942a7) into master (1289cc6) will increase coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head b9942a7 differs from pull request most recent head 020d0ac. Consider uploading reports for the commit 020d0ac to get more accurate results

@@            Coverage Diff             @@
##           master     #431      +/-   ##
==========================================
+ Coverage   86.88%   86.93%   +0.05%     
==========================================
  Files           6        6              
  Lines         488      490       +2     
  Branches       73       73              
==========================================
+ Hits          424      426       +2     
  Misses         48       48              
  Partials       16       16              
Impacted Files Coverage Δ
aioodbc/pool.py 93.91% <100.00%> (+0.08%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Since the annotation represents the elements of the `kwargs` mapping
rather than the mapping itself, `Any` is a more appropriate annotation
for `kwargs`.
@jettify jettify merged commit e82bf55 into aio-libs:master May 9, 2023
3 checks passed
@jettify
Copy link
Member

jettify commented May 9, 2023

thanks!

@RA80533 RA80533 deleted the chore/typing/pool branch May 11, 2023 19:00
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.

None yet

2 participants