Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/connectors/test_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def test_classify_read_four_cols_error(mocker):
)

def test_classify_write_logs_new_model_id_integration(caplog):
caplog.set_level(logging.INFO)
df = pd.DataFrame({
'Example': ['apple', 'banana'],
'Category': ['fruit', 'fruit'],
Expand Down Expand Up @@ -1425,6 +1426,7 @@ def test_lookup_write_logs_new_model_id(caplog):
"""
Integration test for lookup model creation logging
"""
caplog.set_level(logging.INFO)
df = pd.DataFrame({
'Key': ['apple', 'banana'],
'Value': ['fruit', 'fruit']
Expand Down Expand Up @@ -1535,6 +1537,7 @@ def test_standardize_write_logs_new_model_id(caplog):
"""
Integration test for standardize model creation logging
"""
caplog.set_level(logging.INFO)
df = pd.DataFrame({
'Find': ['ASAP', 'ETA'],
'Replace': ['As Soon As Possible', 'Estimated Time of Arrival'],
Expand Down
14 changes: 7 additions & 7 deletions tests/recipes/test_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_recipe_by_production_version():
"""
Test running a recipe using a model ID and production version
"""
df = wrangles.recipe.run("a6bac9e7-2388-4347")
df = wrangles.recipe.run("e954717c-fb9c-4c47")
assert (
len(df) == 20 and
list(df.columns) == ["header"]
Expand All @@ -154,10 +154,10 @@ def test_recipe_by_production_semantic_version(mocker):
return_value={"recipe": "{}"}
)

wrangles.recipe.run("a6bac9e7-2388-4347:production")
wrangles.recipe.run("e954717c-fb9c-4c47:production")

model_content.assert_called_once_with(
"a6bac9e7-2388-4347",
"e954717c-fb9c-4c47",
"production-version-id"
)

Expand All @@ -178,17 +178,17 @@ def test_recipe_by_production_semantic_version_falls_back_to_latest(
return_value={"recipe": "{}"}
)

wrangles.recipe.run("a6bac9e7-2388-4347:production")
wrangles.recipe.run("e954717c-fb9c-4c47:production")

model_content.assert_called_once_with("a6bac9e7-2388-4347", None)
model_content.assert_called_once_with("e954717c-fb9c-4c47", None)
assert "No production version exists, defaulting to latest version" in caplog.text


def test_recipe_by_version_latest():
"""
Test running a recipe using a model ID and latest version
"""
df = wrangles.recipe.run("a6bac9e7-2388-4347:latest")
df = wrangles.recipe.run("e954717c-fb9c-4c47:latest")
assert (
len(df) == 10 and
list(df.columns) == ["header"]
Expand All @@ -198,7 +198,7 @@ def test_recipe_by_latest_version():
"""
Test running a recipe using a model ID and latest version
"""
df = wrangles.recipe.run("02fc0c63-1294-415b")
df = wrangles.recipe.run("1b41d016-7129-4b66")
assert (
len(df) == 15 and
list(df.columns) == ["header"]
Expand Down