Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Warning propagation improvements #491

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

Merged
merged 1 commit into from
Jul 27, 2016
Merged

Conversation

vtermanis
Copy link
Contributor

Dear PyMySQL team,

Here are a couple of suggestions (similar to what I submitted to MySQLdb#101 regarding warning handling in your library:

  1. Include error code in warnings, not just string
    I thought it would make sense for the Warning instances to not just have a string argument but, same as with errors, to also include the error code (as first argument, with string being second).
  2. Fix warning propagation for unbuffered queries
    Since warning count is not available until whole result has been fetched, handle warnings "deferred" (simiarly to MySQldb)

@vtermanis
Copy link
Contributor Author

Apologies for failures - I shall investigate

- Include error code in warnings, not just string
- Fix warning propagation for unbuffered queries
@coveralls
Copy link

coveralls commented Jul 26, 2016

Coverage Status

Coverage increased (+0.2%) to 88.805% when pulling 5988617 on vtermanis:warning_fixes into 95f5526 on PyMySQL:master.

@vtermanis
Copy link
Contributor Author

The problem was due to a warning not being propagated with an unbuffered cursor until the next query has been started (both DML, see change in test_DictCursor.py). I think this my change to move the next statement into the warning-catch clause is OK. (I think previously it didn't raise a warning at all for SSDictCursor in that particular case.)

I also added a unit test - hope that's the right place for it. Also, is the "coverage decreased" warning a red herring or have I done something wrong?

@methane methane merged commit 666ff95 into PyMySQL:master Jul 27, 2016
@vtermanis vtermanis deleted the warning_fixes branch July 28, 2016 13:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.