Skip to content

Commit d35079c

Browse files
fix: dataset llm config migration (#368)
1 parent bf9e2a4 commit d35079c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

alembic/versions/04cd434ed6eb_remove_markdown_dataset_fields_for_new_.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,16 @@ def __convert_object(row):
127127
pdf_extraction = {}
128128
extraction_data = row["llm_config"].get("extraction", {})
129129
if (
130-
LLMProvider.from_string(extraction_data.get("llmIdentifier", "")).value
130+
"llmIdentifier" in extraction_data
131+
and LLMProvider.from_string(extraction_data.get("llmIdentifier")).value
131132
== "AZURE_DI"
132133
):
133134
pdf_extraction["azureDiApiBase"] = extraction_data.get("azureDiApiBase", "")
134135
pdf_extraction["azureDiEnvVarId"] = extraction_data.get("azureDiEnvVarId", "")
135136
pdf_extraction["extractor"] = "AZURE_DI"
136-
elif LLMProvider.from_string(extraction_data.get("llmIdentifier", "")).value in (
137+
elif "llmIdentifier" in extraction_data and LLMProvider.from_string(
138+
extraction_data.get("llmIdentifier")
139+
).value in (
137140
"AZURE",
138141
"OPEN_AI",
139142
"AZURE_FOUNDRY",

0 commit comments

Comments
 (0)