Skip to content
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

fix: third-party test #1124

Merged
merged 12 commits into from
Sep 15, 2023
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,22 @@ workflows:
################################
- Postgres:
name: Third Party Test - Postgres | v3.10 | Linux
filters:
branches:
only:
- master
- staging
# filters:
# branches:
# only:
# - master
# - staging
################################
### THIRD PARTY: Staging, Master
################################
################################
- MySQL:
name: Third Party Test - MySQL | v3.10 | Linux
filters:
branches:
only:
- master
- staging
# filters:
# branches:
# only:
# - master
# - staging
################################
### NOTEBOOKS: Staging, Master
################################
Expand Down
3 changes: 3 additions & 0 deletions evadb/storage/native_storage_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def __init__(self, db: EvaDBDatabase):
def write(self, table: TableCatalogEntry, rows: Batch):
pass

def create(self, table: TableCatalogEntry):
pass

def read(self, table: TableCatalogEntry) -> Iterator[Batch]:
try:
db_catalog_entry = self.db.catalog().get_database_catalog_entry(
Expand Down
8 changes: 5 additions & 3 deletions evadb/third_party/databases/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import os
from contextlib import contextmanager

from evadb.executor.executor_utils import ExecutorError


def _get_database_handler(engine: str, **kwargs):
"""
Expand Down Expand Up @@ -48,10 +50,10 @@ def _get_database_handler(engine: str, **kwargs):
def get_database_handler(engine: str, **kwargs):
handler = _get_database_handler(engine, **kwargs)
try:
handler.connect()
resp = handler.connect()
if not resp.status:
raise ExecutorError(f"Cannot establish connection due to {resp.error}")
yield handler
except Exception as e:
raise Exception(f"Error connecting to the database: {str(e)}")
finally:
handler.disconnect()

Expand Down
6 changes: 3 additions & 3 deletions test/third_party_tests/test_native_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _create_table_in_native_database(self):
"""USE test_data_source {
CREATE TABLE test_table (
name VARCHAR(10),
Age INT,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally made this change so that we could test the corner case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I missed that. Thanks for point it out.

age INT,
comment VARCHAR (100)
)
}""",
Expand All @@ -49,7 +49,7 @@ def _insert_value_into_native_database(self, col1, col2, col3):
self.evadb,
f"""USE test_data_source {{
INSERT INTO test_table (
name, Age, comment
name, age, comment
) VALUES (
'{col1}', {col2}, '{col3}'
)
Expand All @@ -67,7 +67,7 @@ def _drop_table_in_native_database(self):
def _create_evadb_table_using_select_query(self):
execute_query_fetch_all(
self.evadb,
"""CREATE TABLE eva_table AS SELECT name, Age FROM test_data_source.test_table;""",
"""CREATE TABLE eva_table AS SELECT name, age FROM test_data_source.test_table;""",
)

# check if the create table is successful
Expand Down