feat(parser): allow subscript in type annotations
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user