From a4a793697159ae215f87bef5b959957e6234e8cb Mon Sep 17 00:00:00 2001 From: Krzysztof Witt <120908425+krzysztof-kwitt@users.noreply.github.com> Date: Tue, 20 Dec 2022 13:18:13 +0000 Subject: [PATCH] feat(bigquery): add ops.DateFromYMD, ops.TimeFromHMS, ops.TimestampFromYMDHMS --- ibis/backends/bigquery/registry.py | 3 +++ ibis/backends/tests/test_temporal.py | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ibis/backends/bigquery/registry.py b/ibis/backends/bigquery/registry.py index 7f7cb29fec3a..28c0028117ae 100644 --- a/ibis/backends/bigquery/registry.py +++ b/ibis/backends/bigquery/registry.py @@ -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), @@ -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), diff --git a/ibis/backends/tests/test_temporal.py b/ibis/backends/tests/test_temporal.py index c982e672c884..0428a87b816a 100644 --- a/ibis/backends/tests/test_temporal.py +++ b/ibis/backends/tests/test_temporal.py @@ -775,7 +775,6 @@ def test_now_from_projection(alltypes): @pytest.mark.notimpl( [ - "bigquery", "pandas", "datafusion", "mysql", @@ -795,7 +794,6 @@ def test_date_literal(con): @pytest.mark.notimpl( [ - "bigquery", "pandas", "datafusion", "mysql", @@ -817,7 +815,6 @@ def test_timestamp_literal(con): @pytest.mark.notimpl( [ - "bigquery", "pandas", "datafusion", "mysql", @@ -841,7 +838,6 @@ def test_time_literal(con): @pytest.mark.notimpl( [ - "bigquery", "pandas", "datafusion", "mysql",