Skip to content

Commit

Permalink
feat(bigquery): add ops.DateFromYMD, ops.TimeFromHMS, ops.TimestampFr…
Browse files Browse the repository at this point in the history
…omYMDHMS
  • Loading branch information
krzysztof-kwitt authored and cpcloud committed Dec 20, 2022
1 parent 30c547a commit a4a7936
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ibis/backends/bigquery/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ def _array_agg(t, op):
ops.Sign: unary("SIGN"),
# Temporal functions
ops.Date: unary("DATE"),
ops.DateFromYMD: fixed_arity("DATE", 3),
ops.DateAdd: _timestamp_op("DATE_ADD", {"D", "W", "M", "Q", "Y"}),
ops.DateSub: _timestamp_op("DATE_SUB", {"D", "W", "M", "Q", "Y"}),
ops.DateTruncate: _truncate("DATE", _date_units),
Expand All @@ -505,9 +506,11 @@ def _array_agg(t, op):
ops.Strftime: compiles_strftime,
ops.StringToTimestamp: compiles_string_to_timestamp,
ops.Time: unary("TIME"),
ops.TimeFromHMS: fixed_arity("TIME", 3),
ops.TimeTruncate: _truncate("TIME", _timestamp_units),
ops.TimestampAdd: _timestamp_op("TIMESTAMP_ADD", {"h", "m", "s", "ms", "us"}),
ops.TimestampFromUNIX: integer_to_timestamp,
ops.TimestampFromYMDHMS: fixed_arity("DATETIME", 6),
ops.TimestampNow: fixed_arity("CURRENT_TIMESTAMP", 0),
ops.TimestampSub: _timestamp_op("TIMESTAMP_SUB", {"h", "m", "s", "ms", "us"}),
ops.TimestampTruncate: _truncate("TIMESTAMP", _timestamp_units),
Expand Down
4 changes: 0 additions & 4 deletions ibis/backends/tests/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,6 @@ def test_now_from_projection(alltypes):

@pytest.mark.notimpl(
[
"bigquery",
"pandas",
"datafusion",
"mysql",
Expand All @@ -795,7 +794,6 @@ def test_date_literal(con):

@pytest.mark.notimpl(
[
"bigquery",
"pandas",
"datafusion",
"mysql",
Expand All @@ -817,7 +815,6 @@ def test_timestamp_literal(con):

@pytest.mark.notimpl(
[
"bigquery",
"pandas",
"datafusion",
"mysql",
Expand All @@ -841,7 +838,6 @@ def test_time_literal(con):

@pytest.mark.notimpl(
[
"bigquery",
"pandas",
"datafusion",
"mysql",
Expand Down

0 comments on commit a4a7936

Please sign in to comment.