feat: Enhance CSV cleaning service with new endpoints for CSV analysis and preview functionality. Introduce support for job management linked to extraction batches, and update the cleaning rules structure. Add new utility functions for handling CSV data and improve documentation for clarity on usage and available endpoints.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
"""Detección de valores nulos / vacíos."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
|
||||
def _is_nullish_scalar(x: Any) -> bool:
|
||||
if x is None or x is pd.NA:
|
||||
return True
|
||||
if isinstance(x, (bool, np.bool_)):
|
||||
return False
|
||||
if isinstance(x, (int, float, np.integer, np.floating)) and not isinstance(
|
||||
x, (bool, np.bool_)
|
||||
):
|
||||
if isinstance(x, float) and (np.isnan(x) or pd.isna(x)):
|
||||
return True
|
||||
return False
|
||||
t = str(x).strip().lower()
|
||||
if not t or t in ("nan", "none", "nat", "null", "<na>"):
|
||||
return True
|
||||
return False
|
||||
Reference in New Issue
Block a user