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

Prevent exception if the query doesn't return rows #243

Closed
wants to merge 1 commit into from

Conversation

mrm-david
Copy link

Trying to get rows from the cursor when the query doesn't return rows will raise an exception.

sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically.

An example such request would for, by example, in mysql SET some_variable = some_value

@OCA-git-bot
Copy link
Contributor

Hi @anddago78,
some modules you are maintaining are being modified, check this out!

@mrm-david
Copy link
Author

Note: I have no idea how I could write a unit test for this

@mrm-david
Copy link
Author

Also should I fix the trailing space in the comment to have 1 more check that pass, or leave it as is (automatically corrected)

@legalsylvain
Copy link
Contributor

Run
pre-commit run -a
Should fix the syntax error.

Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Feb 11, 2024
@dreispt
Copy link
Member

dreispt commented Mar 9, 2024

Superseded by #274

@dreispt dreispt closed this Mar 9, 2024
SiesslPhillip pushed a commit to grueneerde/OCA-server-backend that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-backend (13.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants