From 7e50be820b25ad083b9bacb19878792674d98386 Mon Sep 17 00:00:00 2001 From: Akmal Soliev Date: Wed, 22 Jan 2025 21:57:11 +0100 Subject: [PATCH] DOCS: Improved docs on Type Validation --- docs/typing.md | 2 ++ validoopsie/typing/__init__.py | 4 ++++ validoopsie/validation_catalogue/TypeValidation/type_check.py | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 docs/typing.md diff --git a/docs/typing.md b/docs/typing.md new file mode 100644 index 0000000..b5ea9d6 --- /dev/null +++ b/docs/typing.md @@ -0,0 +1,2 @@ +::: typing + handler: python diff --git a/validoopsie/typing/__init__.py b/validoopsie/typing/__init__.py index 9016301..0c92991 100644 --- a/validoopsie/typing/__init__.py +++ b/validoopsie/typing/__init__.py @@ -12,6 +12,7 @@ class ValidationType(DTypes): """ValidoopsieType represents a valid type. It can be one of the following: + - ArrayType: Array type - BooleanType: Boolean type - CategoryType: Categorical type @@ -31,6 +32,7 @@ class FloatType(ValidationType, narwhals.Float32, narwhals.Float64, narwhals.Dec """FloatType represents a floating-point type. It can be one of the following: + - Float32: 32-bit floating-point number - Float64: 64-bit floating-point number - Decimal: Arbitrary-precision decimal number @@ -48,6 +50,7 @@ class IntType( """IntType represents an integer type. It can be one of the following: + - Int8: 8-bit signed integer - Int16: 16-bit signed integer - Int32: 32-bit signed integer @@ -67,6 +70,7 @@ class UIntType( """UIntType represents an unsigned integer type. It can be one of the following: + - UInt8: 8-bit unsigned integer - UInt16: 16-bit unsigned integer - UInt32: 32-bit unsigned integer diff --git a/validoopsie/validation_catalogue/TypeValidation/type_check.py b/validoopsie/validation_catalogue/TypeValidation/type_check.py index 78a7c7b..7aa6046 100644 --- a/validoopsie/validation_catalogue/TypeValidation/type_check.py +++ b/validoopsie/validation_catalogue/TypeValidation/type_check.py @@ -18,6 +18,10 @@ class TypeCheck(BaseValidationParameters): (e.g. `IntegerType`) or more specific type provided by Narwhals (e.g. `narwhals.Int64`). + For a full list of types refer to: + + * [Validoopsie Generic Types](https://akmalsoliev.github.io/Validoopsie/typing.html#typing.FloatType) + * [Narwhals Specific Types](https://narwhals-dev.github.io/narwhals/api-reference/dtypes/) Example of the `column_type_definitions`: