UncountablePythonSDK 0.0.93__py3-none-any.whl → 0.0.96__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of UncountablePythonSDK might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.93
3
+ Version: 0.0.96
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -38,6 +38,7 @@ Requires-Dist: simplejson==3.*
38
38
  Requires-Dist: grpcio==1.67.1
39
39
  Requires-Dist: protobuf>=4.21.1
40
40
  Requires-Dist: azure-storage-blob==12.*
41
+ Requires-Dist: boto3-stubs[essential,ses]==1.36.4
41
42
  Provides-Extra: test
42
43
  Requires-Dist: mypy==1.*; extra == "test"
43
44
  Requires-Dist: ruff==0.*; extra == "test"
@@ -28,7 +28,7 @@ examples/integration-server/jobs/materials_auto/example_wh.py,sha256=Hx5nonavOh2
28
28
  examples/integration-server/jobs/materials_auto/profile.yaml,sha256=XlOXSRplMJ13T6900pv1wDKxeE9V1hZZTMuvup1MiBM,896
29
29
  pkgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  pkgs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
- pkgs/argument_parser/__init__.py,sha256=AOL6yZkJg9Z8Q4v4JY4agEbMDQWPptVauSA_itShv64,693
31
+ pkgs/argument_parser/__init__.py,sha256=nQGVudX2XjaFRNXU7V3e-Ap-zmUpRVrwHqlzJ1FDgvk,816
32
32
  pkgs/argument_parser/_is_enum.py,sha256=Gw6jJa8nBwYGqXwwCZbSnWL8Rvr5alkg5lSVAqXtOZM,257
33
33
  pkgs/argument_parser/_is_namedtuple.py,sha256=Rjc1bKanIPPogl3qG5JPBxglG1TqWYOo1nxxhBASQWY,265
34
34
  pkgs/argument_parser/argument_parser.py,sha256=_W0-HLC1F8jXgeFJnhUREorqcXzuhZi__eX_7FFkkVs,19363
@@ -38,7 +38,7 @@ pkgs/filesystem_utils/_blob_session.py,sha256=CtoB7PIocuZo8vvFIS_Rc-YR6KwzFB0rHU
38
38
  pkgs/filesystem_utils/_gdrive_session.py,sha256=XTAKppTfIiJtPkzq90yftoMHa-kcGe9MDZQlmx1bviQ,11058
39
39
  pkgs/filesystem_utils/_local_session.py,sha256=xFEYhAvNqrOYqwt4jrEYOuYkjJn0zclZhTelW_Q1-rw,2325
40
40
  pkgs/filesystem_utils/_s3_session.py,sha256=DdD6M90z1VyTiuRdTmjvBNJOEFHBPyEU8wGKRKwHvOU,4027
41
- pkgs/filesystem_utils/_sftp_session.py,sha256=6qwBGYu8UTFYw9YAmYAD0qL9qtivRRQpvzmlInmJZ_k,4709
41
+ pkgs/filesystem_utils/_sftp_session.py,sha256=l1hS8KjnINqCX2CZU1t66H-is0mTwTLeMcQMyXW8DjM,4847
42
42
  pkgs/filesystem_utils/file_type_utils.py,sha256=oklu7Wtcxg9pBz84cAlXpNlhYEM0AbsO5DoEqvFjoXY,1896
43
43
  pkgs/filesystem_utils/filesystem_session.py,sha256=BQ2Go8Mu9-GcnaWh2Pm4x7ugLVsres6XrOQ8RoiEpcE,1045
44
44
  pkgs/serialization/__init__.py,sha256=b2sNfYICz0D6Y8shzEUfyUoHZukfuAvfuaZvg8dZHic,1163
@@ -51,10 +51,11 @@ pkgs/serialization/serial_generic.py,sha256=vAC0-o9fkco2lM_YvBavY0JDYncDxbW3jFbo
51
51
  pkgs/serialization/serial_union.py,sha256=IdWsSsM8j-qGfl5Wv6haX37ZS1SKob8XT8cilBBOVIo,2670
52
52
  pkgs/serialization/yaml.py,sha256=yoJtu7_ixnJV6uTxA_U1PpK5F_ixT08AKVh5ocyYwXM,1466
53
53
  pkgs/serialization_util/__init__.py,sha256=YykkhqGNKiLCo-D5vSTq6WiPNfCyPXyr-mQO5e5Klak,513
54
+ pkgs/serialization_util/_env_flags.py,sha256=5kBchfeYS_MRWWSdUE3EljXTtOZX-YYH7inh48d-Qz8,90
54
55
  pkgs/serialization_util/_get_type_for_serialization.py,sha256=dW5_W9MFd6wgWfW5qlWork-GBb-QFLtiOZkjk2Zqn2M,1177
55
56
  pkgs/serialization_util/convert_to_snakecase.py,sha256=H2BAo5ZdcCDN77RpLb-uP0s7-FQ5Ukwnsd3VYc1vD0M,583
56
57
  pkgs/serialization_util/dataclasses.py,sha256=uhNGXQPQLZblDFQuuwkAGmKOPiRyfDzCdg72CVtYJGA,390
57
- pkgs/serialization_util/serialization_helpers.py,sha256=d11gYBe0WDlPDMqi8LatD4I5RluIcheD8xtMXnPLF1g,6537
58
+ pkgs/serialization_util/serialization_helpers.py,sha256=gP4U5zLYA6Y3y1qtcH2qoRsXPh-UnhR5ITEIRUDj06A,6649
58
59
  pkgs/strenum_compat/__init__.py,sha256=wXRFeNvBm8RU6dy1PFJ5sRLgUIEeH_DVR95Sv5qpGbk,59
59
60
  pkgs/strenum_compat/strenum_compat.py,sha256=uOUAgpYTjHs1MX8dG81jRlyTkt3KNbkV_25zp7xTX2s,36
60
61
  pkgs/type_spec/__init__.py,sha256=h5DmJTca4QVV10sZR1x0-MlkZfuGYDfapR3zHvXfzto,19
@@ -64,7 +65,7 @@ pkgs/type_spec/config.py,sha256=K-DFjRVIW5RCJOuB0QhkWZMOrsIZavFURqmhgAoULgw,5103
64
65
  pkgs/type_spec/emit_io_ts.py,sha256=CUvBs0boB_X-Kndh66yYcqFfq3oC_LGs8YffLkJ0ZXA,5707
65
66
  pkgs/type_spec/emit_open_api.py,sha256=9AgtHB3ZIObs9cV-RqNZt_q1icmIGwPeovQ63gTl-l8,24541
66
67
  pkgs/type_spec/emit_open_api_util.py,sha256=34zslFjTiOI5q8YreBOLD-afmaW4lrlK7pBpNAd3CxA,2379
67
- pkgs/type_spec/emit_python.py,sha256=BohmwGN89EDHiNlT6-z7xv2C0vIRhQ2SXr4kdoue2a4,52103
68
+ pkgs/type_spec/emit_python.py,sha256=0JKXPapSOVVn6laO5dOpKfON18YkK5KtfhpE-Sqb_5E,52001
68
69
  pkgs/type_spec/emit_typescript.py,sha256=_7-SLAOP0jMIrDWDKCPJpyykJh3n0hynm5b-Ltq23hM,10620
69
70
  pkgs/type_spec/emit_typescript_util.py,sha256=sugxboeMwXiIdk4RDyUR_CxU31Le3OQ7i5HmuHeSLvc,10447
70
71
  pkgs/type_spec/load_types.py,sha256=ero3SXB0M7xKHni5Qxop5Yh5A1TYjjoqwkEgUCQx71Q,3657
@@ -87,7 +88,7 @@ uncountable/__init__.py,sha256=8l8XWNCKsu7TG94c-xa2KHpDegvxDC2FyQISdWC763Y,89
87
88
  uncountable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
89
  uncountable/core/__init__.py,sha256=RFv0kO6rKFf1PtBPu83hCGmxqkJamRtsgQ9_-ztw7tA,341
89
90
  uncountable/core/async_batch.py,sha256=9pYGFzVCQXt8059qFHgutweGIFPquJ5Xfq6NT5P-1K0,1206
90
- uncountable/core/client.py,sha256=cypErG4AXAcgkzetvlSLWA75-LKjqreobZgjSfSUKbY,13004
91
+ uncountable/core/client.py,sha256=ZlGKzpAnPaU0ABOb_bhIDUKZ9x8rlezqVaK0mfDvdw8,13253
91
92
  uncountable/core/environment.py,sha256=6cc-nUvUIbJMI0OSEg3dWI-iNgSYhCdUKKn607Z3QpM,1040
92
93
  uncountable/core/file_upload.py,sha256=bgvXk9vfF5qlhy2NAUcEEG7Q7i-c1wr2HrpaWD7HldU,4516
93
94
  uncountable/core/types.py,sha256=s2CjqYJpsmbC7xMwxxT7kJ_V9bwokrjjWVVjpMcQpKI,333
@@ -106,7 +107,7 @@ uncountable/integration/db/connect.py,sha256=mE3bdV0huclH2iT_dXCQdRL4LkjIuf_myAR
106
107
  uncountable/integration/db/session.py,sha256=96cGQXpe6IugBTdSsjdP0S5yhJ6toSmbVB6qhc3FJzE,693
107
108
  uncountable/integration/executors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
109
  uncountable/integration/executors/executors.py,sha256=Kzisp1eKufGCWrHIw4mmAj-l1UQ2oJsJR7I-_mksnVs,5441
109
- uncountable/integration/executors/generic_upload_executor.py,sha256=OnVY4KfmAgaf9LPSAgj7H2wFRXwNXBpg7egVy85z5lk,10327
110
+ uncountable/integration/executors/generic_upload_executor.py,sha256=KRUVeQkywIQUxzuzCIp6Vli1JWFelUCKTeJCxjMmkuI,11179
110
111
  uncountable/integration/executors/script_executor.py,sha256=BBQ9f0l7uH2hgKf60jtm-pONzwk-EeOhM2qBAbv_URo,846
111
112
  uncountable/integration/queue_runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
112
113
  uncountable/integration/queue_runner/job_scheduler.py,sha256=2acmeWscG87MZsifxwMRMGJ4sQgQVNJNr5CqIPUg75E,6288
@@ -143,13 +144,13 @@ uncountable/types/calculations.py,sha256=fApOFpgBemt_t7IVneVR0VdI3X5EOxiG6Xhzr6R
143
144
  uncountable/types/calculations_t.py,sha256=LE_HWYPf7yxNTpH5sVPaC0e98OxJ5hUOhHezeJNKDtk,648
144
145
  uncountable/types/chemical_structure.py,sha256=ujyragaD26-QG5jgKnWhO7TN3N1V9b_04T2WhqNYxxo,281
145
146
  uncountable/types/chemical_structure_t.py,sha256=iYmGER_vXqoksv2Nr189qU1Zm70s-U49Eiv0DkWaB1I,773
146
- uncountable/types/client_base.py,sha256=h5nOrnuw6Szq-fEu9mxzMhqMlm3HDpoi5PlL9Or8ypk,68699
147
+ uncountable/types/client_base.py,sha256=5UJI7ByJitlpoW6ET6AIB14pgzB8zHXTQ0yn291cWmc,68932
147
148
  uncountable/types/client_config.py,sha256=qLpHt4O_B098CyN6qQajoxZ2zjZ1DILXLUEGyyGP0TQ,280
148
149
  uncountable/types/client_config_t.py,sha256=k_UkjemqiVuJBiFUjJYk3h673Nahr0nGZvfEZFzsC0k,699
149
150
  uncountable/types/curves.py,sha256=QyEyC20jsG-LGKVx6miiF-w70vKMwNkILFBDIJ5Ok9g,345
150
151
  uncountable/types/curves_t.py,sha256=2_9qdrSl1XAvIG57lo45KWNpa0wXgZ97OkSRCPRrudc,1347
151
152
  uncountable/types/entity.py,sha256=Zclk1LYcRaYrMDhqyCjMSLEg0fE6_q8LHvV22Qvscgs,566
152
- uncountable/types/entity_t.py,sha256=dTf525ZlAnhWwuCPElR5xooLt0q0LtdtTMkgMQv15nM,17422
153
+ uncountable/types/entity_t.py,sha256=MWtA4b9ZoayKDKJ2j1MNbt7lefSFJy3mWaswoOOx3ks,17512
153
154
  uncountable/types/experiment_groups.py,sha256=qUpFOx1AKgzaT_4khCOv5Xs6jwiQGbvHH-GUh3v1nv4,288
154
155
  uncountable/types/experiment_groups_t.py,sha256=_fAYZwqYLR3cFdv2vwLOYs5TvH5CEWDEbh3kFpg26zY,700
155
156
  uncountable/types/field_values.py,sha256=hERqHIDmWPQpdW7BLitdA-DNiutmll-ggecwEO7FoVU,1181
@@ -169,7 +170,7 @@ uncountable/types/inputs_t.py,sha256=0b3U77JcZT4hgUvbP_i-E5RoJbJnRxn3OKBqGWu32TM
169
170
  uncountable/types/integration_server.py,sha256=VonA8h8TGnVBiss5W8-K82lA01JQa7TLk0ubFo8iiBQ,364
170
171
  uncountable/types/integration_server_t.py,sha256=37zyqeet54P9m6pxaZfLOgZCqqZA2dxJ5gl6NCoelQ0,1188
171
172
  uncountable/types/job_definition.py,sha256=6BkLZrmTfIYh45XFGZ5HOYveued0YXvl17YTlXblXjw,1646
172
- uncountable/types/job_definition_t.py,sha256=n8lwjNtt6eHg01yARRIgDiLO9W8ev5upb3qs2RPHZXg,7753
173
+ uncountable/types/job_definition_t.py,sha256=ed_fCyLFQBo6XDfqtfUnk4ghmx0uGtDHVEnNB1N_yv4,7837
173
174
  uncountable/types/outputs.py,sha256=I6zP2WHXg_jXgMqmuEJuJOlsjKjQGHjfs1JOwW9YxBM,260
174
175
  uncountable/types/outputs_t.py,sha256=ZJhKKkksJ-K7iuuumCly9edU8TRv-eWol4PKG7XPo3E,734
175
176
  uncountable/types/overrides.py,sha256=fOvj8P9K9ul8fnTwA--l140EWHuc1BFq8tXgtBkYld4,410
@@ -217,8 +218,8 @@ uncountable/types/api/batch/execute_batch_load_async.py,sha256=rxr2pvJ4w_2Xnqzff
217
218
  uncountable/types/api/chemical/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
218
219
  uncountable/types/api/chemical/convert_chemical_formats.py,sha256=B1MT10IfFLapomSwzJyAKvyjrwKVDqEuESIhCJPJtgc,1778
219
220
  uncountable/types/api/entity/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
220
- uncountable/types/api/entity/create_entities.py,sha256=2MVtjfpegFwwUU0NGu-cpvgwusV-6B0zhCPWclXTEsc,1562
221
- uncountable/types/api/entity/create_entity.py,sha256=cVEYcn3ao1vEiF7CiKd85OYBqqqd7ElwRyD_V5C_BHg,1647
221
+ uncountable/types/api/entity/create_entities.py,sha256=R0Xa4gBhOJJ9hNwyZZq2l3BCn-6zy-04JzDo4NxHjVs,1611
222
+ uncountable/types/api/entity/create_entity.py,sha256=YBaFJDZGFnAPadeiqOGZ7LTHET_3RJlXJOUyUpm42PU,1696
222
223
  uncountable/types/api/entity/get_entities_data.py,sha256=OUeBo0YkZmVTHT2EHAQt19rm2PU4OpJzOj3aCmZMw0Y,1433
223
224
  uncountable/types/api/entity/grant_entity_permissions.py,sha256=Zx3FDHSjiBN_wRtmxbWSWdmT-CkzEoi2uoVLCIdS2Q8,1391
224
225
  uncountable/types/api/entity/list_entities.py,sha256=1I6T6fjfolXx1lg8iRiCO5J0ieU0bdudPp31ZmMkXIQ,1895
@@ -295,7 +296,7 @@ uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr
295
296
  uncountable/types/api/triggers/run_trigger.py,sha256=diX1ix_5hkti1F1uYoZhP5iyc6GHAU5coKgqq5syLhI,1059
296
297
  uncountable/types/api/uploader/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
297
298
  uncountable/types/api/uploader/invoke_uploader.py,sha256=-loZzBihKqx63eP-f5RuV1mu6tgkRTZmIc545kklZLk,1273
298
- UncountablePythonSDK-0.0.93.dist-info/METADATA,sha256=Pwy0kXB5Pc8CCUeDNAzQXwTcJwZb9N_7jTpUigM7KFw,2064
299
- UncountablePythonSDK-0.0.93.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
300
- UncountablePythonSDK-0.0.93.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
301
- UncountablePythonSDK-0.0.93.dist-info/RECORD,,
299
+ UncountablePythonSDK-0.0.96.dist-info/METADATA,sha256=noOdXVOZuFMPGoDTMwFBACEpGQ0lj08XV7gBEefA4ko,2114
300
+ UncountablePythonSDK-0.0.96.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
301
+ UncountablePythonSDK-0.0.96.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
302
+ UncountablePythonSDK-0.0.96.dist-info/RECORD,,
@@ -1,3 +1,4 @@
1
+ from ._is_enum import is_string_enum_class as is_string_enum_class
1
2
  from .argument_parser import CachedParser as CachedParser
