You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raise"Error: source_dataset_id integer is required"unlesssource_dataset_id.present? && source_dataset_id.is_a?(Integer)
17
17
raise"Error: new_dataset_name string is required"unlessnew_dataset_name.present? && new_dataset_name.is_a?(String)
18
-
raise"Error: new_dataset_name already in use"ifnew_dataset_name_already_in_use?
18
+
raise"Error: new_dataset_name already in use in this schema: #{new_dataset_name}. Suggest you add (COPY) as a suffix to the name"ifnew_dataset_name_already_in_use?
19
19
20
-
logger.info(" Start Duplicate Source Dataset Id: #{source_dataset_id} to New Dataset Name: #{new_dataset_name}")
20
+
logger.info(" Duplicating Source Dataset in schema #{source_dataset.schema}. Source Dataset Id: #{source_dataset_id} to New Dataset Name: #{new_dataset_name}")
raiseValidationError,"Schema #{target_schema} does not exist in target database: #{target_database_id}"unlesstarget_database_available_schemas.include?(target_schema)
113
127
raiseValidationError,"The source_dashboard_id #{source_dashboard_id} datasets are required to point to one schema only. Actual schema list is #{source_dashboard_schemas.join(',')}"ifsource_dashboard_has_more_than_one_schema?
128
+
129
+
# new dataset validations
130
+
raiseValidationError,"DATASET NAME CONFLICT: The Target Schema #{target_schema} already has existing datasets named: #{target_schema_matching_dataset_names.join(',')}"unlesstarget_schema_matching_dataset_names.empty?
existing_names=Superset::Dataset::List.new(title_contains: source_dataset_name,schema_equals: target_schema).result.map{|t|t['table_name']}.uniq# contains match to cover with suffix as well
158
+
unlessexisting_names.flatten.empty?
159
+
logger.error" HALTING PROCESS: Schema #{target_schema} already has Dataset called #{existing_names}"
0 commit comments