-
Notifications
You must be signed in to change notification settings - Fork 131
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
[PROD-37531] Exposing REPL credential provider to Python SDK #130
[PROD-37531] Exposing REPL credential provider to Python SDK #130
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #130 +/- ##
==========================================
- Coverage 53.01% 53.00% -0.01%
==========================================
Files 29 29
Lines 17568 17570 +2
==========================================
Hits 9313 9313
- Misses 8255 8257 +2
☔ View full report in Codecov by Sentry. |
@@ -6,7 +6,8 @@ | |||
# available to be imported from databricks.sdk.runtime.globals. This import can be used | |||
# in Python modules so users can access these objects from Files more easily. | |||
dbruntime_objects = [ | |||
"display", "displayHTML", "dbutils", "table", "sql", "udf", "getArgument", "sc", "sqlContext", "spark" | |||
"display", "displayHTML", "dbutils", "table", "sql", "udf", "getArgument", "sc", "sqlContext", "spark", | |||
"init_runtime_native_auth" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if init_runtime_native_auth
is not present in the userNamespaceGlobals
in the old DBR versions? please add if var not in userNamespaceGlobals: continue
, otherwise SDK might crash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nfx I will add it. However, when I test this against DBR 12.2 LTS (which definitely doesn't have init_runtime_native_auth
), it doesn't actually crash. That is surprising considering that if I run this in notebook, it raise a KeyError
as expected. Do you have any idea why this is the case? Just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a mystery :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgttm
@@ -6,7 +6,8 @@ | |||
# available to be imported from databricks.sdk.runtime.globals. This import can be used | |||
# in Python modules so users can access these objects from Files more easily. | |||
dbruntime_objects = [ | |||
"display", "displayHTML", "dbutils", "table", "sql", "udf", "getArgument", "sc", "sqlContext", "spark" | |||
"display", "displayHTML", "dbutils", "table", "sql", "udf", "getArgument", "sc", "sqlContext", "spark", | |||
"init_runtime_native_auth" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a mystery :)
# Version changelog ## 0.1.9 * Added new services from OpenAPI spec ([#145](#145), [#159](#159)). * Added consistent usage of the `upload(path, IO)` and `download(path) -> IO` across file-related operations ([#148](#148)). * Added Databricks Metadata Service credential provider ([#139](#139), [#130](#130)). * Added exposing runtime credential provider without changing user namespace ([#140](#140)). * Added a check for `is not None` for primitive fields in `as_dict()` ([#147](#147)). * Fixed bug related to boolean flags and convert `True` to `true` in query strings ([#156](#156)). * Fixed generation of external entities ([#146](#146)). * Make u2m authentication work with new CLI ([#150](#150)).
Changes
In previous PR, we expose a function that will be used by Python SDK's
runtime_native_auth
so that in notebook environment it directly access information from command execution to authenticate. This PR import it from Python runtime to put on last piece of puzzle.Tests
make test
run locallymake fmt
applied