Skip to content
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

[ISSUE]AttributeError: 'PublicTokenInfo' object has no attribute 'owner_id' #843

Open
abhinav-as opened this issue Dec 23, 2024 · 0 comments

Comments

@abhinav-as
Copy link

Description
The return type of the method w.token_management.list() is Iterator[[TokenInfo] as per the documentation. However the return type becomes Iterator[[PublicTokenInfo] when I run my code via a databricks job that is attatched to a job cluster.
Screenshot 2024-12-23 at 9 16 58 AM
The same code is working fine on a different cluster. both of these clusters have the same databricks-sdk version 0.10.0 and the same configuration.

Reproduction

pats = self.workspace_client.token_management.list()
        for pat in pats:
            if str(pat.owner_id) == service_principal.id:
                return True, pat

Expected behavior
The above code should not give the above error attatched in the screenshot no matter which cluster I run from

Is it a regression?
tried in the latest version as well. Got the same error.

Debug Logs
The SDK logs helpful debugging information when debug logging is enabled. Set the log level to debug by adding logging.basicConfig(level=logging.DEBUG) to your program, and include the logs here.
log4j-active.txt
stderr.txt
stdout.txt

Other Information

  • DBR: 13.3 LTS (includes Apache Spark 3.4.1, Scala 2.12)
    Additional context
Screenshot 2024-12-23 at 9 38 02 AM FYI the JSON value when hitting the endpoint is same in both the clusters. Is there a way to return only the json object?
@abhinav-as abhinav-as changed the title AttributeError: 'PublicTokenInfo' object has no attribute 'owner_id' [ISSUE]AttributeError: 'PublicTokenInfo' object has no attribute 'owner_id' Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant