Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add --detect_header and DatasetColumn support #67
Add --detect_header and DatasetColumn support #67
Changes from all commits
29446de
30dd5a7
95d6106
3f559af
0f76448
cfe97c4
9daa9f3
9b158f5
33de3ba
3b8ff20
06ad062
99383af
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Similarly to #59, adding a new key-value argument will likely break other contexts e.g.
BulkToMapAnnotationContext
.#60 is one way to fix this issue but as indicated in the PR, it would be good to find a more scalable strategy
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.
I totally missed this, I was under the impression that column_types is already a present key-value argument, here in the
populate
option, and I'm just now passing in a non-None value instead of the default None.But currently,
omero metadata populate Screen:51 -n --file example.csv --detect_header --context bulkmap
does fail with a similar exception. I will discuss with @emilroz to see if we could brainstorm a more scalable solution.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.
No worries. The absence of integration tests for the other contexts does not help detecting this use case.
As mentioned in #59 (comment), using
**kwargs
might be an option to handle undefined keywords arguments in a lenient manner.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.
Addressed in 9b158f5
@sbesson Now that
**kwargs
is used forDeleteMapAnnotationContext
andBulkToMapAnnotationContext
, there are some keyword arguments that are not used and could be cleaned up. Do you think it's appropriate to clean up here or later in a different 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.
If that's okay with you I think cleaning up unused arguments in a follow-up PR would likely simplify the review process
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.
I assume these improvements build on top of the
DatasetColumn
implementation in ome/omero-py#309. Is the requirement for the new API only client-side or will a server need to be upgraded with a version ofomero-py
containing these changes to use this new functionality?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.
Correct. During testing, I needed to upgrade my server omero-py with the new DatasetColumn implementation to use the new
--detect_header
functionality. Otherwise, I'd get an exception about DatasetColum not implemented when using a dataset ID column with'dataset'
as a header type .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 remember which call led to the server exception and the exception type thrown by the server? As a general rule, we don't want this plugin to not make particular assumptions. It should be possible to handle both scenarios and fall back to the former logic if
DatasetColumn
is not implemented server-side. Catching the appropriate exception with atry/except
block is the immediate solution that comes to mind unless @joshmoore can think of an alternate way to introspect the server-side OMERO.py version.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.
Other versions are inspectable from the config service, but we'd need to teach the Java process how to inspect the Python process to get that info.
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.
Makes sense. In terms of functional review, I think this means we should probably test this tool against two types of servers: with and without upgraded OMERO.py. The population should succeed in both cases but only the server with an upgraded OMERO.py should populate a
DatasetColumn
.@muhanadz can you add some minimal handling to distinguish between upgraded and non-upgraded servers?