Skip to main content

PySpark Stubs

Build Status PyPI version Conda Forge version

A collection of the Apache Spark stub files. These files were generated by stubgen and manually edited to include accurate type hints.

Tests and configuration files have been originally contributed to the Typeshed project. Please refer to its contributors list and license for details.

Motivation

  • Static error detection (see SPARK-20631)

    SPARK-20631

  • Improved completion for chained method calls.

    Syntax completion

Installation and usage

Please note that the guidelines for distribution of type information is still work in progress (PEP 561 - Distributing and Packaging Type Information). Currently installation script overlays existing Spark installations (pyi stub files are copied next to their py counterparts in the PySpark installation directory). If this approach is not acceptable you can stub files to the search path manually.

According to PEP 484:

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

Moreover:

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.)

Please check usage before proceeding.

The package is available on PYPI:

pip install pyspark-stubs

Depending on your environment you might also need a type checker, like Mypy or Pytype.

  • PyCharm - Works out-of-the-box, though as of today (PyCharm 2018.2.4) built-in type checker is somewhat limited compared to MyPy.

  • Atom - Requires atom-mypy or equivalent.

  • Jupyter Notebooks - It is possible to use magics to type check directly in the notebook.

  • Environment independent - Just use your favorite checker directly, optionally combined with tool like entr.

Version Compatibility

Package versions follow PySpark versions with exception to maintenance releases - i.e. pyspark-stubs==2.3.0 should be compatible with pyspark>=2.3.0,<2.4.0. Maintenance releases (post1, post2, …, postN) are reserved for internal annotations updates.

API Coverage

Module

Dynamically typed

Statically typed

Notes

pyspark

✔

✘

pyspark.accumulators

✘

✔

pyspark.broadcast

✔

✔

Mixed

pyspark.cloudpickle

✘

✘

Internal

pyspark.conf

✘

✔

pyspark.context

✘

✔

pyspark.daemon

✘

✘

Internal

pyspark.files

✘

✔

pyspark.find_spark_home

✘

✘

Internal

pyspark.heapq3

✘

✘

Internal

pyspark.java_gateway

✘

✘

Internal

pyspark.join

✘

✔

pyspark.ml

✔

✘

pyspark.ml.base

✘

✔

pyspark.ml.classification

✘

✔

pyspark.ml.clustering

✘

✔

pyspark.ml.common

✔

✘

pyspark.ml.evaluation

✘

✔

pyspark.ml.feature

✘

✔

pyspark.ml.fpm

✘

✔

pyspark.ml.image

✘

✔

pyspark.ml.linalg

✘

✔

pyspark.ml.param

✘

✔

pyspark.ml.param._shared_params_code_gen

✘

✘

Internal

pyspark.ml.param.shared

✘

✔

pyspark.ml.pipeline

✘

✔

pyspark.ml.recommendation

✘

✔

pyspark.ml.regression

✘

✔

pyspark.ml.stat

✘

✔

pyspark.ml.tests

✘

✘

Tests

pyspark.ml.tuning

✘

✔

pyspark.ml.util

✘

✔

pyspark.ml.wrapper

✔

✔

Mixed

pyspark.mllib

✔

✘

pyspark.mllib.classification

✘

✔

pyspark.mllib.clustering

✘

✔

pyspark.mllib.common

✔

✘

pyspark.mllib.evaluation

✘

✔

pyspark.mllib.feature

✘

✔

pyspark.mllib.fpm

✘

✔

pyspark.mllib.linalg

✘

✔

pyspark.mllib.linalg.distributed

✘

✔

pyspark.mllib.random

✘

✔

pyspark.mllib.recommendation

✘

✔

pyspark.mllib.regression

✘

✔

pyspark.mllib.stat

✘

✔

pyspark.mllib.stat.KernelDensity

✘

✔

pyspark.mllib.stat._statistics

✘

✔

pyspark.mllib.stat.distribution

✘

✔

pyspark.mllib.stat.test

✘

✔

pyspark.mllib.tests

✘

✘

Tests

pyspark.mllib.tree

✘

✔

pyspark.mllib.util

✘

✔

pyspark.profiler

✘

✔

pyspark.rdd

✘

✔

pyspark.rddsampler

✘

✔

pyspark.resultiterable

✘

✔

pyspark.serializers

✔

✘

pyspark.shell

✘

✘

Internal

pyspark.shuffle

✘

✘

Internal

pyspark.sql

✔

✘

pyspark.sql.catalog

✘

✔

pyspark.sql.column

✘

✔

pyspark.sql.conf

✘

✔

pyspark.sql.context

✘

✔

pyspark.sql.dataframe

✘

✔

pyspark.sql.functions

✘

✔

pyspark.sql.group

✘

✔

pyspark.sql.readwriter

✘

✔

pyspark.sql.session

✘

✔

pyspark.sql.streaming

✘

✔

pyspark.sql.tests

✘

✘

Tests

pyspark.sql.types

✘

✔

pyspark.sql.utils

✔

✘

pyspark.sql.window

✘

✔

pyspark.statcounter

✘

✔

pyspark.status

✘

✔

pyspark.storagelevel

✘

✔

pyspark.streaming

✔

✘

pyspark.streaming.context

✘

✔

pyspark.streaming.dstream

✘

✔

pyspark.streaming.flume

✔

✘

pyspark.streaming.kafka

✘

✔

pyspark.streaming.kinesis

✔

✘

pyspark.streaming.listener

✔

✘

pyspark.streaming.tests

✘

✘

Tests

pyspark.streaming.util

✔

✘

pyspark.taskcontext

✘

✔

pyspark.tests

✘

✘

Tests

pyspark.traceback_utils

✘

✘

Internal

pyspark.util

✔

✘

pyspark.version

✘

✔

pyspark.worker

✘

✘

Internal

Disclaimer

Apache Spark, Spark, PySpark, Apache, and the Spark logo are trademarks of The Apache Software Foundation. This project is not owned, endorsed, or sponsored by The Apache Software Foundation.

Metadata

Release files for pyspark-stubs 2.4.0.post12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyspark-stubs 2.4.0.post12
File Size Uploaded Provenance Actions
pyspark-stubs-2.4.0.post12.tar.gz 63.1 kB Without provenance Details for pyspark-stubs-2.4.0.post12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyspark-stubs 2.4.0.post12
File Interpreter ABI Platform Actions
pyspark_stubs-2.4.0.post12-py3-none-any.whl Python 3 none any Details for pyspark_stubs-2.4.0.post12-py3-none-any.whl

Total release size: 168.8 kB

Release files / pyspark-stubs-2.4.0.post12.tar.gz

Download URL pyspark-stubs-2.4.0.post12.tar.gz
Size 63.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c5c57feae13182d0c370beb18941480a9870d57c55755871e15523b7182d8321
BLAKE2b-256 checksum
How to use checksums
e51611f5585a90c18cc40afc3d2274bd66708c66b1979f968d1e6fd02f2912d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / pyspark_stubs-2.4.0.post12-py3-none-any.whl

Download URL pyspark_stubs-2.4.0.post12-py3-none-any.whl
Size 105.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e13a89e77ece7147c861dc9a93f513c70085c5d0e752756021bca3b319c01b80
BLAKE2b-256 checksum
How to use checksums
18df49f08315eec80134cc2159d9353f8c19fa3bb781972b4d7c8d43ec246d32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Security for pyspark-stubs 2.4.0.post12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page