Spark & PySpark — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Spark & PySpark (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Author PySpark jobs that scale, avoid shuffles where possible, and use cluster resources efficiently.
from pyspark.sql import SparkSession
from pyspark.sql import functions as F
spark = (
SparkSession.builder
.appName("etl")
.config("spark.sql.shuffle.partitions", "200")
.config("spark.sql.adaptive.enabled", "true")
.getOrCreate()
)Enable Adaptive Query Execution (AQE); it coalesces shuffle partitions and optimizes joins at runtime.
DataFrame operations go through Catalyst and Tungsten, giving query optimization and off-heap memory. Drop to RDDs only when no DataFrame primitive exists.
Python UDFs serialize each row to the Python worker and back, breaking codegen. Order of preference:
pyspark.sql.functions (e.g. F.regexp_extract, F.when).from pyspark.sql.functions import pandas_udf
@pandas_udf("double")
def normalize(s):
return (s - s.mean()) / s.std()from pyspark.sql.functions import broadcast
result = large.join(broadcast(small), "key")repartition(n, col) does a full shuffle to balance data; use before wide writes.coalesce(n) reduces partitions without a shuffle; use to avoid tiny output files.df.write.partitionBy("dt").mode("overwrite").parquet("/data/out")Cache only when a DataFrame is reused multiple times in the DAG:
df.cache()
df.count() # materializeUnpersist when done to free memory. Caching a once-used DataFrame wastes memory.
collect() on large data; it pulls everything to the driver.df.explain(True).spark.sql.shuffle.partitions to roughly match cluster cores for the data size.F.col references rather than string columns when chaining for clarity.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.