[SYNPY-1765] Remove project id arg from create_record_based_curator_task#1329
[SYNPY-1765] Remove project id arg from create_record_based_curator_task#1329andrewelamb merged 11 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Hi @andrewelamb ! This is looking really close! A few remaining items:
Documentation that needs to be fixed:
synapseclient/extensions/curator/readme.mdsee:create_record_based_metadata_task
*synapsePythonClient/docs/guides/extensions/curator/metadata_curation.mdseecreate_record_based_metadata_task
Also, the projects created by the integration test should have unique names otherwise we might trigger a racing condition.
Also, do you think project_id_from_entity_id belongs in a util module?
tests/integration/synapseclient/extensions/curator/test_record_based_metadata_task.py
Outdated
Show resolved
Hide resolved
tests/integration/synapseclient/extensions/curator/test_record_based_metadata_task.py
Outdated
Show resolved
Hide resolved
tests/integration/synapseclient/extensions/curator/test_record_based_metadata_task.py
Outdated
Show resolved
Hide resolved
tests/integration/synapseclient/extensions/curator/test_record_based_metadata_task.py
Outdated
Show resolved
Hide resolved
I'm happy with this. Do you have a suggested location? |
How about creating a util module for the curator extension, since only the curator extension needs it at the moment |
| while not isinstance(current_obj, Project): | ||
| current_obj = get(current_obj.parent_id, synapse_client=synapse_client) | ||
| iterations += 1 | ||
| if iterations > 1000: |
There was a problem hiding this comment.
I am a bit curious why you picked 1000 as the magic number? should we also encode that on top of the Python file?
There was a problem hiding this comment.
Yeah, that's a good question. I figured it was a big enough number that there's no way a DCC would actually nest folders to that degree, but was also small enough that if there was actually something wrong with Synapse it wouldn't loop forever. I'm open to changing it, though!
I can set it as a global.
linglp
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the changes.
Problem:
create_record_based_metadata_taskrequired both afolder_idandproject_idrecord_set_nameincreate_record_based_metadata_taskand forRecordSetneeded improvement.Solution:
project_id_from_entity_idfunction.project_idis deprecated and no longer used. Nowproject_idis gotten from thefolder_id.project_id_from_entity_idfunctionTesting:
project_id_from_entity_idfunctionproject_id_from_entity_idfunction has been patched in existing unit tests forcreate_record_based_metadata_task