Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/webapp/routers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,15 @@ def trigger_inference_run(
+ str(len(inst_result)),
)
inst_file_schemas = [x.schemas for x in batch_result[0][0].files]
schema_configs = jsonpickle.decode(query_result[0][0].schema_configs)
raw_config = query_result[0][0].schema_configs

for config_group in schema_configs:
for config in config_group:
config.schema_type = LEGACY_TO_NEW_SCHEMA.get(
config.schema_type, config.schema_type
)
# Inline legacy → new mapping directly on the string
for legacy, new in LEGACY_TO_NEW_SCHEMA.items():
# This replaces every occurrence of "PDP_COURSE", "PDP_COHORT", etc.
raw_config = raw_config.replace(f'"{legacy}"', f'"{new}"')

schema_configs = jsonpickle.decode(raw_config)
# POTENTIAL_REVERSE: schema_configs = jsonpickle.decode(query_result[0][0].schema_configs)

if not check_file_types_valid_schema_configs(
inst_file_schemas,
Expand Down
Loading