-
Notifications
You must be signed in to change notification settings - Fork 99
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
Patch dbutils.notebook.entry_point...
to return current local notebook path from env var
#618
base: main
Are you sure you want to change the base?
Conversation
…ook path from env var
This PR breaks backwards compatibility for databrickslabs/ucx downstream. See build logs for more details. Running from downstreams #81 |
a15b9d5
to
23d7021
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #618 +/- ##
==========================================
- Coverage 57.89% 57.74% -0.16%
==========================================
Files 44 47 +3
Lines 27956 32418 +4462
==========================================
+ Hits 16185 18719 +2534
- Misses 11771 13699 +1928 ☔ View full report in Codecov by Sentry. |
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.
Few nits but otherwise looks good.
@@ -241,6 +243,75 @@ def __getattr__(self, util) -> '_ProxyUtil': | |||
name=util) | |||
|
|||
|
|||
@dataclass | |||
class OverrideResult: |
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.
Is this necessary? We just return result.result
every time. Might as well return the result itself?
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.
This is to provide a type that wraps a None result from the override. Some of the functions can then safely return None, if the override is not found or is not able to run.
Co-authored-by: Miles Yucht <miles@databricks.com> Signed-off-by: Kartik Gupta <88345179+kartikgupta-db@users.noreply.github.com>
Co-authored-by: Miles Yucht <miles@databricks.com> Signed-off-by: Kartik Gupta <88345179+kartikgupta-db@users.noreply.github.com>
Signed-off-by: Kartik Gupta <88345179+kartikgupta-db@users.noreply.github.com>
This PR breaks backwards compatibility for databrickslabs/blueprint downstream. See build logs for more details. Running from downstreams #81 |
Changes
dbutils.notebook.entry_point.getDbutils().notebook().getContext().notebookPath().get()
to get the current notebook path in notebooks (referring https://stackoverflow.com/questions/53523560/databricks-how-do-i-get-path-of-current-notebook).Proposal
Tests
make test
run locallymake fmt
applied