Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging new #1429

Open
wants to merge 11 commits into
base: staging
Choose a base branch
from
3 changes: 3 additions & 0 deletions evadb/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

DISCRETE = 0
CONTINUOUS = 1
NO_GPU = -1
Expand All @@ -21,3 +22,5 @@
IFRAMES = "IFRAMES"
AUDIORATE = "AUDIORATE"
DEFAULT_FUNCTION_EXPRESSION_COST = 100
DBFUNCTIONS = __file__[0:-13] + "/functions/"
ENVFUNCTIONS = "./Lib/site-packages/evadb/functions/"
1 change: 1 addition & 0 deletions evadb/functions/function_bootstrap_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
NDARRAY_DIR = "ndarray"
TUTORIALS_DIR = "tutorials"


DummyObjectDetector_function_query = """CREATE FUNCTION IF NOT EXISTS DummyObjectDetector
INPUT (Frame_Array NDARRAY INT8(3, ANYDIM, ANYDIM))
OUTPUT (label NDARRAY STR(1))
Expand Down
23 changes: 22 additions & 1 deletion evadb/parser/create_function_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from pathlib import Path
from typing import List, Tuple

from evadb.configuration.constants import EvaDB_INSTALLATION_DIR
from evadb.parser.create_statement import ColumnDefinition
from evadb.parser.select_statement import SelectStatement
from evadb.parser.statement import AbstractStatement
Expand Down Expand Up @@ -64,7 +65,27 @@ def __init__(
self._if_not_exists = if_not_exists
self._inputs = inputs
self._outputs = outputs
self._impl_path = Path(impl_path) if impl_path else None
if impl_path:
if len(str(impl_path)) < 12:
self._impl_path = Path(impl_path)
elif "DBFUNCTIONS" == str(impl_path)[0:11] and (
str(impl_path)[11:12] == "."
or str(impl_path)[11:12] == "\\"
or str(impl_path)[11:12] == "/"
):
self._impl_path = Path(
str(EvaDB_INSTALLATION_DIR) + "\\functions\\" + str(impl_path)[12:]
)
elif "ENVFUNCTIONS" == str(impl_path)[0:12] and (
str(impl_path)[12:13] == "."
or str(impl_path)[12:13] == "\\"
or str(impl_path)[12:13] == "/"
):
self._impl_path = Path("..\\functions\\" + str(impl_path)[13:])
else:
self._impl_path = Path(impl_path)
else:
self._impl_path = None
self._function_type = function_type
self._query = query
self._metadata = metadata
Expand Down