dcicutils 8.4.0.1b7__py3-none-any.whl → 8.4.0.1b9__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- dcicutils/structured_data.py +1 -46
- {dcicutils-8.4.0.1b7.dist-info → dcicutils-8.4.0.1b9.dist-info}/METADATA +1 -1
- {dcicutils-8.4.0.1b7.dist-info → dcicutils-8.4.0.1b9.dist-info}/RECORD +6 -6
- {dcicutils-8.4.0.1b7.dist-info → dcicutils-8.4.0.1b9.dist-info}/LICENSE.txt +0 -0
- {dcicutils-8.4.0.1b7.dist-info → dcicutils-8.4.0.1b9.dist-info}/WHEEL +0 -0
- {dcicutils-8.4.0.1b7.dist-info → dcicutils-8.4.0.1b9.dist-info}/entry_points.txt +0 -0
dcicutils/structured_data.py
CHANGED
@@ -37,7 +37,6 @@ ARRAY_NAME_SUFFIX_CHAR = "#"
|
|
37
37
|
ARRAY_NAME_SUFFIX_REGEX = re.compile(rf"{ARRAY_NAME_SUFFIX_CHAR}\d+")
|
38
38
|
DOTTED_NAME_DELIMITER_CHAR = "."
|
39
39
|
FILE_SCHEMA_NAME = "File"
|
40
|
-
FILE_SCHEMA_NAME_PROPERTY = "filename"
|
41
40
|
|
42
41
|
# Forward type references for type hints.
|
43
42
|
Portal = Type["Portal"]
|
@@ -105,48 +104,6 @@ class StructuredDataSet:
|
|
105
104
|
def resolved_refs(self) -> List[str]:
|
106
105
|
return self._resolved_refs
|
107
106
|
|
108
|
-
@staticmethod
|
109
|
-
def format_issue(issue: dict, original_file: Optional[str] = None) -> str:
|
110
|
-
def src_string(issue: dict) -> str:
|
111
|
-
if not isinstance(issue, dict) or not isinstance(issue_src := issue.get("src"), dict):
|
112
|
-
return ""
|
113
|
-
show_file = original_file and (original_file.endswith(".zip") or
|
114
|
-
original_file.endswith(".tgz") or original_file.endswith(".gz"))
|
115
|
-
src_file = issue_src.get("file") if show_file else ""
|
116
|
-
src_type = issue_src.get("type")
|
117
|
-
src_column = issue_src.get("column")
|
118
|
-
src_row = issue_src.get("row", 0)
|
119
|
-
if src_file:
|
120
|
-
src = f"{os.path.basename(src_file)}"
|
121
|
-
sep = ":"
|
122
|
-
else:
|
123
|
-
src = ""
|
124
|
-
sep = "."
|
125
|
-
if src_type:
|
126
|
-
src += (sep if src else "") + src_type
|
127
|
-
sep = "."
|
128
|
-
if src_column:
|
129
|
-
src += (sep if src else "") + src_column
|
130
|
-
if src_row > 0:
|
131
|
-
src += (" " if src else "") + f"[{src_row}]"
|
132
|
-
if not src:
|
133
|
-
if issue.get("warning"):
|
134
|
-
src = "Warning"
|
135
|
-
elif issue.get("error"):
|
136
|
-
src = "Error"
|
137
|
-
else:
|
138
|
-
src = "Issue"
|
139
|
-
return src
|
140
|
-
issue_message = None
|
141
|
-
if issue:
|
142
|
-
if error := issue.get("error"):
|
143
|
-
issue_message = error
|
144
|
-
elif warning := issue.get("warning"):
|
145
|
-
issue_message = warning
|
146
|
-
elif issue.get("truncated"):
|
147
|
-
return f"Truncated result set | More: {issue.get('more')} | See: {issue.get('details')}"
|
148
|
-
return f"{src_string(issue)}: {issue_message}" if issue_message else ""
|
149
|
-
|
150
107
|
def _load_file(self, file: str) -> None:
|
151
108
|
# Returns a dictionary where each property is the name (i.e. the type) of the data,
|
152
109
|
# and the value is array of dictionaries for the data itself. Handle these kinds of files:
|
@@ -369,9 +326,6 @@ class Schema:
|
|
369
326
|
def resolved_refs(self) -> List[str]:
|
370
327
|
return list(self._resolved_refs)
|
371
328
|
|
372
|
-
def is_file_type(self) -> bool:
|
373
|
-
return (self.name == FILE_SCHEMA_NAME) or (self._portal and self._portal.is_file_schema(self.name))
|
374
|
-
|
375
329
|
def get_map_value_function(self, column_name: str) -> Optional[Any]:
|
376
330
|
return (self._get_typeinfo(column_name) or {}).get("map")
|
377
331
|
|
@@ -604,6 +558,7 @@ class PortalBase:
|
|
604
558
|
elif isinstance(key, dict):
|
605
559
|
self._key = key
|
606
560
|
self._key_pair = (key.get("key"), key.get("secret")) if key else None
|
561
|
+
self._server = key.get("server")
|
607
562
|
elif isinstance(key, tuple) and len(key) >= 2:
|
608
563
|
self._key = {"key": key[0], "secret": key[1]}
|
609
564
|
self._key_pair = key
|
@@ -55,14 +55,14 @@ dcicutils/secrets_utils.py,sha256=8dppXAsiHhJzI6NmOcvJV5ldvKkQZzh3Fl-cb8Wm7MI,19
|
|
55
55
|
dcicutils/sheet_utils.py,sha256=VlmzteONW5VF_Q4vo0yA5vesz1ViUah1MZ_yA1rwZ0M,33629
|
56
56
|
dcicutils/snapshot_utils.py,sha256=ymP7PXH6-yEiXAt75w0ldQFciGNqWBClNxC5gfX2FnY,22961
|
57
57
|
dcicutils/ssl_certificate_utils.py,sha256=F0ifz_wnRRN9dfrfsz7aCp4UDLgHEY8LaK7PjnNvrAQ,9707
|
58
|
-
dcicutils/structured_data.py,sha256=
|
58
|
+
dcicutils/structured_data.py,sha256=ODG3o6VMyFUVhdDChLTzAIbDCxZ3cPSdfL2DaKGN2c8,42995
|
59
59
|
dcicutils/task_utils.py,sha256=MF8ujmTD6-O2AC2gRGPHyGdUrVKgtr8epT5XU8WtNjk,8082
|
60
60
|
dcicutils/trace_utils.py,sha256=g8kwV4ebEy5kXW6oOrEAUsurBcCROvwtZqz9fczsGRE,1769
|
61
61
|
dcicutils/validation_utils.py,sha256=cMZIU2cY98FYtzK52z5WUYck7urH6JcqOuz9jkXpqzg,14797
|
62
62
|
dcicutils/variant_utils.py,sha256=2H9azNx3xAj-MySg-uZ2SFqbWs4kZvf61JnK6b-h4Qw,4343
|
63
63
|
dcicutils/zip_utils.py,sha256=0OXR0aLNwyLIZOzIFTM_5DOun7dxIv6TIZbFiithkO0,3276
|
64
|
-
dcicutils-8.4.0.
|
65
|
-
dcicutils-8.4.0.
|
66
|
-
dcicutils-8.4.0.
|
67
|
-
dcicutils-8.4.0.
|
68
|
-
dcicutils-8.4.0.
|
64
|
+
dcicutils-8.4.0.1b9.dist-info/LICENSE.txt,sha256=t0_-jIjqxNnymZoNJe-OltRIuuF8qfhN0ATlHyrUJPk,1102
|
65
|
+
dcicutils-8.4.0.1b9.dist-info/METADATA,sha256=twJ5fTqOriYRIy40WeEgOk_fwKHPRvkPK4CiIIYHMOs,3314
|
66
|
+
dcicutils-8.4.0.1b9.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
67
|
+
dcicutils-8.4.0.1b9.dist-info/entry_points.txt,sha256=8wbw5csMIgBXhkwfgsgJeuFcoUc0WsucUxmOyml2aoA,209
|
68
|
+
dcicutils-8.4.0.1b9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|