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,23 @@
|
||||
"""Reglas de documento (homologación; split se aplica en apply.py)."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import pandas as pd
|
||||
|
||||
from ..documents import homologate_doc_type, split_doc_tipo_y_numero_texto
|
||||
from ..nullish import _is_nullish_scalar
|
||||
|
||||
|
||||
def _rule_doc_type_homologate(series: pd.Series) -> pd.Series:
|
||||
"""Homologa una columna que contiene tipos de documento."""
|
||||
|
||||
def _fn(x: Any):
|
||||
if _is_nullish_scalar(x):
|
||||
return x
|
||||
tipo, _num = split_doc_tipo_y_numero_texto(x, homologate=True)
|
||||
if tipo is not None:
|
||||
return tipo
|
||||
return homologate_doc_type(x)
|
||||
|
||||
return series.map(_fn)
|
||||
Reference in New Issue
Block a user