Skip to content

fix(examples): bound image telephone downloads - #879

Merged
elijahbenizzy merged 1 commit into
apache:mainfrom
Ghraven:raven-bound-image-telephone-downloads
Oct 17, 2026
Merged

elijahbenizzy merged 1 commit into
apache:mainfrom
Ghraven:raven-bound-image-telephone-downloads

Conversation

@Ghraven

@Ghraven Ghraven commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Problem

The image-telephone examples download generated image URLs with requests.get(image_url).content. Without a timeout, the examples can hang indefinitely if the image host stalls. They also write the response body without checking HTTP status, so an error response can be saved as if it were an image.

Before / after

Before, both the base image-telephone example and the Hamilton integration variant used unbounded image downloads and did not call raise_for_status().

After, both examples use a 30 second image download timeout and call raise_for_status() before writing the image bytes. Successful downloads keep the same behavior.

Verification

  • python -m py_compile examples\image-telephone\application.py examples\integrations\hamilton\image-telephone\application.py
  • git diff --check

@github-actions github-actions Bot added the area/examples Relates to /examples label Aug 11, 2026

@elijahbenizzy elijahbenizzy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Timeout + raise_for_status on the example downloads. LGTM.

@elijahbenizzy
elijahbenizzy enabled auto-merge (squash) October 17, 2026 15:15
auto-merge was automatically disabled October 17, 2026 16:10

Pull request was closed

@elijahbenizzy elijahbenizzy reopened this Oct 17, 2026
@elijahbenizzy
elijahbenizzy enabled auto-merge (squash) October 17, 2026 16:10
@elijahbenizzy
elijahbenizzy merged commit c96b5f7 into apache:main Oct 17, 2026
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/examples Relates to /examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants