Skip to main content
Version: 1.22.2 (latest)

dlt._workspace.helpers.dashboard.utils.formatters

String formatting, datetime humanization, and dict-to-table conversion utilities for the dashboard.

humanize_datetime

def humanize_datetime(dt: Union[str, int, float, datetime],
datetime_format: str) -> str

View source on GitHub

Format a datetime-like value (datetime, timestamp, or ISO string) into a human-readable string.

humanize_datetime_values

def humanize_datetime_values(c: DashboardConfiguration,
d: Dict[str, Any]) -> Dict[str, Any]

View source on GitHub

Format well-known datetime keys (started_at, finished_at, etc.) in a dict to human-readable strings.

format_duration

def format_duration(ms: float) -> str

View source on GitHub

Format a duration in milliseconds as a human-readable string (e.g. '120ms', '3.5s', '1.2m').

format_exception_message

def format_exception_message(exception: Exception) -> str

View source on GitHub

Convert a pipeline/destination exception to a user-friendly error message.

filter_empty_values

def filter_empty_values(d: Mapping[str, Any]) -> Dict[str, Any]

View source on GitHub

Return a new dict with all None and empty string values removed.

align_dict_keys

def align_dict_keys(items: List[Dict[str, Any]]) -> List[Dict[str, Any]]

View source on GitHub

Ensure all dicts in a list share the same keys, filling missing ones with '-' for uniform table rendering.

dict_to_table_items

def dict_to_table_items(d: Dict[str, Any]) -> List[TNameValueItem]

View source on GitHub

Convert a dict to a list of {name, value} dicts for display in a marimo table.

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.