Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Certified Generative AI Engineer Associate Exam - Topic 4 Question 27 Discussion

Posted by Cristal on Apr 11, 2026 at 07:14 AM

All of the following are Python APIs used to query Databricks foundation models. When running in an interactive notebook, which of the following libraries does not automatically use the current session credentials?

Suggested Answer: B

When working within a Databricks notebook, several high-level SDKs are 'Databricks-aware.' The MLflow Deployments SDK (C) and the Databricks Python SDK (D) are designed to automatically look for the DATABRICKS_HOST and DATABRICKS_TOKEN environment variables provided by the notebook context. The OpenAI client (A), when configured for Databricks via Mosaic AI Gateway, also typically handles authentication via workspace integration in recent versions. However, the REST API via the requests library (B) is a generic Python HTTP client. It has no intrinsic knowledge of the Databricks environment. To use it, an engineer must manually extract the token (e.g., via dbutils.notebook.entry_point...) and explicitly pass it in the Authorization: Bearer <token> header of the request. Without this manual step, the requests library will fail with a 401 Unauthorized error.


Get Premium Databricks Certified Generative AI Engineer Associate Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
20 comments · newest first
GA
Gabriele 1 month ago
Overall, B is the safest bet for this question.
GI
Gianna 1 month ago
D) Databricks Python SDK definitely uses them, right?
BR
Brent 2 months ago
I feel like C) MLflow Deployments SDK might use session credentials.
KR
Kris 2 months ago
A) OpenAI client seems like a good option too, but I lean towards B.
LI
Ligia 2 months ago
I agree, it doesn't use session credentials automatically.
RI
Ria 2 months ago
I think it's B) REST API via requests library.
BO
Boris 2 months ago
That's interesting, I didn't know that!
MI
Mignon 3 months ago
Nope, definitely B.
VE
Velda 3 months ago
Wait, are you sure? I thought it was D) Databricks Python SDK.
FA
Fabiola 3 months ago
Yeah, I agree with that!
GE
Georgene 3 months ago
I think it's B) REST API via requests library.
LO
Lonna 3 months ago
That's interesting, I didn't know that!
VI
Vilma 3 months ago
Nope, it's definitely A) OpenAI client that doesn't use session creds.
DA
Dahlia 4 months ago
Wait, are you sure? I thought it was D) Databricks Python SDK.
NI
Nichelle 5 months ago
Yeah, I agree with that!
YU
Yuonne 5 months ago
I think it's B) REST API via requests library.
JI
Jillian 6 months ago
I feel like the MLflow Deployments SDK is also tied to the session, but I can't recall the specifics for each option.
LI
Lindsey 6 months ago
I’m a bit confused about the OpenAI client. Did we cover whether it uses session credentials or not?
DU
Dulce 6 months ago
I remember practicing a question similar to this, and I think the REST API via requests library might not use session credentials by default.
LI
Lino 6 months ago
I think the Databricks Python SDK uses the current session credentials automatically, but I'm not sure about the others.
0/2000 characters

Save Cancel