Skip to content

Fix HTTPException body mapping when extra-info key is body - #1

Closed
afeld with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-httpexception-body
Closed

Fix HTTPException body mapping when extra-info key is body#1
afeld with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-httpexception-body

Conversation

Copilot AI commented Sep 9, 2026

Copy link
Copy Markdown

HTTPException.body could remain empty because Python exception mapping only read response_body from DuckDB error extra-info. Some HTTP errors now surface payload under body, so the attribute was silently unset.

  • Exception field mapping

    • Update HTTP exception translation to accept both extra-info keys:
      • legacy: response_body
      • current/alternate: body
    • This preserves backward compatibility while correctly populating HTTPException.body for newer payloads.
  • Test expectation alignment

    • Adjust HTTPFS exception assertion to validate body as a string instead of assuming it is always empty.
} else if (entry.first == "response_body" || entry.first == "body") {
    e.attr("body") = entry.second;
}

Copilot AI and others added 2 commits September 9, 2026 06:38
Co-authored-by: afeld <86842+afeld@users.noreply.github.com>
Co-authored-by: afeld <86842+afeld@users.noreply.github.com>
Comment thread tests/extensions/test_httpfs.py
@afeld
afeld marked this pull request as ready for review September 9, 2026 07:02
Co-authored-by: afeld <86842+afeld@users.noreply.github.com>
Copilot AI requested a review from afeld September 9, 2026 07:03
@afeld

afeld commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Opened upstream: duckdb#614

@afeld afeld closed this Sep 9, 2026
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.

2 participants