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


##########
tests/providers/apache/beam/operators/test_beam.py:
##########
@@ -286,7 +287,7 @@ def test_exec_dataflow_runner(self, gcs_hook, 
dataflow_hook_mock, beam_hook_mock
             "jobName": job_name,
             "stagingLocation": "gs://test/staging",
             "region": "us-central1",
-            "labels": {"foo": "bar", "airflow-version": TEST_VERSION},
+            "labels": {"foo": "bar"},

Review Comment:
   It's correct fix.
   
   The test failed because it should NOT get version label. if you look at 
BeamRunJavaPipelineOperator - you will see that it does NOT set default labels 
in the constructor - they are only set by `BeamDataflowMixin`s  
`__get_dataflow_pipeline_options` - in the `execute` method. But those defaults 
were updated by both PythonPipelineOperator and GoPilpelineOperator - in their 
constructors.  So the test should not expect the version (because this test 
does not run `execute' of Java operator.  However in most cases this test got 
"airflow-version" if any of the Python/Go operator tests were run before - 
because default options were modified by them.
   
   Now - I have no idea if Python and Go should also NOT have the defaults in 
the constructor - it is likely, because they use the same mixin, however - I am 
not sure. And I decided to play safe and rather than remove setting the 
defaults I decided to get rid of the side effect by deepcopyng the dict before 
setting the defaults.
   
   



-- 
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