-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate Compute function data classes
Marked the `ComputeFunctionDocument` and `ComputeFunctionMetadata` classes for deprecation. This reflects an early design adjustment to better align with the existing Globus Compute SDK.
- Loading branch information
Showing
7 changed files
with
50 additions
and
20 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
changelog.d/20241023_134132_30907815+rjmello_modify_compute_client_reg_func.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Deprecated | ||
~~~~~~~~~~ | ||
|
||
- Deprecated the ``ComputeFunctionDocument`` and ``ComputeFunctionMetadata`` classes. | ||
This change reflects an early design adjustment to better align with the existing | ||
Globus Compute SDK. (:pr:`NUMBER`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
tests/functional/services/compute/test_register_function.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import globus_sdk | ||
from globus_sdk._testing import load_response | ||
from globus_sdk.services.compute import ComputeFunctionDocument | ||
|
||
|
||
def test_register_function(compute_client: globus_sdk.ComputeClient): | ||
meta = load_response(compute_client.register_function).metadata | ||
function_doc = ComputeFunctionDocument( | ||
function_name=meta["function_name"], function_code=meta["function_code"] | ||
) | ||
res = compute_client.register_function(function_doc) | ||
registration_doc = { | ||
"function_name": meta["function_name"], | ||
"function_code": meta["function_code"], | ||
} | ||
res = compute_client.register_function(function_data=registration_doc) | ||
assert res.http_status == 200 | ||
assert res.data["function_uuid"] == meta["function_id"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
|
||
from globus_sdk.exc import RemovedInV4Warning | ||
from globus_sdk.services.compute.data import ( | ||
ComputeFunctionDocument, | ||
ComputeFunctionMetadata, | ||
) | ||
|
||
|
||
def test_compute_function_metadata_deprecated(): | ||
with pytest.warns( | ||
RemovedInV4Warning, match="ComputeFunctionMetadata is deprecated." | ||
): | ||
ComputeFunctionMetadata() | ||
|
||
|
||
def test_compute_function_document_deprecated(): | ||
with pytest.warns( | ||
RemovedInV4Warning, match="ComputeFunctionDocument is deprecated." | ||
): | ||
ComputeFunctionDocument(function_name="foo", function_code="bar") |