@@ -169,14 +169,32 @@ interface PythonExecutableProps {
169
169
/**
170
170
* Additional Python files that AWS Glue adds to the Python path before executing your script.
171
171
* Only individual files are supported, directories are not supported.
172
+ * Equivalent to a job parameter `--extra-py-files`.
172
173
*
173
174
* @default - no extra python files and argument is not set
174
175
*
175
- * @see `--extra-py-files` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
176
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
176
177
*/
177
178
readonly extraPythonFiles ?: Code [ ] ;
178
179
}
179
180
181
+ interface RayExecutableProps {
182
+ /**
183
+ * The Python version to use.
184
+ */
185
+ readonly pythonVersion : PythonVersion ;
186
+
187
+ /**
188
+ * Additional Python modules that AWS Glue adds to the Python path before executing your script.
189
+ * Equivalent to a job parameter `--s3-py-modules`.
190
+ *
191
+ * @default - no extra python files and argument is not set
192
+ *
193
+ * @see https://docs.aws.amazon.com/glue/latest/dg/author-job-ray-job-parameters.html
194
+ */
195
+ readonly s3PythonModules ?: Code [ ] ;
196
+ }
197
+
180
198
interface SharedJobExecutableProps {
181
199
/**
182
200
* Runtime. It is required for Ray jobs.
@@ -199,10 +217,11 @@ interface SharedJobExecutableProps {
199
217
/**
200
218
* Additional files, such as configuration files that AWS Glue copies to the working directory of your script before executing it.
201
219
* Only individual files are supported, directories are not supported.
220
+ * Equivalent to a job parameter `--extra-files`.
202
221
*
203
222
* @default [] - no extra files are copied to the working directory
204
223
*
205
- * @see `--extra-files` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
224
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
206
225
*/
207
226
readonly extraFiles ?: Code [ ] ;
208
227
}
@@ -211,19 +230,21 @@ interface SharedSparkJobExecutableProps extends SharedJobExecutableProps {
211
230
/**
212
231
* Additional Java .jar files that AWS Glue adds to the Java classpath before executing your script.
213
232
* Only individual files are supported, directories are not supported.
233
+ * Equivalent to a job parameter `--extra-jars`.
214
234
*
215
235
* @default [] - no extra jars are added to the classpath
216
236
*
217
- * @see `--extra-jars` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
237
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
218
238
*/
219
239
readonly extraJars ?: Code [ ] ;
220
240
221
241
/**
222
242
* Setting this value to true prioritizes the customer's extra JAR files in the classpath.
243
+ * Equivalent to a job parameter `--user-jars-first`.
223
244
*
224
245
* @default false - priority is not given to user-provided jars
225
246
*
226
- * @see `--user-jars-first` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
247
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
227
248
*/
228
249
readonly extraJarsFirst ?: boolean ;
229
250
}
@@ -234,8 +255,9 @@ interface SharedSparkJobExecutableProps extends SharedJobExecutableProps {
234
255
export interface ScalaJobExecutableProps extends SharedSparkJobExecutableProps {
235
256
/**
236
257
* The fully qualified Scala class name that serves as the entry point for the job.
258
+ * Equivalent to a job parameter `--class`.
237
259
*
238
- * @see `--class` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
260
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
239
261
*/
240
262
readonly className : string ;
241
263
}
@@ -253,7 +275,7 @@ export interface PythonShellExecutableProps extends SharedJobExecutableProps, Py
253
275
/**
254
276
* Props for creating a Python Ray job executable
255
277
*/
256
- export interface PythonRayExecutableProps extends SharedJobExecutableProps , PythonExecutableProps { }
278
+ export interface PythonRayExecutableProps extends SharedJobExecutableProps , RayExecutableProps { }
257
279
258
280
/**
259
281
* The executable properties related to the Glue job's GlueVersion, JobType and code
@@ -377,14 +399,17 @@ export class JobExecutable {
377
399
if ( JobLanguage . PYTHON !== config . language && config . extraPythonFiles ) {
378
400
throw new Error ( 'extraPythonFiles is not supported for languages other than JobLanguage.PYTHON' ) ;
379
401
}
402
+ if ( config . extraPythonFiles && type === JobType . RAY . name ) {
403
+ throw new Error ( 'extraPythonFiles is not supported for Ray jobs' ) ;
404
+ }
380
405
if ( config . pythonVersion === PythonVersion . THREE_NINE && type !== JobType . PYTHON_SHELL . name && type !== JobType . RAY . name ) {
381
406
throw new Error ( 'Specified PythonVersion PythonVersion.THREE_NINE is only supported for JobType Python Shell and Ray' ) ;
382
407
}
383
408
if ( config . pythonVersion === PythonVersion . THREE && type === JobType . RAY . name ) {
384
409
throw new Error ( 'Specified PythonVersion PythonVersion.THREE is not supported for Ray' ) ;
385
410
}
386
411
if ( config . runtime === undefined && type === JobType . RAY . name ) {
387
- throw new Error ( 'Runtime is required for Ray jobs. ' ) ;
412
+ throw new Error ( 'Runtime is required for Ray jobs' ) ;
388
413
}
389
414
this . config = config ;
390
415
}
@@ -410,8 +435,9 @@ export interface JobExecutableConfig {
410
435
411
436
/**
412
437
* The language of the job (Scala or Python).
438
+ * Equivalent to a job parameter `--job-language`.
413
439
*
414
- * @see `--job-language` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
440
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
415
441
*/
416
442
readonly language : JobLanguage ;
417
443
@@ -441,46 +467,61 @@ export interface JobExecutableConfig {
441
467
442
468
/**
443
469
* The Scala class that serves as the entry point for the job. This applies only if your the job langauage is Scala.
470
+ * Equivalent to a job parameter `--class`.
444
471
*
445
472
* @default - no scala className specified
446
473
*
447
- * @see `--class` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
474
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
448
475
*/
449
476
readonly className ?: string ;
450
477
451
478
/**
452
479
* Additional Java .jar files that AWS Glue adds to the Java classpath before executing your script.
480
+ * Equivalent to a job parameter `--extra-jars`.
453
481
*
454
482
* @default - no extra jars specified.
455
483
*
456
- * @see `--extra-jars` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
484
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
457
485
*/
458
486
readonly extraJars ?: Code [ ] ;
459
487
460
488
/**
461
489
* Additional Python files that AWS Glue adds to the Python path before executing your script.
490
+ * Equivalent to a job parameter `--extra-py-files`.
462
491
*
463
492
* @default - no extra python files specified.
464
493
*
465
- * @see `--extra-py-files` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
494
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
466
495
*/
467
496
readonly extraPythonFiles ?: Code [ ] ;
468
497
498
+ /**
499
+ * Additional Python modules that AWS Glue adds to the Python path before executing your script.
500
+ * Equivalent to a job parameter `--s3-py-modules`.
501
+ *
502
+ * @default - no extra python files specified.
503
+ *
504
+ * @see https://docs.aws.amazon.com/glue/latest/dg/author-job-ray-job-parameters.html
505
+ */
506
+ readonly s3PythonModules ?: Code [ ] ;
507
+
469
508
/**
470
509
* Additional files, such as configuration files that AWS Glue copies to the working directory of your script before executing it.
510
+ * Equivalent to a job parameter `--extra-files`.
471
511
*
472
512
* @default - no extra files specified.
473
513
*
474
- * @see `--extra-files` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
514
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
475
515
*/
476
516
readonly extraFiles ?: Code [ ] ;
477
517
478
518
/**
479
519
* Setting this value to true prioritizes the customer's extra JAR files in the classpath.
520
+ * Equivalent to a job parameter `--user-jars-first`.
480
521
*
481
522
* @default - extra jars are not prioritized.
482
523
*
483
- * @see `--user-jars-first` in https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
524
+ * @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
484
525
*/
485
526
readonly extraJarsFirst ?: boolean ;
486
527
}
0 commit comments