Skip to content

Commit

Permalink
feat(impala): rudimentary date support
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and gforsyth committed Dec 21, 2023
1 parent 46e565d commit d4bcf7b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
1 change: 1 addition & 0 deletions ibis/backends/base/sql/registry/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def needs_parens(op: ops.Node):
"boolean": "boolean",
"timestamp": "timestamp",
"decimal": "decimal",
"date": "date",
}


Expand Down
1 change: 0 additions & 1 deletion ibis/backends/tests/test_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ def test_scalar_param(backend, alltypes, df, value, dtype, col):
ids=["string", "date", "datetime"],
)
@pytest.mark.notimpl(["druid", "oracle"])
@pytest.mark.notyet(["impala"], reason="impala doesn't support dates")
def test_scalar_param_date(backend, alltypes, value):
param = ibis.param("date")
ds_col = alltypes.date_string_col
Expand Down
17 changes: 1 addition & 16 deletions ibis/backends/tests/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,7 @@
@pytest.mark.parametrize("attr", ["year", "month", "day"])
@pytest.mark.parametrize(
"expr_fn",
[
param(lambda c: c.date(), id="date"),
param(
lambda c: c.cast("date"),
id="cast",
marks=pytest.mark.notimpl(["impala"], raises=com.UnsupportedBackendType),
),
],
[param(lambda c: c.date(), id="date"), param(lambda c: c.cast("date"), id="cast")],
)
@pytest.mark.notimpl(
["druid"],
Expand Down Expand Up @@ -1957,7 +1950,6 @@ def test_string_to_timestamp(alltypes, fmt):
],
)
@pytest.mark.notimpl(["mssql", "druid", "oracle"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(["impala"], raises=com.UnsupportedBackendType)
@pytest.mark.notimpl(
["flink"],
raises=Py4JJavaError,
Expand Down Expand Up @@ -2494,7 +2486,6 @@ def test_timestamp_column_from_ymdhms(backend, con, alltypes, df):
"java.lang.UnsupportedOperationException: class org.apache.calcite.sql.SqlIdentifier: LONG"
),
)
@pytest.mark.notimpl(["impala"], raises=com.UnsupportedBackendType)
@pytest.mark.notimpl(
["oracle"], raises=sa.exc.DatabaseError, reason="ORA-01861 literal does not match"
)
Expand All @@ -2512,7 +2503,6 @@ def test_date_scalar_from_iso(con):
raises=sa.exc.ProgrammingError,
reason="java.lang.UnsupportedOperationException: class org.apache.calcite.sql.SqlIdentifier: STRING",
)
@pytest.mark.notimpl(["impala"], raises=com.UnsupportedBackendType)
@pytest.mark.notyet(
["oracle"],
raises=sa.exc.DatabaseError,
Expand Down Expand Up @@ -2648,11 +2638,6 @@ def build_date_col(t):
raises=sa.exc.CompileError,
reason='No literal value renderer is available for literal value "datetime.date(2010, 11, 1)" with datatype DATE',
)
@pytest.mark.notyet(
["impala"],
reason="impala doesn't support dates",
raises=com.UnsupportedBackendType,
)
@pytest.mark.notimpl(["oracle"], raises=sa.exc.DatabaseError)
@pytest.mark.parametrize(
("left_fn", "right_fn"),
Expand Down

0 comments on commit d4bcf7b

Please sign in to comment.