• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

georgia-tech-db / eva / #758

04 Sep 2023 08:37PM UTC coverage: 0.0% (-78.3%) from 78.333%
#758

push

circle-ci

hershd23
Increased underline length in at line 75 in text_summarization.rst
	modified:   docs/source/benchmarks/text_summarization.rst

0 of 11303 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/evadb/catalog/services/udf_io_catalog_service.py
1
# coding=utf-8
2
# Copyright 2018-2023 EvaDB
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
from typing import List
×
16

17
from sqlalchemy.orm import Session
×
18
from sqlalchemy.sql.expression import select
×
19

20
from evadb.catalog.models.udf_io_catalog import UdfIOCatalog, UdfIOCatalogEntry
×
21
from evadb.catalog.services.base_service import BaseService
×
22
from evadb.utils.logging_manager import logger
×
23

24

25
class UdfIOCatalogService(BaseService):
×
26
    def __init__(self, db_session: Session):
×
27
        super().__init__(UdfIOCatalog, db_session)
×
28

29
    def get_input_entries_by_udf_id(self, udf_id: int) -> List[UdfIOCatalogEntry]:
×
30
        try:
×
31
            result = (
×
32
                self.session.execute(
33
                    select(self.model).filter(
34
                        self.model._udf_id == udf_id,
35
                        self.model._is_input == True,  # noqa
36
                    )
37
                )
38
                .scalars()
39
                .all()
40
            )
41
            return [obj.as_dataclass() for obj in result]
×
42
        except Exception as e:
43
            error = f"Getting inputs for UDF id {udf_id} raised {e}"
44
            logger.error(error)
45
            raise RuntimeError(error)
46

47
    def get_output_entries_by_udf_id(self, udf_id: int) -> List[UdfIOCatalogEntry]:
×
48
        try:
×
49
            result = (
×
50
                self.session.execute(
51
                    select(self.model).filter(
52
                        self.model._udf_id == udf_id,
53
                        self.model._is_input == False,  # noqa
54
                    )
55
                )
56
                .scalars()
57
                .all()
58
            )
59
            return [obj.as_dataclass() for obj in result]
×
60
        except Exception as e:
61
            error = f"Getting outputs for UDF id {udf_id} raised {e}"
62
            logger.error(error)
63
            raise RuntimeError(error)
64

65
    def insert_entries(self, io_list: List[UdfIOCatalogEntry]):
×
66
        """Commit entries to the udf_io table
67

68
        Arguments:
69
            io_list (List[UdfIOCatalogEntry]): List of io info io be added
70
        """
71

72
        for io in io_list:
×
73
            io_obj = UdfIOCatalog(
×
74
                name=io.name,
75
                type=io.type,
76
                is_nullable=io.is_nullable,
77
                array_type=io.array_type,
78
                array_dimensions=io.array_dimensions,
79
                is_input=io.is_input,
80
                udf_id=io.udf_id,
81
            )
82
            io_obj.save(self.session)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc