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

georgia-tech-db / eva / 042c0bf0-bd18-4ca0-adb3-9a9fb37193b5

06 Sep 2023 06:49PM UTC coverage: 80.573% (+9.6%) from 70.955%
042c0bf0-bd18-4ca0-adb3-9a9fb37193b5

push

circle-ci

gaurav274
merge + minor fixes

768 of 768 new or added lines in 95 files covered. (100.0%)

9369 of 11628 relevant lines covered (80.57%)

1.45 hits per line

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

97.56
/evadb/plan_nodes/create_function_plan.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 pathlib import Path
2✔
16
from typing import List
2✔
17

18
from evadb.catalog.models.function_io_catalog import FunctionIOCatalogEntry
2✔
19
from evadb.catalog.models.function_metadata_catalog import FunctionMetadataCatalogEntry
2✔
20
from evadb.plan_nodes.abstract_plan import AbstractPlan
2✔
21
from evadb.plan_nodes.types import PlanOprType
2✔
22

23

24
class CreateFunctionPlan(AbstractPlan):
2✔
25
    """
26
    This plan is used for storing information required to create function operators
27

28
    Attributes:
29
        name: str
30
            function_name provided by the user required
31
        if_not_exists: bool
32
            if true should throw an error if function with same name exists
33
            else will replace the existing
34
        inputs: List[FunctionIOCatalogEntry]
35
            function inputs, annotated list similar to table columns
36
        outputs: List[FunctionIOCatalogEntry]
37
            function outputs, annotated list similar to table columns
38
        impl_file_path: Path
39
            file path which holds the implementation of the function.
40
        function_type: str
41
            function type. it ca be object detection, classification etc.
42
    """
43

44
    def __init__(
2✔
45
        self,
46
        name: str,
47
        if_not_exists: bool,
48
        inputs: List[FunctionIOCatalogEntry],
49
        outputs: List[FunctionIOCatalogEntry],
50
        impl_file_path: Path,
51
        function_type: str = None,
52
        metadata: List[FunctionMetadataCatalogEntry] = None,
53
    ):
54
        super().__init__(PlanOprType.CREATE_FUNCTION)
2✔
55
        self._name = name
2✔
56
        self._if_not_exists = if_not_exists
2✔
57
        self._inputs = inputs
2✔
58
        self._outputs = outputs
2✔
59
        self._impl_path = impl_file_path
2✔
60
        self._function_type = function_type
2✔
61
        self._metadata = metadata
2✔
62

63
    @property
2✔
64
    def name(self):
2✔
65
        return self._name
2✔
66

67
    @property
2✔
68
    def if_not_exists(self):
2✔
69
        return self._if_not_exists
2✔
70

71
    @property
2✔
72
    def inputs(self):
2✔
73
        return self._inputs
2✔
74

75
    @property
2✔
76
    def outputs(self):
2✔
77
        return self._outputs
2✔
78

79
    @property
2✔
80
    def impl_path(self):
2✔
81
        return self._impl_path
2✔
82

83
    @property
2✔
84
    def function_type(self):
2✔
85
        return self._function_type
2✔
86

87
    @property
2✔
88
    def metadata(self):
2✔
89
        return self._metadata
2✔
90

91
    def __str__(self):
2✔
92
        return "CreateFunctionPlan(name={}, \
×
93
            if_not_exists={}, \
94
            inputs={}, \
95
            outputs={}, \
96
            impl_file_path={}, \
97
            function_type={}, \
98
            metadata={})".format(
99
            self._name,
100
            self._if_not_exists,
101
            self._inputs,
102
            self._outputs,
103
            self._impl_path,
104
            self._function_type,
105
            self._metadata,
106
        )
107

108
    def __hash__(self) -> int:
2✔
109
        return hash(
2✔
110
            (
111
                super().__hash__(),
112
                self.if_not_exists,
113
                tuple(self.inputs),
114
                tuple(self.outputs),
115
                self.impl_path,
116
                self.function_type,
117
                tuple(self.metadata),
118
            )
119
        )
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

© 2026 Coveralls, Inc