-
Notifications
You must be signed in to change notification settings - Fork 258
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
Warnings are thrown since last version #103
Comments
thanks for report! I will take a look |
Theese messages are very annoing. This "Warning" was added in commit 0202d23 |
Just seen this too. Quite annoying indeed :) |
@jettify should we add an option to suppress warnings / make them opt-in? |
Users can easily suppress warnings using Python stdlib already, no need for switches, they'd only complicate the codebase |
@webknjaz A how would be appreciated :P |
@TECHNOFAB11 |
If anybody has this problem, it is how you can filter annoying warnings: import warnings
# Suppress warnings only for aiomysql, all other modules can send warnings
warnings.filterwarnings('ignore', module=r"aiomysql")
...
# Enable warnings again
warnings.filterwarnings('default', module=r"aiomysql") |
or use another function to warnings:
|
It's not just about not showing the warnings though, the extra round trip SQL to execute and read the result set adds overhead. So being able to disable it altogether is still useful. |
PyMySQL stopped showing warnings by default in 0.10.0:
we should do the same. |
I don't think warnings should be removed without replacement. I've just created PyMySQL/PyMySQL#1056 and plan to port this functionality to aiomysql afterwards. I'm not yet entirely sure I want fully remove the functionality to raise warnings, but if they're kept it should be configurable whether they're raised. |
Since I updated to the latest version aiomysql throws me warnings when I use a "IF NOT EXISTS" or "IGNORE" statement instead of just discarding them
Executed code:
await cur.execute("CREATE DATABASE IF NOT EXISTS srv_163305530364788736;")
Is there any way to tell aiomysql/pymysql to just discard this?
The text was updated successfully, but these errors were encountered: