Skip to content

Commit

Permalink
test(snowflake): enable xgboost model test again
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored Jun 14, 2024
1 parent 2124ccc commit 44224b1
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions ibis/backends/snowflake/tests/test_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import ibis
import ibis.expr.datatypes as dt
from ibis import udf
from ibis.backends.tests.errors import SnowflakeProgrammingError


@udf.scalar.builtin
Expand Down Expand Up @@ -94,14 +93,6 @@ def test_builtin_agg_udf(con):
tm.assert_frame_equal(result, expected)


@pytest.mark.xfail(
reason=(
"000603 (XX000): "
"SQL execution internal error: "
"Processing aborted due to error 300010:2392087340; incident 4953102."
),
raises=SnowflakeProgrammingError,
)
def test_xgboost_model(con):
from ibis import _

Expand All @@ -112,12 +103,19 @@ def predict_price(
carat_scaled: float, cut_encoded: int, color_encoded: int, clarity_encoded: int
) -> int:
import sys
from pathlib import Path

import joblib
import pandas as pd

import_dir = sys._xoptions.get("snowflake_import_directory")
model = joblib.load(f"{import_dir}model.joblib")
import_dir = Path(sys._xoptions.get("snowflake_import_directory"))
assert import_dir.exists(), import_dir

model_path = import_dir / "model.joblib"
assert model_path.exists(), model_path

model = joblib.load(model_path)

df = pd.concat(
[carat_scaled, cut_encoded, color_encoded, clarity_encoded], axis=1
)
Expand Down

0 comments on commit 44224b1

Please sign in to comment.