Skip to content

Commit

Permalink
Merge pull request #29586 from Better affinity test.
Browse files Browse the repository at this point in the history
Consider underlying providers in both directions when doing affinity test.
  • Loading branch information
robertwb authored Dec 1, 2023
2 parents 39e1615 + 04fe4b5 commit 85d4fcf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdks/python/apache_beam/yaml/yaml_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def affinity(self, other: "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:
Expand Down

0 comments on commit 85d4fcf

Please sign in to comment.