-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Dynamic options: add data table filter #12941
Dynamic options: add data table filter #12941
Conversation
f99c729
to
725f3c2
Compare
725f3c2
to
d608ba1
Compare
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.
This is really cool, but from_file
should not be able to reference files outside of the tool dir.
<inputs> | ||
<param name="dynamic_select" type="select"> | ||
<!-- initialize options from file (contains all entries that could be added to the data table) --> | ||
<options from_file="../test/functional/tool-data/test_file.tsv"> |
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.
That's a security issue and should not work.
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.
Do you have an idea how to specify another dir during tests, eg test/functional/tool-data/
?
I guess we can check if os.path.abspath(path)
startswith the tool-data
dir... could do this in another PR.
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.
It's fine to do this in another PR, but we shouldn't merge this before we sorted that out.
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.
Also there is a safe_contains
function in galaxy.util you can use
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.
ae4c401 contains a possible solution for:
Do you have an idea how to specify another dir during tests, eg test/functional/tool-data/?
Any comments?
8065a08
to
2a47e13
Compare
I'm bumping this to 22.05, we still need to figure out what's up with #12941 (comment) |
fix missing import
2a47e13
to
bce9300
Compare
…tthias/galaxy into topic/data-table-filter
from_file does not work (relative paths are not possible .. and in the tests we do not know the abs path)
…tthias/galaxy into topic/data-table-filter
`Exception: Cannot specify outputs in a test expecting failure.`
@@ -490,6 +490,190 @@ def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"): | |||
) | |||
|
|||
|
|||
FILTER_REQUIRED_ATTRIBUTES = { |
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.
@jmchilton is this going to conflict with your modeling work ?
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.
Could you split the linting from the table filter work ?
Separate PR? |
yes |
Co-authored-by: Marius van den Beek <[email protected]>
I have a hard time to find the motivation to invest any more time here. It seems that this will just create another PR that will not be merged for years. |
This reverts commit 77434f2.
This PR was merged without a "kind/" label, please correct. |
In a recent gitter discussion (https://gitter.im/galaxy-iuc/iuc?at=6190aeff8c019f0d0b93414b) it was asked for a way to have a select list containing only elements that are not yet in a data table.. Et voila .. there is a data table filter.
The test tool shows how it might be used:
from_file
also had no test so far)For the first part I needed to apply a little hack:
from_file
seems to assume that the file is intool-data
in the Galaxy root. It would be much nicer if the file would be loaded from the dir (or atool-data
dir in this dir) containing the tool. Otherwise we would not meet the use case of the gitter discussion.I did not think about other possible use cases (e.g. intersections of data tables) and possibly needed attributes...
Ping @mvdbeek @pvanheus
The PR also adds more linting to filters.
How to test the changes?
(Select all options that apply)
License