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

georgia-tech-db / eva / #836

18 Oct 2023 06:28PM UTC coverage: 0.0% (-78.6%) from 78.602%
#836

push

circle-ci

Andy Xu
Skip the limit test

0 of 12321 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/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
×
16
from typing import List
×
17

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

23

24
class CreateFunctionPlan(AbstractPlan):
×
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
        or_replace: bool
32
            if true should overwrite if function with same name exists
33
        if_not_exists: bool
34
            if true should skip if function with same name exists
35
        inputs: List[FunctionIOCatalogEntry]
36
            function inputs, annotated list similar to table columns
37
        outputs: List[FunctionIOCatalogEntry]
38
            function outputs, annotated list similar to table columns
39
        impl_file_path: Path
40
            file path which holds the implementation of the function.
41
        function_type: str
42
            function type. it ca be object detection, classification etc.
43
    """
44

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

66
    @property
×
67
    def name(self):
×
68
        return self._name
×
69

70
    @property
×
71
    def or_replace(self):
×
72
        return self._or_replace
×
73

74
    @property
×
75
    def if_not_exists(self):
×
76
        return self._if_not_exists
×
77

78
    @property
×
79
    def inputs(self):
×
80
        return self._inputs
×
81

82
    @property
×
83
    def outputs(self):
×
84
        return self._outputs
×
85

86
    @property
×
87
    def impl_path(self):
×
88
        return self._impl_path
×
89

90
    @property
×
91
    def function_type(self):
×
92
        return self._function_type
×
93

94
    @property
×
95
    def metadata(self):
×
96
        return self._metadata
×
97

98
    def __str__(self):
×
99
        return "CreateFunctionPlan(name={}, \
×
100
            or_replace={}, \
101
            if_not_exists={}, \
102
            inputs={}, \
103
            outputs={}, \
104
            impl_file_path={}, \
105
            function_type={}, \
106
            metadata={})".format(
107
            self._name,
108
            self._or_replace,
109
            self._if_not_exists,
110
            self._inputs,
111
            self._outputs,
112
            self._impl_path,
113
            self._function_type,
114
            self._metadata,
115
        )
116

117
    def __hash__(self) -> int:
×
118
        return hash(
×
119
            (
120
                super().__hash__(),
121
                self.or_replace,
122
                self.if_not_exists,
123
                tuple(self.inputs),
124
                tuple(self.outputs),
125
                self.impl_path,
126
                self.function_type,
127
                tuple(self.metadata),
128
            )
129
        )
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