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

georgia-tech-db / eva / #754

04 Sep 2023 09:54PM UTC coverage: 74.807% (-5.5%) from 80.336%
#754

push

circle-ci

jiashenC
update case

8727 of 11666 relevant lines covered (74.81%)

0.75 hits per line

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

67.65
/evadb/parser/lark_visitor/_drop_statement.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 lark import Tree
1✔
16

17
from evadb.parser.drop_object_statement import DropObjectStatement
1✔
18
from evadb.parser.types import ObjectType
1✔
19

20

21
class DropObject:
1✔
22
    def drop_table(self, tree):
1✔
23
        table_name = None
1✔
24
        if_exists = False
1✔
25

26
        for child in tree.children:
1✔
27
            if isinstance(child, Tree):
1✔
28
                if child.data == "if_exists":
1✔
29
                    if_exists = True
1✔
30
                elif child.data == "uid":
1✔
31
                    table_name = self.visit(child)
1✔
32

33
        return DropObjectStatement(ObjectType.TABLE, table_name, if_exists)
1✔
34

35
    # Drop Index
36
    def drop_index(self, tree):
1✔
37
        index_name = None
×
38
        if_exists = False
×
39

40
        for child in tree.children:
×
41
            if isinstance(child, Tree):
×
42
                if child.data == "if_exists":
×
43
                    if_exists = True
×
44
                elif child.data == "uid":
×
45
                    index_name = self.visit(child)
×
46

47
        return DropObjectStatement(ObjectType.INDEX, index_name, if_exists)
×
48

49
    # Drop Function
50
    def drop_function(self, tree):
1✔
51
        function_name = None
1✔
52
        if_exists = False
1✔
53

54
        for child in tree.children:
1✔
55
            if isinstance(child, Tree):
1✔
56
                if child.data == "uid":
1✔
57
                    function_name = self.visit(child)
1✔
58
                elif child.data == "if_exists":
×
59
                    if_exists = True
×
60

61
        return DropObjectStatement(ObjectType.FUNCTION, function_name, if_exists)
1✔
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