-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix notebook sources with
NotebookLinter.apply
(#3693)
## Changes Add notebook fixing to `NotebookLinter` - Implement `Notebook.apply` - Call `Notebook.apply` from `FileLiner.apply` for `Notebook` source container - Remove legacy `NotebookMigrator` - Introduce `PythonLinter` to run apply on a AST tree - Allow to ### Linked issues Progresses #3514 Breaks up #3520 ### Functionality - [x] modified existing command: `databricks labs ucx migrate-local-code` ### Tests - [x] manually tested - [x] modified and added unit tests - [x] modified and added integration tests
- Loading branch information
1 parent
01c4263
commit eb6009a
Showing
16 changed files
with
561 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from enum import Enum | ||
import urllib.parse | ||
|
||
|
||
DOCS_URL = "https://databrickslabs.github.io/ucx/docs/" | ||
GITHUB_URL = "https://github.com/databrickslabs/ucx" | ||
|
||
|
||
class IssueType(Enum): | ||
"""The issue type""" | ||
|
||
FEATURE = "Feature" | ||
BUG = "Bug" | ||
TASK = "Task" | ||
|
||
|
||
def construct_new_issue_url( | ||
issue_type: IssueType, | ||
title: str, | ||
body: str, | ||
*, | ||
labels: set[str] | None = None, | ||
) -> str: | ||
"""Construct a new issue URL. | ||
References: | ||
- https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/creating-an-issue#creating-an-issue-from-a-url-query | ||
""" | ||
labels = labels or set() | ||
labels.add("needs-triage") | ||
parameters = { | ||
"type": issue_type.value, | ||
"title": title, | ||
"body": body, | ||
"labels": ",".join(sorted(labels)), | ||
} | ||
query = "&".join(f"{key}={urllib.parse.quote_plus(value)}" for key, value in parameters.items()) | ||
return f"{GITHUB_URL}/issues/new?{query}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.