Skip to content

Commit a73bcc1

Browse files
authored
Change default behavior of file based metadata tasks to not attach wikis (#1270)
* update tests for new default behavior * change default wiki behavior * update documentation
1 parent 1bfe138 commit a73bcc1

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

docs/guides/extensions/curator/metadata_curation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ entity_view_id, task_id = create_file_based_metadata_task(
103103
folder_id="syn987654321", # Folder containing your data files
104104
curation_task_name="FileMetadata_Curation", # Must be unique within the project
105105
instructions="Annotate each file with metadata according to the schema requirements.",
106-
attach_wiki=True, # Creates a wiki in the folder with the entity view
106+
attach_wiki=True, # Creates a wiki in the folder with the entity view (Defaults to False)
107107
entity_view_name="Animal Study Files View",
108108
schema_uri=schema_uri # Schema found in Step 2
109109
)

synapseclient/extensions/curator/file_based_metadata_task.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def create_file_based_metadata_task(
294294
folder_id: str,
295295
curation_task_name: str,
296296
instructions: str,
297-
attach_wiki: bool = True,
297+
attach_wiki: bool = False,
298298
entity_view_name: str = "JSON Schema view",
299299
schema_uri: Optional[str] = None,
300300
enable_derived_annotations: bool = False,
@@ -320,7 +320,7 @@ def create_file_based_metadata_task(
320320
folder_id="syn12345678",
321321
curation_task_name="BiospecimenMetadataTemplate",
322322
instructions="Please curate this metadata according to the schema requirements",
323-
attach_wiki=True,
323+
attach_wiki=False,
324324
entity_view_name="Biospecimen Metadata View",
325325
schema_uri="sage.schemas.v2571-amp.Biospecimen.schema-0.0.1"
326326
)
@@ -332,7 +332,7 @@ def create_file_based_metadata_task(
332332
Must be unique within the project, otherwise if it matches an existing
333333
CurationTask, that task will be updated with new data.
334334
instructions: Instructions for the curation task.
335-
attach_wiki: Whether or not to attach a Synapse Wiki (default: True).
335+
attach_wiki: Whether or not to attach a Synapse Wiki (default: False).
336336
entity_view_name: Name for the created entity view (default: "JSON Schema view").
337337
schema_uri: Optional JSON schema URI to bind to the folder. If provided,
338338
the schema will be bound to the folder before creating the entity view.

tests/unit/synapseclient/extensions/unit_test_curator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ def test_create_file_based_metadata_task_missing_folder_id(self, mock_get_client
206206
folder_id="",
207207
curation_task_name=self.curation_task_name,
208208
instructions=self.instructions,
209+
attach_wiki=True,
209210
synapse_client=self.mock_syn,
210211
)
211212

@@ -226,6 +227,7 @@ def test_create_file_based_metadata_task_missing_curation_task_name(
226227
folder_id=self.folder_id,
227228
curation_task_name="",
228229
instructions=self.instructions,
230+
attach_wiki=True,
229231
synapse_client=self.mock_syn,
230232
)
231233

@@ -246,6 +248,7 @@ def test_create_file_based_metadata_task_missing_instructions(
246248
folder_id=self.folder_id,
247249
curation_task_name=self.curation_task_name,
248250
instructions="",
251+
attach_wiki=True,
249252
synapse_client=self.mock_syn,
250253
)
251254

@@ -272,6 +275,7 @@ def test_create_file_based_metadata_task_schema_binding_error(
272275
folder_id=self.folder_id,
273276
curation_task_name=self.curation_task_name,
274277
instructions=self.instructions,
278+
attach_wiki=True,
275279
schema_uri=self.schema_uri,
276280
synapse_client=self.mock_syn,
277281
)
@@ -302,6 +306,7 @@ def test_create_file_based_metadata_task_entity_view_creation_error(
302306
folder_id=self.folder_id,
303307
curation_task_name=self.curation_task_name,
304308
instructions=self.instructions,
309+
attach_wiki=True,
305310
synapse_client=self.mock_syn,
306311
)
307312

0 commit comments

Comments
 (0)