question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mergeDataSets fails when blank value is used for merging

See original GitHub issue

To 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
RomashkoVictorcommented, Nov 8, 2020

Great, thanks=)

1reaction
rmpestanocommented, Nov 8, 2020

The fix will be available in v1.17.0 to be released today, thank you guys.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found