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,7 @@
Deprecated
~~~~~~~~~~

- The following features have been deprecated as they are not supported by any collections:

- The ``add_symlink_item`` method of ``TransferData``
- The ``recursive_symlinks`` argument to ``TransferData``
28 changes: 18 additions & 10 deletions src/globus_sdk/services/transfer/data/transfer_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,8 @@ class TransferData(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 recursive_symlinks: Specify the behavior of recursive directory transfers
when encountering symlinks. One of ``"ignore"``, ``"keep"``, or ``"copy"``.
``"ignore"`` skips symlinks, ``"keep"`` creates symlinks at the destination
matching the source (without modifying the link path at all), and
``"copy"`` follows symlinks on the source, failing if the link is invalid.
[default: ``"ignore"``]
: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_source_errors: When true, source permission denied and file
Expand All @@ -92,7 +88,7 @@ class TransferData(utils.PayloadWrapper):
:param fail_on_quota_errors: When true, quota exceeded errors will cause the
task to fail.
[default: ``False``]
:param delete_destination_extra: Delete files, directories, and symlinks on the
:param delete_destination_extra: Delete files and directories on the
destination endpoint which don’t exist on the source endpoint or are a
different type. Only applies for recursive directory transfers.
[default: ``False``]
Expand Down Expand Up @@ -196,6 +192,12 @@ def __init__(
if destination_endpoint is None:
raise exc.GlobusSDKUsageError("destination_endpoint is required")

if recursive_symlinks:
exc.warn_deprecated(
"`recursive_symlinks` is not currently supported by any collections. "
"To reduce confusion, this keyword argument will be removed."
)

log.debug("Creating a new TransferData object")
self["DATA_TYPE"] = "transfer"
self["DATA"] = []
Expand Down Expand Up @@ -250,9 +252,7 @@ def add_item(
additional_fields: dict[str, t.Any] | None = None,
) -> None:
"""
Add a file or directory to be transferred. If the item is a symlink
to a file or directory, the file or directory at the target of
the symlink will be transferred.
Add a file or directory to be transferred.

Appends a transfer_item document to the DATA key of the transfer
document.
Expand Down Expand Up @@ -304,6 +304,10 @@ def add_item(

def add_symlink_item(self, source_path: str, destination_path: str) -> None:
"""
.. warning::

This method is not currently supported by any collections.

Add a symlink to be transferred as a symlink rather than as the
target of the symlink.

Expand All @@ -313,6 +317,10 @@ def add_symlink_item(self, source_path: str, destination_path: str) -> None:
:param source_path: Path to the source symlink
:param destination_path: Path to which the source symlink will be transferred
"""
exc.warn_deprecated(
"add_symlink_item is not currently supported by any collections. "
"To reduce confusion, this method will be removed."
)
item_data = {
"DATA_TYPE": "transfer_symlink_item",
"source_path": source_path,
Expand Down
1 change: 0 additions & 1 deletion tests/functional/services/transfer/test_task_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def test_transfer_submit_success(client):
assert tdata["sync_level"] == 0

tdata.add_item("/path/to/foo", "/path/to/bar")
tdata.add_symlink_item("linkfoo", "linkbar")

res = client.submit_transfer(tdata)

Expand Down
17 changes: 0 additions & 17 deletions tests/unit/helpers/test_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,6 @@ def test_transfer_add_item():
assert all(fields_data[k] == v for k, v in addfields.items())


def test_transfer_add_symlink_item():
"""
Adds a transfer_symlink_item to TransferData, verifies results
"""
tdata = TransferData(source_endpoint=GO_EP1_ID, destination_endpoint=GO_EP2_ID)
# add item
source_path = "source/path/"
dest_path = "dest/path/"
tdata.add_symlink_item(source_path, dest_path)
# verify results
assert len(tdata["DATA"]) == 1
data = tdata["DATA"][0]
assert data["DATA_TYPE"] == "transfer_symlink_item"
assert data["source_path"] == source_path
assert data["destination_path"] == dest_path


def test_delete_init_with_client():
"""
Verifies DeleteData field initialization
Expand Down
Loading