Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TransferData.add_item to omit recursive #696

Merged
merged 3 commits into from
Mar 2, 2023

Conversation

sirosen
Copy link
Member

@sirosen sirosen commented Mar 1, 2023

By default today, add_item will create a subdocument with {"recursive": false}. This update defaults to omission of the "recursive" key to match the new behavior being released by the Transfer API.

This change is technically backwards incompatible in that we're changing the document we generate. However, our previous default (False) was chosen to match API behaviors and the new default (omission) is chosen to match new API behaviors. This can impact users, but is likely acceptable without a major version bump. To have a noticeable negative impact, a user would have to not be specifying recursive but also explicitly want the behavior of recursive=False.

The changelog entry encourages users to be explicit about their desired usage if they are concerned.


📚 Documentation preview 📚: https://globus-sdk-python--696.org.readthedocs.build/en/696/

By default today, `add_item` will create a subdocument with
`{"recursive": false}`. This update defaults to omission of the
`"recursive"` key to match the new behavior being released by the
Transfer API.

This change is technically backwards incompatible in that we're
changing the document we generate. However, our previous default
(`False`) was chosen to match API behaviors and the new default
(omission) is chosen to match new API behaviors. This can impact
users, but is likely acceptable without a major version bump. To have
a noticeable negative impact, a user would have to not be specifying
`recursive` but also explicitly want the behavior of `recursive=False`.

The changelog entry encourages users to be explicit about their
desired usage if they are concerned.
@sirosen sirosen force-pushed the no-default-recursive branch from 5e955a6 to 38a63dd Compare March 1, 2023 18:05
Copy link
Contributor

@aaschaer aaschaer left a comment

Choose a reason for hiding this comment

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

Code looks good, left a comment on the changleog text

behaviors which treat the absence of the ``recursive`` flag as meaning
autodetect, rather than the previous default of ``False``. Users are
recommended to avoid explicitly setting the value unless they would like
to avoid using the autodetection logic (:pr:`NUMBER`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we want to recommend avoiding explicitly setting values, as doing so allows catching some errors at submission time that would otherwise cause task errors later like trying to pass external_checksum on a dir

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't aware of or thinking about that particular advantage of continuing to pass the flag.
Omitting recursive is still what I'd recommend to a naive user, but there's more nuance to it than I realized.

Let me take another crack at the changelog message for this update.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've toned it down, but still said that it's not necessary to set the flag in "many cases" (intentionally vague).
Let me know what you think of the update!

Copy link
Contributor

Choose a reason for hiding this comment

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

New text sounds good to me!

This tones down the statement in the changelog to better allow for the
possibility that setting the `recursive` flag explicitly can benefit
certain use-cases.
@sirosen sirosen merged commit 76cd247 into globus:main Mar 2, 2023
@sirosen sirosen deleted the no-default-recursive branch March 2, 2023 20:22
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