Skip to content

Commit

Permalink
chore(snowflake, bigquery): remove to_timestamp in tests (#9858)
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth authored Aug 16, 2024
1 parent 3f3738d commit 93db1b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ibis/backends/bigquery/tests/system/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,19 @@ def test_multiple_project_queries_execute(con):
assert len(result) == 5


def test_string_to_timestamp(con):
def test_string_as_timestamp(con):
timestamp = pd.Timestamp(
datetime.datetime(year=2017, month=2, day=6), tz=pytz.timezone("UTC")
)
expr = ibis.literal("2017-02-06").to_timestamp("%F")
expr = ibis.literal("2017-02-06").as_timestamp("%F")
result = con.execute(expr)
assert result == timestamp

timestamp_tz = pd.Timestamp(
datetime.datetime(year=2017, month=2, day=6, hour=5),
tz=pytz.timezone("UTC"),
)
expr_tz = ibis.literal("2017-02-06 America/New_York").to_timestamp("%F %Z")
expr_tz = ibis.literal("2017-02-06 America/New_York").as_timestamp("%F %Z")
result_tz = con.execute(expr_tz)
assert result_tz == timestamp_tz

Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/snowflake/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_timestamp_tz_column(simple_con):
ibis.util.gen_name("snowflake_timestamp_tz_column"),
schema=ibis.schema({"ts": "string"}),
temp=True,
).mutate(ts=lambda t: t.ts.to_timestamp("YYYY-MM-DD HH24-MI-SS"))
).mutate(ts=lambda t: t.ts.as_timestamp("YYYY-MM-DD HH24-MI-SS"))
expr = t.ts
assert expr.execute().empty

Expand Down

0 comments on commit 93db1b8

Please sign in to comment.