Skip to content

Commit

Permalink
fix(tester): allow any infer's result columns order
Browse files Browse the repository at this point in the history
  • Loading branch information
Caceresenzo committed May 11, 2023
1 parent d17bf5e commit e9ae749
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crunch/__version__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'crunch-cli'
__description__ = 'crunch-cli - CLI of the CrunchDAO Platform'
__version__ = '1.1.2'
__version__ = '1.1.3'
__author__ = 'Enzo CACERES'
__author_email__ = '[email protected]'
__url__ = 'https://github.com/crunchdao/crunch-cli'
4 changes: 2 additions & 2 deletions crunch/ensure.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def is_dataframe(input, name: str):
def return_infer(result) -> pandas.DataFrame:
is_dataframe(result, "prediction")

expected = ["id", "date", "value"]
got: typing.List[str] = list(result.columns)
expected = {"id", "date", "value"}
got: typing.Set[str] = set(result.columns)

if got != expected:
logging.error(f"prediction expected columns: `{expected}` but got `{got}`")
Expand Down
30 changes: 29 additions & 1 deletion examples/test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
" print(\"model_directory\", model_directory)\n",
" print(\"x_test\", len(x_test))\n",
"\n",
" return pandas.DataFrame(columns=['id', 'date', 'value'])\n",
" return pandas.DataFrame(columns=['date', 'id', 'value'])\n",
" # return pandas.DataFrame()\n"
]
},
Expand All @@ -156,6 +156,34 @@
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit e9ae749

Please sign in to comment.