Repository: sage-bionetworks/schematic
Issue: Schematic adds "Filename" value as an annotation

**Describe the bug**
Schematic pushes "Filename" value in a manifest as an annotation. This is an issue because schematic will then throw an error when you regenerate a manifest that contains files that have a `Filename` annotation and `use_annotations = T`. The error is: `Warning: Error in py_call_impl: ValueError: cannot insert Filename, already exists` This prevents a user from revisiting/reannotating data using schematic. 

**To Reproduce**
Steps to reproduce the behavior:
1. Generate a manifest, fill in.
2. Apply manifest to files. 
3. Try and regenerate a new manifest containing the same files with use_annotations = T.

**Expected behavior**
I expect Filename to not be set as an annotation.




Changed files:
schematic/models/commands.py, schematic/store/synapse.py, schematic/models/metadata.py, schematic/help.py

diff --git a/schematic/help.py b/schematic/help.py
index e450de49..ed8a02e4 100644
--- a/schematic/help.py
+++ b/schematic/help.py
@@ -72,6 +72,11 @@ model_commands = {
                 "The component or data type from the data model which you can use to validate the "
                 "data filled in your manifest template."
             ),
+            "use_schema_label": (
+                "Store attributes using the schema label (--use_schema_label, default) or store attributes using the display label "
+                "(--use_display_label). Attribute display names in the schema must not only include characters that are "
+                "not accepted by Synapse. Annotation names may only contain: letters, numbers, '_' and '.'"
+            ),
         },
         "validate": {
             "short_help": ("Validation of manifest files."),
diff --git a/schematic/models/commands.py b/schematic/models/commands.py
index 96fa0949..b3ce2910 100644
--- a/schematic/models/commands.py
+++ b/schematic/models/commands.py
@@ -63,8 +63,14 @@ def model(ctx, config):  # use as `schematic model ...`
     "--validate_component",
     help=query_dict(model_commands, ("model", "submit", "validate_component")),
 )
+@click.option(
+    "--use_schema_label/--use_display_label", 
+    "-sl/-dl",
+    default=True,
+    help=query_dict(model_commands, ("model", "submit", "use_schema_label")),
+)
 @click.pass_obj
-def submit_manifest(ctx, manifest_path, dataset_id, validate_component):
+def submit_manifest(ctx, manifest_path, dataset_id, validate_component, use_schema_label):
     """
     Running CLI with manifest validation (optional) and submission options.
     """
@@ -81,6 +87,7 @@ def submit_manifest(ctx, manifest_path, dataset_id, validate_component):
             manifest_path=manifest_path,
             dataset_id=dataset_id,
             validate_component=validate_component,
+            use_schema_label=use_schema_label,
         )
 
         if success:
diff --git a/schematic/models/metadata.py b/schematic/models/metadata.py
index 4189ff25..1fd3b1ea 100644
--- a/schematic/models/metadata.py
+++ b/schematic/models/metadata.py
@@ -306,7 +306,7 @@ class MetadataModel(object):
         return mg.populate_manifest_spreadsheet(manifestPath, emptyManifestURL)
 
     def submit_metadata_manifest(
-        self, manifest_path: str, dataset_id: str, validate_component: str = None
+        self, manifest_path: str, dataset_id: str, validate_component: str = None, use_schema_label: bool = True
     ) -> bool:
         """Wrap methods that are responsible for validation of manifests for a given component, and association of the
         same manifest file with a specified dataset.
@@ -360,7 +360,7 @@ class MetadataModel(object):
 
         # no need to perform validation, just submit/associate the metadata manifest file
         syn_store.associateMetadataWithFiles(
-            metadataManifestPath=manifest_path, datasetId=dataset_id
+            metadataManifestPath=manifest_path, datasetId=dataset_id, useSchemaLabel=use_schema_label
         )
 
         logger.debug(
diff --git a/schematic/store/synapse.py b/schematic/store/synapse.py
index b772ad28..0611eaad 100644
--- a/schematic/store/synapse.py
+++ b/schematic/store/synapse.py
@@ -510,11 +510,16 @@ class SynapseStorage(BaseStorage):
             #  prepare metadata for Synapse storage (resolve display name into a name that Synapse annotations support (e.g no spaces)
             metadataSyn = {}
             for k, v in row.to_dict().items():
+
                 if useSchemaLabel:
                     keySyn = se.get_class_label_from_display_name(str(k))
                 else:
                     keySyn = str(k)
 
+                # Skip `Filename` and `ETag` columns when setting annotations
+                if keySyn in ["Filename", "ETag", "eTag"]:
+                    continue
+
                 # truncate annotation values to 500 characters if the
                 # size of values is greater than equal to 500 characters
                 # add an explicit [truncatedByDataCuratorApp] message at the end