Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
universalmind303 committed Oct 31, 2024
1 parent 173b715 commit de7dd4b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/daft-sql/src/modules/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,4 +565,12 @@ impl SQLFunction for SQLConcat {

Ok(first)
}

fn docstrings(&self, _: &str) -> String {
"Concatenate the inputs into a single string".to_string()
}

fn arg_names(&self) -> &'static [&'static str] {
&["...inputs"]
}
}
7 changes: 7 additions & 0 deletions tests/sql/test_utf8_exprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def test_utf8_exprs():
tokenize_encode(a, 'r50k_base') as tokenize_encode_a,
tokenize_decode(tokenize_encode(a, 'r50k_base'), 'r50k_base') as tokenize_decode_a,
concat(a, '---') as concat_a,
concat('--', a, a, a, '--') as concat_multi_a
FROM df
"""
actual = daft.sql(sql).collect()
Expand Down Expand Up @@ -107,6 +108,12 @@ def test_utf8_exprs():
col("a").str.tokenize_encode("r50k_base").alias("tokenize_encode_a"),
col("a").str.tokenize_encode("r50k_base").str.tokenize_decode("r50k_base").alias("tokenize_decode_a"),
col("a").str.concat("---").alias("concat_a"),
daft.lit("--")
.str.concat(col("a"))
.str.concat(col("a"))
.str.concat(col("a"))
.str.concat("--")
.alias("concat_multi_a"),
)
.collect()
.to_pydict()
Expand Down

0 comments on commit de7dd4b

Please sign in to comment.