Skip to content
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

Added scripts to restore submission from spreadsheet. ops-1163 #1165

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ESapenaVentura
Copy link
Collaborator

@ESapenaVentura ESapenaVentura commented Aug 21, 2023

Added scripts with instructions to fix the issue described in #1163

@ESapenaVentura ESapenaVentura self-assigned this Aug 21, 2023
@ESapenaVentura ESapenaVentura mentioned this pull request Aug 21, 2023
1 task
@amnonkhen amnonkhen changed the title Added scripts to restore submission from spreadsheet. ops1163 Added scripts to restore submission from spreadsheet. ops-1163 Aug 23, 2023
json.dump(global_uuid_mapping, f, indent=4, separators=(', ', ': '))

def main(project_uuid, token, spreadsheet_path, submission_uuid):
ingest_api = IngestApi('https://api.ingest.archive.data.humancellatlas.org/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use a hard coded ingest api url.
If you leave it blank, it is taken from the INGEST_API environment variable.
Add a note in the readme to set the correct variable prior to running the script.

Suggested change
ingest_api = IngestApi('https://api.ingest.archive.data.humancellatlas.org/')
ingest_api = IngestApi()



if __name__ == '__main__':
main(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using some argument parsing here.

@ESapenaVentura
Copy link
Collaborator Author

Applied the feedback

Comment on lines 49 to 51
project_uuid = os.getenv('project_uuid')
mongodb_uri = os.getenv('mongodb_uri') or 'mongodb://localhost:27017/'
map_json_path = os.getenv('map_json_path') or 'uuid_mapping.json'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env variables should be uppercase

Comment on lines 43 to 44
mongodb_uri = os.getenv('mongodb_uri') or 'mongodb://localhost:27017/'
map_json_path = os.getenv('map_json_path') or 'uuid_mapping.json'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the default function argument of getenv

@ESapenaVentura
Copy link
Collaborator Author

Applied feedback - Please @amnonkhen re-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants