-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implementation of BaseOperatorLink for cloud run jobs to expose the GCP cloud logging url #46911
base: main
Are you sure you want to change the base?
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
b2d6790
to
1295e5b
Compare
… github.com:ramonvermeulen/airflow into feature/ramon/36963-cloud-run-jobs-operator-log-url
626d1dd
to
9685f0b
Compare
9685f0b
to
5c07ae6
Compare
@potiuk @amoghrajesh @sunank200 @eladkal Since I see that most of you are involved in decision making and recent contributions to the google-provider, and this is my first time contributing to airflow, I would love to hear your view/opinion on this feature. |
providers/google/src/airflow/providers/google/cloud/operators/cloud_run.py
Outdated
Show resolved
Hide resolved
providers/google/src/airflow/providers/google/cloud/operators/cloud_run.py
Outdated
Show resolved
Hide resolved
providers/google/src/airflow/providers/google/cloud/operators/cloud_run.py
Outdated
Show resolved
Hide resolved
… github.com:ramonvermeulen/airflow into feature/ramon/36963-cloud-run-jobs-operator-log-url
… github.com:ramonvermeulen/airflow into feature/ramon/36963-cloud-run-jobs-operator-log-url
5d17b3d
to
fffcc52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than just putting this URL in the log message, please look at the "OperatorExtraLinks" concept -- you can make this show up as a button in the Airflow UI.
(They way I would suggest wiring that up is to have the operator push the url to XCom, and the OperatorLink can then pull the URL out of xcom)
Thanks, wasn't aware of that functionality. Will see if I can change the implementation after the weekend to make use of |
Since I am back from holidays, I tried to do the implementation via With Airflow 3, I get the following error on the base class I am using:
Line causing the error:
I am using the BaseGoogleLink and tried to follow the same pattern as the other extra link implementations in the google provider. If this is something that needs to be solved for Airflow 3 for all the Google Provider Links anyways, it would be nice if I can add that to the PR. However, since this is my first PR I do not have a great understanding of the airflow codebase (yet). Not sure what should be used instead of the ORM in Airflow 3> to access the XCom from within a BaseOperatorLink? Full error output:
|
Managed to get rid of the above error, and again pulled in the latest upstream. However, I notice there is an error when the web app tries to fetch the extra link and I have the feeling it might be related to recent changes:
Line causing the error airflow/airflow/models/xcom.py Line 338 in 0010596
Stacktrace
Error has to do with the To give an example, this is how the XCom looks like for the CloudRunExecuteJobOperator (the new implementation in this PR): And for the BigQueryCreateTableOperator that I tested: Both seem to contain a valid link, however the API server throws a 500 with the jsondecode error (a plain URL in XCom is not valid json). This happens when you open the details page of a task instance (e.g. react front-end fetching the API on this specific TaskInstance list extra links route). |
This #47961 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and I am happy to approve once you have added the test I requested
Just updated the PR with a test for |
New implementation (with extra_links) example:

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.