ibis icon indicating copy to clipboard operation
ibis copied to clipboard

bug: join between tz-naive and tz-aware should fail early

Open jreback opened this issue 8 years ago • 3 comments

this join should raise on dtype incompat early.

diff --git a/ibis/pandas/execution/tests/test_join.py b/ibis/pandas/execution/tests/test_join.py
index f670965..2157803 100644
--- a/ibis/pandas/execution/tests/test_join.py
+++ b/ibis/pandas/execution/tests/test_join.py
@@ -290,3 +290,10 @@ def test_keyed_asof_join(
     expected = pd.merge_asof(
         time_keyed_df1, time_keyed_df2, on='time', by='key')
     tm.assert_frame_equal(result[expected.columns], expected)
+
+
+def test_invalid_datetime_with_tz_aware(time_left, time_right):
+    time_left = time_left.mutate(
+        time=time_left.time.cast('timestamp("UTC")'))
+    expr = time_left.inner_join(time_right, 'time')
+    result = expr.execute()

jreback avatar Nov 16 '17 13:11 jreback

This might be a thing that we defer to backends. Some backends let you compare naive and non-naive timestamps.

cpcloud avatar Aug 08 '18 20:08 cpcloud

Should We raise during the compilation on each backend?

kszucs avatar Aug 09 '18 22:08 kszucs

This can probably be done with a new rlz rule, like if_is_timestamp_both_are_the_same_timezone_awarenessness

cpcloud avatar Dec 14 '21 22:12 cpcloud

Closing as stale.

cpcloud avatar Feb 07 '23 12:02 cpcloud