refactor: pass ExprMetadata
down to compliant Exprs from narwhals.Expr
#1848
Labels
ExprMetadata
down to compliant Exprs from narwhals.Expr
#1848
Currently, we track expression metadata at the compliant level:
This is quite error-prone, as we repeat logic in quite a few places.
I'd prefer it if:
nth
,col
,selector
,all
). Because in group_by-agg,selector
andall
require some special treatment. But this could be done much more simply at the Narwhals level, without tracking function names everywhere in DuckDB / PySpark / Ibis / whatever else we add, which I hope would also have a modern enough syntaxTo do this, I haven't tried, but perhaps:
_to_compliant_expr
could take ametadata
argument, which takes aTypeDict
of metadata which we keep track of at thenarwhals/expr.py
andnarwhals/functions.py
levelThe text was updated successfully, but these errors were encountered: