Skip to content

TransferClientV2#1370

Open
aaschaer wants to merge 3 commits intomainfrom
aaron/transfer_v2
Open

TransferClientV2#1370
aaschaer wants to merge 3 commits intomainfrom
aaron/transfer_v2

Conversation

@aaschaer
Copy link
Contributor

@aaschaer aaschaer commented Feb 26, 2026

Adds TransferClientV2 to experimental, adds its supporting classes, and labels existing v2 support in the TransferClient as Beta as proposed here.

Most of the code in this PR is things for the existing TransferClient that were copied and then slightly modified to work with Transfer v2. Things that are completely new:

  • TransferClientV2.list_stream_access_points
  • IterableJSONAPIResponse
  • JSONAPIPaginator

Some things that aren't included here but would be nice to have at some point:

  • some kind of JSON:API document constructor class. This probably can be added without breaking anything as long as it is/acts like a dict.
  • better JSON:API support in responses. Not sure if this would be a separate class, or adding convenience attributes/methods to GlobusHTTPResponse that are available if the response looks like a JSON:API response

I also found some issues with the existing tunnels support in the TransferClient while copying things over to TransferClientV2, most notably the iteration on list_tunnels was looking for a v1 "DATA" key. I've included fixes for now, but I'm a bit worried about supporting those going forwards. We likely will make more changes and fixes TransferClientV2 side that might not make it to TransferClient, so maybe we should deprecate those completely rather than leaving them there with a "careful this is Beta" comment?

@aaschaer aaschaer changed the title TransferClientV2, more JSON:API support, and tunnels fixes TransferClientV2 Feb 26, 2026
@aaschaer aaschaer marked this pull request as ready for review March 3, 2026 22:27
@aaschaer
Copy link
Contributor Author

aaschaer commented Mar 3, 2026

Marking this ready for review as it now has tests and I think its enough to start adding Transfer v2 support to going forwards.


# CreateTunnelData has been moved to experimental but is provided here for
# backwards compatibility
from globus_sdk.experimental.transfer_v2.data import CreateTunnelData
Copy link
Member

Choose a reason for hiding this comment

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

I don't like having this dependency arrow, from non-experimental SDK into globus_sdk.experimental.
It makes it harder to know which changes are safe and which are not at review time -- even though the class is located in experimental, any change to it would be subject to the usual level of rigor we apply for our backwards compatibility policy. Even if we decided to make an exemption, it's confusing in terms of "what is allowed?"

I'm trying to decide on a solution to propose. I see two options so far, listed in my current order of preference:

  1. Depend from experimental onto this non-experimental class (since it's not really changing)
  2. Copy the class in two locations, one experimental and one not

I'm sure we could come up with others, but I expect the deprecation cycle for TransferClient to be extremely long, and I'm therefore wary of creating a "temporary situation" which might last much longer than expected. I'd like to be careful here.


Tunnels functionality is currently in Beta and may experience
changes that will break this interface

Copy link
Member

Choose a reason for hiding this comment

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

This note makes me think that perhaps I misunderstood -- and it has bearing on the comment above. Is the API not actually stabilized? I'd like to clarify that, separately from figuring out what to do about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Responded in slack since that seems like an easier place to have a wider discussion if needed, but yes anything under v2 is not stable

"""This response class is for iterating on JSON:API responses that have an
array of data in their top level `data` key."""

default_iter_key = "data"
Copy link
Member

Choose a reason for hiding this comment

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

How would you feel about breaking this response and the paginator off of this PR, into a separate one?
I think we could fairly rapidly review+merge these two parts, with their tests, and that they're unlikely to need changes. That would slim down the PR overall and make it easier to review -- especially since I realize now that I have some high-level questions about how we move away from potentially problematic TransferClient methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, will do

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