potiuk commented on code in PR #27264:
URL: https://github.com/apache/airflow/pull/27264#discussion_r1199598710


##########
tests/providers/google/cloud/utils/test_mlengine_operator_utils.py:
##########
@@ -114,6 +113,11 @@ def test_create_evaluate_ops(self, mock_beam_pipeline, 
mock_python):
         mock_beam_pipeline.assert_called_once_with(evaluate_prediction)
         mock_python.assert_called_once_with(evaluate_summary)
 
+        # importing apache_beam elsewhere modifies the metrics. In order to 
avoid metrics being modified

Review Comment:
   Also interesting one. Just importing apache_beam has a sidde effect on those 
tests for 3.11 - but I mitigated it by lazy creation of METRIC_FN_ENCODED so it 
won't matter if the import is done and when. Previously, the top-level imports 
in Pytest (when all google tests were run) caused apache_beam to be imported 
between the top-level import here and execution of the test. That was really 
interesting because the tests failed if we collected the mlengine_summary tests 
AFTER collecting this test. That was a little 🤯 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to