Skip to content

Fix: Allow smartSplit() to handle String of chars not just a single char#1761

Merged
wetneb merged 3 commits intoOpenRefine:masterfrom
omkarnix:master
Oct 15, 2018
Merged

Fix: Allow smartSplit() to handle String of chars not just a single char#1761
wetneb merged 3 commits intoOpenRefine:masterfrom
omkarnix:master

Conversation

@omkarnix
Copy link
Copy Markdown

This commit adds the support of String separator in function smartSplit. Previously only char separator is supported. Now smartSplit can support String as well as single char as separator. Changed to existing implementation of overloaded constructor of CSVParser which takes string separator.

@wetneb
Copy link
Copy Markdown
Member

wetneb commented Oct 14, 2018

Hi @omkarnix, thanks a lot for this pull request! As discussed in the issue it would be great to have a few tests for this (as you have noticed the test coverage is really poor at the moment so we are trying to improve that for all new changes). Let me know if you need any help.

@omkarnix
Copy link
Copy Markdown
Author

@wetneb, Sure Thanks for reviewing. Actually, I realized that low test coverage after creating PR and started the discussion on #1674. Will amend my PR with tests tomorrow and update! Thank you for quick responses and encouragement!

} else {
return function.call(bindings, args);
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thanks a lot! As a small note, I think invoke should not need to take the function name as parameter, as it is always FUNCTION_NAME in this class (and the method is private). But that is a cosmetic concern.

Copy link
Copy Markdown
Author

@omkarnix omkarnix Oct 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Actually I thought we should move the invoke method to some test util class. Also could you please help me understand what is RefineTest and should we extend our control function test classes with RefineTest?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@omkarnix moving to a test util class would make a lot of sense too.

The RefineTest class is used to create a test workspace and initialize various other things that are required when dealing with projects. For function tests it is not needed to extend it, as function registration is done statically as you have rightly noted.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Thanks. I would certainly like to refactor it and move the invoke method to some util class.
I noticed that travis CI build failed due to assertion failure in serializeProcessManager whereas appveyor build succeeded. Could it be a glitch while building on travis-ci? Can we trigger the build manually?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, thanks a lot! As a small note, I think invoke should not need to take the function name as parameter, as it is always FUNCTION_NAME in this class (and the method is private). But that is a cosmetic concern.

@wetneb I agree. It was really not required to create constant for the local static value. So made the change suggested by yo .Also added one more misc change. Can you review it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes don't worry about unrelated test failures (although this one is curious). I can restart the build when it happens.

…independent by replacing BeforeSuite with BeforeTest
@wetneb wetneb merged commit 3f6b380 into OpenRefine:master Oct 15, 2018
@omkarnix
Copy link
Copy Markdown
Author

@wetneb Thank you very much for your support and encouragement on contribution. The community is very supportive. I would certainly try to contribute as much as possible!

@wetneb wetneb added this to the 3.1 milestone Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants