feat(parser): allow subscript in type annotations

This commit is contained in:
2026-07-08 14:43:52 +02:00
parent e0a468a2c2
commit 3c97e75db6

View File

@@ -380,7 +380,7 @@ class PythonParser:
for col in cols: for col in cols:
columns.append(self._parse_frame_column(col)) columns.append(self._parse_frame_column(col))
case ast.Slice() | ast.Name(): case ast.Slice() | ast.Name() | ast.Subscript():
columns.append(self._parse_frame_column(schema)) columns.append(self._parse_frame_column(schema))
case _: case _:
@@ -391,7 +391,7 @@ class PythonParser:
def _parse_frame_column(self, column: ast.expr) -> FrameColumn: def _parse_frame_column(self, column: ast.expr) -> FrameColumn:
loc: Location = Location.from_ast(column) loc: Location = Location.from_ast(column)
match column: match column:
case ast.Name(): case ast.Name() | ast.Subscript():
return FrameColumn( return FrameColumn(
location=loc, location=loc,
name=None, name=None,