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

Add method get_value for FSMContext #1432

Open
wants to merge 7 commits into
base: dev-3.x
Choose a base branch
from

Conversation

wrrrzr
Copy link

@wrrrzr wrrrzr commented Mar 3, 2024

Description

Added method get_value for FSMContext

Fixes #1431

Type of change

Please delete options that are not relevant.

  • Documentation (typos, code examples or any documentation update)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@github-actions github-actions bot added the 3.x Issue or PR for stable 3.x version label Mar 3, 2024
Copy link

github-actions bot commented Mar 3, 2024

✔️ Changelog found.

Thank you for adding a description of the changes

Copy link
Member

@JrooTJunior JrooTJunior left a 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

:return: value of current data by key
"""
current_data = await self.get_data(key=key)
return current_data[data_key]
Copy link
Member

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.

CHANGES/1432.feature.rst Outdated Show resolved Hide resolved
Copy link
Member

@JrooTJunior JrooTJunior left a 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.

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.99%. Comparing base (0c9eeda) to head (07059e3).

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
unittests 99.99% <80.00%> (-0.01%) ⬇️

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

Files Coverage Δ
aiogram/fsm/storage/base.py 100.00% <100.00%> (ø)
aiogram/fsm/context.py 95.65% <50.00%> (-4.35%) ⬇️

@wrrrzr
Copy link
Author

wrrrzr commented Mar 9, 2024

you need to answer the question above and adjust the description of the changes according to the previous comments.

ok

@JrooTJunior
Copy link
Member

Please merge dev-3.x branch into your branch to fix tests

@wrrrzr
Copy link
Author

wrrrzr commented Mar 10, 2024

Please merge dev-3.x branch into your branch to fix tests

ok

@JrooTJunior
Copy link
Member

Any news?

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add function get_value to FSMContext
2 participants