diff --git a/evadb/catalog/catalog_manager.py b/evadb/catalog/catalog_manager.py index 8a519fdcc..f9cf4a3d3 100644 --- a/evadb/catalog/catalog_manager.py +++ b/evadb/catalog/catalog_manager.py @@ -583,12 +583,17 @@ def insert_function_catalog_entry( <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +======= +>>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) name, impl_file_path, type, @@ -609,6 +614,7 @@ def insert_function_catalog_entry( >>>>>>> 2dacff69 (feat: sync master staging (#1050)) <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ) >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) @@ -616,6 +622,11 @@ def insert_function_catalog_entry( >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +======= + ) +>>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) return function_entry def get_function_catalog_entry_by_name(self, name: str) -> FunctionCatalogEntry: diff --git a/evadb/catalog/services/function_catalog_service.py b/evadb/catalog/services/function_catalog_service.py index 486c9cc95..73d1abbfc 100644 --- a/evadb/catalog/services/function_catalog_service.py +++ b/evadb/catalog/services/function_catalog_service.py @@ -16,24 +16,33 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) from typing import List ======= >>>>>>> 2dacff69 (feat: sync master staging (#1050)) <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= from typing import List >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) from sqlalchemy.orm import Session from sqlalchemy.sql.expression import select @@ -42,12 +51,17 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +======= +>>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) from evadb.catalog.models.utils import ( FunctionIOCatalogEntry, FunctionMetadataCatalogEntry, @@ -61,11 +75,15 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= from evadb.catalog.services.base_service import BaseService >>>>>>> 2dacff69 (feat: sync master staging (#1050)) ======= >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +<<<<<<< HEAD ======= ======= from evadb.catalog.services.base_service import BaseService @@ -76,6 +94,8 @@ from evadb.catalog.services.base_service import BaseService >>>>>>> 2dacff69 (feat: sync master staging (#1050)) >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) from evadb.utils.logging_manager import logger @@ -86,10 +106,13 @@ def __init__(self, db_session: Session): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) self._function_io_service = FunctionIOCatalogService(db_session) self._function_metadata_service = FunctionMetadataCatalogService(db_session) @@ -108,6 +131,9 @@ def insert_entry( >>>>>>> 2dacff69 (feat: sync master staging (#1050)) <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= self._function_io_service = FunctionIOCatalogService(db_session) self._function_metadata_service = FunctionMetadataCatalogService(db_session) @@ -121,10 +147,13 @@ def insert_entry( function_io_list: List[FunctionIOCatalogEntry], function_metadata_list: List[FunctionMetadataCatalogEntry], >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ) -> FunctionCatalogEntry: """Insert a new function entry @@ -143,12 +172,17 @@ def insert_entry( <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +======= +>>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) for function_io in function_io_list: function_io.function_id = function_obj._row_id @@ -177,11 +211,15 @@ def insert_entry( <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= return function_obj.as_dataclass() >>>>>>> 2dacff69 (feat: sync master staging (#1050)) ======= >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +<<<<<<< HEAD ======= ======= return function_obj.as_dataclass() @@ -192,6 +230,8 @@ def insert_entry( return function_obj.as_dataclass() >>>>>>> 2dacff69 (feat: sync master staging (#1050)) >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) def get_entry_by_name(self, name: str) -> FunctionCatalogEntry: """return the function entry that matches the name provided. diff --git a/evadb/catalog/services/function_io_catalog_service.py b/evadb/catalog/services/function_io_catalog_service.py index 06f8e128d..f9d071cbd 100644 --- a/evadb/catalog/services/function_io_catalog_service.py +++ b/evadb/catalog/services/function_io_catalog_service.py @@ -73,10 +73,13 @@ def get_output_entries_by_function_id( <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) def create_entries(self, io_list: List[FunctionIOCatalogEntry]): io_objs = [] ======= @@ -90,14 +93,20 @@ def insert_entries(self, io_list: List[FunctionIOCatalogEntry]): >>>>>>> 2dacff69 (feat: sync master staging (#1050)) <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= def create_entries(self, io_list: List[FunctionIOCatalogEntry]): io_objs = [] >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) for io in io_list: io_obj = FunctionIOCatalog( name=io.name, diff --git a/evadb/catalog/services/function_metadata_catalog_service.py b/evadb/catalog/services/function_metadata_catalog_service.py index 1bc3b880f..230a0c4d0 100644 --- a/evadb/catalog/services/function_metadata_catalog_service.py +++ b/evadb/catalog/services/function_metadata_catalog_service.py @@ -34,10 +34,13 @@ def __init__(self, db_session: Session): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) def create_entries(self, entries: List[FunctionMetadataCatalogEntry]): metadata_objs = [] ======= @@ -45,14 +48,20 @@ def insert_entries(self, entries: List[FunctionMetadataCatalogEntry]): >>>>>>> 2dacff69 (feat: sync master staging (#1050)) <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= def create_entries(self, entries: List[FunctionMetadataCatalogEntry]): metadata_objs = [] >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) try: for entry in entries: metadata_obj = FunctionMetadataCatalog( @@ -65,10 +74,13 @@ def create_entries(self, entries: List[FunctionMetadataCatalogEntry]): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= logger.exception( f"Failed to insert entry {entry} into function metadata catalog with exception {str(e)}" @@ -76,12 +88,17 @@ def create_entries(self, entries: List[FunctionMetadataCatalogEntry]): >>>>>>> 2dacff69 (feat: sync master staging (#1050)) <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +======= +>>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) raise CatalogError(e) def get_entries_by_function_id( diff --git a/test/integration_tests/long/test_create_table_executor.py b/test/integration_tests/long/test_create_table_executor.py index 88fe82831..8258c9548 100644 --- a/test/integration_tests/long/test_create_table_executor.py +++ b/test/integration_tests/long/test_create_table_executor.py @@ -126,12 +126,17 @@ def test_create_table_with_incorrect_info(self): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) ======= >>>>>>> 2170a7a9 (Bump v0.3.4+ dev) ======= >>>>>>> c5f43c65 (Bump v0.3.4+ dev) +======= +======= +>>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) def test_create_table_with_restricted_keywords(self): create_table = "CREATE TABLE hello (_row_id INTEGER, price TEXT);" with self.assertRaises(AssertionError): @@ -144,10 +149,14 @@ def test_create_table_with_restricted_keywords(self): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= >>>>>>> 40a10ce1 (Bump v0.3.4+ dev) ======= >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +<<<<<<< HEAD ======= ======= >>>>>>> 40a10ce1 (Bump v0.3.4+ dev) @@ -156,6 +165,8 @@ def test_create_table_with_restricted_keywords(self): ======= >>>>>>> 40a10ce1 (Bump v0.3.4+ dev) >>>>>>> c5f43c65 (Bump v0.3.4+ dev) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) if __name__ == "__main__": unittest.main() diff --git a/test/unit_tests/catalog/test_catalog_manager.py b/test/unit_tests/catalog/test_catalog_manager.py index f0e19b9c6..30a364af8 100644 --- a/test/unit_tests/catalog/test_catalog_manager.py +++ b/test/unit_tests/catalog/test_catalog_manager.py @@ -150,10 +150,13 @@ def test_insert_function( <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) function_mock.return_value.insert_entry.assert_called_with( "function", "sample.py", @@ -171,6 +174,9 @@ def test_insert_function( >>>>>>> 2dacff69 (feat: sync master staging (#1050)) <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ======= function_mock.return_value.insert_entry.assert_called_with( "function", @@ -180,10 +186,13 @@ def test_insert_function( function_io_list, function_metadata_list, >>>>>>> d4c650b6 (fix: make the table/function catalog insert operation atomic (#1293)) +<<<<<<< HEAD ======= >>>>>>> 9fe75f29 (feat: sync master staging (#1050)) ======= >>>>>>> b87af508 (feat: sync master staging (#1050)) +======= +>>>>>>> bc98b4af (fix: make the table/function catalog insert operation atomic (#1293)) ) checksum_mock.assert_called_with("sample.py") self.assertEqual(actual, function_mock.return_value.insert_entry.return_value)