From 5b4f85417dc6e75150a2c42d536366508321aa08 Mon Sep 17 00:00:00 2001 From: Akarys Shorabek Date: Wed, 29 Jan 2025 20:48:14 +0500 Subject: [PATCH 1/3] Fix postcommit python arm workflow --- .../ml/inference/sklearn_inference_it_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py b/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py index c5480234cda6..270454741e11 100644 --- a/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py +++ b/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py @@ -54,6 +54,9 @@ def file_lines_sorted(filepath): @pytest.mark.uses_sklearn @pytest.mark.it_postcommit class SklearnInference(unittest.TestCase): + + # TODO(https://github.com/apache/beam/issues/33796) use older numpy version for python 3.9 and 3.10 + @unittest.skipIf((3, 9, 0) <= sys.version_info < (3, 11, 0), "Beam#33796") def test_sklearn_mnist_classification(self): test_pipeline = TestPipeline(is_integration_test=True) input_file = 'gs://apache-beam-ml/testing/inputs/it_mnist_data.csv' @@ -85,6 +88,9 @@ def test_sklearn_mnist_classification(self): true_label, expected_prediction = expected_outputs[i].split(',') self.assertEqual(predictions_dict[true_label], expected_prediction) + + # TODO(https://github.com/apache/beam/issues/33796) use older numpy version for python 3.9 and 3.10 + @unittest.skipIf((3, 9, 0) <= sys.version_info < (3, 11, 0), "Beam#33796") def test_sklearn_mnist_classification_large_model(self): test_pipeline = TestPipeline(is_integration_test=True) input_file = 'gs://apache-beam-ml/testing/inputs/it_mnist_data.csv' @@ -118,7 +124,8 @@ def test_sklearn_mnist_classification_large_model(self): self.assertEqual(predictions_dict[true_label], expected_prediction) # TODO(https://github.com/apache/beam/issues/27151) use model with sklearn 1.2 - @unittest.skipIf(sys.version_info >= (3, 11, 0), "Beam#27151") + # TODO(https://github.com/apache/beam/issues/33796) use older numpy version for python 3.9 and 3.10 + @unittest.skipIf(sys.version_info >= (3, 9, 0), "Beam#27151") def test_sklearn_regression(self): test_pipeline = TestPipeline(is_integration_test=True) input_file = 'gs://apache-beam-ml/testing/inputs/japanese_housing_test_data.csv' # pylint: disable=line-too-long From 442955133670db4876be36fd498104429193c8cf Mon Sep 17 00:00:00 2001 From: Akarys Shorabek Date: Wed, 29 Jan 2025 21:21:29 +0500 Subject: [PATCH 2/3] formatting --- .../python/apache_beam/ml/inference/sklearn_inference_it_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py b/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py index 270454741e11..179aafbf75b1 100644 --- a/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py +++ b/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py @@ -88,7 +88,6 @@ def test_sklearn_mnist_classification(self): true_label, expected_prediction = expected_outputs[i].split(',') self.assertEqual(predictions_dict[true_label], expected_prediction) - # TODO(https://github.com/apache/beam/issues/33796) use older numpy version for python 3.9 and 3.10 @unittest.skipIf((3, 9, 0) <= sys.version_info < (3, 11, 0), "Beam#33796") def test_sklearn_mnist_classification_large_model(self): From d4c04174b41da5e5b7a201c512792600097bee87 Mon Sep 17 00:00:00 2001 From: Akarys Shorabek Date: Wed, 29 Jan 2025 21:49:44 +0500 Subject: [PATCH 3/3] formatting --- .../apache_beam/ml/inference/sklearn_inference_it_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py b/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py index 179aafbf75b1..c82b1698981b 100644 --- a/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py +++ b/sdks/python/apache_beam/ml/inference/sklearn_inference_it_test.py @@ -55,7 +55,7 @@ def file_lines_sorted(filepath): @pytest.mark.it_postcommit class SklearnInference(unittest.TestCase): - # TODO(https://github.com/apache/beam/issues/33796) use older numpy version for python 3.9 and 3.10 + # TODO(https://github.com/apache/beam/issues/33796) use older numpy @unittest.skipIf((3, 9, 0) <= sys.version_info < (3, 11, 0), "Beam#33796") def test_sklearn_mnist_classification(self): test_pipeline = TestPipeline(is_integration_test=True) @@ -88,7 +88,7 @@ def test_sklearn_mnist_classification(self): true_label, expected_prediction = expected_outputs[i].split(',') self.assertEqual(predictions_dict[true_label], expected_prediction) - # TODO(https://github.com/apache/beam/issues/33796) use older numpy version for python 3.9 and 3.10 + # TODO(https://github.com/apache/beam/issues/33796) use older numpy @unittest.skipIf((3, 9, 0) <= sys.version_info < (3, 11, 0), "Beam#33796") def test_sklearn_mnist_classification_large_model(self): test_pipeline = TestPipeline(is_integration_test=True) @@ -123,7 +123,7 @@ def test_sklearn_mnist_classification_large_model(self): self.assertEqual(predictions_dict[true_label], expected_prediction) # TODO(https://github.com/apache/beam/issues/27151) use model with sklearn 1.2 - # TODO(https://github.com/apache/beam/issues/33796) use older numpy version for python 3.9 and 3.10 + # TODO(https://github.com/apache/beam/issues/33796) use older numpy @unittest.skipIf(sys.version_info >= (3, 9, 0), "Beam#27151") def test_sklearn_regression(self): test_pipeline = TestPipeline(is_integration_test=True)