LoginSignup
0
0

More than 1 year has passed since last update.

PythonをGlue3.0で実行する方法

Last updated at Posted at 2022-04-16

はじめに

AWS GlueでPythonを動かそうと思い「Python Shell script editor」をポチッと選択してみたら、なんとGlueのバージョンが選べず、Glue3.0ではなく1.0で動かすしかなかった。
Glueバージョンを選択したうえでPythonを動かす方法を見つけたので共有します。

と言ってもめっちゃ簡単な話なので簡潔にお話しします。

今回の問題

GlueStudioのJobsメニューでPythonジョブを作ろうとすると、「Python Shell script editor」を選びたくなる。
image.png

実際に作ってみると、Glue versionが空になっている。この場合、実際にはGlue1.0が動くらしい。
image.png

ジョブの詳細を見てみると、Python3.6になっている。ここは変更不可。Glue2.0以降はPython3.7になる。
image.png

解決策

「Visual with a source and target」を選択してジョブを作成する。
image.png

「Create」をクリックすると以下画面になるので、「Script」をクリックする。
image.png

何やらエラーが出ているしScriptがロックされているが、臆せず「Edit Script」をクリックする。
image.png

visual modeからscript-only modeに変更するともう後戻りはできないよ!という旨のメッセージが出るが、「Confirm」をクリックする。
image.png

Pythonコードが書けるようになる。
image.png

Glueバージョンも0.9~3.0で選べる。
image.png

さいごに

Glue3.0でPythonを動かしたいときにちょっと迷ったので共有でした。
なんで「Python Shell script editor」でGlueのバージョン選べないのか分からないですが、、。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0