Skip to content

Commit 1aa04d3

Browse files
committed
remove try/except, and just fail if needed
1 parent 0b344f1 commit 1aa04d3

File tree

1 file changed

+27
-30
lines changed

1 file changed

+27
-30
lines changed

tasks_data_retrieval/create_tasks_data.py

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -242,36 +242,32 @@ def _get_task_type(
242242
for source in sources:
243243
t_start = time.perf_counter()
244244
print(f"START processing {source=}")
245-
try:
246-
task_list = []
247-
data = get_package_info(source)
248-
pkg_name = data["name"]
249-
pkg_version = data.get("version")
250-
authors = data["manifest"].get("authors")
251-
install_instructions = data.get("install_instructions")
252-
pkg_task_list = data["manifest"]["task_list"]
253-
for task in pkg_task_list:
254-
new_task = dict()
255-
for column_name in COLUMN_NAMES:
256-
new_task[column_name] = task.get(
257-
column_name, COLUMN_DEFAULTS.get(column_name, None)
258-
)
259-
new_task["version"] = pkg_version
260-
new_task["type"] = _get_task_type(task)
261-
new_task["authors"] = authors
262-
new_task["install_instructions"] = install_instructions
263-
TaskReadV2(**new_task)
264-
task_list.append(new_task)
265-
266-
task_group = dict(
267-
pkg_name=pkg_name,
268-
version=pkg_version,
269-
task_list=task_list,
270-
)
271-
ntasks = len(task_list)
272-
except Exception as e:
273-
print(f"ERROR, skip.\nOriginal error:\n{str(e)}")
274-
245+
task_list = []
246+
data = get_package_info(source)
247+
pkg_name = data["name"]
248+
pkg_version = data.get("version")
249+
authors = data["manifest"].get("authors")
250+
install_instructions = data.get("install_instructions")
251+
pkg_task_list = data["manifest"]["task_list"]
252+
for task in pkg_task_list:
253+
new_task = dict()
254+
for column_name in COLUMN_NAMES:
255+
new_task[column_name] = task.get(
256+
column_name, COLUMN_DEFAULTS.get(column_name, None)
257+
)
258+
new_task["version"] = pkg_version
259+
new_task["type"] = _get_task_type(task)
260+
new_task["authors"] = authors
261+
new_task["install_instructions"] = install_instructions
262+
TaskReadV2(**new_task)
263+
task_list.append(new_task)
264+
265+
task_group = dict(
266+
pkg_name=pkg_name,
267+
version=pkg_version,
268+
task_list=task_list,
269+
)
270+
ntasks = len(task_list)
275271
TaskGroupReadV2(**task_group)
276272

277273
task_groups.append(task_group)
@@ -285,6 +281,7 @@ def _get_task_type(
285281
)
286282
print()
287283

284+
288285
# grouping results
289286
GROUPED_RESULT = []
290287

0 commit comments

Comments
 (0)