Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Deprecated
----------

- The ``skip_activation_check`` parameter to ``TransferData`` and ``DeleteData``
has been deprecated. This parameter no longer has any effect when set. (:pr:`NUMBER`)
10 changes: 8 additions & 2 deletions src/globus_sdk/services/transfer/data/delete_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class DeleteData(utils.PayloadWrapper):
timestamp is in UTC to avoid confusion and ambiguity. Examples of ISO-8601
timestamps include ``2017-10-12 09:30Z``, ``2017-10-12 12:33:54+00:00``, and
``2017-10-12``
:param skip_activation_check: When true, allow submission even if the endpoint
isn't currently activated
:param skip_activation_check: This argument is deprecated, as 'activation' is no
longer supported by Globus Collections.
:param notify_on_succeeded: Send a notification email when the delete task
completes with a status of SUCCEEDED.
[default: ``True``]
Expand Down Expand Up @@ -108,6 +108,12 @@ def __init__(
if endpoint is None:
raise exc.GlobusSDKUsageError("endpoint is required")

if skip_activation_check is not None:
exc.warn_deprecated(
"`skip_activation_check` is no longer supported by Globus Collections, "
"and has no effect when set."
)

self["DATA_TYPE"] = "delete"
self["DATA"] = []
self._set_optstrs(
Expand Down
10 changes: 8 additions & 2 deletions src/globus_sdk/services/transfer/data/transfer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class TransferData(utils.PayloadWrapper):
``2017-10-12``
:param recursive_symlinks: This keyword argument is deprecated as not collections
support it.
:param skip_activation_check: When true, allow submission even if the endpoints
aren't currently activated
:param skip_activation_check: This argument is deprecated, as 'activation' is no
longer supported by Globus Collections.
:param skip_source_errors: When true, source permission denied and file
not found errors from the source endpoint will cause the offending
path to be skipped.
Expand Down Expand Up @@ -198,6 +198,12 @@ def __init__(
"To reduce confusion, this keyword argument will be removed."
)

if skip_activation_check is not None:
exc.warn_deprecated(
"`skip_activation_check` is no longer supported by Globus Collections, "
"and has no effect when set."
)

log.debug("Creating a new TransferData object")
self["DATA_TYPE"] = "transfer"
self["DATA"] = []
Expand Down
12 changes: 11 additions & 1 deletion tests/unit/helpers/test_timer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import contextlib
import datetime

import pytest
Expand Down Expand Up @@ -30,7 +31,16 @@ def test_timer_from_transfer_data_ok():
"badkey, value", (("submission_id", "foo"), ("skip_activation_check", True))
)
def test_timer_from_transfer_data_rejects_forbidden_keys(badkey, value):
tdata = TransferData(None, GO_EP1_ID, GO_EP2_ID, **{badkey: value})
if badkey == "skip_activation_check":
ctx = pytest.warns(
exc.RemovedInV4Warning,
match="`skip_activation_check` is no longer supported",
)
else:
ctx = contextlib.nullcontext()

with ctx:
tdata = TransferData(None, GO_EP1_ID, GO_EP2_ID, **{badkey: value})
with pytest.raises(ValueError):
with pytest.warns(exc.RemovedInV4Warning, match="Prefer TransferTimer"):
TimerJob.from_transfer_data(tdata, "2022-01-01T00:00:00Z", 600)
Expand Down
20 changes: 17 additions & 3 deletions tests/unit/helpers/test_transfer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import pytest

from globus_sdk import DeleteData, GlobusSDKUsageError, TransferClient, TransferData
from globus_sdk import (
DeleteData,
GlobusSDKUsageError,
TransferClient,
TransferData,
exc,
)
from globus_sdk._testing import load_response
from globus_sdk.services.transfer.client import _format_filter
from tests.common import GO_EP1_ID, GO_EP2_ID
Expand Down Expand Up @@ -337,11 +343,19 @@ def create(**kwargs):
# not present if not provided as a param or provided as explicit None
assert "skip_activation_check" not in create()
elif value:
data = create(skip_activation_check=True)
with pytest.warns(
exc.RemovedInV4Warning,
match="`skip_activation_check` is no longer supported",
):
data = create(skip_activation_check=True)
assert "skip_activation_check" in data
assert data["skip_activation_check"] is True
else:
data = create(skip_activation_check=False)
with pytest.warns(
exc.RemovedInV4Warning,
match="`skip_activation_check` is no longer supported",
):
data = create(skip_activation_check=False)
assert "skip_activation_check" in data
assert data["skip_activation_check"] is False

Expand Down
Loading