Skip to content

Commit

Permalink
chore(deps): update dependency sqlglot to >=24.0.0,<25.26 (#188)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency sqlglot to >=24.0.0,<25.26

* add split_part support

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: eakmanrq <[email protected]>
  • Loading branch information
renovate[bot] and eakmanrq authored Oct 18, 2024
1 parent ee6bda6 commit 9d8ddd2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/duckdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ See something that you would like to see supported? [Open an issue](https://gith
* [sort_array](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.sort_array.html)
* [soundex](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.soundex.html)
* [split](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split.html)
* [split_part](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split_part.html)
* [sqrt](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.sqrt.html)
* [stddev](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.stddev.html)
* [stddev_pop](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.stddev_pop.html)
Expand Down
1 change: 1 addition & 0 deletions docs/snowflake.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ See something that you would like to see supported? [Open an issue](https://gith
* [soundex](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.soundex.html)
* [split](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split.html)
* Regular expressions not supported
* [split_part](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split_part.html)
* [sqrt](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.sqrt.html)
* [stddev](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.stddev.html)
* [stddev_pop](https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.stddev_pop.html)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
python_requires=">=3.8",
install_requires=[
"prettytable<3.11.1",
"sqlglot>=24.0.0,<25.25",
"sqlglot>=24.0.0,<25.26",
"typing_extensions>=4.8,<5",
],
extras_require={
Expand Down
6 changes: 4 additions & 2 deletions sqlframe/base/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4697,7 +4697,7 @@ def spark_partition_id() -> Column:
return Column.invoke_anonymous_function(None, "spark_partition_id")


@meta(unsupported_engines="*")
@meta(unsupported_engines=["bigquery", "postgres"])
def split_part(src: ColumnOrName, delimiter: ColumnOrName, partNum: ColumnOrName) -> Column:
"""
Splits `str` by delimiter and return requested part of the split (1-based).
Expand All @@ -4723,7 +4723,9 @@ def split_part(src: ColumnOrName, delimiter: ColumnOrName, partNum: ColumnOrName
>>> df.select(split_part(df.a, df.b, df.c).alias('r')).collect()
[Row(r='13')]
"""
return Column.invoke_anonymous_function(src, "split_part", delimiter, partNum)
return Column.invoke_expression_over_column(
src, expression.SplitPart, delimiter=delimiter, part_index=partNum
)


@meta()
Expand Down
1 change: 1 addition & 0 deletions sqlframe/duckdb/functions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ from sqlframe.base.functions import (
skewness as skewness,
sort_array as sort_array,
soundex as soundex,
split_part as split_part,
sqrt as sqrt,
startswith as startswith,
stddev as stddev,
Expand Down
1 change: 1 addition & 0 deletions sqlframe/snowflake/functions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ from sqlframe.base.functions import (
sinh as sinh,
size as size,
soundex as soundex,
split_part as split_part,
sqrt as sqrt,
startswith as startswith,
stddev as stddev,
Expand Down

0 comments on commit 9d8ddd2

Please sign in to comment.