mik-laj commented on a change in pull request #7809: Run Dataflow for ML Engine 
summary in venv
URL: https://github.com/apache/airflow/pull/7809#discussion_r396172233
 
 

 ##########
 File path: airflow/providers/google/cloud/utils/mlengine_operator_utils.py
 ##########
 @@ -225,20 +225,22 @@ def validate_err_and_count(summary):
     metric_fn_encoded = base64.b64encode(dill.dumps(metric_fn, 
recurse=True)).decode()
     evaluate_summary = DataflowCreatePythonJobOperator(
         task_id=(task_prefix + "-summary"),
-        py_options=["-m"],
-        
py_file="airflow.providers.google.cloud.utils.mlengine_prediction_summary",
+        py_file=os.path.join(os.path.dirname(__file__), 
'mlengine_prediction_summary.py'),
         dataflow_default_options=dataflow_options,
         options={
             "prediction_path": prediction_path,
             "metric_fn_encoded": metric_fn_encoded,
             "metric_keys": ','.join(metric_keys)
         },
         py_interpreter=py_interpreter,
+        py_requirements=[
+            'apache-beam[gcp]>=2.14.0'
 
 Review comment:
   We install these libraries in an isolated environment outside of user code. 
In this environment, we only run Airflow code. At this point, Airflow is not a 
framework, but an application. We do not need an extension point here, i.e. 
change versions. Version pinning is a good solution here to maintain stability.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to