summaryrefslogtreecommitdiffstats
path: root/sqlglot/dataframe/sql/functions.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/dataframe/sql/functions.py')
-rw-r--r--sqlglot/dataframe/sql/functions.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/sqlglot/dataframe/sql/functions.py b/sqlglot/dataframe/sql/functions.py
index 4002cfe..d0ae50c 100644
--- a/sqlglot/dataframe/sql/functions.py
+++ b/sqlglot/dataframe/sql/functions.py
@@ -368,9 +368,7 @@ def covar_samp(col1: ColumnOrName, col2: ColumnOrName) -> Column:
def first(col: ColumnOrName, ignorenulls: t.Optional[bool] = None) -> Column:
- if ignorenulls is not None:
- return Column.invoke_anonymous_function(col, "FIRST", ignorenulls)
- return Column.invoke_anonymous_function(col, "FIRST")
+ return Column.invoke_expression_over_column(col, expression.First, ignore_nulls=ignorenulls)
def grouping_id(*cols: ColumnOrName) -> Column:
@@ -394,9 +392,7 @@ def isnull(col: ColumnOrName) -> Column:
def last(col: ColumnOrName, ignorenulls: t.Optional[bool] = None) -> Column:
- if ignorenulls is not None:
- return Column.invoke_anonymous_function(col, "LAST", ignorenulls)
- return Column.invoke_anonymous_function(col, "LAST")
+ return Column.invoke_expression_over_column(col, expression.Last, ignore_nulls=ignorenulls)
def monotonically_increasing_id() -> Column: