Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPARK-6938: All require statements now have an informative error message. #5532

Closed
wants to merge 2 commits into from

Conversation

hougs
Copy link

@hougs hougs commented Apr 15, 2015

This pr adds informative error messages to all require statements in the Vectors class that did not previously have them. This references SPARK-6938.

@srowen
Copy link
Member

srowen commented Apr 15, 2015

ok to test

@SparkQA
Copy link

SparkQA commented Apr 15, 2015

Test build #30359 has finished for PR 5532 at commit 1221f94.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@srowen
Copy link
Member

srowen commented Apr 15, 2015

LGTM. CC @mengxr for any comments on the messages.

@@ -215,7 +215,8 @@ object Vectors {
require(prev < i, s"Found duplicate indices: $i.")
prev = i
}
require(prev < size)
require(prev < size, s"You may not write an element to index ${prev} because the declared " +
Copy link
Contributor

Choose a reason for hiding this comment

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

${prev} -> $prev, and same for ${size}, ${p}.

@mengxr
Copy link
Contributor

mengxr commented Apr 15, 2015

LGTM except minor style issues.

@hougs
Copy link
Author

hougs commented Apr 15, 2015

I didn't see that in the spark scala style guide. It is probably worth updating there if you want people to stick with it. I tend to go with being 'strict' with ${} because of bad experiences with dropping the braces in bash. It isn't actualy needed here, just an anachronism. Would you prefer the change as additional commit on top of this, or for me to amend my previous commit and force push the single commit to my branch to replace the current one?

@vanzin
Copy link
Contributor

vanzin commented Apr 15, 2015

@jhlch you can just add new commits to your branch (generally easier), when your changes are pushed they're all squashed into a single commit.

@srowen
Copy link
Member

srowen commented Apr 15, 2015

I don't mind defensive braces as I don't know of a downside and also worry about this kind of thing in bash scripts. I don't think the code base does either consistently and I generally match nearby style. It's a toss-up here so I'd just make the extra commit.

@hougs
Copy link
Author

hougs commented Apr 15, 2015

@vanzin That's cool. Is that done by the committer or something more magically automatic(jenkins?)?

@vanzin
Copy link
Contributor

vanzin commented Apr 15, 2015

I think the scripts used by committers do the squashing.

@hougs
Copy link
Author

hougs commented Apr 15, 2015

Cool, that makes more sense. Also, how convenient. I will leave this unsquashed.

@SparkQA
Copy link

SparkQA commented Apr 16, 2015

Test build #30380 has finished for PR 5532 at commit ab321bb.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@asfgit asfgit closed this in 52c3439 Apr 16, 2015
@mengxr
Copy link
Contributor

mengxr commented Apr 16, 2015

Merged into master. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants