-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Unclear documentation for the delegate_to parameter #9461
Comments
@olchas] Do you want to work on it? It looks like this is a task for you. |
@mik-laj sure. Could you assign me to this issue, please? |
@olchas We first need to ask a basic question. Shouldn't we abandon support for this feature? In what cases does it work? In what cases does it not work? |
@mik-laj I am still looking into it. The name suggests that domain-wide delegation only makes sense for G Suite applications (so in terms of Airflow it should only be applied to I am also still uncertain about how the two impersonation mechanisms can/should work together. As far as I can tell, domain-wide delegation is supposed to be used to impersonate user account using service account, while direct impersonation can be used to impersonate service account using either another service account or user account. So, I can see two scenarios:
However, @jaketf, @amithmathew, do you perhaps have more insight on the topic? |
Taking a look at the code now it seems we have this common GoogleBaseHook used by hooks for gsuite and cloud. This To play devil's advocate: There may be use cases where users expect |
|
@jaketf, @amithmathew so it would seem that the approach could be to:
WDYT? |
Sounds like great plan. |
One small problem though - we will have to deprecate the delegate_to parameter rather than remove them initially. In 2.1 we might be able to remove them, |
@olchas I'm in favour of 2nd approach. Regarding the deprecation - first I would check if current implementation works. If it does not then I see no reason for deprecation - let us just remove it. |
@olchas I'm in favour of 2nd approach. Regarding the deprecation - first I would check if current implementation works. If it does not then I see no reason for deprecation - let us just remove it. Agree with @turbaszek. I thought about deprecation in the sense that it will not fail when someone actually adds the "delegate_to" parameter. I am afraid there might be cases that someone already added this parameter and we do not want their DAGs to fail (even if this parameter was superfluous). I believe we have **kwargs in most such operators but it's worth checking. |
I agree remove |
@eladkal Please assign me :) |
I created a PR to resolve this issue. While tackling it, I came up with some questions:
|
|
Restore delegate_to param to GoogleDiscoveryApiHook to allow to specification of a service account for domain-wide delegation when using GoogleDiscoveryApiHook to access Google APIs which support domain-wide delegation but do not have a dedicated hook (such as Workspaces Admin API). Note that based on the discussion in apache#9461, the delegate_to param was deprecated in apache#29088 (and removed in apache#30748) from many hooks including GoogleDiscoveryApiHook. However, the delegate_to param was not removed from the docstring for the GoogleDiscoveryApiHook constructor. Update GCP connection docs to reflect delegate_to param in GoogleDiscoveryApiHook usage only when using Google APIs that support domain-wide delegation.
Restore delegate_to param to GoogleDiscoveryApiHook to allow to specification of a service account for domain-wide delegation when using GoogleDiscoveryApiHook to access Google APIs which support domain-wide delegation but do not have a dedicated hook (such as Workspaces Admin API). Note that based on the discussion in #9461, the delegate_to param was deprecated in #29088 (and removed in #30748) from many hooks including GoogleDiscoveryApiHook. However, the delegate_to param was not removed from the docstring for the GoogleDiscoveryApiHook constructor. Update GCP connection docs to reflect delegate_to param in GoogleDiscoveryApiHook usage only when using Google APIs that support domain-wide delegation.
Hello,
Most GCP operators accept the
delegate_to
parameter. It is not super well documented and it can be confusing to users exactly when they would use this as opposed to another conn id.A little more documentation on the following page would be helpful.
https://airflow.readthedocs.io/en/latest/howto/connection/gcp.html
You can get extra points for adding information about Impersonated credentials
. This feature is not supported by Airflow, but it is related (ticket).
Are you wondering how to start contributing to this project? Start by reading our contributor guide
Best regards,
Kamil
CC: @jaketf
The text was updated successfully, but these errors were encountered: