13
13
14
14
CONFLICT_TBL_EXT = "_conflict"
15
15
16
- cas_table_postfixes = ["_annotation " , "_labelset " , "_metadata " , "_annotation_transfer " ]
16
+ cas_tables = ["annotation " , "labelset " , "metadata " , "annotation_transfer " ]
17
17
18
18
19
19
def export_cas_data (sqlite_db : str , output_file : str , dataset_cache_folder : str = None ):
@@ -27,13 +27,13 @@ def export_cas_data(sqlite_db: str, output_file: str, dataset_cache_folder: str
27
27
28
28
cas_tables = get_table_names (sqlite_db )
29
29
for table_name in cas_tables :
30
- if table_name . endswith ( "_metadata" ) :
30
+ if table_name == "metadata" :
31
31
parse_metadata_data (cta , sqlite_db , table_name )
32
- elif table_name . endswith ( "_annotation" ) :
32
+ elif table_name == "annotation" :
33
33
parse_annotation_data (cta , sqlite_db , table_name )
34
- elif table_name . endswith ( "_labelset" ) :
34
+ elif table_name == "labelset" :
35
35
parse_labelset_data (cta , sqlite_db , table_name )
36
- elif table_name . endswith ( "_annotation_transfer" ) :
36
+ elif table_name == "annotation_transfer" :
37
37
parse__annotation_transfer_data (cta , sqlite_db , table_name )
38
38
39
39
project_config = read_project_config (Path (output_file ).parent .absolute ())
@@ -168,7 +168,7 @@ def get_table_names(sqlite_db):
168
168
columns = list (map (lambda x : x [0 ], cursor .description ))
169
169
table_column_index = columns .index ('table' )
170
170
for row in rows :
171
- if str (row [table_column_index ]). endswith ( tuple ( cas_table_postfixes )) :
171
+ if str (row [table_column_index ]) in cas_tables :
172
172
cas_tables .append (str (row [table_column_index ]))
173
173
return cas_tables
174
174
0 commit comments