changes to auto aggregation creation
@@ -1075,6 +1075,16 @@ def check_aggregations(resource, folders, res_files):
# need relative folder path for creating aggregation from folder
fol = fol[len(resource.file_path) + 1:]
agg_type = resource.get_folder_aggregation_type_to_set(folder)
+
+ if agg_type == 'TimeSeriesLogicalFile':
+ # check if the folder (fol) contains a csv file
+ res_files = ResourceFile.list_folder(resource=resource, folder=fol,
+ sub_folders=False)
+ # there can be only one file in the folder
+ # if that file is a csv file - don't use the folder to create aggregation
+ if res_files[0].extension.lower() == '.csv':
+ continue
+
if agg_type and agg_type != "FileSetLogicalFile":
agg_type = agg_type.replace('LogicalFile', '')
set_logical_file_type(res=resource, user=None, file_id=None,
