Skip to content

Where to pass bearer token? #4

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

Open
ion-elgreco opened this issue Jun 27, 2024 · 3 comments
Open

Where to pass bearer token? #4

ion-elgreco opened this issue Jun 27, 2024 · 3 comments

Comments

@ion-elgreco
Copy link

Wanted to see if I could replace my internally built UC API wrapper but using this package I cannot figure out how to pass a bearer token?

Tried passing the below to extra_headers, but no luck unfortunately.

headers = {
  "Authorization": f"Bearer {my_token}",
  "Content-Type": "application/json",
}
@samster25
Copy link
Collaborator

This is how we did it in daft using this package.

unitycatalog.Unitycatalog(
            base_url=endpoint.rstrip("/") + "/api/2.1/unity-catalog/",
            default_headers={"Authorization": f"Bearer {token}"},
        )

What sort of error are you getting?

@ion-elgreco
Copy link
Author

Ah didn't realize that you have to explicitly add /api/2.1/unity-catalog, in my own wrapper this was automatically appended to the uri

@samster25
Copy link
Collaborator

@ion-elgreco Yeah currently this project is just generated from the openapi stubs. I think it would be a good idea to build a higher level api that we can also expose.

We could move over the Daft code to here:
https://github.com/Eventual-Inc/Daft/blob/d2107b75966eed116403123e97ef29abdd0db8ec/daft/unity_catalog/unity_catalog.py#L12

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

2 participants