Skip to content

Lazy evaluating parsed json in GlobusHttpResponse#1381

Merged
sirosen merged 4 commits intoglobus:mainfrom
AK2000:ak2000-fix-1380
May 1, 2026
Merged

Lazy evaluating parsed json in GlobusHttpResponse#1381
sirosen merged 4 commits intoglobus:mainfrom
AK2000:ak2000-fix-1380

Conversation

@AK2000
Copy link
Copy Markdown
Contributor

@AK2000 AK2000 commented Apr 15, 2026

Fix for issue #1380 that works with my event streaming client. Lazy evaluating parse json in globus responses to fix streaming. This does not affect any other error handling in the test suite but it also does not use @sirosen's suggestion that we only move to lazy parsing when streaming is enabled

Copy link
Copy Markdown
Member

@sirosen sirosen left a comment

Choose a reason for hiding this comment

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

Thanks for this patch, it looks good! (And I was wrong about needing to make it conditional, so 👍 to not doing that. 😅 )

I think we need a regression unit test, but I'm happy for the SDK maintainers to take on that responsibility (unless you want to do it). I plan to add a test and ask for someone else to act as a co-reviewer.

Comment thread src/globus_sdk/response.py Outdated
@sirosen
Copy link
Copy Markdown
Member

sirosen commented Apr 30, 2026

I added the requisite unit test and fixed that assert usage. I've asked for someone else on the team to double-check here -- both to check my work and to confirm that I haven't missed anything subtle that this change might imply.

EDIT: oh, and I noticed that the changelog needed some fixing, so that's included too.

sirosen added 2 commits April 30, 2026 20:04
The test confirms that a streaming response is not read on init but is
read when attribute access forces it.

Also, fix a minor stylistic issue regarding assert vs explicit branching.
@sirosen sirosen force-pushed the ak2000-fix-1380 branch from b08a449 to 4da1796 Compare May 1, 2026 01:05
@sirosen sirosen merged commit b45bc53 into globus:main May 1, 2026
7 checks passed
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.

3 participants