diff --git a/ibis-server/resources/function_list/bigquery.csv b/ibis-server/resources/function_list/bigquery.csv index 57c3c7452..5e34520c6 100644 --- a/ibis-server/resources/function_list/bigquery.csv +++ b/ibis-server/resources/function_list/bigquery.csv @@ -17,6 +17,7 @@ scalar,timestamp_trunc,timestamp,,"timestamp,granularity","Truncates a timestamp scalar,timestamp_micros,timestamp,,"int64","Converts the number of microseconds since 1970-01-01 00:00:00 UTC to a TIMESTAMP." scalar,timestamp_millis,timestamp,,"int64","Converts the number of milliseconds since 1970-01-01 00:00:00 UTC to a TIMESTAMP." scalar,timestamp_seconds,timestamp,,"int64","Converts the number of seconds since 1970-01-01 00:00:00 UTC to a TIMESTAMP." +scalar,timestamp,timestamp,,"text","Converts a string to a TIMESTAMP." scalar,format_date,string,,"string,date","Formats a date according to the specified format string." scalar,format_timestamp,string,,"string,timestamp","Formats a timestamp according to the specified format string." scalar,parse_date,date,,"text,text","Parses a date from a string." diff --git a/ibis-server/tests/routers/v3/connector/bigquery/test_functions.py b/ibis-server/tests/routers/v3/connector/bigquery/test_functions.py index 16b99bbfa..90103e680 100644 --- a/ibis-server/tests/routers/v3/connector/bigquery/test_functions.py +++ b/ibis-server/tests/routers/v3/connector/bigquery/test_functions.py @@ -45,7 +45,7 @@ async def test_function_list(client): response = await client.get(url=f"{base_url}/functions") assert response.status_code == 200 result = response.json() - assert len(result) == DATAFUSION_FUNCTION_COUNT + 34 + assert len(result) == DATAFUSION_FUNCTION_COUNT + 35 the_func = next( filter( lambda x: x["name"] == "string_agg", diff --git a/ibis-server/tests/routers/v3/connector/bigquery/test_query.py b/ibis-server/tests/routers/v3/connector/bigquery/test_query.py index ebdd0fac8..b5f371b0a 100644 --- a/ibis-server/tests/routers/v3/connector/bigquery/test_query.py +++ b/ibis-server/tests/routers/v3/connector/bigquery/test_query.py @@ -78,16 +78,16 @@ async def test_query(client, manifest_str, connection_info): assert len(result["columns"]) == len(manifest["models"][0]["columns"]) assert len(result["data"]) == 1 assert result["data"][0] == [ + 36485, + 1202, + "F", + "356711.63", + "1992-06-06 00:00:00.000000", + "36485_1202", "2024-01-01 23:59:59.000000", "2024-01-01 23:59:59.000000 UTC", "2024-01-16 04:00:00.000000 UTC", # utc-5 "2024-07-16 03:00:00.000000 UTC", # utc-4 - "36485_1202", - 1202, - "1992-06-06 00:00:00.000000", - 36485, - "F", - "356711.63", ] assert result["dtypes"] == { "o_orderkey": "int64", @@ -141,7 +141,6 @@ async def test_query_with_invalid_manifest_str(client, connection_info): }, ) assert response.status_code == 422 - assert response.text == "Base64 decode error: Invalid padding" async def test_query_without_manifest(client, connection_info): diff --git a/ibis-server/tools/query_local_run.py b/ibis-server/tools/query_local_run.py index fd07ceed6..d90accf1b 100644 --- a/ibis-server/tools/query_local_run.py +++ b/ibis-server/tools/query_local_run.py @@ -58,7 +58,7 @@ print("### Starting the session context ###") print("#") -session_context = SessionContext(encoded_str, function_list_path) +session_context = SessionContext(encoded_str, function_list_path + f"{data_source}.csv") planned_sql = session_context.transform_sql(sql) print("# Planned SQL:\n", planned_sql)