Skip to content

Commit 5f5fc67

Browse files
authored
Merge pull request #935 from Sage-Bionetworks/develop-table-uploads
Add Restriction Flag to Make Synapse Table Method
2 parents fae8881 + d8e9200 commit 5f5fc67

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

schematic/store/synapse.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ def associateMetadataWithFiles(
10861086
table_name = table_name,
10871087
update_col = 'Uuid',
10881088
specify_schema = False,
1089+
restrict = restrict_manifest
10891090
)
10901091

10911092
# Get annotations for the table manifest
@@ -1317,7 +1318,7 @@ def getDatasetAnnotationsBatch(
13171318
return table
13181319

13191320
def make_synapse_table(self, table_to_load, dataset_id, existingTableId, table_name,
1320-
update_col = 'entityId', column_type_dictionary = {}, specify_schema=True):
1321+
update_col = 'entityId', column_type_dictionary = {}, specify_schema=True, restrict = False):
13211322
'''
13221323
Record based data
13231324
'''
@@ -1327,7 +1328,7 @@ def make_synapse_table(self, table_to_load, dataset_id, existingTableId, table_n
13271328
if existingTableId:
13281329
existing_table, existing_results = self.get_synapse_table(existingTableId)
13291330
table_to_load = update_df(existing_table, table_to_load, update_col)
1330-
self.syn.store(Table(existingTableId, table_to_load, etag = existing_results.etag))
1331+
self.syn.store(Table(existingTableId, table_to_load, etag = existing_results.etag), isRestricted = restrict)
13311332
# remove system metadata from manifest
13321333
existing_table.drop(columns = ['ROW_ID', 'ROW_VERSION'], inplace = True)
13331334
else:
@@ -1358,13 +1359,13 @@ def make_synapse_table(self, table_to_load, dataset_id, existingTableId, table_n
13581359
cols.append(Column(name=col, columnType='STRING', maximumSize=500))
13591360
schema = Schema(name=table_name, columns=cols, parent=datasetParentProject)
13601361
table = Table(schema, table_to_load)
1361-
table_id = self.syn.store(table)
1362+
table_id = self.syn.store(table, isRestricted = restrict)
13621363
return table.schema.id
13631364
else:
13641365
# For just uploading the tables to synapse using default
13651366
# column types.
13661367
table = build_table(table_name, datasetParentProject, table_to_load)
1367-
table = self.syn.store(table)
1368+
table = self.syn.store(table, isRestricted = restrict)
13681369
return table.schema.id
13691370

13701371

0 commit comments

Comments
 (0)