Skip to content

Commit

Permalink
feat(duckdb): add functionality needed to pass integer to interval test
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed Mar 9, 2022
1 parent c544b59 commit e2119e8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions ibis/backends/base/sql/alchemy/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ def _sort_key(t, expr):
ops.StringSQLLike: _string_like,
ops.StartsWith: _startswith,
ops.EndsWith: _endswith,
ops.StringConcat: varargs(sa.func.concat),
# math
ops.Ln: unary(sa.func.ln),
ops.Exp: unary(sa.func.exp),
Expand Down
1 change: 1 addition & 0 deletions ibis/backends/duckdb/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,6 @@ def _struct_field(t, expr):
ops.TimestampFromUNIX: _timestamp_from_unix,
ops.Translate: fixed_arity('replace', 3),
ops.TimestampNow: fixed_arity('now', 0),
ops.ArrayIndex: fixed_arity('list_element', 2),
}
)
7 changes: 6 additions & 1 deletion ibis/backends/postgres/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,12 @@ def _day_of_week_name(t, expr):
ops.RegexReplace: _regex_replace,
ops.Translate: fixed_arity('translate', 3),
ops.RegexExtract: _regex_extract_,
ops.StringSplit: fixed_arity(sa.func.string_to_array, 2),
ops.StringSplit: fixed_arity(
lambda col, sep: sa.func.string_to_array(
col, sep, type_=sa.ARRAY(col.type)
),
2,
),
ops.StringJoin: _string_join,
ops.FindInSet: _find_in_set,
# math
Expand Down
2 changes: 0 additions & 2 deletions ibis/backends/tests/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,8 @@ def convert_to_offset(offset, displacement_type=displacement_type):
"clickhouse",
"dask",
"datafusion",
"duckdb",
"impala",
"mysql",
"postgres",
"pyspark",
"sqlite",
]
Expand Down

0 comments on commit e2119e8

Please sign in to comment.