garlandz-db opened a new pull request, #55234: URL: https://github.com/apache/spark/pull/55234
### What changes were proposed in this pull request? Adds three RST docstring directives to PySpark modules, classes, and methods to annotate their Spark Connect compatibility: - `.. classic:: true` — the API is only available in Classic Spark (not Spark Connect) - `.. connect:: true` — the API is available in Spark Connect - `.. connect_migration:: <message>` — migration guidance for users transitioning from Classic Spark to Spark Connect The annotation spec is documented in `python/pyspark/__init__.py`. Annotations are resolved by inheriting from the nearest annotated ancestor; a child annotation overrides the parent's. Annotated modules/classes in this PR: - `pyspark.core` and its submodules (RDD, SparkContext, etc.) — Classic only, with per-method migration guidance - `pyspark.mllib` — Classic only, migrate to `pyspark.ml.connect` - `pyspark.ml.clustering` (LDA family) — Classic only - `pyspark.ml.deepspeed`, `pyspark.ml.torch` — Classic only - `pyspark.ml.wrapper` — Classic only - `pyspark.ml.connect` — Connect - `pyspark.sql.classic`, `pyspark.sql.connect` — Classic / Connect respectively - `pyspark.sql.context` — Classic only (use SparkSession instead) - `pyspark.sql.dataframe.DataFrame.rdd` — migration guidance - `pyspark.sql.readwriter.DataFrameReader.json` — migration guidance for RDD arg - `pyspark.sql.udf.UDFRegistration.registerJavaFunction` — migration guidance - `pyspark.sql.metrics`, `pyspark.errors.exceptions.connect` — Connect - Various internal/utility modules — Classic only ### Why are the changes needed? These annotations enable tooling (IDEs, documentation generators, linters) to surface accurate Spark Connect compatibility information to users, helping them understand which APIs are available in Spark Connect and how to migrate. ### Does this PR introduce _any_ user-facing change? No. Docstring-only changes; no functional code modifications. ### How was this patch tested? No tests added — docstring-only changes. Existing test suites continue to pass. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude (Anthropic), claude-sonnet-4-6 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
