Skip to content

can't write to onelake using the latest nightly build #2326

@djouallah

Description

@djouallah

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions