dcicutils 8.14.0.1b2__tar.gz → 8.14.0.1b4__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/PKG-INFO +1 -1
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/scripts/update_portal_object.py +37 -18
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/scripts/view_portal_object.py +12 -2
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/pyproject.toml +1 -1
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/LICENSE.txt +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/README.rst +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/__init__.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/base.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/beanstalk_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/bundle_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/captured_output.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/cloudformation_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/codebuild_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/command_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/common.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/contribution_scripts.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/contribution_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/creds_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/data_readers.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/data_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/datetime_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/deployment_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/diff_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/docker_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/ecr_scripts.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/ecr_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/ecs_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/env_base.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/env_manager.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/env_scripts.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/env_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/env_utils_legacy.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/es_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/exceptions.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/ff_mocks.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/ff_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/file_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/function_cache_decorator.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/glacier_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/hack_for_elasticsearch_numpy_usage.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/http_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/jh_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/kibana/dashboards.json +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/kibana/readme.md +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/lang_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/c4-infrastructure.jsonc +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/c4-python-infrastructure.jsonc +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/park-lab-common-server.jsonc +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/park-lab-common.jsonc +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/park-lab-gpl-pipeline.jsonc +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/park-lab-pipeline.jsonc +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/log_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/misc_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/obfuscation_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/opensearch_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/portal_object_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/portal_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/progress_bar.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/project_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/qa_checkers.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/qa_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/redis_tools.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/redis_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/s3_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/schema_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/scripts/publish_to_pypi.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/scripts/run_license_checker.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/secrets_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/sheet_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/snapshot_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/ssl_certificate_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/structured_data.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/submitr/progress_constants.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/submitr/ref_lookup_strategy.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/task_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/tmpfile_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/trace_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/validation_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/variant_utils.py +0 -0
- {dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/zip_utils.py +0 -0
@@ -123,7 +123,8 @@ def main():
|
|
123
123
|
parser.add_argument("--delete", type=str, required=False, default=None, help="Delete data.")
|
124
124
|
parser.add_argument("--purge", type=str, required=False, default=None, help="Purge data.")
|
125
125
|
parser.add_argument("--noignore", action="store_true", required=False, default=False,
|
126
|
-
help="Do not ignore standard fields on
|
126
|
+
help="Do not ignore standard fields on update(s).")
|
127
|
+
parser.add_argument("--ignore", nargs="+", help="Ignore these additional fields.")
|
127
128
|
parser.add_argument("--confirm", action="store_true", required=False, default=False, help="Confirm before action.")
|
128
129
|
parser.add_argument("--verbose", action="store_true", required=False, default=False, help="Verbose output.")
|
129
130
|
parser.add_argument("--quiet", action="store_true", required=False, default=False, help="Quiet output.")
|
@@ -158,7 +159,7 @@ def main():
|
|
158
159
|
explicit_schema_name=explicit_schema_name,
|
159
160
|
update_function=post_data,
|
160
161
|
update_action_name="POST",
|
161
|
-
noignore=args.noignore,
|
162
|
+
noignore=args.noignore, ignore=args.ignore,
|
162
163
|
confirm=args.confirm, verbose=args.verbose, quiet=args.quiet, debug=args.debug)
|
163
164
|
if args.patch:
|
164
165
|
_post_or_patch_or_upsert(portal=portal,
|
@@ -167,7 +168,7 @@ def main():
|
|
167
168
|
update_function=patch_data,
|
168
169
|
update_action_name="PATCH",
|
169
170
|
patch_delete_fields=args.delete,
|
170
|
-
noignore=args.noignore,
|
171
|
+
noignore=args.noignore, ignore=args.ignore,
|
171
172
|
confirm=args.confirm, verbose=args.verbose, quiet=args.quiet, debug=args.debug)
|
172
173
|
args.delete = None
|
173
174
|
if args.upsert:
|
@@ -177,7 +178,7 @@ def main():
|
|
177
178
|
update_function=upsert_data,
|
178
179
|
update_action_name="UPSERT",
|
179
180
|
patch_delete_fields=args.delete,
|
180
|
-
noignore=args.noignore,
|
181
|
+
noignore=args.noignore, ignore=args.ignore,
|
181
182
|
confirm=args.confirm, verbose=args.verbose, quiet=args.quiet, debug=args.debug)
|
182
183
|
args.delete = None
|
183
184
|
|
@@ -201,7 +202,7 @@ def _post_or_patch_or_upsert(portal: Portal, file_or_directory: str,
|
|
201
202
|
explicit_schema_name: str,
|
202
203
|
update_function: Callable, update_action_name: str,
|
203
204
|
patch_delete_fields: Optional[str] = None,
|
204
|
-
noignore: bool = False,
|
205
|
+
noignore: bool = False, ignore: Optional[List[str]] = None,
|
205
206
|
confirm: bool = False, verbose: bool = False,
|
206
207
|
quiet: bool = False, debug: bool = False) -> None:
|
207
208
|
|
@@ -227,18 +228,21 @@ def _post_or_patch_or_upsert(portal: Portal, file_or_directory: str,
|
|
227
228
|
if debug:
|
228
229
|
_print(f"DEBUG: File ({file}) contains an object of type: {schema_name}")
|
229
230
|
update_function(portal, data, schema_name, file=file,
|
230
|
-
patch_delete_fields=patch_delete_fields,
|
231
|
+
patch_delete_fields=patch_delete_fields,
|
232
|
+
noignore=noignore, ignore=ignore,
|
231
233
|
confirm=confirm, verbose=verbose, debug=debug)
|
232
234
|
elif is_schema_name_list(portal, list(data.keys())):
|
233
235
|
if debug:
|
234
236
|
_print(f"DEBUG: File ({file}) contains a dictionary of schema names.")
|
235
237
|
for schema_name in data:
|
236
238
|
if isinstance(schema_data := data[schema_name], list):
|
239
|
+
schema_data = _impose_special_ordering(schema_data, schema_name)
|
237
240
|
if debug:
|
238
241
|
_print(f"DEBUG: Processing {update_action_name}s for type: {schema_name}")
|
239
242
|
for index, item in enumerate(schema_data):
|
240
243
|
update_function(portal, item, schema_name, file=file, index=index,
|
241
|
-
patch_delete_fields=patch_delete_fields,
|
244
|
+
patch_delete_fields=patch_delete_fields,
|
245
|
+
noignore=noignore, ignore=ignore,
|
242
246
|
confirm=confirm, verbose=verbose, debug=debug)
|
243
247
|
else:
|
244
248
|
_print(f"WARNING: File ({file}) contains schema item which is not a list: {schema_name}")
|
@@ -247,9 +251,12 @@ def _post_or_patch_or_upsert(portal: Portal, file_or_directory: str,
|
|
247
251
|
elif isinstance(data, list):
|
248
252
|
if debug:
|
249
253
|
_print(f"DEBUG: File ({file}) contains a list of objects of type: {schema_name}")
|
254
|
+
import pdb ; pdb.set_trace() # noqa
|
255
|
+
data = _impose_special_ordering(data, schema_name)
|
250
256
|
for index, item in enumerate(data):
|
251
257
|
update_function(portal, item, schema_name, file=file, index=index,
|
252
|
-
patch_delete_fields=patch_delete_fields,
|
258
|
+
patch_delete_fields=patch_delete_fields,
|
259
|
+
noignore=noignore, ignore=ignore,
|
253
260
|
confirm=confirm, verbose=verbose, debug=debug)
|
254
261
|
if debug:
|
255
262
|
_print(f"DEBUG: Processing {update_action_name} file done: {file}")
|
@@ -282,9 +289,16 @@ def _post_or_patch_or_upsert(portal: Portal, file_or_directory: str,
|
|
282
289
|
_print(f"ERROR: Cannot find file or directory: {file_or_directory}")
|
283
290
|
|
284
291
|
|
292
|
+
def _impose_special_ordering(data: List[dict], schema_name: str) -> List[dict]:
|
293
|
+
if schema_name == "FileFormat":
|
294
|
+
return sorted(data, key=lambda item: "extra_file_formats" in item)
|
295
|
+
return data
|
296
|
+
|
297
|
+
|
285
298
|
def post_data(portal: Portal, data: dict, schema_name: str,
|
286
299
|
file: Optional[str] = None, index: int = 0,
|
287
|
-
patch_delete_fields: Optional[str] = None,
|
300
|
+
patch_delete_fields: Optional[str] = None,
|
301
|
+
noignore: bool = False, ignore: Optional[List[str]] = None,
|
288
302
|
confirm: bool = False, verbose: bool = False, debug: bool = False) -> None:
|
289
303
|
ignored(patch_delete_fields)
|
290
304
|
if not (identifying_path := portal.get_identifying_path(data, portal_type=schema_name)):
|
@@ -301,7 +315,7 @@ def post_data(portal: Portal, data: dict, schema_name: str,
|
|
301
315
|
if verbose:
|
302
316
|
_print(f"POST {schema_name} item: {identifying_path}")
|
303
317
|
try:
|
304
|
-
data = _prune_data_for_update(data, noignore=noignore)
|
318
|
+
data = _prune_data_for_update(data, noignore=noignore, ignore=ignore)
|
305
319
|
portal.post_metadata(schema_name, data)
|
306
320
|
if debug:
|
307
321
|
_print(f"DEBUG: POST {schema_name} item done: {identifying_path}")
|
@@ -313,7 +327,8 @@ def post_data(portal: Portal, data: dict, schema_name: str,
|
|
313
327
|
|
314
328
|
def patch_data(portal: Portal, data: dict, schema_name: str,
|
315
329
|
file: Optional[str] = None, index: int = 0,
|
316
|
-
patch_delete_fields: Optional[str] = None,
|
330
|
+
patch_delete_fields: Optional[str] = None,
|
331
|
+
noignore: bool = False, ignore: Optional[List[str]] = None,
|
317
332
|
confirm: bool = False, verbose: bool = False, debug: bool = False) -> None:
|
318
333
|
if not (identifying_path := portal.get_identifying_path(data, portal_type=schema_name)):
|
319
334
|
if isinstance(file, str) and isinstance(index, int):
|
@@ -331,7 +346,7 @@ def patch_data(portal: Portal, data: dict, schema_name: str,
|
|
331
346
|
try:
|
332
347
|
if delete_fields := _parse_delete_fields(patch_delete_fields):
|
333
348
|
identifying_path += f"?delete_fields={delete_fields}"
|
334
|
-
data = _prune_data_for_update(data, noignore=noignore)
|
349
|
+
data = _prune_data_for_update(data, noignore=noignore, ignore=ignore)
|
335
350
|
portal.patch_metadata(identifying_path, data)
|
336
351
|
if debug:
|
337
352
|
_print(f"DEBUG: PATCH {schema_name} item OK: {identifying_path}")
|
@@ -343,7 +358,8 @@ def patch_data(portal: Portal, data: dict, schema_name: str,
|
|
343
358
|
|
344
359
|
def upsert_data(portal: Portal, data: dict, schema_name: str,
|
345
360
|
file: Optional[str] = None, index: int = 0,
|
346
|
-
patch_delete_fields: Optional[str] = None,
|
361
|
+
patch_delete_fields: Optional[str] = None,
|
362
|
+
noignore: bool = False, ignore: Optional[List[str]] = None,
|
347
363
|
confirm: bool = False, verbose: bool = False, debug: bool = False) -> None:
|
348
364
|
if not (identifying_path := portal.get_identifying_path(data, portal_type=schema_name)):
|
349
365
|
if isinstance(file, str) and isinstance(index, int):
|
@@ -358,12 +374,12 @@ def upsert_data(portal: Portal, data: dict, schema_name: str,
|
|
358
374
|
_print(f"{'PATCH' if exists else 'POST'} {schema_name} item: {identifying_path}")
|
359
375
|
try:
|
360
376
|
if not exists:
|
361
|
-
data = _prune_data_for_update(data, noignore=noignore)
|
377
|
+
data = _prune_data_for_update(data, noignore=noignore, ignore=ignore)
|
362
378
|
portal.post_metadata(schema_name, data)
|
363
379
|
else:
|
364
380
|
if delete_fields := _parse_delete_fields(patch_delete_fields):
|
365
381
|
identifying_path += f"?delete_fields={delete_fields}"
|
366
|
-
data = _prune_data_for_update(data, noignore=noignore)
|
382
|
+
data = _prune_data_for_update(data, noignore=noignore, ignore=ignore)
|
367
383
|
portal.patch_metadata(identifying_path, data)
|
368
384
|
if debug:
|
369
385
|
_print(f"DEBUG: UPSERT {schema_name} item OK: {identifying_path}")
|
@@ -373,10 +389,13 @@ def upsert_data(portal: Portal, data: dict, schema_name: str,
|
|
373
389
|
return
|
374
390
|
|
375
391
|
|
376
|
-
def _prune_data_for_update(data: dict, noignore: bool = False) -> dict:
|
377
|
-
if noignore is True
|
392
|
+
def _prune_data_for_update(data: dict, noignore: bool = False, ignore: Optional[List[str]] = None) -> dict:
|
393
|
+
ignore_these_properties = [] if noignore is True else _IGNORE_PROPERTIES_ON_UPDATE
|
394
|
+
if isinstance(ignore, list):
|
395
|
+
ignore_these_properties = ignore_these_properties + ignore
|
396
|
+
if not ignore_these_properties:
|
378
397
|
return data
|
379
|
-
return {key: value for key, value in data.items() if key not in
|
398
|
+
return {key: value for key, value in data.items() if key not in ignore_these_properties}
|
380
399
|
|
381
400
|
|
382
401
|
def _create_portal(env: Optional[str] = None, app: Optional[str] = None,
|
@@ -104,6 +104,7 @@ def main():
|
|
104
104
|
parser.add_argument("--raw", action="store_true", required=False, default=False, help="Raw output.")
|
105
105
|
parser.add_argument("--inserts", action="store_true", required=False, default=False,
|
106
106
|
help="Format output for subsequent inserts.")
|
107
|
+
parser.add_argument("--ignore", nargs="+", help="Ignore these fields for --inserts.")
|
107
108
|
parser.add_argument("--tree", action="store_true", required=False, default=False, help="Tree output for schemas.")
|
108
109
|
parser.add_argument("--database", action="store_true", required=False, default=False,
|
109
110
|
help="Read from database output.")
|
@@ -191,7 +192,7 @@ def main():
|
|
191
192
|
return
|
192
193
|
|
193
194
|
data = _get_portal_object(portal=portal, uuid=args.uuid, raw=args.raw, inserts=args.inserts,
|
194
|
-
database=args.database, check=args.bool, verbose=args.verbose)
|
195
|
+
ignore=args.ignore, database=args.database, check=args.bool, verbose=args.verbose)
|
195
196
|
if args.bool:
|
196
197
|
if data:
|
197
198
|
_print(f"{args.uuid}: found")
|
@@ -242,7 +243,15 @@ def _create_portal(ini: str, env: Optional[str] = None,
|
|
242
243
|
|
243
244
|
def _get_portal_object(portal: Portal, uuid: str,
|
244
245
|
raw: bool = False, inserts: bool = False, database: bool = False,
|
246
|
+
ignore: Optional[List[str]] = None,
|
245
247
|
check: bool = False, verbose: bool = False) -> dict:
|
248
|
+
|
249
|
+
def prune_data(data: dict) -> dict:
|
250
|
+
nonlocal ignore
|
251
|
+
if not isinstance(ignore, list) or not ignore:
|
252
|
+
return data
|
253
|
+
return {key: value for key, value in data.items() if key not in ignore}
|
254
|
+
|
246
255
|
response = None
|
247
256
|
try:
|
248
257
|
if not uuid.startswith("/"):
|
@@ -300,6 +309,7 @@ def _get_portal_object(portal: Portal, uuid: str,
|
|
300
309
|
for result in results:
|
301
310
|
results_index += 1
|
302
311
|
result.pop("schema_version", None)
|
312
|
+
result = prune_data(result)
|
303
313
|
if (subtypes and
|
304
314
|
(result_uuid := result.get("uuid")) and
|
305
315
|
(individual_result_type := get_metadata_for_individual_result_type(result_uuid))): # noqa
|
@@ -313,7 +323,7 @@ def _get_portal_object(portal: Portal, uuid: str,
|
|
313
323
|
# Get the result as non-raw so we can get its type.
|
314
324
|
elif ((response_cooked := portal.get(path, database=database)) and
|
315
325
|
(isinstance(response_type := response_cooked.json().get("@type"), list) and response_type)):
|
316
|
-
response = {f"{response_type[0]}": [response]}
|
326
|
+
response = {f"{response_type[0]}": [prune_data(response)]}
|
317
327
|
elif raw:
|
318
328
|
response.pop("schema_version", None)
|
319
329
|
return response
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "dcicutils"
|
3
|
-
version = "8.14.0.
|
3
|
+
version = "8.14.0.1b4" # TODO: To become 8.14.1
|
4
4
|
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
|
5
5
|
authors = ["4DN-DCIC Team <support@4dnucleome.org>"]
|
6
6
|
license = "MIT"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/hack_for_elasticsearch_numpy_usage.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/c4-infrastructure.jsonc
RENAMED
File without changes
|
File without changes
|
File without changes
|
{dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/park-lab-common.jsonc
RENAMED
File without changes
|
{dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/park-lab-gpl-pipeline.jsonc
RENAMED
File without changes
|
{dcicutils-8.14.0.1b2 → dcicutils-8.14.0.1b4}/dcicutils/license_policies/park-lab-pipeline.jsonc
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|