Skip to content

test: pull out datafusion function count #897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ibis-server/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

def file_path(path: str) -> str:
return os.path.join(os.path.dirname(__file__), path)


DATAFUSION_FUNCTION_COUNT = 269
2 changes: 1 addition & 1 deletion ibis-server/tests/routers/v2/connector/test_trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def trino(request) -> TrinoContainer:
db = TrinoContainer().start()

# To avoid `TrinoQueryError(type=INTERNAL_ERROR, name=GENERIC_INTERNAL_ERROR, message="nodes is empty")`
time.sleep(10)
time.sleep(5)

conn = connect(
host=db.get_container_host_ip(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from app.config import get_config
from app.main import app
from tests.conftest import file_path
from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path
from tests.routers.v3.connector.bigquery.conftest import base_url

manifest = {
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

config.set_remote_function_list_path(function_list_path)
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 299
assert len(result) == DATAFUSION_FUNCTION_COUNT + 30
the_func = next(filter(lambda x: x["name"] == "abs", result))
assert the_func == {
"name": "abs",
Expand All @@ -72,7 +72,7 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

def test_scalar_function(manifest_str: str, connection_info):
response = client.post(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from app.config import get_config
from app.main import app
from tests.conftest import file_path
from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path
from tests.routers.v3.connector.canner.conftest import base_url

manifest = {
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

config.set_remote_function_list_path(function_list_path)
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 299
assert len(result) == DATAFUSION_FUNCTION_COUNT + 30
the_func = next(filter(lambda x: x["name"] == "abs", result))
assert the_func == {
"name": "abs",
Expand All @@ -72,7 +72,7 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

def test_scalar_function(manifest_str: str, connection_info):
response = client.post(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from app.config import get_config
from app.main import app
from tests.conftest import file_path
from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path
from tests.routers.v3.connector.clickhouse.conftest import base_url

manifest = {
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

config.set_remote_function_list_path(function_list_path)
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 348
assert len(result) == DATAFUSION_FUNCTION_COUNT + 79
the_func = next(filter(lambda x: x["name"] == "abs", result))
assert the_func == {
"name": "abs",
Expand All @@ -72,7 +72,7 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

def test_scalar_function(manifest_str: str, connection_info):
response = client.post(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from app.config import get_config
from app.main import app
from tests.conftest import file_path
from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path
from tests.routers.v3.connector.mssql.conftest import base_url

manifest = {
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

config.set_remote_function_list_path(function_list_path)
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 321
assert len(result) == DATAFUSION_FUNCTION_COUNT + 52
the_func = next(filter(lambda x: x["name"] == "abs", result))
assert the_func == {
"name": "abs",
Expand All @@ -72,7 +72,7 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

def test_scalar_function(manifest_str: str, connection_info):
response = client.post(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from app.config import get_config
from app.main import app
from tests.conftest import file_path
from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path
from tests.routers.v3.connector.mysql.conftest import base_url

manifest = {
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

config.set_remote_function_list_path(function_list_path)
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 304
assert len(result) == DATAFUSION_FUNCTION_COUNT + 35
the_func = next(filter(lambda x: x["name"] == "abs", result))
assert the_func == {
"name": "abs",
Expand All @@ -72,7 +72,7 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

def test_scalar_function(manifest_str: str, connection_info):
response = client.post(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from app.config import get_config
from app.main import app
from tests.conftest import file_path
from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path
from tests.routers.v3.connector.postgres.conftest import base_url

manifest = {
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

config.set_remote_function_list_path(function_list_path)
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 318
assert len(result) == DATAFUSION_FUNCTION_COUNT + 49
the_func = next(filter(lambda x: x["name"] == "abs", result))
assert the_func == {
"name": "abs",
Expand All @@ -72,7 +72,7 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

def test_scalar_function(manifest_str: str, connection_info):
response = client.post(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from app.config import get_config
from app.main import app
from tests.conftest import file_path
from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path
from tests.routers.v3.connector.snowflake.conftest import base_url

manifest = {
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

config.set_remote_function_list_path(function_list_path)
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 340
assert len(result) == DATAFUSION_FUNCTION_COUNT + 71
the_func = next(filter(lambda x: x["name"] == "abs", result))
assert the_func == {
"name": "abs",
Expand All @@ -72,7 +72,7 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

def test_scalar_function(manifest_str: str, connection_info):
response = client.post(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from app.config import get_config
from app.main import app
from tests.conftest import file_path
from tests.conftest import DATAFUSION_FUNCTION_COUNT, file_path
from tests.routers.v3.connector.trino.conftest import base_url

manifest = {
Expand Down Expand Up @@ -51,13 +51,13 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

config.set_remote_function_list_path(function_list_path)
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 299
assert len(result) == DATAFUSION_FUNCTION_COUNT + 30
the_func = next(filter(lambda x: x["name"] == "abs", result))
assert the_func == {
"name": "abs",
Expand All @@ -72,7 +72,7 @@ def test_function_list():
response = client.get(url=f"{base_url}/functions")
assert response.status_code == 200
result = response.json()
assert len(result) == 269
assert len(result) == DATAFUSION_FUNCTION_COUNT

def test_scalar_function(manifest_str: str, connection_info):
response = client.post(
Expand Down
Loading