-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Refactor handling of default_quote #1965
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
Conversation
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.
The changes is Message
lead to errors when trying to access message._default_quote
after unplicking. Need to make that backwards compatible.
Also, we might wanna mark the default_quote
arg (maybe even the attribute, too) for deprecation.
Latests commits
|
We should postpone this after #1994 |
2a9a5b0
to
1fdc197
Compare
b3e9be1
to
b7e635b
Compare
Also, we could/should raise a warning, if both |
* Unify kwargs handling in Bot methods * Remove Request.get, make api_kwargs an explicit argument, move note to head of Bot class * Fix test_official * Update get_file methods
* First go on refactoring JobQueue * Temporarily enable tests for the v13 branch * Work on tests * Temporarily enable tests for the v13 branch * Increase coverage * Remove JobQueue.tick() # Was intended for interal use anyways # Fixes tests * Address review * Temporarily enable tests for the v13 branch * Address review * Dispatch errors * Fix handling of job_kwargs * Remove possibility to pass a Bot to JobQueue
* Refactor persistence of bots * User BP.set_bot in Dispatcher * Temporarily enable tests for the v13 branch * Add documentation
# Conflicts: # telegram/bot.py
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.
LGTM
telegram/ext/updater.py
Outdated
warnings.warn('Passing defaults to an Updater has no effect, if a Bot is passed, ' | ||
'too. Pass it to the Bot instead.', |
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.
warnings.warn('Passing defaults to an Updater has no effect, if a Bot is passed, ' | |
'too. Pass it to the Bot instead.', | |
warnings.warn('Passing defaults to an Updater has no effect when a Bot is passed' | |
'as well. Pass them to the Bot instead.', |
In here are a lot of changes which I reviewed in different PRs, like the refactor of the jobqueue, the api kwargs or the persistence part. Is that intended? |
# Conflicts: # telegram/bot.py # tests/test_persistence.py
* Refactor handling of `default_quote` * Make it a breaking change * Pickle a bots defaults * Temporarily enable tests for the v13 branch * Temporarily enable tests for the v13 branch * Refactor handling of kwargs in Bot methods (#1924) * Unify kwargs handling in Bot methods * Remove Request.get, make api_kwargs an explicit argument, move note to head of Bot class * Fix test_official * Update get_file methods * Refactor JobQueue (#1981) * First go on refactoring JobQueue * Temporarily enable tests for the v13 branch * Work on tests * Temporarily enable tests for the v13 branch * Increase coverage * Remove JobQueue.tick() # Was intended for interal use anyways # Fixes tests * Address review * Temporarily enable tests for the v13 branch * Address review * Dispatch errors * Fix handling of job_kwargs * Remove possibility to pass a Bot to JobQueue * Refactor persistence of Bot instances (#1994) * Refactor persistence of bots * User BP.set_bot in Dispatcher * Temporarily enable tests for the v13 branch * Add documentation * Add warning to Updater for passing both defaults and bot * Address review * Fix test
* Refactor handling of `default_quote` * Make it a breaking change * Pickle a bots defaults * Temporarily enable tests for the v13 branch * Temporarily enable tests for the v13 branch * Refactor handling of kwargs in Bot methods (#1924) * Unify kwargs handling in Bot methods * Remove Request.get, make api_kwargs an explicit argument, move note to head of Bot class * Fix test_official * Update get_file methods * Refactor JobQueue (#1981) * First go on refactoring JobQueue * Temporarily enable tests for the v13 branch * Work on tests * Temporarily enable tests for the v13 branch * Increase coverage * Remove JobQueue.tick() # Was intended for interal use anyways # Fixes tests * Address review * Temporarily enable tests for the v13 branch * Address review * Dispatch errors * Fix handling of job_kwargs * Remove possibility to pass a Bot to JobQueue * Refactor persistence of Bot instances (#1994) * Refactor persistence of bots * User BP.set_bot in Dispatcher * Temporarily enable tests for the v13 branch * Add documentation * Add warning to Updater for passing both defaults and bot * Address review * Fix test
Right now,
bot.defaults.quote
is passed through the json data when decoding an update for it to be stored inMessage.default_quote
. As @n5y pointed out offline, it would be cleaner to just useMessage.bot.defaults.quote
. This is, what this PR does.To not break backwards compatibility, I left some optional
default_quote
args in the Webhook classes untouched and also keptdefault_quote
as argument forMessage
(with a warning that it will override the bots settings). That's discussable though, as nobody should have actually used that …Closes parts of #1797