You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "jongyoul (via GitHub)" <gi...@apache.org> on 2026/03/30 04:50:06 UTC
[PR] [ZEPPELIN-6404] Fix empty response body handling in merge_pr.py [zeppelin]
jongyoul opened a new pull request, #5199:
URL: https://github.com/apache/zeppelin/pull/5199
## Summary
- Fix `JSONDecodeError` when JIRA transition API returns empty response body
- Return empty dict `{}` instead of attempting to parse empty string
## Context
After merging PR #5183, the JIRA resolve step crashed with `JSONDecodeError: Expecting value: line 1 column 1`. The JIRA transition API returns HTTP 204 (No Content) on success, but `_http()` unconditionally called `json.loads()` on the empty body.
## Test plan
- [x] Verified JIRA transition actually succeeded despite the error
- [ ] Run `python3 dev/merge_pr.py --pr <number> --resolve-jira --dry-run` to verify no regression
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6404] Fix empty response body handling in merge_pr.py [zeppelin]
Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on PR #5199:
URL: https://github.com/apache/zeppelin/pull/5199#issuecomment-4153431042
Merged into master (cd8ba63f).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6404] Fix empty response body handling in merge_pr.py [zeppelin]
Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul merged PR #5199:
URL: https://github.com/apache/zeppelin/pull/5199
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6404] Fix empty response body handling in merge_pr.py [zeppelin]
Posted by "jongyoul (via GitHub)" <gi...@apache.org>.
jongyoul commented on PR #5199:
URL: https://github.com/apache/zeppelin/pull/5199#issuecomment-4152163542
It's a small fix for empty body of JIRA API.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6404] Fix empty response body handling in merge_pr.py [zeppelin]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #5199:
URL: https://github.com/apache/zeppelin/pull/5199#discussion_r3007505821
##########
dev/merge_pr.py:
##########
@@ -92,11 +92,12 @@ def _http(self, method, url, payload=None, auth=""):
req.add_header("Authorization", auth)
try:
with urllib.request.urlopen(req) as resp:
- return resp.status, json.loads(resp.read().decode())
+ body = resp.read().decode()
+ return resp.status, json.loads(body) if body else {}
except urllib.error.HTTPError as e:
err_body = e.read().decode() if e.fp else ""
try:
- return e.code, json.loads(err_body)
+ return e.code, json.loads(err_body) if err_body else {}
Review Comment:
`body` is checked for emptiness before `json.loads`, but whitespace-only responses (e.g., "\n") will still be treated as non-empty and will raise `JSONDecodeError`. Consider using a trimmed check (e.g., treat `body.strip()` as empty) before attempting JSON parsing, and apply the same logic to `err_body` in the error path.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org