From 3672b10dec607b37a8e9be9a82c3fbdf43fffd33 Mon Sep 17 00:00:00 2001 From: Jeffrey Kinard Date: Thu, 17 Oct 2024 18:36:32 -0400 Subject: [PATCH 1/2] Fix beam.Row.__eq__ to ignore key order Signed-off-by: Jeffrey Kinard --- sdks/python/apache_beam/pvalue.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/pvalue.py b/sdks/python/apache_beam/pvalue.py index 5a400570cf18..53cd7a9f91bb 100644 --- a/sdks/python/apache_beam/pvalue.py +++ b/sdks/python/apache_beam/pvalue.py @@ -682,7 +682,8 @@ def __eq__(self, other): type(self) == type(other) and len(self.__dict__) == len(other.__dict__) and all( s == o for s, - o in zip(self.__dict__.items(), other.__dict__.items()))) + o in zip( + sorted(self.__dict__.items()), sorted(other.__dict__.items())))) def __reduce__(self): return _make_Row, tuple(self.__dict__.items()) From 01a98dc4e5b4e3c937519846f9335093f66bd48c Mon Sep 17 00:00:00 2001 From: Jeffrey Kinard Date: Thu, 17 Oct 2024 18:46:47 -0400 Subject: [PATCH 2/2] fix line break Signed-off-by: Jeffrey Kinard --- sdks/python/apache_beam/pvalue.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdks/python/apache_beam/pvalue.py b/sdks/python/apache_beam/pvalue.py index 53cd7a9f91bb..c6057fcf4d37 100644 --- a/sdks/python/apache_beam/pvalue.py +++ b/sdks/python/apache_beam/pvalue.py @@ -681,8 +681,7 @@ def __eq__(self, other): return ( type(self) == type(other) and len(self.__dict__) == len(other.__dict__) and all( - s == o for s, - o in zip( + s == o for (s, o) in zip( sorted(self.__dict__.items()), sorted(other.__dict__.items())))) def __reduce__(self):