2
3
  from .argument_parser import ParserError as ParserError
3
4
  from .argument_parser import ParserExtraFieldsError as ParserExtraFieldsError
@@ -5,6 +6,7 @@ from .argument_parser import ParserFunction as ParserFunction
5
6
  from .argument_parser import ParserOptions as ParserOptions
6
7
  from .argument_parser import SourceEncoding as SourceEncoding
7
8
  from .argument_parser import build_parser as build_parser
9
+ from .argument_parser import is_optional as is_optional
8
10
  from .argument_parser import is_union as is_union
9
11
  from .case_convert import camel_to_snake_case as camel_to_snake_case
10
12
  from .case_convert import kebab_to_pascal_case as kebab_to_pascal_case
@@ -54,6 +54,10 @@ def list_sftp_files(
54
54
  os.path.join(dir_path, file)
55
55
  for file in connection.listdir(dir_path)
56
56
  if connection.isfile(os.path.join(dir_path, file))
57
+ and (
58
+ valid_extensions is None
59
+ or os.path.splitext(file)[1] in valid_extensions
60
+ )
57
61
  ])
58
62
  return file_paths
59
63
 
@@ -0,0 +1,3 @@
1
+ import os
2
+
3
+ USE_FASTJSON: bool = os.environ.get("USE_FASTJSON", "false").lower() == "true"
@@ -23,6 +23,7 @@ from pkgs.serialization import (
23
23
  get_serial_class_data,
24
24
  )
25
25
 
26
+ from ._env_flags import USE_FASTJSON
26
27
  from ._get_type_for_serialization import SerializationType, get_serialization_type
27
28
  from .dataclasses import iterate_fields
28
29
 
@@ -109,7 +110,9 @@ def _get_dataclass_conversion_lookups(dataclass_type: Any) -> DataclassConversio
109
110
  if scd.has_to_string_value(key):
110
111
  value_conversion_functions[key] = _to_string_value
111
112
  elif scd.has_unconverted_value(key):
112
- value_conversion_functions[key] = identity
113
+ value_conversion_functions[key] = (
114
+ serialize_for_storage if USE_FASTJSON else identity
115
+ )
113
116
  else:
114
117
  value_conversion_functions[key] = serialize_for_api
115
118
 
@@ -859,7 +859,7 @@ def _emit_type(ctx: Context, stype: builder.SpecType) -> None:
859
859
  if not stype.base.is_base:
860
860
  base_class = f"({refer_to(ctx, stype.base)})"
861
861
  elif len(generics) > 0:
862
- base_class = f"(typing.Generic[{', '.join(generics)}])"
862
+ base_class = f"[{', '.join(generics)}]"
863
863
  class_out.write(f"class {stype.name}{base_class}:\n")
864
864
 
