Skip to content

Commit

Permalink
Fix mypy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sultaniman committed Mar 25, 2024
1 parent 848db33 commit 63b0b3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dlt/common/cli/runner/pipeline_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ def load_module(self, script_path: str) -> ModuleType:
return module

@contextmanager
def expect_no_pipeline_runs(self):
def expect_no_pipeline_runs(self): # type: ignore[no-untyped-def]
"""Monkey patch pipeline.run during module loading
Restore it once importing is done
"""
old_run = dlt.Pipeline.run

def noop(*args, **kwargs) -> LoadInfo:
def noop(*args, **kwargs) -> LoadInfo: # type: ignore
self.has_pipeline_auto_runs = True

dlt.Pipeline.run = noop
dlt.Pipeline.run = noop # type: ignore

yield

dlt.Pipeline.run = old_run
dlt.Pipeline.run = old_run # type: ignore

@property
def pipeline_module(self) -> ModuleType:
Expand Down

0 comments on commit 63b0b3c

Please sign in to comment.