Skip to main content
Version: devel

dlt.common.normalizers.json

DataItemNormalizer Objects

class DataItemNormalizer(abc.ABC, Generic[TNormalizerConfig])

View source on GitHub

py_type_to_sc_type_map

@property
def py_type_to_sc_type_map() -> Dict[Type[Any], TDataType]

View source on GitHub

Lookup from Python type to schema type. Override in subclasses.

py_type_to_sc_type

@abc.abstractmethod
def py_type_to_sc_type(t: Type[Any]) -> TDataType

View source on GitHub

Resolve Python type to schema type including subclass/Enum handling.

can_coerce_type

@abc.abstractmethod
def can_coerce_type(to_type: TDataType, from_type: TDataType) -> bool

View source on GitHub

Return True if from_type can be coerced to to_type.

coerce_type

@abc.abstractmethod
def coerce_type(to_type: TDataType, from_type: TDataType, value: Any) -> Any

View source on GitHub

Coerce value from from_type to to_type. Raises ValueError on failure.

SupportsDataItemNormalizer Objects

class SupportsDataItemNormalizer(Protocol)

View source on GitHub

Expected of modules defining data item normalizer

DataItemNormalizer

A class with a name DataItemNormalizer deriving from normalizers.json.DataItemNormalizer

wrap_in_dict

def wrap_in_dict(label: str, item: Any) -> DictStrAny

View source on GitHub

Wraps item that is not a dictionary into dictionary that can be json normalized

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.