tvalentyn commented on a change in pull request #15734:
URL: https://github.com/apache/beam/pull/15734#discussion_r730112634
##########
File path: sdks/python/apache_beam/dataframe/frames_test.py
##########
@@ -187,7 +187,7 @@ def _run_test(
else:
cmp = lambda x: np.isclose(expected, x)
else:
- cmp = expected.__eq__
+ cmp = lambda x: x == expected
Review comment:
1) this sounds more like `eq` than `cmp`.
2) Don't have full context about the classes involved here, but if
expected.__eq__(x) doesn't work well, will x.__eq__(expected) always work? Note
that `x == expected` may fall back to `expected.__eq__(x)` in some casses.
##########
File path: sdks/python/apache_beam/dataframe/frames_test.py
##########
@@ -187,7 +187,7 @@ def _run_test(
else:
cmp = lambda x: np.isclose(expected, x)
else:
- cmp = expected.__eq__
+ cmp = lambda x: x == expected
Review comment:
1) this sounds more like `eq` than `cmp`.
2) Don't have full context about the classes involved here, but if
`expected.__eq__(x)` doesn't work well, will `x.__eq__(expected)` always work?
Note that `x == expected` may fall back to `expected.__eq__(x)` in some casses.
--
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]