PILOT-2689: update the item_path in attribute attachment to item_id - #40
Merged
Conversation
Contributor
hugoantunes
suggested changes
Apr 13, 2023
|
|
||
| # finish the upload once all on success api return | ||
| # otherwise wait for 1 second and check again | ||
| for res in on_success_res: |
Contributor
There was a problem hiding this comment.
You can use the .wait() to ensure that the task is finished.
Suggested change
| for res in on_success_res: | |
| [res.wait() for res in on_success_res] |
| num_of_file = len(upload_file_path) | ||
| logger.info(f'Upload Time: {time.time() - upload_start_time:.2f}s for {num_of_file:d} files') | ||
|
|
||
| return pre_upload_infos |
Contributor
There was a problem hiding this comment.
do we use something else than the file.id? If not I would only return the id.
Member
Author
There was a problem hiding this comment.
yeah will return item_id only
| num_of_file = len(upload_file_path) | ||
| logger.info(f'Upload Time: {time.time() - upload_start_time:.2f}s for {num_of_file:d} files') | ||
|
|
||
| return pre_upload_infos |
Contributor
There was a problem hiding this comment.
Now that simple_upload you have to add the return typing.
|
|
||
| # finish the upload once all on success api return | ||
| # otherwise wait for 1 second and check again | ||
| for res in on_success_res: |
Contributor
There was a problem hiding this comment.
You can use the .wait() to ensure that the task is finished.
| from app.services.output_manager.error_handler import customized_error_msg | ||
|
|
||
|
|
||
| def test_file_upload_command_success(mocker, cli_runner): |
Contributor
There was a problem hiding this comment.
Do we really need to mock all of this?
hugoantunes
approved these changes
Apr 13, 2023
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.
Summary
in the old logic, the attribute attachment will use the item name + path to identify the file. now with new pre-registration workflow, the item_id is pre-generated and will can use it for identification.
should merge with bff-cli api update: https://github.com/PilotDataPlatform/bff-cli/pull/45
JIRA Issues
PILOT-2689
Type of Change
Please delete options that are not relevant.
Testing
Are there any new or updated tests to validate the changes?
Test Directions
update the test case for attribute attachment