开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
开源项目 > 服务器应用 > 分布式服务/框架 &&
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
12 Star 71 Fork 89

Apache/spark

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (53)
标签 (301)
master
branch-4.2
branch-4.x
branch-3.5
branch-4.0
branch-4.1
dependabot/maven/org.apache.thrift-libthrift-0.23.0
infrastructure-ruleset-bot/default-branch-protection
dependabot/maven/io.netty-netty-transport-native-epoll-4.2.13.Final
pr-54140-update
dependabot/pip/dev/protobuf-6.33.5
use-master-dockerfile-for-release
SPARK-41916
dependabot/npm_and_yarn/dev/multi-9491a2a7cf
dependabot/maven/hadoop-cloud/com.squareup.okhttp3-okhttp-4.9.2
r0DK6b6xRWqc5bnV
HeartSaVioR/SPARK-51187-4.0
branch-3.4
dependabot/maven/com.google.protobuf-protobuf-java-3.25.5
dependabot/bundler/docs/google-protobuf-3.25.5
v4.2.0-rc5
v4.2.0-rc4
v4.2.0-rc3
v4.2.0-rc2
v4.2.0-rc1
v4.0.3
v4.0.3-rc1
v4.1.2
v4.1.2-rc1
v4.2.0-preview5
v4.2.0-preview5-rc1
v4.2.0-preview4
v4.2.0-preview4-rc1
v4.2.0-preview3
v4.2.0-preview3-rc1
v4.2.0-preview2
v4.2.0-preview2-rc1
v4.0.2
v4.0.2-rc1
v3.5.8
master
分支 (53)
标签 (301)
master
branch-4.2
branch-4.x
branch-3.5
branch-4.0
branch-4.1
dependabot/maven/org.apache.thrift-libthrift-0.23.0
infrastructure-ruleset-bot/default-branch-protection
dependabot/maven/io.netty-netty-transport-native-epoll-4.2.13.Final
pr-54140-update
dependabot/pip/dev/protobuf-6.33.5
use-master-dockerfile-for-release
SPARK-41916
dependabot/npm_and_yarn/dev/multi-9491a2a7cf
dependabot/maven/hadoop-cloud/com.squareup.okhttp3-okhttp-4.9.2
r0DK6b6xRWqc5bnV
HeartSaVioR/SPARK-51187-4.0
branch-3.4
dependabot/maven/com.google.protobuf-protobuf-java-3.25.5
dependabot/bundler/docs/google-protobuf-3.25.5
v4.2.0-rc5
v4.2.0-rc4
v4.2.0-rc3
v4.2.0-rc2
v4.2.0-rc1
v4.0.3
v4.0.3-rc1
v4.1.2
v4.1.2-rc1
v4.2.0-preview5
v4.2.0-preview5-rc1
v4.2.0-preview4
v4.2.0-preview4-rc1
v4.2.0-preview3
v4.2.0-preview3-rc1
v4.2.0-preview2
v4.2.0-preview2-rc1
v4.0.2
v4.0.2-rc1
v3.5.8
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (53)
标签 (301)
master
branch-4.2
branch-4.x
branch-3.5
branch-4.0
branch-4.1
dependabot/maven/org.apache.thrift-libthrift-0.23.0
infrastructure-ruleset-bot/default-branch-protection
dependabot/maven/io.netty-netty-transport-native-epoll-4.2.13.Final
pr-54140-update
dependabot/pip/dev/protobuf-6.33.5
use-master-dockerfile-for-release
SPARK-41916
dependabot/npm_and_yarn/dev/multi-9491a2a7cf
dependabot/maven/hadoop-cloud/com.squareup.okhttp3-okhttp-4.9.2
r0DK6b6xRWqc5bnV
HeartSaVioR/SPARK-51187-4.0
branch-3.4
dependabot/maven/com.google.protobuf-protobuf-java-3.25.5
dependabot/bundler/docs/google-protobuf-3.25.5
v4.2.0-rc5
v4.2.0-rc4
v4.2.0-rc3
v4.2.0-rc2
v4.2.0-rc1
v4.0.3
v4.0.3-rc1
v4.1.2
v4.1.2-rc1
v4.2.0-preview5
v4.2.0-preview5-rc1
v4.2.0-preview4
v4.2.0-preview4-rc1
v4.2.0-preview3
v4.2.0-preview3-rc1
v4.2.0-preview2
v4.2.0-preview2-rc1
v4.0.2
v4.0.2-rc1
v3.5.8
spark
/
dev
/
lint-python
spark
/
dev
/
lint-python
lint-python 10.46 KB
一键复制 编辑 原始数据 按行查看 历史
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
#!/usr/bin/env bash
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# define test binaries + versions
FLAKE8_BUILD="flake8"
MINIMUM_FLAKE8="3.9.0"
RUFF_BUILD="ruff"
MINIMUM_RUFF="0.14.0"
MINIMUM_MYPY="1.19.1"
MYPY_BUILD="mypy"
PYTEST_BUILD="pytest"
PYTHON_EXECUTABLE="${PYTHON_EXECUTABLE:-python3}"
BLACK_BUILD="$PYTHON_EXECUTABLE -m black"
function exit_with_usage {
set +x
echo "lint-python - linter for Python"
echo ""
echo "usage:"
cl_options="[--compile] [--custom-pyspark-error] [--ruff] [--mypy] [--mypy-examples] [--mypy-data]"
echo "lint-python $cl_options"
echo ""
exit 1
}
# Parse arguments
while (( "$#" )); do
case 1ドル in
--compile)
COMPILE_TEST=true
;;
--black)
BLACK_TEST=true
;;
--custom-pyspark-error)
PYSPARK_CUSTOM_ERRORS_CHECK_TEST=true
;;
--flake8)
FLAKE8_TEST=true
;;
--ruff)
RUFF_TEST=true
;;
--mypy)
MYPY_TEST=true
;;
--mypy-examples)
MYPY_EXAMPLES_TEST=true
;;
--mypy-data)
MYPY_DATA_TEST=true
;;
*)
echo "Error: 1ドル is not supported"
exit_with_usage
;;
esac
shift
done
if [[ -z "$COMPILE_TEST$BLACK_TEST$PYSPARK_CUSTOM_ERRORS_CHECK_TEST$FLAKE8_TEST$RUFF_TEST$MYPY_TEST$MYPY_EXAMPLES_TEST$MYPY_DATA_TEST" ]]; then
COMPILE_TEST=true
PYSPARK_CUSTOM_ERRORS_CHECK_TEST=true
RUFF_TEST=true
MYPY_TEST=true
MYPY_EXAMPLES_TEST=true
MYPY_DATA_TEST=true
fi
function satisfies_min_version {
local provided_version="1ドル"
local expected_version="2ドル"
echo "$(
"$PYTHON_EXECUTABLE" << EOM
try:
from setuptools.extern.packaging import version
except ModuleNotFoundError:
from packaging import version
print(version.parse('$provided_version') >= version.parse('$expected_version'))
EOM
)"
}
function compile_python_test {
local COMPILE_STATUS=
local COMPILE_REPORT=
if [[ ! "1ドル" ]]; then
echo "No python files found! Something is very wrong -- exiting."
exit 1;
fi
# compileall: https://docs.python.org/3/library/compileall.html
echo "starting python compilation test..."
COMPILE_REPORT=$( ("$PYTHON_EXECUTABLE" -B -mcompileall -q -l -x "[/\\\\][.]git" 1ドル) 2>&1)
COMPILE_STATUS=$?
if [ $COMPILE_STATUS -ne 0 ]; then
echo "Python compilation failed with the following errors:"
echo "$COMPILE_REPORT"
echo "$COMPILE_STATUS"
exit "$COMPILE_STATUS"
else
echo "python compilation succeeded."
echo
fi
}
function mypy_annotation_test {
local MYPY_REPORT=
local MYPY_STATUS=
echo "starting mypy annotations test..."
MYPY_REPORT=$( ($MYPY_BUILD \
--python-executable $PYTHON_EXECUTABLE \
--namespace-packages \
--config-file python/mypy.ini \
--cache-dir /tmp/.mypy_cache/ \
python/pyspark) 2>&1)
MYPY_STATUS=$?
if [ "$MYPY_STATUS" -ne 0 ]; then
echo "annotations failed mypy checks:"
echo "$MYPY_REPORT"
echo "$MYPY_STATUS"
exit "$MYPY_STATUS"
else
echo "annotations passed mypy checks."
echo
fi
}
function mypy_data_test {
local PYTEST_REPORT=
local PYTEST_STATUS=
echo "starting mypy data test..."
$PYTHON_EXECUTABLE -c "import importlib.util; import sys; \
sys.exit(0 if importlib.util.find_spec('pytest_mypy_plugins') else 1)"
if [ $? -ne 0 ]; then
echo "pytest-mypy-plugins missing. Skipping for now."
return
fi
PYTEST_REPORT=$( (MYPYPATH=python $PYTEST_BUILD \
-o "python_files=test_*.yml" \
--rootdir python \
--mypy-only-local-stub \
--mypy-ini-file python/mypy.ini \
python/pyspark/tests/typing \
python/pyspark/sql/tests/typing \
python/pyspark/ml/tests/typing \
) 2>&1)
PYTEST_STATUS=$?
if [ "$PYTEST_STATUS" -ne 0 ]; then
echo "annotations failed data checks:"
echo "$PYTEST_REPORT"
echo "$PYTEST_STATUS"
exit "$PYTEST_STATUS"
else
echo "annotations passed data checks."
echo
fi
}
function mypy_examples_test {
local MYPY_REPORT=
local MYPY_STATUS=
echo "starting mypy examples test..."
MYPY_REPORT=$( (MYPYPATH=python $MYPY_BUILD \
--python-executable $PYTHON_EXECUTABLE \
--namespace-packages \
--config-file python/mypy.ini \
--exclude "mllib/*" \
examples/src/main/python/) 2>&1)
MYPY_STATUS=$?
if [ "$MYPY_STATUS" -ne 0 ]; then
echo "examples failed mypy checks:"
echo "$MYPY_REPORT"
echo "$MYPY_STATUS"
exit "$MYPY_STATUS"
else
echo "examples passed mypy checks."
echo
fi
}
function mypy_test {
if ! hash "$MYPY_BUILD" 2> /dev/null; then
echo "The $MYPY_BUILD command was not found. Skipping for now."
return
fi
_MYPY_VERSION=($($MYPY_BUILD --version))
MYPY_VERSION="${_MYPY_VERSION[1]}"
EXPECTED_MYPY="$(satisfies_min_version $MYPY_VERSION $MINIMUM_MYPY)"
if [[ "$EXPECTED_MYPY" == "False" ]]; then
echo "The minimum mypy version needs to be $MINIMUM_MYPY. Your current version is $MYPY_VERSION. Skipping for now."
return
fi
if [[ "$MYPY_TEST" == "true" ]]; then
mypy_annotation_test
fi
if [[ "$MYPY_EXAMPLES_TEST" == "true" ]]; then
mypy_examples_test
fi
if [[ "$MYPY_DATA_TEST" == "true" ]]; then
mypy_data_test
fi
}
function flake8_test {
local FLAKE8_VERSION=
local EXPECTED_FLAKE8=
local FLAKE8_REPORT=
local FLAKE8_STATUS=
if ! hash "$FLAKE8_BUILD" 2> /dev/null; then
echo "The flake8 command was not found. Skipping for now."
return
fi
_FLAKE8_VERSION=($($FLAKE8_BUILD --version))
FLAKE8_VERSION="${_FLAKE8_VERSION[0]}"
EXPECTED_FLAKE8="$(satisfies_min_version $FLAKE8_VERSION $MINIMUM_FLAKE8)"
if [[ "$EXPECTED_FLAKE8" == "False" ]]; then
echo "\
The minimum flake8 version needs to be $MINIMUM_FLAKE8. Your current version is $FLAKE8_VERSION
flake8 checks failed."
exit 1
fi
echo "starting $FLAKE8_BUILD test..."
FLAKE8_REPORT=$( ($FLAKE8_BUILD --append-config dev/tox.ini --count --show-source --statistics .) 2>&1)
FLAKE8_STATUS=$?
if [ "$FLAKE8_STATUS" -ne 0 ]; then
echo "flake8 checks failed:"
echo "$FLAKE8_REPORT"
echo "$FLAKE8_STATUS"
exit "$FLAKE8_STATUS"
else
echo "flake8 checks passed."
echo
fi
}
function ruff_test {
local RUFF_VERSION=
local EXPECTED_RUFF=
local RUFF_REPORT=
local RUFF_STATUS=
if ! hash "$RUFF_BUILD" 2> /dev/null; then
echo "The ruff command was not found. Skipping for now."
return
fi
_RUFF_VERSION=($($RUFF_BUILD --version))
RUFF_VERSION="${_RUFF_VERSION[1]}"
EXPECTED_RUFF="$(satisfies_min_version $RUFF_VERSION $MINIMUM_RUFF)"
if [[ "$EXPECTED_RUFF" == "False" ]]; then
echo "\
The minimum ruff version needs to be $MINIMUM_RUFF. Your current version is $RUFF_VERSION
ruff checks failed."
exit 1
fi
echo "starting $RUFF_BUILD test..."
RUFF_REPORT=$( ($RUFF_BUILD check) 2>&1)
RUFF_STATUS=$?
if [ "$RUFF_STATUS" -ne 0 ]; then
echo "ruff checks failed:"
echo "$RUFF_REPORT"
echo "$RUFF_STATUS"
exit "$RUFF_STATUS"
else
echo "ruff checks passed."
echo
fi
RUFF_REPORT=$( ($RUFF_BUILD format --diff python/pyspark dev python/packaging python/benchmarks) 2>&1)
RUFF_STATUS=$?
if [ "$RUFF_STATUS" -ne 0 ]; then
echo "ruff format checks failed:"
echo "$RUFF_REPORT"
echo "$RUFF_STATUS"
exit "$RUFF_STATUS"
else
echo "ruff format checks passed."
echo
fi
}
function black_test {
local BLACK_REPORT=
local BLACK_STATUS=
# Skip check if black is not installed.
$PYTHON_EXECUTABLE -c 'import black' &> /dev/null
if [ $? -ne 0 ]; then
echo "The Python library providing 'black' module was not found. Skipping black checks for now."
echo
return
fi
echo "starting black test..."
BLACK_REPORT=$( ($BLACK_BUILD --check python/pyspark dev python/packaging python/benchmarks) 2>&1)
BLACK_STATUS=$?
if [ "$BLACK_STATUS" -ne 0 ]; then
echo "black checks failed:"
echo "$BLACK_REPORT"
echo "Please run 'dev/reformat-python' script."
echo "$BLACK_STATUS"
exit "$BLACK_STATUS"
else
echo "black checks passed."
echo
fi
}
function pyspark_custom_errors_check_test {
local PYSPARK_CUSTOM_ERRORS_CHECK_REPORT=
local PYSPARK_CUSTOM_ERRORS_CHECK_STATUS=
echo "starting PySpark custom errors check..."
PYSPARK_CUSTOM_ERRORS_CHECK_REPORT=$( "$PYTHON_EXECUTABLE" dev/check_pyspark_custom_errors.py 2>&1 )
PYSPARK_CUSTOM_ERRORS_CHECK_STATUS=$?
if [ "$PYSPARK_CUSTOM_ERRORS_CHECK_STATUS" -ne 0 ]; then
echo "PySpark custom errors check failed!"
echo "$PYSPARK_CUSTOM_ERRORS_CHECK_REPORT"
exit "$PYSPARK_CUSTOM_ERRORS_CHECK_STATUS"
else
echo "PySpark custom errors check passed."
echo
fi
}
SCRIPT_DIR="$( cd "$( dirname "0ドル" )" && pwd )"
SPARK_ROOT_DIR="$(dirname "${SCRIPT_DIR}")"
pushd "$SPARK_ROOT_DIR" &> /dev/null
PYTHON_SOURCE="$(git ls-files '*.py')"
if [[ "$COMPILE_TEST" == "true" ]]; then
compile_python_test "$PYTHON_SOURCE"
fi
if [[ "$BLACK_TEST" == "true" ]]; then
black_test
fi
if [[ "$PYSPARK_CUSTOM_ERRORS_CHECK_TEST" == "true" ]]; then
pyspark_custom_errors_check_test
fi
if [[ "$FLAKE8_TEST" == "true" ]]; then
flake8_test
fi
if [[ "$RUFF_TEST" == "true" ]]; then
ruff_test
fi
if [[ "$MYPY_TEST" == "true" ]] || [[ "$MYPY_EXAMPLES_TEST" == "true" ]] || [[ "$MYPY_DATA_TEST" == "true" ]]; then
mypy_test
fi
echo
echo "all lint-python tests passed!"
popd &> /dev/null
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

