Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ $(document).ready(function () {

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

var allExecCnt = 0;
var allRDDBlocks = 0;
var allMemoryUsed = 0;
Expand Down Expand Up @@ -505,7 +504,7 @@ $(document).ready(function () {
{data: 'allTotalTasks'},
{
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

},
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
if (oData.allTotalDuration > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,20 @@ $(document).ready(function() {
pageLength: 20
});

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

var searchString = historySummary["context"]["location"]["search"];
var requestedIncomplete = getParameterByName("showIncomplete", searchString);
requestedIncomplete = (requestedIncomplete == "true" ? true : false);

appParams = {
var appParams = {
limit: appLimit,
status: (requestedIncomplete ? "running" : "completed")
};

$.getJSON(uiRoot + "/api/v1/applications", appParams, function(response,status,jqXHR) {
var array = [];
var hasMultipleAttempts = false;
for (i in response) {
for (var i in response) {
var app = response[i];
if (app["attempts"][0]["completed"] == requestedIncomplete) {
continue; // if we want to show for Incomplete, we skip the completed apps; otherwise skip incomplete ones.
Expand All @@ -127,7 +127,7 @@ $(document).ready(function() {
hasMultipleAttempts = true;
}
var num = app["attempts"].length;
for (j in app["attempts"]) {
for (var j in app["attempts"]) {
var attempt = app["attempts"][j];
attempt["startTime"] = formatTimeMillis(attempt["startTimeEpoch"]);
attempt["endTime"] = formatTimeMillis(attempt["endTimeEpoch"]);
Expand All @@ -149,15 +149,15 @@ $(document).ready(function() {
"applications": array,
"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


$.get(uiRoot + "/static/historypage-template.html", function(template) {
var sibling = historySummary.prev();
historySummary.detach();
var apps = $(Mustache.render($(template).filter("#history-summary-template").html(),data));
var attemptIdColumnName = 'attemptId';
var startedColumnName = 'started';
var defaultSortColumn = completedColumnName = 'completed';
var completedColumnName = 'completed';
var durationColumnName = 'duration';
var conf = {
"columns": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function renderDagVizForJob(svgContainer) {
} else {
// Link each graph to the corresponding stage page (TODO: handle stage attempts)
// Use the link from the stage table so it also works for the history server
var attemptId = 0
var attemptId = 0;
var stageLink = d3.select("#stage-" + stageId + "-" + attemptId)
.select("a.name-link")
.attr("href");
Expand All @@ -236,7 +236,7 @@ function renderDagVizForJob(svgContainer) {
// existing ones, taking into account the position and width of the last stage's
// container. We do not need to do this for the first stage of this job.
if (i > 0) {
var existingStages = svgContainer.selectAll("g.cluster.stage")
var existingStages = svgContainer.selectAll("g.cluster.stage");
if (!existingStages.empty()) {
var lastStage = d3.select(existingStages[0].pop());
var lastStageWidth = toFloat(lastStage.select("rect").attr("width"));
Expand Down Expand Up @@ -369,8 +369,8 @@ function resizeSvg(svg) {
* here this function is to enable line break.
*/
function interpretLineBreak(svg) {
var allTSpan = svg.selectAll("tspan").each(function() {
node = d3.select(this);
svg.selectAll("tspan").each(function() {
var node = d3.select(this);
var original = node[0][0].innerHTML;
if (original.indexOf("\\n") != -1) {
var arr = original.split("\\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ function reselectCheckboxesBasedOnTaskTableState() {

function getStageAttemptId() {
var words = document.baseURI.split('?');
var attemptIdStr = words[1].split('&')[1];
var digitsRegex = /[0-9]+/;
// We are using regex here to extract the stage attempt id as there might be certain url's with format
// like /proxy/application_1539986433979_27115/stages/stage/?id=0&attempt=0#tasksTitle
Expand Down Expand Up @@ -433,7 +432,7 @@ $(document).ready(function () {
"oLanguage": {
"sEmptyTable": "No data to show yet"
}
}
};
var executorSummaryTableSelector =
$("#summary-executor-table").DataTable(executorSummaryConf);
$('#parent-container [data-toggle="tooltip"]').tooltip();
Expand Down Expand Up @@ -612,7 +611,7 @@ $(document).ready(function () {
"searching": false,
"order": [[0, "asc"]],
"bAutoWidth": false
}
};
$("#accumulator-table").DataTable(accumulatorConf);

// building tasks table that uses server side functionality
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function onSearchStringChange() {
if($(this).attr('id') && $(this).attr('id').match(/thread_[0-9]+_tr/) ) {
var children = $(this).children()
var found = false
for (i = 0; i < children.length; i++) {
for (var i = 0; i < children.length; i++) {
if (children.eq(i).text().toLowerCase().indexOf(searchString) >= 0) {
found = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function createRESTEndPointForExecutorsPage(appId) {
if (ind > 0) {
var appId = words[ind + 1];
var newBaseURI = words.slice(0, ind + 2).join('/');
return newBaseURI + "/api/v1/applications/" + appId + "/allexecutors"
return newBaseURI + "/api/v1/applications/" + appId + "/allexecutors";
}
ind = words.indexOf("history");
if (ind > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function collapseTable(thisName, table){
var status = window.localStorage.getItem(thisName) == "true";
status = !status;

thisClass = '.' + thisName
var thisClass = '.' + thisName

// Expand the list of additional metrics.
var tableDiv = $(thisClass).parent().find('.' + table);
Expand Down
1 change: 0 additions & 1 deletion dev/pip-sanity-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
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

from pyspark.mllib.linalg import *
import sys

Expand Down
29 changes: 1 addition & 28 deletions dev/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from sparktestsupport import SPARK_HOME, USER_HOME, ERROR_CODES
from sparktestsupport.shellutils import exit_from_command_with_retcode, run_cmd, rm_r, which
from sparktestsupport.toposort import toposort_flatten, toposort
from sparktestsupport.toposort import toposort_flatten
import sparktestsupport.modules as modules


Expand Down Expand Up @@ -153,30 +153,6 @@ def determine_java_executable():
return java_exe if java_exe else which("java")


JavaVersion = namedtuple('JavaVersion', ['major', 'minor', 'patch'])


def determine_java_version(java_exe):
"""Given a valid java executable will return its version in named tuple format
with accessors '.major', '.minor', '.patch', '.update'"""

raw_output = subprocess.check_output([java_exe, "-version"],
stderr=subprocess.STDOUT,
universal_newlines=True)

raw_output_lines = raw_output.split('\n')

# find raw version string, eg 'java version "1.8.0_25"'
raw_version_str = next(x for x in raw_output_lines if " version " in x)

match = re.search(r'(\d+)\.(\d+)\.(\d+)', raw_version_str)

major = int(match.group(1))
minor = int(match.group(2))
patch = int(match.group(3))

return JavaVersion(major, minor, patch)

# -------------------------------------------------------------------------------------------------
# Functions for running the other build and test scripts
# -------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -443,7 +419,6 @@ def run_python_packaging_tests():
def run_build_tests():
set_title_and_block("Running build tests", "BLOCK_BUILD_TESTS")
run_cmd([os.path.join(SPARK_HOME, "dev", "test-dependencies.sh")])
pass
Copy link
Member Author

Choose a reason for hiding this comment

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

pass does nothing in a block not otherwise empty



def run_sparkr_tests():
Expand Down Expand Up @@ -495,8 +470,6 @@ def main():
" install one and retry.")
sys.exit(2)

java_version = determine_java_version(java_exe)

# install SparkR
if which("R"):
run_cmd([os.path.join(SPARK_HOME, "R", "install-dev.sh")])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void main(String[] args) {
// Empty categoricalFeaturesInfo indicates all features are continuous.
int numClasses = 2;
Map<Integer, Integer> categoricalFeaturesInfo = new HashMap<>();
Integer numTrees = 3; // Use more in practice.
int numTrees = 3; // Use more in practice.
String featureSubsetStrategy = "auto"; // Let the algorithm choose.
String impurity = "gini";
int maxDepth = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from pyspark import SparkContext
# $example on$
from pyspark.mllib.clustering import BisectingKMeans, BisectingKMeansModel
from pyspark.mllib.clustering import BisectingKMeans
# $example off$

if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pyspark import SparkContext
# $example on$
import math
from pyspark.mllib.regression import LabeledPoint, IsotonicRegression, IsotonicRegressionModel
from pyspark.mllib.regression import IsotonicRegression, IsotonicRegressionModel
from pyspark.mllib.util import MLUtils
# $example off$

Expand Down
6 changes: 3 additions & 3 deletions examples/src/main/python/mllib/multi_class_metrics_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
metrics = MulticlassMetrics(predictionAndLabels)

# Overall statistics
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

recall = metrics.recall(1.0)
f1Score = metrics.fMeasure(1.0)
print("Summary Stats")
print("Precision = %s" % precision)
print("Recall = %s" % recall)
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/python/mllib/ranking_metrics_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# $example on$
from pyspark.mllib.recommendation import ALS, Rating
from pyspark.mllib.evaluation import RegressionMetrics, RankingMetrics
from pyspark.mllib.evaluation import RegressionMetrics
# $example off$
from pyspark import SparkContext

Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/python/mllib/standard_scaler_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from pyspark import SparkContext
# $example on$
from pyspark.mllib.feature import StandardScaler, StandardScalerModel
from pyspark.mllib.feature import StandardScaler
from pyspark.mllib.linalg import Vectors
from pyspark.mllib.util import MLUtils
# $example off$
Expand Down
2 changes: 1 addition & 1 deletion examples/src/main/python/sql/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from __future__ import print_function

# $example on:spark_hive$
from os.path import expanduser, join, abspath
from os.path import join, abspath

from pyspark.sql import SparkSession
from pyspark.sql import Row
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ protected boolean handle(String opt, String value) {
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

String[] setConf = value.split("=", 2);
checkArgument(setConf.length == 2, "Invalid argument to %s: %s", CONF, value);
conf.put(setConf[0], setConf[1]);
Expand Down
1 change: 0 additions & 1 deletion python/pyspark/broadcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import gc
import os
import socket
import sys
from tempfile import NamedTemporaryFile
import threading
Expand Down
1 change: 0 additions & 1 deletion python/pyspark/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ def stop(self):
' been killed or may also be in a zombie state.',
RuntimeWarning
)
pass
finally:
self._jsc = None
if getattr(self, "_accumulatorServer", None):
Expand Down
4 changes: 1 addition & 3 deletions python/pyspark/java_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import atexit
import os
import sys
import select
import signal
import shlex
import shutil
Expand Down Expand Up @@ -174,8 +173,7 @@ def local_connect_and_auth(port, auth_secret):
errors.append("tried to connect to %s, but an error occured: %s" % (sa, emsg))
sock.close()
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



def ensure_callback_server_started(gw):
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/ml/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pyspark.ml import Estimator, Model
from pyspark.ml.param.shared import *
from pyspark.ml.regression import DecisionTreeModel, DecisionTreeRegressionModel, \
GBTParams, HasVarianceImpurity, RandomForestParams, TreeEnsembleModel, TreeEnsembleParams
GBTParams, HasVarianceImpurity, RandomForestParams, TreeEnsembleModel
from pyspark.ml.util import *
from pyspark.ml.wrapper import JavaEstimator, JavaModel, JavaParams
from pyspark.ml.wrapper import JavaWrapper
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/ml/fpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from pyspark import keyword_only, since
from pyspark.sql import DataFrame
from pyspark.ml.util import *
from pyspark.ml.wrapper import JavaEstimator, JavaModel, JavaParams, _jvm
from pyspark.ml.wrapper import JavaEstimator, JavaModel, JavaParams
from pyspark.ml.param.shared import *

__all__ = ["FPGrowth", "FPGrowthModel", "PrefixSpan"]
Expand Down
1 change: 0 additions & 1 deletion python/pyspark/ml/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#

import sys
import warnings

from pyspark import since, keyword_only
from pyspark.ml.param.shared import *
Expand Down
Loading