-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new error cases for invalid io signatures, modules not fond, an…
…d column names not matching for custom functions
- Loading branch information
Showing
6 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import pandas as pd | ||
|
||
from evadb.catalog.catalog_type import ColumnType, NdArrayType | ||
from evadb.functions.abstract.abstract_function import AbstractFunction | ||
from evadb.functions.decorators.decorators import forward, setup | ||
from evadb.functions.decorators.io_descriptors.data_types import PandasDataframe | ||
|
||
class InvalidSignatureInput(AbstractFunction): | ||
""" | ||
Arguments: | ||
None | ||
Input Signatures: | ||
multiple input dataframes which is an invalid input signature | ||
""" | ||
@property | ||
def name(self) -> str: | ||
return "InvalidSignature" | ||
|
||
@setup(cacheable=False) | ||
def setup(self) -> None: | ||
# Any setup or initialization can be done here if needed | ||
pass | ||
|
||
@forward( | ||
input_signatures=[ | ||
PandasDataframe( | ||
columns=["col1", "col2"], | ||
column_types=[NdArrayType.STR, NdArrayType.STR], | ||
column_shapes=[(None,), (None,)], | ||
), | ||
PandasDataframe( | ||
columns=["col1", "col2"], | ||
column_types=[NdArrayType.STR, NdArrayType.STR], | ||
column_shapes=[(None,), (None,)], | ||
) | ||
], | ||
output_signatures=[ | ||
PandasDataframe( | ||
columns=["data1", "data2"], | ||
column_types=[NdArrayType.STR, NdArrayType.STR], | ||
column_shapes=[(None,), (None,)], | ||
) | ||
], | ||
) | ||
def forward(self, input_df): | ||
# Create a DataFrame from the parsed data | ||
ans = [] | ||
ans.append({'data1': 'data1', 'data2': 'data2'}) | ||
output_dataframe = pd.DataFrame(ans, columns=['data1', 'data2']) | ||
|
||
return output_dataframe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import pandas as pd | ||
|
||
from evadb.catalog.catalog_type import ColumnType, NdArrayType | ||
from evadb.functions.abstract.abstract_function import AbstractFunction | ||
from evadb.functions.decorators.decorators import forward, setup | ||
from evadb.functions.decorators.io_descriptors.data_types import PandasDataframe | ||
|
||
class InvalidSignatureInput(AbstractFunction): | ||
""" | ||
Arguments: | ||
None | ||
Input Signatures: | ||
multiple input dataframes which is an invalid input signature | ||
""" | ||
@property | ||
def name(self) -> str: | ||
return "InvalidSignature" | ||
|
||
@setup(cacheable=False) | ||
def setup(self) -> None: | ||
# Any setup or initialization can be done here if needed | ||
pass | ||
|
||
@forward( | ||
input_signatures=[ | ||
PandasDataframe( | ||
columns=["col1", "col2"], | ||
column_types=[NdArrayType.STR, NdArrayType.STR], | ||
column_shapes=[(None,), (None,)], | ||
) | ||
], | ||
output_signatures=[ | ||
PandasDataframe( | ||
columns=["data1", "data2"], | ||
column_types=[NdArrayType.STR, NdArrayType.STR], | ||
column_shapes=[(None,), (None,)], | ||
), | ||
PandasDataframe( | ||
columns=["data1", "data2"], | ||
column_types=[NdArrayType.STR, NdArrayType.STR], | ||
column_shapes=[(None,), (None,)], | ||
) | ||
], | ||
) | ||
def forward(self, input_df): | ||
# Create a DataFrame from the parsed data | ||
ans = [] | ||
ans.append({'data1': 'data1', 'data2': 'data2'}) | ||
output_dataframe = pd.DataFrame(ans, columns=['data1', 'data2']) | ||
output_df_2 = pd.DataFrame(ans, columns=['data1', 'data2']) | ||
|
||
return output_dataframe, output_df_2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters