mergeDataSets fails when blank value is used for merging
See original GitHub issueTo use mergeDatasets feature we should add ‘empty.yml’ dataset to class level. In other case we will receive error:
at com.github.database.rider.core.dataset.DataSetExecutorImpl.loadDataSet(DataSetExecutorImpl.java:295)
at com.github.database.rider.core.dataset.DataSetExecutorImpl.loadDataSets(DataSetExecutorImpl.java:305)
at com.github.database.rider.core.dataset.DataSetExecutorImpl.createDataSet(DataSetExecutorImpl.java:149)
... 74 more
It can be fixed simply by removing null and empty strings after merge.
public static DataSet mergeDataSetAnnotations(DataSet classLevelDataSet, DataSet methodLevelDataSet) {
//only the lists are merged
String[] value = joinArray(classLevelDataSet.value(), methodLevelDataSet.value());
value = removeEmptyAndNullElements(value);
...
return mergedDataSet;
}
public static String[] removeEmptyAndNullElements(String[] values) {
List<String> result = new ArrayList<>(values.length);
for(String value:values){
if(value != null && !value.trim().isEmpty()) {
result.add(value);
}
}
return result.toArray(new String[0]);
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Problem: The Merge tool returns null values in ArcGIS Pro
In the Merge pane, click the Parameters tab. Click the drop-down list next to the Browse icon, and select the desired input dataset...
Read more >Merging datasets with NULL values - Oracle - TechTarget
Merging datasets with NULL values. A MERGE may appear to work properly, but it's important you check your target dataset to make sure...
Read more >Merge with Caution: How to Avoid Common Problems ... - SAS
When datasets are merged using the MERGE statement in a DATA step, a given record in one input dataset may not have corresponding...
Read more >Why won't my data frames merge? - Stack Overflow
Use the R head() command to see the first lines of your merged dataset in the console (which won't trim your columns to...
Read more >Error when using merge - Statalist
2. You are failing to take account of one or more additional variables in your data set that, combined with the variables you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great, thanks=)
The fix will be available in
v1.17.0
to be released today, thank you guys.