You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Lee-W (via GitHub)" <gi...@apache.org> on 2023/08/16 09:41:37 UTC
[GitHub] [airflow] Lee-W opened a new pull request, #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Lee-W opened a new pull request, #33433:
URL: https://github.com/apache/airflow/pull/33433
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
<!-- Please keep an empty line above the dashes. -->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
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](https://github.com/apache/airflow/tree/main/newsfragments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk merged pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #33433:
URL: https://github.com/apache/airflow/pull/33433
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] Lee-W commented on pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #33433:
URL: https://github.com/apache/airflow/pull/33433#issuecomment-1691301163
>
> > > can you add example DAG for this change and unit tests as well
> >
> >
> > I'm using the existing DAG for the testing, and I don't expect code changes to be needed on the DAG. And yes, I'll add some unit tests
>
> Does the existing DAG make use of DefaultAzureCredential?
Whether to use `DefaultAzureCredential` is decided on the connection setup; if tenant and password are not set, it'll fallback to `DefaultAzureCredential`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] Lee-W commented on pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #33433:
URL: https://github.com/apache/airflow/pull/33433#issuecomment-1691008135
<img width="1583" alt="圖片" src="https://github.com/apache/airflow/assets/5144808/6e4da421-d0f5-49c8-aa33-3279a4967f0a">
<img width="1592" alt="圖片" src="https://github.com/apache/airflow/assets/5144808/61d329af-966b-41f4-aab5-177cadfc72e0">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] phanikumv commented on pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "phanikumv (via GitHub)" <gi...@apache.org>.
phanikumv commented on PR #33433:
URL: https://github.com/apache/airflow/pull/33433#issuecomment-1691287597
> > can you add example DAG for this change and unit tests as well
>
> I'm using the existing DAG for the testing, and I don't expect code changes to be needed on the DAG. And yes, I'll add some unit tests
Does the existing DAG make use of DefaultAzureCredential?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] Lee-W commented on a diff in pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #33433:
URL: https://github.com/apache/airflow/pull/33433#discussion_r1295728983
##########
airflow/providers/microsoft/azure/hooks/data_lake.py:
##########
@@ -308,18 +310,18 @@ def get_conn(self) -> DataLakeServiceClient: # type: ignore[override]
# connection_string auth takes priority
return DataLakeServiceClient.from_connection_string(connection_string, **extra)
+ credential: Credentials
tenant = self._get_field(extra, "tenant_id")
if tenant:
# use Active Directory auth
app_id = conn.login
app_secret = conn.password
- token_credential = ClientSecretCredential(tenant, app_id, app_secret)
- return DataLakeServiceClient(
- account_url=f"https://{conn.host}.dfs.core.windows.net", credential=token_credential, **extra
- )
+ credential = ClientSecretCredential(tenant, app_id, app_secret)
+ elif conn.password:
+ credential = conn.password
+ else:
+ credential = DefaultAzureCredential()
Review Comment:
Sure. I'll test and post a screenshot before I mark these PRs as read to review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] Lee-W commented on pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #33433:
URL: https://github.com/apache/airflow/pull/33433#issuecomment-1694143780
Just add some unit tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] phanikumv commented on a diff in pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "phanikumv (via GitHub)" <gi...@apache.org>.
phanikumv commented on code in PR #33433:
URL: https://github.com/apache/airflow/pull/33433#discussion_r1295710721
##########
airflow/providers/microsoft/azure/hooks/data_lake.py:
##########
@@ -308,18 +310,18 @@ def get_conn(self) -> DataLakeServiceClient: # type: ignore[override]
# connection_string auth takes priority
return DataLakeServiceClient.from_connection_string(connection_string, **extra)
+ credential: Credentials
tenant = self._get_field(extra, "tenant_id")
if tenant:
# use Active Directory auth
app_id = conn.login
app_secret = conn.password
- token_credential = ClientSecretCredential(tenant, app_id, app_secret)
- return DataLakeServiceClient(
- account_url=f"https://{conn.host}.dfs.core.windows.net", credential=token_credential, **extra
- )
+ credential = ClientSecretCredential(tenant, app_id, app_secret)
+ elif conn.password:
+ credential = conn.password
+ else:
+ credential = DefaultAzureCredential()
Review Comment:
Can you post a screenshot of a task working successfully with the `DefaultAzureCredential` that you introduced
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] Lee-W commented on pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #33433:
URL: https://github.com/apache/airflow/pull/33433#issuecomment-1691096325
> can you add example DAG for this change and unit tests as well
I'm using the existing DAG for the testing, and I don't expect code changes to be needed on the DAG. And yes, I'll add some unit tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #33433:
URL: https://github.com/apache/airflow/pull/33433#issuecomment-1695400610
@phanikumv -> are you good with it ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org