-
-
Notifications
You must be signed in to change notification settings - Fork 806
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
Add method get_value for FSMContext #1432
base: dev-3.x
Are you sure you want to change the base?
Conversation
✔️ Changelog found.Thank you for adding a description of the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New methods should be covered by tests
aiogram/fsm/storage/base.py
Outdated
:return: value of current data by key | ||
""" | ||
current_data = await self.get_data(key=key) | ||
return current_data[data_key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using method get
with default value?
return current_data.get(data_key, default=default)
The use of this method (get_value
) is not very clear, so I do not understand whether there should be an error or a default value, it is necessary to further explain the use case so that I understand what should be here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to answer the question above and adjust the description of the changes according to the previous comments.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-3.x #1432 +/- ##
===========================================
- Coverage 100.00% 99.99% -0.01%
===========================================
Files 412 412
Lines 10682 10687 +5
===========================================
+ Hits 10682 10686 +4
- Misses 0 1 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ok |
Please merge |
ok |
Any news? |
Description
Added method get_value for FSMContext
Fixes #1431
Type of change
Please delete options that are not relevant.