Skip to main content
Version: 1.5.0 (latest)

common.runtime.run_context

RunContext Objects

class RunContext(SupportsRunContext)

[view_source]

A default run context used by dlt

run_dir

@property
def run_dir() -> str

[view_source]

The default run dir is the current working directory but may be overridden by DLT_PROJECT_DIR env variable.

settings_dir

@property
def settings_dir() -> str

[view_source]

Returns a path to dlt settings directory. If not overridden it resides in current working directory

The name of the setting folder is '.dlt'. The path is current working directory '.' but may be overridden by DLT_PROJECT_DIR env variable.

data_dir

@property
def data_dir() -> str

[view_source]

Gets default directory where pipelines' data (working directories) will be stored

  1. if DLT_DATA_DIR is set in env then it is used
  2. in user home directory: ~/.dlt/
  3. if current user is root: in /var/dlt/
  4. if current user does not have a home directory: in /tmp/dlt/

get_run_entity

def get_run_entity(entity: str) -> str

[view_source]

Default run context assumes that entities are defined in root dir

plug_run_context

@plugins.hookspec(firstresult=True)
def plug_run_context(
run_dir: Optional[str],
runtime_kwargs: Optional[Dict[str, Any]]) -> SupportsRunContext

[view_source]

Spec for plugin hook that returns current run context.

Arguments:

  • run_dir str - An initial run directory of the context
  • runtime_kwargs - Any additional arguments passed to the context via PluggableRunContext.reload

Returns:

  • SupportsRunContext - A run context implementing SupportsRunContext protocol

current

def current() -> SupportsRunContext

[view_source]

Returns currently active run context

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.