Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
AstrakhantsevaAA committed Jan 4, 2024
1 parent 7f7c8bc commit a02d1d3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions dlt/cli/magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
from IPython.core.magic_arguments import argument, magic_arguments, parse_argstring

from dlt.cli import echo
from dlt.cli._dlt import (
init_command_wrapper,
pipeline_command_wrapper,
schema_command_wrapper,
telemetry_change_status_command_wrapper,
)
from dlt.common.runtime.exec_info import is_databricks, is_ipython

DEFAULT_VERIFIED_SOURCES_REPO = "https://github.com/dlt-hub/verified-sources.git"
Expand Down Expand Up @@ -53,7 +47,9 @@ def display(self) -> t.Any:
return display # Assuming 'display' is a predefined callable

def success_message(self, message: str) -> t.Any:
msg = f'<div><span style="color: green; font-weight: bold">{message}</span></div>'
msg = (
f'<div><span style="color: green; font-weight: bold">{message}</span></div>'
)
return self.display(HTML(msg))

def on_exception(self, ex: str, info: str) -> t.Any:
Expand All @@ -73,6 +69,8 @@ def on_exception(self, ex: str, info: str) -> t.Any:
)
@line_magic
def settings(self, line: str) -> int:
from dlt.cli._dlt import telemetry_change_status_command_wrapper

"""
A dlt line magic command to set global settings like telemetry
"""
Expand Down Expand Up @@ -113,6 +111,8 @@ def init(self, line: str) -> t.Any:
"""
A dlt line magic command for initializing a dlt project.
"""
from dlt.cli._dlt import init_command_wrapper

args = parse_argstring(self.init, line)

with echo.always_choose(False, always_choose_value=True):
Expand Down Expand Up @@ -143,6 +143,8 @@ def pipeline(self, line: str) -> t.Any:
"""
A dlt line magic command for pipeline operations.
"""
from dlt.cli._dlt import pipeline_command_wrapper

args = parse_argstring(self.pipeline, line)

if args.operation == "list-pipelines":
Expand All @@ -165,6 +167,8 @@ def schema(self, line: str) -> t.Any:
"""
A dlt line magic command for handling schemas.
"""
from dlt.cli._dlt import schema_command_wrapper

args = parse_argstring(self.schema, line)

try:
Expand Down

0 comments on commit a02d1d3

Please sign in to comment.