apachespark存根文件的集合

pyspark-stubs的Python项目详细描述


Build StatusPyPI versionConda Forge version

apachespark的集合stub files。这些 文件由生成 stubgen 并手动编辑以包含准确的类型提示。在

测试和配置文件最初已提供给 Typeshed project。请参考 到它的contributors listlicense用于 细节。在

动机

  • 静态错误检测(参见 SPARK-20631

    SPARK-20631

  • 改进了自动完成功能。在

    Syntax completion

安装和使用

请注意,类型信息的分发指南是 仍在进行中(PEP 561 - Distributing and Packaging Type Information)。目前 安装脚本覆盖现有的Spark安装(pyistub 文件被复制到PySpark中它们的py副本旁边 安装目录)。如果这种方法不可接受,您可以添加存根 手动将文件添加到搜索路径。在

根据PEP 484

Third-party stub packages can use any location for stub storage. Type checkers should search for them using PYTHONPATH.

此外:

Third-party stub packages can use any location for stub storage. Type checkers should search for them using PYTHONPATH. A default fallback directory that is always checked is shared/typehints/python3.5/ (or 3.6, etc.)

请在继续之前检查用法。在

包可在PYPI上获得:

pip install pyspark-stubs

conda-forge

^{pr2}$

根据您的环境,您可能还需要一个类型检查器,如Mypy 或者Pytype[1],以及自动完成工具,如Jedi。在

EditorType checkingAutocompletionNotes
Atom[2][3]Through plugins.
IPython / Jupyter Notebook[4]
PyCharm
PyDev[5]?
VIM / Neovim[6][7]Through plugins.
Visual Studio Code[8][9]Completion with plugin
Environment independent / other editors[10][11]Through Mypy and Jedi.

这个包是针对MyPy开发分支进行测试的,在极少数情况下(主要是重要的上游错误修复),它与之前的MyPy版本不兼容。在

PySpark版本兼容性

软件包版本遵循PySpark版本,但维护版本除外,即PySpark存根==2.3.0应与PySpark>;=2.3.0,<;2.4.0兼容。 维护版本(post1post2,…,postN)是为内部注释更新而保留的。在

API覆盖范围:

从2.4.0版开始,大部分的公共API都包含在内。有关详细信息,请查看API coverage document。在

另请参见

免责声明

apachespark、Spark、PySpark、Apache和Spark徽标是trademarksThe Apache Software Foundation。本项目未被拥有、认可或 由Apache软件基金会赞助。在

脚注

^{tb2}$
[2]Requires atom-mypy or equivalent.
[3]Requires autocomplete-python-jedi or equivalent.
[4]It is possible to use magics to type check directly in the notebook. In general though, you’ll have to export whole notebook to .py file and run type checker on the result.
[5]Requires PyDev 7.0.3 or later.
[6]TODO Using vim-mypy, syntastic or Neomake.
[7]With jedi-vim.
[8]With Mypy linter.
[9]With Python extension for Visual Studio Code.
[10]Just use your favorite checker directly, optionally combined with tool like entr.
[11]See Jedi editor plugins list.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何使用Scanner用文件中的文本填充数组,然后从数组中随机选择文本?   java如何在windows中使用BlueJ进行无限缓冲   java为什么JPA中存在“太多连接”?   java如何在recyclerview中创建和填充公共字段?   当我在Google Play上发布应用程序时,很多设备都不支持java xWalkWebView 64位   HTML文档文本中位置或偏移量的java含义   java如何在JTextArea中打开文件,并使用FileReader和FileWriter类进行读写   java`elementtobelickable`只是检查它是否可见并已启用   安卓中图像下方的java绘图文本   java我如何为我的Android应用程序启用Google signin,使其只允许来自特定Google域的用户?   在超级Java调用中调用父级的内部类   java在没有定时器的情况下运行代码   java使用hashset值作为hashmap中的键   java我需要为我的应用程序获取API密钥,为此,我需要证书的MD5签名   java编写一个方法来查看字符串x是否包含字母“G”