[AIR] Run test_tensorflow_predictors.py and fix failing tests (#25208)

`test_tensorflow_predictors` wasn't running in CI. This fixes that and also fixes broken tests.

Co-authored-by: Amog Kamsetty <amogkamsetty@yahoo.com>
This commit is contained in:
Balaji Veeramani 2022-05-26 15:15:03 -07:00 committed by GitHub
parent d2f0c3b2f6
commit 1ad5e619e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,7 +53,7 @@ def test_predict():
predictions = predictor.predict(data_batch)
assert len(predictions) == 3
assert predictions.to_numpy().flatten().round().tolist() == [2, 4, 6]
assert predictions.to_numpy().flatten().tolist() == [2, 4, 6]
assert hasattr(predictor.preprocessor, "_batch_transformed")
@ -67,7 +67,7 @@ def test_predict_feature_columns():
predictions = predictor.predict(data_batch, feature_columns=[0])
assert len(predictions) == 3
assert predictions.to_numpy().flatten().round().tolist() == [2, 4, 6]
assert predictions.to_numpy().flatten().tolist() == [2, 4, 6]
assert hasattr(predictor.preprocessor, "_batch_transformed")
@ -82,3 +82,10 @@ def test_predict_no_preprocessor():
assert len(predictions) == 3
assert predictions.to_numpy().flatten().tolist() == [1, 2, 3]
if __name__ == "__main__":
import pytest
import sys
sys.exit(pytest.main(["-v", "-x", __file__]))