deriva 1.7.3__py3-none-any.whl → 1.7.4__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.
- deriva/config/rollback_annotation.py +1 -1
- deriva/core/__init__.py +1 -1
- deriva/core/datapath.py +55 -55
- deriva/core/ermrest_model.py +702 -186
- deriva/core/hatrac_cli.py +3 -5
- deriva/core/hatrac_store.py +9 -20
- deriva/core/mmo.py +379 -0
- deriva/transfer/download/processors/postprocess/transfer_post_processor.py +2 -2
- deriva/transfer/download/processors/query/base_query_processor.py +2 -1
- {deriva-1.7.3.dist-info → deriva-1.7.4.dist-info}/METADATA +1 -1
- {deriva-1.7.3.dist-info → deriva-1.7.4.dist-info}/RECORD +24 -15
- tests/deriva/core/mmo/__init__.py +0 -0
- tests/deriva/core/mmo/base.py +300 -0
- tests/deriva/core/mmo/test_mmo_drop.py +252 -0
- tests/deriva/core/mmo/test_mmo_find.py +90 -0
- tests/deriva/core/mmo/test_mmo_prune.py +196 -0
- tests/deriva/core/mmo/test_mmo_rename.py +222 -0
- tests/deriva/core/mmo/test_mmo_replace.py +180 -0
- tests/deriva/core/test_datapath.py +52 -26
- tests/deriva/core/test_ermrest_model.py +782 -0
- {deriva-1.7.3.dist-info → deriva-1.7.4.dist-info}/LICENSE +0 -0
- {deriva-1.7.3.dist-info → deriva-1.7.4.dist-info}/WHEEL +0 -0
- {deriva-1.7.3.dist-info → deriva-1.7.4.dist-info}/entry_points.txt +0 -0
- {deriva-1.7.3.dist-info → deriva-1.7.4.dist-info}/top_level.txt +0 -0
deriva/core/__init__.py
CHANGED
deriva/core/datapath.py
CHANGED
|
@@ -1008,35 +1008,32 @@ class _TableWrapper (object):
|
|
|
1008
1008
|
# determine whether insert is idempotent and therefore retry safe
|
|
1009
1009
|
retry_safe = on_conflict_skip and _has_user_pkey(self._wrapped_table)
|
|
1010
1010
|
|
|
1011
|
-
# perform all requests
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
result = _ResultSet(self.path.uri, results_func)
|
|
1039
|
-
result.fetch()
|
|
1011
|
+
# perform all requests synchronously so the caller can get exceptions
|
|
1012
|
+
results = []
|
|
1013
|
+
for batch in _generate_batches(
|
|
1014
|
+
entities,
|
|
1015
|
+
max_batch_rows=max_batch_rows,
|
|
1016
|
+
max_batch_bytes=max_batch_bytes
|
|
1017
|
+
):
|
|
1018
|
+
try:
|
|
1019
|
+
if retry_safe:
|
|
1020
|
+
resp = _request_with_retry(
|
|
1021
|
+
lambda: request_func(batch),
|
|
1022
|
+
retry_codes=retry_codes,
|
|
1023
|
+
backoff_factor=backoff_factor,
|
|
1024
|
+
max_attempts=max_attempts
|
|
1025
|
+
)
|
|
1026
|
+
else:
|
|
1027
|
+
resp = request_func(batch)
|
|
1028
|
+
results.extend(resp.json())
|
|
1029
|
+
except HTTPError as e:
|
|
1030
|
+
logger.debug(e.response.text)
|
|
1031
|
+
if 400 <= e.response.status_code < 500:
|
|
1032
|
+
raise DataPathException(_http_error_message(e), e)
|
|
1033
|
+
else:
|
|
1034
|
+
raise e
|
|
1035
|
+
|
|
1036
|
+
result = _ResultSet(self.path.uri, lambda ignore1, ignore2, ignore3: results)
|
|
1040
1037
|
return result
|
|
1041
1038
|
|
|
1042
1039
|
|
|
@@ -1101,34 +1098,37 @@ class _TableWrapper (object):
|
|
|
1101
1098
|
def request_func(batch):
|
|
1102
1099
|
return self._schema._catalog._wrapped_catalog.put(path, json=batch, headers={'Content-Type': 'application/json'})
|
|
1103
1100
|
|
|
1104
|
-
# perform all requests
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
result = _ResultSet(self.path.uri, results_func)
|
|
1129
|
-
result.fetch()
|
|
1101
|
+
# perform all requests synchronously so the caller can get exceptions
|
|
1102
|
+
results = []
|
|
1103
|
+
for batch in _generate_batches(
|
|
1104
|
+
entities,
|
|
1105
|
+
max_batch_rows=max_batch_rows,
|
|
1106
|
+
max_batch_bytes=max_batch_bytes
|
|
1107
|
+
):
|
|
1108
|
+
try:
|
|
1109
|
+
resp = _request_with_retry(
|
|
1110
|
+
lambda: request_func(batch),
|
|
1111
|
+
retry_codes=retry_codes,
|
|
1112
|
+
backoff_factor=backoff_factor,
|
|
1113
|
+
max_attempts=max_attempts
|
|
1114
|
+
)
|
|
1115
|
+
results.extend(resp.json())
|
|
1116
|
+
except HTTPError as e:
|
|
1117
|
+
logger.debug(e.response.text)
|
|
1118
|
+
if 400 <= e.response.status_code < 500:
|
|
1119
|
+
raise DataPathException(_http_error_message(e), e)
|
|
1120
|
+
else:
|
|
1121
|
+
raise e
|
|
1122
|
+
|
|
1123
|
+
result = _ResultSet(self.path.uri, lambda ignore1, ignore2, ignore3: results)
|
|
1130
1124
|
return result
|
|
1131
1125
|
|
|
1126
|
+
def delete(self):
|
|
1127
|
+
"""Deletes the entity set referenced by the Table.
|
|
1128
|
+
"""
|
|
1129
|
+
self.path.delete()
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
1132
|
class _TableAlias (_TableWrapper):
|
|
1133
1133
|
"""Represents a table alias in datapath expressions.
|
|
1134
1134
|
"""
|