warning to install optional dependencies#3393
Conversation
Bibo-Joshi
left a comment
There was a problem hiding this comment.
The changes themself look got to me 👍
- pre-commit is complaining a bit. If you run
pre-commit installlocally, the pre-commit hooks will run before you can commit - We'll need a test to ensure that the warning is issued as expected, i.e. the warning is there, the messages is the expected one and the warning points the user to the line where
context.job_queueis accessed. You can e.g. have a look atTestJobQueue.test_run_dailyfor some inspiration on how that can be done :)
harshil21
left a comment
There was a problem hiding this comment.
Some stylistic suggestions below.
Also the more likely scenario is when user does application.job_queue.run_* and faces an error. Shouldn't we make that a property to raise this warning as well?
I guess it's hard to say if |
Bibo-Joshi
left a comment
There was a problem hiding this comment.
Thanks for the updates!
-
TestConversationHandler.test_no_running_job_queue_warningcurrently fails b/c it's trying to overrideapp.job_queue. Maybe it's best to build a newApplicationinstance in that test, i.e. something likeif not jq: app = ApplicationBuilder().token(bot.token).job_queue(None)
-
similar for
TestConversationHandler.test_schedule_job_exception: here one would doAB().token(…).job_queue(DictJQ())
There was a problem hiding this comment.
okay I'm not sure why Github is not showing me the changes in conversationhandler.py in the files changed tab, but I think you should replace all instances of application.job_queue with application._job_queue to avoid unintentionally raising a warning in user code
Bibo-Joshi
left a comment
There was a problem hiding this comment.
I took the liberty to tie up the very last loose ends :) I'm happy now. If harshil is as well, we can merge.
closes #3391