Skip to content

Commit

Permalink
feat: func metadata support float/bool
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav274 committed Oct 17, 2023
1 parent 61af3ed commit 7c8b6da
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions evadb/catalog/models/function_metadata_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from sqlalchemy.orm import relationship

from evadb.catalog.models.base_model import BaseModel
from evadb.catalog.models.utils import FunctionMetadataCatalogEntry
from evadb.catalog.models.utils import FunctionMetadataCatalogEntry, TextPickleType


class FunctionMetadataCatalog(BaseModel):
Expand All @@ -34,7 +34,7 @@ class FunctionMetadataCatalog(BaseModel):
__tablename__ = "function_metadata_catalog"

_key = Column("key", String(100))
_value = Column("value", String(100))
_value = Column("value", TextPickleType())
_function_id = Column(
"function_id", Integer, ForeignKey("function_catalog._row_id")
)
Expand Down
2 changes: 1 addition & 1 deletion evadb/parser/evadb.lark
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function_metadata: function_metadata_key function_metadata_value

function_metadata_key: uid

function_metadata_value: string_literal | decimal_literal
function_metadata_value: constant

vector_store_type: USING (FAISS | QDRANT | PINECONE | PGVECTOR | CHROMADB)

Expand Down
6 changes: 6 additions & 0 deletions evadb/parser/lark_visitor/_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ def array_literal(self, tree):
res = ConstantValueExpression(np.array(array_elements), ColumnType.NDARRAY)
return res

def boolean_literal(self, tree):
text = tree.children[0]
if text == "TRUE":
return ConstantValueExpression(True, ColumnType.BOOLEAN)
return ConstantValueExpression(False, ColumnType.BOOLEAN)

def constant(self, tree):
for child in tree.children:
if isinstance(child, Tree):
Expand Down

0 comments on commit 7c8b6da

Please sign in to comment.