Repository navigation
Closed
Milestone
Description
Apache Iceberg version
None
Please describe the bug 🐞
using this code
!pip install --extra-index-url https://test.pypi.org/simple/ pyiceberg==0.10.0.dev20250813003016
from pyiceberg.catalog.sql import SqlCatalog
import duckdb
def connect_catalog():
catalog = SqlCatalog(
"default",
**{
"uri": "sqlite:///:memory:",
"adls.account-name" : 'onelake' ,
"adls.client-id" : client_id,
"adls.tenant-id" : tenant_id,
"adls.client-secret" : client_secret,
"legacy-current-snapshot-id": True ,
"warehouse" : "abfss://iceberg@onelake.dfs.fabric.microsoft.com/external.Lakehouse/Files"
},
)
return catalog
catalog = connect_catalog()
db = "aemo"
catalog.create_namespace_if_not_exists(db)
tbl = db+"."+"calendar"
if not catalog.table_exists(tbl):
df=duckdb.sql(""" SELECT cast(unnest(generate_series(cast ('2018-04-01' as date), cast('2024-12-31' as date), interval 1 day)) as date) as date,
EXTRACT(year from date) as year,
EXTRACT(month from date) as month
""").arrow()
catalog.create_table(tbl,schema=df.schema)
catalog.load_table(tbl).overwrite(df)
print('calendar created')
else:
print("table exist already")
I am getting this error
ClientSecretCredential.get_token_info failed: The current credential is not configured to acquire tokens for tenant xxxxxxxxxxxxxxxxxxxxxxxxxx. To enable acquiring tokens for this tenant add it to the additionally_allowed_tenants when creating the credential, or add "*" to additionally_allowed_tenants to allow acquiring tokens for any tenant.
btw, this works fine and I got a token
from azure.identity import ClientSecretCredential
# Create credential with specific values
credential = ClientSecretCredential(
tenant_id=tenant_id,
client_id=client_id,
client_secret=client_secret
)
# Get token for Azure Storage
token = credential.get_token("https://storage.azure.com/.default").token
Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
Metadata
Metadata
Assignees
Labels
No labels
Activity
Fokko commentedon Aug 13, 2025
@djouallah Thanks for raising this. We're very close on the 0.10 release and I would love to include this fix. Could you share a full stacktrace to help me identify where it blows up? For example, it is unclear to me which FileIO you're using. Thanks!
djouallah commentedon Aug 13, 2025
kevinjqliu commentedon Aug 14, 2025
Looks like this fails in
AzureBlobFileSystemspecifically in the way credential is handled.i was able to get it working with this:
Use
adls.credentialto pass credential directly to theAzureBlobFileSystemconstructor, this was added in #2299To work with onelake, we also need to set
adls.account-hostwhich was added in #2016. Theaccount-hostparameter was only added toAzureBlobFileSystemin this commit which is only available for version >=2024.7.0You can check which adlfs version youre using by running
I looks like pyiceberg already install adlfs
2024.12.0by default so the issue is likely just with setting theaccount_hostandcredentialcould you set those and confirm?
djouallah commentedon Aug 14, 2025
i can confirm, this works and onelake recognized it as a valid iceberg table :), thank you all !!!
bump adlfs minimum to 2024.7.0 (#2330)