A new datatractor CLI#16
Merged
Merged
Conversation
ml-evs
reviewed
Mar 26, 2025
Member
ml-evs
left a comment
There was a problem hiding this comment.
Will dig more into this later, just one comment for now!
ml-evs
reviewed
Apr 8, 2025
Comment on lines
+215
to
+220
| try: | ||
| ret = func(**vars(args)) | ||
| if ret is not None and len(ret) > 0: | ||
| print(ret) | ||
| except RuntimeError as e: | ||
| print(e) |
Member
There was a problem hiding this comment.
I think for the CLI, we should try to return valid JSON rather than printing Python dictionaries so it can be piped into other tools, e.g.,
Suggested change
| try: | |
| ret = func(**vars(args)) | |
| if ret is not None and len(ret) > 0: | |
| print(ret) | |
| except RuntimeError as e: | |
| print(e) | |
| try: | |
| ret = func(**vars(args)) | |
| if ret is not None and len(ret) > 0: | |
| print(json.dumps(ret)) | |
| except RuntimeError as e: | |
| print(e) |
This might need some better error handling though.
Contributor
Author
There was a problem hiding this comment.
Yeah that's true, I forgot a printed python dict is not json.
Member
There was a problem hiding this comment.
I've added a guarded JSON dump, also when using probe you now get e.g. {"id": "biologic-mpr", "registered_extractors": ["yadg", "galvani"]} back rather than just the list so its valid JSON.
PeterKraus
commented
Apr 9, 2025
Contributor
Author
PeterKraus
left a comment
There was a problem hiding this comment.
LGTM! (Cannot approve my own PR)
ml-evs
approved these changes
Apr 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses #10 by implementing
datatractor beam input_type input_path- install & extract from filedatatractor probe input_type- return registered Extractors for thatinput_typedatatractor yard extractor_id- return extractor definition from registrydatatractor install extractor_id- install Extractor (optionally into venv)