• 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/models/udf_cache_catalog.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 ast import literal_eval
×
16
from typing import Tuple
×
17

18
from sqlalchemy import Column, ForeignKey, Integer, String, UniqueConstraint
×
19
from sqlalchemy.orm import relationship
×
20

21
from evadb.catalog.models.association_models import (
×
22
    depend_column_and_udf_cache,
23
    depend_udf_and_udf_cache,
24
)
25
from evadb.catalog.models.base_model import BaseModel
×
26
from evadb.catalog.models.utils import UdfCacheCatalogEntry
×
27

28

29
class UdfCacheCatalog(BaseModel):
×
30
    """The `UdfCacheCatalog` catalog stores information about the udf cache.
31

32
    It maintains the following information for each cache entry:
33
    `_row_id:` An autogenerated identifier for the cache entry.
34
    `_name:` The name of the cache, also referred to as the unique UDF signature.
35
    `_udf_id:` `_row_id` of the UDF in the `UdfCatalog` for which the cache is built.
36
    `_args:` A serialized list of `ColumnCatalog` `_row_id`s for each argument of the
37
    UDF. If the argument is a function expression, it stores the string representation
38
    of the expression tree.
39
    """
40

41
    __tablename__ = "udf_cache"
×
42

43
    _name = Column("name", String(128))
×
44
    _udf_id = Column(
×
45
        "udf_id", Integer, ForeignKey("udf_catalog._row_id", ondelete="CASCADE")
46
    )
47
    _cache_path = Column("cache_path", String(256))
×
48
    _args = Column("args", String(1024))
×
49

50
    __table_args__ = (UniqueConstraint("name", "udf_id"), {})
×
51

52
    _col_depends = relationship(
×
53
        "ColumnCatalog",
54
        secondary=depend_column_and_udf_cache,
55
        back_populates="_dep_caches",
56
        # cascade="all, delete-orphan",
57
    )
58

59
    _udf_depends = relationship(
×
60
        "UdfCatalog",
61
        secondary=depend_udf_and_udf_cache,
62
        back_populates="_dep_caches",
63
        # cascade="all, delete-orphan",
64
    )
65

66
    def __init__(self, name: str, udf_id: int, cache_path: str, args: Tuple[str]):
×
67
        self._name = name
×
68
        self._udf_id = udf_id
×
69
        self._cache_path = cache_path
×
70
        self._args = str(args)
×
71

72
    def as_dataclass(self) -> "UdfCacheCatalogEntry":
×
73
        udf_depends = [obj._row_id for obj in self._udf_depends]
×
74
        col_depends = [obj._row_id for obj in self._col_depends]
×
75
        return UdfCacheCatalogEntry(
×
76
            row_id=self._row_id,
77
            name=self._name,
78
            udf_id=self._udf_id,
79
            cache_path=self._cache_path,
80
            args=literal_eval(self._args),
81
            udf_depends=udf_depends,
82
            col_depends=col_depends,
83
        )
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