The `awsglue3-local` package is a Python utility for facilitating local development of AWS Glue 3.0 jobs. It aims to simplify the setup of a local PySpark environment that mimics the Glue 3.0 runtime, allowing developers to test Glue scripts outside of the AWS cloud. As of its latest release, it's at version 1.0.0. The release cadence is irregular, typically tied to the need for Glue version compatibility.
pip install awsglue3-localVerified import paths — ran on the pinned version, not inferred.
A basic AWS Glue job script demonstrating the initialization of `GlueContext`, `SparkSession`, and parsing job arguments using `getResolvedOptions`. This code assumes `awsglue3-local` has correctly set up the environment for these imports to resolve. Note that full `DynamicFrame` functionality often requires additional Glue libraries and configurations, which `awsglue3-local` aims to facilitate but might require more complex setup for specific connectors.
Be aware that local execution with `awsglue3-local` provides an approximation of the Glue runtime. For full fidelity, consider using official AWS Glue Docker images or `spark-submit` with `aws-glue-libs` on the classpath.
Always perform final validation and testing on the actual AWS Glue environment. Ensure local testing focuses on logic and syntax, rather than subtle performance or integration nuances.
For local testing, ensure you either pass dummy arguments (e.g., `sys.argv.extend(['--JOB_NAME', 'my_local_job'])`) or handle missing arguments gracefully in your script, e.g., by providing default values or checking for argument existence.
Ensure `awsglue3-local` is correctly installed. If running with PySpark, confirm that the Glue libraries (often `aws-glue-libs.jar`) are included in your Spark classpath. For `awsglue3-local`, this should ideally be handled, but manual intervention might be needed for complex setups.
Ensure your local Spark environment (or the environment configured by `awsglue3-local`) includes the correct Hadoop-AWS JARs. For `pyspark` directly, this often involves `spark-submit --packages org.apache.hadoop:hadoop-aws:x.y.z ...`.
Verify that `GlueContext` is correctly initialized (`GlueContext(sc)`), and `job.init()` is called. Ensure your local environment is robust enough to handle the Glue-specific Spark extensions. Sometimes, restarting the Spark session helps.
No dependency data recorded yet.
No resource links recorded.