Commit 2cba3b7
authored
fsspec: Support token in ADLS (#2331)
<!--
Thanks for opening a pull request!
-->
<!-- In the case this PR will resolve an issue, please replace
${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
<!-- Closes #${GITHUB_ISSUE_ID} -->
# Rationale for this change
Closes #2328
Pass `token` string as `credential` in `AzureBlobFileSystem`,
https://fsspec.github.io/adlfs/api/
This is a known workaround as described by
Azure/azure-sdk-for-python#9075 (comment)
I've also made a feature request for java implementation
apache/iceberg#13818
Note,
[`pyarrow.fs.AzureFileSystem`](https://arrow.apache.org/docs/python/generated/pyarrow.fs.AzureFileSystem.html)
does not currently expose credential as a parameter
# Are these changes tested?
Yes, manually since azurite does not integrate with entra.
heres a repro script
```
from azure.identity import DefaultAzureCredential
import pyarrow as pa
credential = DefaultAzureCredential()
token = credential.get_token("https://storage.azure.com/.default").token
warehouse = "abfss://kevinliu_demo_ws@daily-onelake.blob.fabric.microsoft.com/kevinliu_demo_lh.Lakehouse/Files"
account_name = "daily-onelake"
account_host = f"{account_name}.blob.fabric.microsoft.com"
catalog = load_catalog("default", **{
"type": "in-memory",
"warehouse": warehouse,
"adls.account-name": account_name,
"adls.account-host": account_host,
"adls.token": token,
})
catalog.create_namespace_if_not_exists("default")
try:
catalog.drop_table("default.test")
except:
...
TEST_DATA = {
"id": [1, 2, 3, 1, 1],
"name": ["AB", "CD", "EF", "CD", "EF"],
}
arrow_table = pa.Table.from_pydict(TEST_DATA)
tbl = catalog.create_table_if_not_exists("default.test", schema=arrow_table.schema)
tbl.append(arrow_table)
tbl.scan().to_arrow()
```
# Are there any user-facing changes?
<!-- In the case of user-facing changes, please add the changelog label.
-->1 parent 8013545 commit 2cba3b7
File tree
3 files changed
+26
-1
lines changed- mkdocs/docs
- pyiceberg/io
3 files changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
| 204 | + | |
| 205 | + | |
201 | 206 | | |
202 | 207 | | |
203 | 208 | | |
| |||
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
210 | 233 | | |
211 | 234 | | |
212 | | - | |
| 235 | + | |
213 | 236 | | |
214 | 237 | | |
215 | 238 | | |
| |||
0 commit comments