OCA / server-backend

GNU Affero General Public License v3.0
104 stars 274 forks source link

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

Closed mrm-david closed 8 months ago

mrm-david commented 1 year ago

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 commented 1 year ago

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

mrm-david commented 1 year ago

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

mrm-david commented 1 year ago

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 commented 1 year ago

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

github-actions[bot] commented 9 months ago

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.

dreispt commented 8 months ago

Superseded by #274