865
865
  emitted_properties_metadata = _emit_type_properties(
@@ -1288,7 +1288,7 @@ def _emit_api_argument_lookup(
1288
1288
  for endpoint_root in builder.api_endpoints:
1289
1289
  routes_output = config.routes_output[endpoint_root]
1290
1290
 
1291
- imports = ["import typing", "import dataclasses"]
1291
+ imports = ["import dataclasses"]
1292
1292
  mappings = []
1293
1293
  for namespace in sorted(
1294
1294
  builder.namespaces.values(),
@@ -1337,9 +1337,6 @@ def _emit_api_argument_lookup(
1337
1337
  argument_lookup_out.write(
1338
1338
  f"""{LINE_BREAK.join(imports)}
1339
1339
 
1340
- AT = typing.TypeVar("AT")
1341
- DT = typing.TypeVar("DT")
1342
-
1343
1340
 
1344
1341
  @dataclasses.dataclass(kw_only=True, frozen=True)
1345
1342
  class ApiEndpointKey:
@@ -1348,7 +1345,7 @@ class ApiEndpointKey:
1348
1345
 
1349
1346
 
1350
1347
  @dataclasses.dataclass(kw_only=True)
1351
- class ApiEndpointSpec(typing.Generic[AT, DT]):
1348
+ class ApiEndpointSpec[AT, DT]:
1352
1349
  route: str
1353
1350
  arguments_type: type[AT]
1354
1351
  data_type: type[DT]
@@ -197,9 +197,10 @@ class Client(ClientMethods):
197
197
  logger=self._cfg.logger,
198
198
  )
199
199
 
200
- def _get_response_json(
201
- self, response: requests.Response, request_id: str
202
- ) -> dict[str, JsonValue]:
200
+ @classmethod
201
+ def _validate_response_status(
202
+ cls, response: requests.Response, request_id: str
203
+ ) -> None:
203
204
  if response.status_code < 200 or response.status_code > 299:
204
205
  extra_details: dict[str, JsonValue] | None = None
205
206
  try:
@@ -214,6 +215,11 @@ class Client(ClientMethods):
214
215
  extra_details=extra_details,
215
216
  request_id=request_id,
216
217
  )
218
+
219
+ def _get_response_json(
220
+ self, response: requests.Response, request_id: str
221
+ ) -> dict[str, JsonValue]:
222
+ self._validate_response_status(response, request_id)
217
223
  try:
218
224
  return typing.cast(dict[str, JsonValue], response.json())
219
225
  except JSONDecodeError as e:
@@ -361,6 +367,8 @@ class Client(ClientMethods):
361
367
  assert isinstance(http_request, HTTPGetRequest)
362
368
  request.params = http_request.query_params
363
369
  response = self._send_request(request)
370
+ self._validate_response_status(response, request_id)
371
+
364
372
  content = response.content
365
373
  content_disposition = response.headers.get("Content-Disposition", None)
366
374
  return [
@@ -184,16 +184,33 @@ class GenericUploadJob(Job[None]):
184
184
  def _construct_filesystem_session(self, args: JobArguments) -> FileSystemSession:
185
185
  match self.data_source:
186
186
  case GenericUploadDataSourceSFTP():
187
- pem_secret = retrieve_secret(
188
- self.data_source.pem_secret, profile_metadata=args.profile_metadata
189
- )
190
- pem_key = paramiko.RSAKey.from_private_key(io.StringIO(pem_secret))
191
- sftp_config = FileSystemSFTPConfig(
192
- ip=self.data_source.host,
193
- username=self.data_source.username,
194
- pem_path=None,
195
- pem_key=pem_key,
196
- )
187
+ if self.data_source.pem_secret is not None:
188
+ pem_secret = retrieve_secret(
189
+ self.data_source.pem_secret,
190
+ profile_metadata=args.profile_metadata,
191
+ )
192
+ pem_key = paramiko.RSAKey.from_private_key(io.StringIO(pem_secret))
193
+ sftp_config = FileSystemSFTPConfig(
194
+ ip=self.data_source.host,
195
+ username=self.data_source.username,
196
+ pem_path=None,
197
+ pem_key=pem_key,
198
+ )
199
+ elif self.data_source.password_secret is not None:
200
+ password_secret = retrieve_secret(
201
+ self.data_source.password_secret,
202
+ profile_metadata=args.profile_metadata,
203
+ )
204
+ sftp_config = FileSystemSFTPConfig(
205
+ ip=self.data_source.host,
206
+ username=self.data_source.username,
207
+ pem_path=None,
208
+ password=password_secret,
209
+ )
210
+ else:
211
+ raise ValueError(
212
+ "Either pem_secret or password_secret must be specified for sftp data source"
213
+ )
197
214
  return SFTPSession(sftp_config=sftp_config)
198
215
  case GenericUploadDataSourceS3():
199
216
  if self.data_source.access_key_secret is not None:
@@ -32,6 +32,7 @@ ENDPOINT_PATH = "api/external/entity/external_create_entities"
32
32
  @dataclasses.dataclass(kw_only=True)
33
33
  class EntityToCreate:
34
34
  field_values: list[field_values_t.FieldRefNameValue] | None = None
35
+ parent_entity: entity_t.Entity | None = None
35
36
 
36
37
 
37
38
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -47,6 +47,7 @@ class Arguments:
47
47
  definition_id: base_t.ObjectId | None = None
48
48
  definition_key: identifier_t.IdentifierKey | None = None
49
49
  field_values: list[field_values_t.FieldRefNameValue] | None = None
50
+ parent_entity: entity_t.Entity | None = None
50
51
 
51
52
 
52
53
  # DO NOT MODIFY -- This file is generated by type_spec
@@ -290,18 +290,21 @@ class ClientMethods(ABC):
290
290
  definition_id: base_t.ObjectId | None = None,
291
291
  definition_key: identifier_t.IdentifierKey | None = None,
292
292
  field_values: list[field_values_t.FieldRefNameValue] | None = None,
293
+ parent_entity: entity_t.Entity | None = None,
293
294
  ) -> create_entity_t.Data:
294
295
  """Creates a new Uncountable entity
295
296
 
296
297
  :param definition_id: Definition id of the entity to create
297
298
  :param definition_key: Key for the definition of the entity to create
298
299
  :param entity_type: The type of the entities requested
300
+ :param parent_entity: The parent entity associated for this new entity. This only applies if there is a pre-defined relationship.
299
301
  """
300
302
  args = create_entity_t.Arguments(
301
303
  definition_id=definition_id,
302
304
  definition_key=definition_key,
303
305
  entity_type=entity_type,
304
306
  field_values=field_values,
307
+ parent_entity=parent_entity,
305
308
  )
306
309
  api_request = APIRequest(
307
310
  method=create_entity_t.ENDPOINT_METHOD,
@@ -346,7 +346,7 @@ class EntityType(StrEnum):
346
346
 
347
347
  # DO NOT MODIFY -- This file is generated by type_spec
348
348
  LimitedEntityType = typing.Annotated[
349
- typing.Literal[EntityType.LAB_REQUEST] | typing.Literal[EntityType.APPROVAL] | typing.Literal[EntityType.CUSTOM_ENTITY] | typing.Literal[EntityType.INVENTORY_AMOUNT] | typing.Literal[EntityType.TASK] | typing.Literal[EntityType.PROJECT] | typing.Literal[EntityType.EQUIPMENT] | typing.Literal[EntityType.INV_LOCAL_LOCATIONS] | typing.Literal[EntityType.FIELD_OPTION_SET] | typing.Literal[EntityType.WEBHOOK] | typing.Literal[EntityType.SPECS] | typing.Literal[EntityType.GOAL] | typing.Literal[EntityType.INGREDIENT_TAG_MAP] | typing.Literal[EntityType.INGREDIENT_TAG] | typing.Literal[EntityType.CONDITION_PARAMETER] | typing.Literal[EntityType.OUTPUT] | typing.Literal[EntityType.OUTPUT_CONDITION_PARAMETER] | typing.Literal[EntityType.ASYNC_JOB],
349
+ typing.Literal[EntityType.LAB_REQUEST] | typing.Literal[EntityType.APPROVAL] | typing.Literal[EntityType.CUSTOM_ENTITY] | typing.Literal[EntityType.INGREDIENT_ATTRIBUTE] | typing.Literal[EntityType.INVENTORY_AMOUNT] | typing.Literal[EntityType.TASK] | typing.Literal[EntityType.PROJECT] | typing.Literal[EntityType.EQUIPMENT] | typing.Literal[EntityType.INV_LOCAL_LOCATIONS] | typing.Literal[EntityType.FIELD_OPTION_SET] | typing.Literal[EntityType.WEBHOOK] | typing.Literal[EntityType.SPECS] | typing.Literal[EntityType.GOAL] | typing.Literal[EntityType.INGREDIENT_TAG_MAP] | typing.Literal[EntityType.INGREDIENT_TAG] | typing.Literal[EntityType.CONDITION_PARAMETER] | typing.Literal[EntityType.OUTPUT] | typing.Literal[EntityType.OUTPUT_CONDITION_PARAMETER] | typing.Literal[EntityType.ASYNC_JOB] | typing.Literal[EntityType.CONSTRAINT],
350
350
  serial_alias_annotation(
351
351
  named_type_path="sdk.entity.LimitedEntityType",
352
352
  ),
@@ -98,7 +98,8 @@ class GenericUploadDataSourceSFTP(GenericUploadDataSourceBase):
98
98
  type: typing.Literal[GenericUploadDataSourceType.SFTP] = GenericUploadDataSourceType.SFTP
99
99
  host: str
100
100
  username: str
101
- pem_secret: secret_retrieval_t.SecretRetrieval
101
+ pem_secret: secret_retrieval_t.SecretRetrieval | None = None
102
+ password_secret: secret_retrieval_t.SecretRetrieval | None = None
102
103
 
103
104
 
104
105
  # DO NOT MODIFY -- This file is generated by type_spec