Skip to content

Conversation

@effigies
Copy link
Contributor

@effigies effigies commented Oct 1, 2025

At times the S3 URLs can become unresponsive, presumably due to an incomplete export. Currently templateflow handles this by treating the XML response as the file contents. Future calls continue to pick that up, even after the export has been fixed.

This PR does two things:

  1. Check the HTTP status code, and error for anything but 200.
  2. Check the target Paths for prior run error outputs and truncate the files back to 0 bytes before continuing in the get() logic, to allow these files to be treated as missing.

@effigies
Copy link
Contributor Author

effigies commented Oct 8, 2025

@mgxd Would you mind having a look?

Copy link
Contributor

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

Looks reasonable and helpful! A few suggestions - otherwise LGTM

effigies and others added 2 commits October 8, 2025 12:52
Co-authored-by: Mathias Goncalves <goncalves.mathias@gmail.com>
@effigies effigies merged commit 35c1b0c into templateflow:master Oct 8, 2025
14 checks passed
@effigies effigies deleted the fix/xml-results branch October 8, 2025 20:00
effigies added a commit that referenced this pull request Oct 21, 2025
25.1.0 (October 21, 2025)

New feature release in the 25.1 series.

This release introduces a new ``TemplateFlowClient`` class that provides the
functionality previously exposed in ``templateflow.api``.
``templateflow.api`` is now a thin wrapper around a global instance of ``TemplateFlowClient``,
so existing code using ``templateflow.api`` should continue to work as before.

These changes allow multiple independent clients to coexist in the same Python process,
as well as defer loading of data from the filesystem until it is requested,
significantly improving import time.

* RF: Factor TemplateFlow into Cache and Client classes (#149)
* FIX: Error on missing S3 files, do not write error data to disk (#148)
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