Skip to content

Commit

Permalink
[MINOR][BUILD] ensure call to translate_component has correct number …
Browse files Browse the repository at this point in the history
…of arguments

## What changes were proposed in this pull request?

The call to `translate_component` only supplied 2 out of the 3 required arguments. I added a default empty list for the missing argument to avoid a run-time error.

I work for Semmle, and noticed the bug with our LGTM code analyzer:
https://lgtm.com/projects/g/apache/spark/snapshot/0655f1624ff7b73e5c8937ab9e83453a5a3a4466/files/dev/create-release/releaseutils.py?sort=name&dir=ASC&mode=heatmap#x1434915b6576fb40:1

## How was this patch tested?

I checked that  `./dev/run-tests` pass OK.

Closes #23567 from ipwright/wrong-number-of-arguments-fix.

Authored-by: wright <wright@semmle.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
  • Loading branch information
wright authored and srowen committed Jan 17, 2019
1 parent 38f0307 commit 4915cb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev/create-release/releaseutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def translate_component(component, commit_hash, warnings):
# The returned components are already filtered and translated
def find_components(commit, commit_hash):
components = re.findall(r"\[\w*\]", commit.lower())
components = [translate_component(c, commit_hash)
components = [translate_component(c, commit_hash, [])
for c in components if c in known_components]
return components

Expand Down

0 comments on commit 4915cb3

Please sign in to comment.