Skip to content

Commit 00a47a0

Browse files
authored
Fix: Improve the field location reporting in config errors (#4511)
1 parent 1b9c04b commit 00a47a0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sqlmesh/utils/pydantic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ def _formatted_validation_errors(error: pydantic.ValidationError) -> t.List[str]
221221
for e in error.errors():
222222
msg = e["msg"]
223223
loc: t.Optional[t.Tuple] = e.get("loc")
224-
result.append(f"Invalid field '{loc[0]}':\n {msg}" if loc else msg)
224+
loc_str = ".".join(loc) if loc else None
225+
result.append(f"Invalid field '{loc_str}':\n {msg}" if loc_str else msg)
225226
return result
226227

227228

0 commit comments

Comments
 (0)