Skip to content

Fix type hints for redis TTL params #922

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 4 commits into from
Jun 16, 2022
Merged

Fix type hints for redis TTL params #922

merged 4 commits into from
Jun 16, 2022

Conversation

andrew000
Copy link
Contributor

@andrew000 andrew000 commented Jun 12, 2022

Description

Use float and datetime.timedelta type hints in RedisStorage.state_ttl and RedisStorage.data_ttl.

Let's reuse type hint ExpiryT from redis.

Type of change

  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@github-actions
Copy link

github-actions bot commented Jun 12, 2022

✔️ Changelog found.

Thank you for adding a description of the changes

@JrooTJunior JrooTJunior added docs Something is missing in docs 3.x Issue or PR for stable 3.x version labels Jun 13, 2022
@JrooTJunior JrooTJunior added this to the 3.0 milestone Jun 13, 2022
@andrew000 andrew000 requested a review from Olegt0rr June 14, 2022 09:47
@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #922 (df6217c) into dev-3.x (b3b320c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           dev-3.x      #922   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          300       300           
  Lines         8183      8184    +1     
=========================================
+ Hits          8183      8184    +1     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiogram/dispatcher/fsm/storage/redis.py 100.00% <100.00%> (ø)

@@ -0,0 +1 @@
Allowed to use int and datetime.timedelta in RedisStorage.state_ttl and RedisStorage.data_ttl
Copy link
Contributor

Choose a reason for hiding this comment

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

It was allowed before, but with wrong type hinting

May be write something like
Fixed type hints for redis TTL params?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, uno momento)

@Olegt0rr Olegt0rr assigned JrooTJunior and unassigned andrew000 Jun 15, 2022
@Olegt0rr Olegt0rr changed the title Allow to use int and datetime.timedelta in RedisStorage.state_ttl and RedisStorage.data_ttl Fix type hints for redis TTL params Jun 16, 2022
@JrooTJunior JrooTJunior merged commit adfc89f into aiogram:dev-3.x Jun 16, 2022
@andrew000 andrew000 deleted the dev-3.x branch June 16, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issue or PR for stable 3.x version docs Something is missing in docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants