fix(weblog/python-flask): missing f in f-string#6673
Conversation
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0c616f083
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| print(f"DB request with {len(list(cursor))} results") | ||
| return f"DB request with {len(list(cursor))} results" |
There was a problem hiding this comment.
Avoid exhausting SQL cursor before composing response
The new f-string log call iterates cursor once (len(list(cursor))) before the response is built, so in any case where the query succeeds and returns rows, the subsequent len(list(cursor)) in the return path will always be 0 because the cursor has already been consumed. This changes endpoint behavior from reporting actual row count to always reporting zero; compute the count once and reuse it for both log and response.
Useful? React with 👍 / 👎.
Motivation
Changes
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present