-
Notifications
You must be signed in to change notification settings - Fork 1
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
Issue #162: Add endpoint to retrieve pictures associated with an inspection #225
Open
snakedye
wants to merge
3
commits into
main
Choose a base branch
from
162-inspection-images
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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 suggest
get /files/<file_id>
.Because:
get inspections/<id>
should return a list of file ids as part of the data. This is probably what we need to work on most.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.
Right now, the pipeline does support pdfs. I don't think the refactored pipeline @saratavakoli77 and @Endlessflow are working on does. However, the application (frontend+backend) itself doesn't support sending pdfs and neither does the datastore.
The datastore can return a
picture_set_id
which I think is akin to a folder in a container (might change in the future), @Francois-Werbrouck can correct me on that. If we have that, I don't think we need to return a full list of files.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.
Still, a broader term than
pictures
might give us more cushion for later.In the frontend, we need the images themselves (hence their ids), not so much their container or set. We want to be able to fetch the images from the backend individually, in parallel, etc.. not always as a set.
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'd like to get @Francois-Werbrouck opinion on this because it's directly linked to the refactoring he's doing. Personally, I can't think of a use case where we'd benefit from fetching images individually. Even if you have the IDs, how do you know which to fetch?
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.
Sure. It's a matter of good design that allows for easy future improvement. In an optimization process in the frontend we might fetch individual images only when required instead of fetching them all at once.
Question for both of you: how complex would it be to implement that?
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.
Picture
. Handeling pdf files shouldn't be a problem.This soon will be answered but I dont see the necessity.
I dont get why we would want to make it more complex, when will we want for an Inspection to partially fetch the files of its list? If the BE wants to include parallelism, you can simply fetch the files individually.
My opinion on the back end requesting just a bunch of files (pictures) by ID doesn't suit a need in the user-application, but I see some utility for our Data Analyst. However at this point I don't see much urgency in allowing fetching a bunch of files just by IDs with no regards for their placement.
I think sticking to either fetching one file or the entire folder content would be better for the Overall Datastore and having App specific fetching are what's most important at the moment on the application when fetching the files.
If the need for our DataAnalyst to fetch N files by IDs arise because they scraped the DB for specific files, I think it wont be that complex or time consuming to implement it at that point.
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.
Ok. I'm putting this into formal request for this issue. In the frontend I need to obtain the file ids associated with an inspection. You guys decide how you want to implement it. I don't mind receiving a set / container id in the inspection data but the backend must allow me to get the individual file ids somehow, which will then be used to query the file data directly, however seen fit.