-
Notifications
You must be signed in to change notification settings - Fork 692
chore: remove dead code and add util tests #11832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ibis/tests/test_util.py
Outdated
| "val", | ||
| [ | ||
| pytest.param([1, 2, 3], id="list"), | ||
| pytest.param({"a": 1}, id="dict"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this entire test:
- the dict case isn't being used
- we don't want to guarantee identity stability only equality stability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, I guess we can add to the contract that identity is preserved.
but still, we don't need the paramaterization. just simplify to
def test_promote_list_identity():
val = [1,2,3]
assert promote_list(val) is val
ibis/tests/test_util.py
Outdated
| pytest.param((1, 2, 3), id="tuple"), | ||
| ], | ||
| ) | ||
| def test_promote_tuple_identity(val): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify to
def test_promote_tuple_identity():
val = (1,2,3)
assert promote_tuple(val) is val
| return node.output_type.__name__ | ||
| except (AttributeError, NotImplementedError): | ||
| return "\u2205" # empty set character | ||
| return "\u2205" # empty set character |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the impact of this change?
|
Thanks for the review feedback! I've addressed all comments: Test Simplifications (commits c94cbc7)Simplified both identity tests per your suggestions:
def test_promote_list_identity():
"""Test that lists are returned as-is (same object)."""
val = [1, 2, 3]
assert promote_list(val) is val
def test_promote_tuple_identity():
"""Test that tuples are returned as-is (same object)."""
val = (1, 2, 3)
assert promote_tuple(val) is valImpact Explanation for
|
Description of changes
visualize.pyforoutput_type.__name__fallback (was marked as TODO for removal)promote_listandpromote_tupleutility functions (resolves TODO in test file)