Skip to content
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

[19.05] Fix input parameter comparisons #9047

Merged

Conversation

mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented Nov 29, 2019

Fixes galaxyproject/tools-iuc#2702 (comment)
Broken in #7826

The implementation of __gt__ and __eq__ is simpler now. One possible breaking change is that a TextToolParameter with value "5" is not equal to a literal 5 anymore. I doubt anyone relied on this behavior.

Fixes galaxyproject/tools-iuc#2702 (comment)
Broken in galaxyproject#7826
Also compares via `float` instead of `int` when other is int,
since that is more reasonable. Otherwise 5.1 > 5 is False.
lib/galaxy/tools/wrappers.py Outdated Show resolved Hide resolved
lib/galaxy/tools/wrappers.py Outdated Show resolved Hide resolved
lib/galaxy/tools/wrappers.py Outdated Show resolved Hide resolved
Cast self instead of other. This fails 5 == '5', which is less magic
(galaxyproject#9047 (comment))
Copy link
Member

@nsoranzo nsoranzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this much better, thanks!

test/unit/tools/test_wrappers.py Outdated Show resolved Hide resolved
test/unit/tools/test_wrappers.py Outdated Show resolved Hide resolved
lib/galaxy/tools/wrappers.py Outdated Show resolved Hide resolved
mvdbeek and others added 2 commits November 29, 2019 14:25
@mvdbeek
Copy link
Member Author

mvdbeek commented Nov 29, 2019

I like this much better, thanks!

Yep, thanks for the help and discussions.

mvdbeek added a commit to mvdbeek/galaxy that referenced this pull request Nov 29, 2019
Cast self instead of other. This fails 5 == '5', which is less magic
(galaxyproject#9047 (comment))
@nsoranzo nsoranzo added this to the 20.01 milestone Nov 29, 2019
@nsoranzo nsoranzo merged commit c0338b3 into galaxyproject:release_19.05 Nov 29, 2019
@nsoranzo nsoranzo deleted the fix_input_parameter_comparisons branch November 29, 2019 15:19
nsoranzo added a commit to nsoranzo/galaxy that referenced this pull request Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants