dataframely.mypy module

class dataframely.mypy.DataframelyPlugin(options: Options)[source]

Bases: Plugin

Attributes:
options
python_version

Methods

get_additional_deps

get_attribute_hook

get_base_class_hook

get_class_attribute_hook

get_class_decorator_hook

get_class_decorator_hook_2

get_customize_class_mro_hook

get_dynamic_class_hook

get_function_hook

get_function_signature_hook

get_metaclass_hook

get_method_hook

get_method_signature_hook

get_type_analyze_hook

lookup_fully_qualified

report_config_data

set_modules

get_additional_deps(file)
get_attribute_hook(fullname)
get_base_class_hook(fullname: str) Callable[[ClassDefContext], None] | None[source]
get_class_attribute_hook(fullname)
get_class_decorator_hook(fullname)
get_class_decorator_hook_2(fullname)
get_customize_class_mro_hook(fullname)
get_dynamic_class_hook(fullname)
get_function_hook(fullname)
get_function_signature_hook(fullname)
get_metaclass_hook(fullname)
get_method_hook(fullname: str) Callable[[MethodContext], Type] | None[source]
get_method_signature_hook(fullname: str) Callable[[MethodSigContext], FunctionLike] | None[source]
get_type_analyze_hook(fullname)
lookup_fully_qualified(fullname)
options
python_version
report_config_data(ctx)
schema_registry: dict[str, TypedDictType]
set_modules(modules)
dataframely.mypy.alter_collection_filter_return_type(ctx: MethodSigContext) FunctionLike[source]

Alter the return type for dy.Collection.filter to a TypedDict for the failure info.

dataframely.mypy.alter_dataframe_iter_rows_return_type(ctx: MethodContext, schema_registry: dict[str, TypedDictType]) Type[source]

Alter the return type for dy.DataFrame.iter_rows to a TypedDict if named=True.

dataframely.mypy.mark_rules_as_staticmethod(ctx: ClassDefContext) None[source]

Mark all methods decorated with @rule as `staticmethod`s.

dataframely.mypy.plugin(version: str) type[Plugin][source]
dataframely.mypy.store_typed_dict_type_for_schema(ctx: ClassDefContext, schema_registry: dict[str, TypedDictType]) None[source]

Add TypedDictType inferred from the schema’s columns to a given registry.