Skip to content

Conversation

@srowen
Copy link
Member

@srowen srowen commented Jan 17, 2019

What changes were proposed in this pull request?

Misc code cleanup from lgtm.com analysis. See comments below for details.

How was this patch tested?

Existing tests.


var endPoint = createRESTEndPointForExecutorsPage(appId);
$.getJSON(endPoint, function (response, status, jqXHR) {
var summary = [];
Copy link
Member Author

Choose a reason for hiding this comment

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

Unused variables

{
data: function (row, type) {
return type === 'display' ? (formatDuration(row.allTotalDuration, type) + ' (' + formatDuration(row.allTotalGCTime, type) + ')') : row.allTotalDuration
return type === 'display' ? (formatDuration(row.allTotalDuration) + ' (' + formatDuration(row.allTotalGCTime) + ')') : row.allTotalDuration
Copy link
Member Author

Choose a reason for hiding this comment

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

Unused JS function args

historySummary = $("#history-summary");
searchString = historySummary["context"]["location"]["search"];
requestedIncomplete = getParameterByName("showIncomplete", searchString);
var historySummary = $("#history-summary");
Copy link
Member Author

Choose a reason for hiding this comment

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

Implicit var -> explicit

"hasMultipleAttempts": hasMultipleAttempts,
"showCompletedColumns": !requestedIncomplete,
}
};
Copy link
Member Author

Choose a reason for hiding this comment

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

Implicit semicolon -> explicit

from __future__ import print_function

from pyspark.sql import SparkSession
from pyspark.ml.param import Params
Copy link
Member Author

Choose a reason for hiding this comment

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

Unused imports

precision = metrics.precision()
recall = metrics.recall()
f1Score = metrics.fMeasure()
precision = metrics.precision(1.0)
Copy link
Member Author

Choose a reason for hiding this comment

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

Missed this when removing deprecated no-arg method

conf.put(SparkLauncher.DRIVER_EXTRA_CLASSPATH, value);
break;
case CONF:
checkArgument(value != null, "Missing argument to %s", CONF);
Copy link
Member Author

Choose a reason for hiding this comment

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

Flags that this seems like it wants to check for null as it's check elsewhere

sock = None
else:
raise Exception("could not open socket: %s" % errors)
raise Exception("could not open socket: %s" % errors)
Copy link
Member Author

Choose a reason for hiding this comment

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

else: with for doesn't do anything different if there's no break

:return: model instance
"""
raise NotImplemented
raise NotImplementedError
Copy link
Member Author

Choose a reason for hiding this comment

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

NotImplemented is not actually an error that can be thrown

'"field6":[{"field7": "row2"}]}',
'{"field1" : null, "field2": "row3", '
'"field3":{"field4":33, "field5": []}}'
'{"field1" : 2, "field3":{"field4":22, "field5": [10, 11]},"field6":[{"field7": "row2"}]}',
Copy link
Member Author

Choose a reason for hiding this comment

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

Confusing string concatenation across lines

@SparkQA
Copy link

SparkQA commented Jan 17, 2019

Test build #101336 has finished for PR 23571 at commit d233b13.

  • This patch fails Python style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 17, 2019

Test build #101337 has finished for PR 23571 at commit 503978d.

  • This patch fails PySpark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Use `numpy.array` instead of `array` in doctests (PR 23571)
@SparkQA
Copy link

SparkQA commented Jan 17, 2019

Test build #101368 has finished for PR 23571 at commit 73e0a25.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member Author

srowen commented Jan 18, 2019

Merged to master

@srowen srowen closed this in c2d0d70 Jan 18, 2019
@srowen srowen deleted the SPARK-26640 branch January 21, 2019 17:57
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
…tm.com analysis

## What changes were proposed in this pull request?

Misc code cleanup from lgtm.com analysis. See comments below for details.

## How was this patch tested?

Existing tests.

Closes apache#23571 from srowen/SPARK-26640.

Lead-authored-by: Sean Owen <[email protected]>
Co-authored-by: Hyukjin Kwon <[email protected]>
Co-authored-by: Sean Owen <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
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.

3 participants