Apache Spark - A unified analytics engine for large-scale data processing
暂无标签
Apache-2.0
使用 Apache-2.0 开源许可协议
, Apache-2.0
使用 Apache-2.0 开源许可协议
取消

发行版

暂无发行版

开源评估指数源自 OSS-Compass 评估体系,评估体系围绕以下三个维度对项目展开评估:

1. 开源生态

  • 生产力:来评估开源项目输出软件制品和开源价值的能力。
  • 创新力:用于评估开源软件及其生态系统的多样化程度。
  • 稳健性:用于评估开源项目面对多变的发展环境,抵御内外干扰并自我恢复的能力。

2. 协作、人、软件

  • 协作:代表了开源开发行为中协作的程度和深度。
  • 人:观察开源项目核心人员在开源项目中的影响力,并通过第三方视角考察用户和开发者对开源项目的评价。
  • 软件:从开源项目对外输出的制品评估其价值最终落脚点。也是开源评估最"古老"的主流方向之一"开源软件" 的具体表现。

3. 评估模型

    基于"开源生态"与"协作、人、软件"的维度,找到与该目标直接或间接相关的可量化指标,对开源项目健康与生态进行量化评估,最终形成开源评估指数。

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/apache/spark.git
git@gitee.com:apache/spark.git
apache
spark
spark
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /