This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Glue job not updating on iam_role_arn change GlueJobOperator/GlueJobHook #36203
Labels
You can continue the conversation there. Go to discussion →
Apache Airflow version
2.7.3
What happened
I'm running a DAG like:
If
a-valid-iam-role-arn
is indeed valid, the DAG runs fine and it created a Glue job with the nameget_stuff
. Now, suppose thatiam_role_arn
changes, maybe I even break it on purpose, e.g., replace the line:iam_role_arn="BREAK_ON_PURPOSE" # Consider this line
I would definitely expect the DAG to update the Glue job
get_stuff
or at least try to do so - if the role is completely bogus maybe it should break loudly or if the role ARN is valid but has insufficient permissions or whatever, the change should go through. After committing the change, re-running the DAG succeeds. Inspecting the Glue job from the AWS console still shows the IAM role to bea-valid-iam-role-arn
, i.e., the job did not update.So while the DAG code does get updated, the Glue job does not. I observe the same effect with a completely bogus IAM role ARN (i.e., invalid ARN), an existing but semantically wrong ARN, and also with a correct, desired ARN that does exist and has the permissions to run whatever is needed.
What you think should happen instead
The Glue job should update with the new IAM role ARN.
How to reproduce
Have a valid default
aws_default
connection. Use the following DAG:Follow the three manual steps above (create bucket, add mock file, pick/create a new IAM role). Run the operator. Update the
iam_role_arn
. Run the operator. Notice now that the Glue job which has been created has not been updated.Operating System
Amazon Linux 2023
Versions of Apache Airflow Providers
apache-airflow-providers-amazon==8.11.0
Deployment
Virtualenv installation
Deployment details
No response
Anything else
Looking at the code, the issue seems to be within
GlueJobHook
. Maybe the culprit is thecreate_or_update_glue_job
method which in turn usescreate_glue_job_config
. I can't, however, see that anything would obviously be wrong. This might be related to #27893Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: