Skip to content

Commit e410e7a

Browse files
Dharin-shahevertlammerts
authored andcommitted
revert unncessary change
1 parent 0bfeccb commit e410e7a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

duckdb/experimental/spark/sql/column.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
if TYPE_CHECKING:
88
from ._typing import DateTimeLiteral, DecimalLiteral, LiteralType
99

10-
from duckdb import ConstantExpression, Expression, FunctionExpression
10+
from duckdb import ColumnExpression, ConstantExpression, Expression, FunctionExpression
1111
from duckdb.sqltypes import DuckDBPyType
1212

1313
__all__ = ["Column"]
@@ -173,11 +173,9 @@ def __getitem__(self, k: Any) -> "Column": # noqa: ANN401
173173
# raise ValueError("Using a slice with a step value is not supported")
174174
# return self.substr(k.start, k.stop)
175175
else:
176-
# Use struct_extract for proper struct field access
177-
from duckdb import ConstantExpression, FunctionExpression
178-
179-
field_name_expr = ConstantExpression(str(k))
180-
return Column(FunctionExpression("struct_extract", self.expr, field_name_expr))
176+
# TODO: this is super hacky # noqa: TD002, TD003
177+
expr_str = str(self.expr) + "." + str(k)
178+
return Column(ColumnExpression(expr_str))
181179

182180
def __getattr__(self, item: Any) -> "Column": # noqa: ANN401
183181
"""An expression that gets an item at position ``ordinal`` out of a list,

0 commit comments

Comments
 (0)