This is an automated email from the ASF dual-hosted git repository.

robertwb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 04fe4b53433 Consider underlying providers in both directions when 
doing affinity test.
     new 85d4fcf7f37 Merge pull request #29586 from Better affinity test.
04fe4b53433 is described below

commit 04fe4b53433f67e1a9e2d0a83d715100795a1bc3
Author: Robert Bradshaw <[email protected]>
AuthorDate: Fri Dec 1 10:13:49 2023 -0800

    Consider underlying providers in both directions when doing affinity test.
---
 sdks/python/apache_beam/yaml/yaml_provider.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sdks/python/apache_beam/yaml/yaml_provider.py 
b/sdks/python/apache_beam/yaml/yaml_provider.py
index 01e39b770c9..25cc366ec2c 100644
--- a/sdks/python/apache_beam/yaml/yaml_provider.py
+++ b/sdks/python/apache_beam/yaml/yaml_provider.py
@@ -109,9 +109,9 @@ class Provider:
     # E.g. we could look at the the expected environments themselves.
     # Possibly, we could provide multiple expansions and have the runner itself
     # choose the actual implementation based on fusion (and other) criteria.
-    return (
-        self.underlying_provider()._affinity(other) +
-        other.underlying_provider()._affinity(self))
+    a = self.underlying_provider()
+    b = other.underlying_provider()
+    return a._affinity(b) + b._affinity(a)
 
   def _affinity(self, other: "Provider"):
     if self is other or self == other:

Reply via email to