Skip to content

Commit b4e6b1b

Browse files
authored
Remove unused arguments (#145)
* Remove in and out schemas from transitions * update version
1 parent 198ea01 commit b4e6b1b

File tree

4 files changed

+12
-47
lines changed

4 files changed

+12
-47
lines changed

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Version 11.4.1 - 2024-12-02
4+
5+
- Remove `in_schema` and `out_schema` from `create_transition` and `update_transition`
6+
37
## Version 11.4.0 - 2024-11-21
48

59
- Added `get_prediction`

Diff for: las/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
__maintainer_email__ ='[email protected]'
88
__title__ = 'lucidtech-las'
99
__url__ = 'https://github.com/LucidtechAI/las-sdk-python'
10-
__version__ = '11.4.0'
10+
__version__ = '11.4.1'

Diff for: las/client.py

+3-23
Original file line numberDiff line numberDiff line change
@@ -1844,8 +1844,6 @@ def create_transition(
18441844
self,
18451845
transition_type: str,
18461846
*,
1847-
in_schema: Optional[dict] = None,
1848-
out_schema: Optional[dict] = None,
18491847
parameters: Optional[dict] = None,
18501848
**optional_args,
18511849
) -> Dict:
@@ -1855,25 +1853,19 @@ def create_transition(
18551853
>>> from pathlib import Path
18561854
>>> from las.client import Client
18571855
>>> client = Client()
1858-
>>> in_schema = {'$schema': 'https://json-schema.org/draft-04/schema#', 'title': 'in', 'properties': {...} }
1859-
>>> out_schema = {'$schema': 'https://json-schema.org/draft-04/schema#', 'title': 'out', 'properties': {...} }
18601856
>>> # A typical docker transition
18611857
>>> docker_params = {
18621858
>>> 'imageUrl': '<image_url>',
18631859
>>> 'credentials': {'username': '<username>', 'password': '<password>'}
18641860
>>> }
1865-
>>> client.create_transition('docker', in_schema=in_schema, out_schema=out_schema, params=docker_params)
1861+
>>> client.create_transition('docker', params=docker_params)
18661862
>>> # A manual transition with UI
18671863
>>> assets = {'jsRemoteComponent': 'las:asset:<hex-uuid>', '<other asset name>': 'las:asset:<hex-uuid>'}
18681864
>>> manual_params = {'assets': assets}
1869-
>>> client.create_transition('manual', in_schema=in_schema, out_schema=out_schema, params=manual_params)
1865+
>>> client.create_transition('manual', params=manual_params)
18701866
18711867
:param transition_type: Type of transition "docker"|"manual"
18721868
:type transition_type: str
1873-
:param in_schema: Json-schema that defines the input to the transition
1874-
:type in_schema: dict, optional
1875-
:param out_schema: Json-schema that defines the output of the transition
1876-
:type out_schema: dict, optional
18771869
:param name: Name of the transition
18781870
:type name: str, optional
18791871
:param parameters: Parameters to the corresponding transition type
@@ -1887,8 +1879,6 @@ def create_transition(
18871879
:py:class:`~las.LimitExceededException`, :py:class:`requests.exception.RequestException`
18881880
"""
18891881
body = dictstrip({
1890-
'inputJsonSchema': in_schema,
1891-
'outputJsonSchema': out_schema,
18921882
'transitionType': transition_type,
18931883
'parameters': parameters,
18941884
})
@@ -1949,8 +1939,6 @@ def update_transition(
19491939
self,
19501940
transition_id: str,
19511941
*,
1952-
in_schema: Optional[dict] = None,
1953-
out_schema: Optional[dict] = None,
19541942
assets: Optional[dict] = None,
19551943
cpu: Optional[int] = None,
19561944
memory: Optional[int] = None,
@@ -1971,10 +1959,6 @@ def update_transition(
19711959
:type name: str, optional
19721960
:param description: Description of the transition
19731961
:type description: str, optional
1974-
:param in_schema: Json-schema that defines the input to the transition
1975-
:type in_schema: dict, optional
1976-
:param out_schema: Json-schema that defines the output of the transition
1977-
:type out_schema: dict, optional
19781962
:param assets: A dictionary where the values are assetIds that can be used in a manual transition
19791963
:type assets: dict, optional
19801964
:param environment: Environment variables to use for a docker transition
@@ -1996,11 +1980,7 @@ def update_transition(
19961980
:raises: :py:class:`~las.InvalidCredentialsException`, :py:class:`~las.TooManyRequestsException`,\
19971981
:py:class:`~las.LimitExceededException`, :py:class:`requests.exception.RequestException`
19981982
"""
1999-
body = dictstrip({
2000-
'inputJsonSchema': in_schema,
2001-
'outputJsonSchema': out_schema,
2002-
})
2003-
1983+
body = {}
20041984
parameters = dictstrip({
20051985
'assets': assets,
20061986
'cpu': cpu,

Diff for: tests/test_transitions.py

+4-23
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717
])
1818
@pytest.mark.parametrize('name_and_description', util.name_and_description_combinations())
1919
def test_create_transition(client: Client, transition_type, parameters, name_and_description):
20-
schema = util.create_json_schema()
2120
response = client.create_transition(
2221
transition_type,
23-
in_schema=schema,
24-
out_schema=schema,
2522
parameters=parameters,
2623
**name_and_description,
2724
)
@@ -73,25 +70,9 @@ def test_get_transition_execution(client: Client):
7370
assert 'status' in response, 'Missing status in response'
7471

7572

76-
@pytest.mark.parametrize(('in_schema', 'out_schema'), [
77-
(None, None),
78-
({'foo': 'bar'}, None),
79-
(None, {'foo': 'bar'}),
80-
({'foo': 'bar'}, {'foo': 'bar'}),
81-
])
8273
@pytest.mark.parametrize('name_and_description', util.name_and_description_combinations(True))
83-
def test_update_transition(
84-
client: Client,
85-
name_and_description,
86-
in_schema,
87-
out_schema,
88-
):
89-
response = client.update_transition(
90-
service.create_transition_id(),
91-
in_schema=in_schema,
92-
out_schema=out_schema,
93-
**name_and_description,
94-
)
74+
def test_update_transition(client: Client, name_and_description):
75+
response = client.update_transition(service.create_transition_id(), **name_and_description)
9576
logging.info(response)
9677
assert_transition(response)
9778

@@ -119,8 +100,8 @@ def test_update_transition_parameters_manual(client: Client, assets):
119100
(None, None),
120101
])
121102
def test_update_transition_parameters_docker(
122-
client: Client,
123-
environment,
103+
client: Client,
104+
environment,
124105
environment_secrets,
125106
cpu,
126107
memory,

0 commit comments

Comments
 (0)