Skip to content

fix(weblog/python-flask): missing f in f-string#6673

Open
Eldolfin wants to merge 2 commits intomainfrom
oscarld/fix-python-flask-missing-f-string
Open

fix(weblog/python-flask): missing f in f-string#6673
Eldolfin wants to merge 2 commits intomainfrom
oscarld/fix-python-flask-missing-f-string

Conversation

@Eldolfin
Copy link
Copy Markdown

@Eldolfin Eldolfin commented Apr 2, 2026

Motivation

Changes

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

CODEOWNERS have been resolved as:

utils/build/docker/python/flask/app.py                                  @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core

@Eldolfin Eldolfin marked this pull request as ready for review April 2, 2026 17:59
@Eldolfin Eldolfin requested review from a team as code owners April 2, 2026 17:59
@Eldolfin Eldolfin requested review from florentinl and gnufede and removed request for a team April 2, 2026 17:59
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +439 to 440
print(f"DB request with {len(list(cursor))} results")
return f"DB request with {len(list(cursor))} results"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant