Skip to content

Improving addListOfRows guessing style when first row has None values. Now it iterates until the first not None value#202

Merged
turulomio merged 7 commits into
mainfrom
201-block_from_lod-bad-dates-if-first-vlue-is-none
Jun 7, 2026
Merged

Improving addListOfRows guessing style when first row has None values. Now it iterates until the first not None value#202
turulomio merged 7 commits into
mainfrom
201-block_from_lod-bad-dates-if-first-vlue-is-none

Conversation

@turulomio

Copy link
Copy Markdown
Owner

No description provided.

turulomio added 3 commits June 7, 2026 02:37
    The style guessing logic now iterates through all rows of a column until it finds a non-None value to determine the appropriate style. Previously, it
  only checked the first row, which led to incorrect styling (e.g., 'Normal' instead of 'Float2') if the first row had a null value in that column.
       - Se han añadido los imports necesarios (datetime, Currency, Percentage).
       - Se ha actualizado test_block_from_lod_with_null_first_row para que compruebe todos los tipos soportados, asegurando que el estilo se adivina
         correctamente aunque la primera fila tenga valores nulos.
       - Se ha incluido una columna (all_null) que verifica que el estilo por defecto se aplica correctamente si toda la columna es nula.
   1. Detección de estilos mejorada en unogenerator/unogenerator.py:
       * Se han actualizado tanto addListOfRowsWithStyle como addListOfColumnsWithStyle para que iteren a través de las filas/columnas hasta encontrar el
         primer valor no nulo (not None). Esto garantiza que el estilo se detecte correctamente incluso si la primera entrada es nula.
       * Se ha incluido documentación breve en el código explicando esta lógica de iteración.
   2. Alineación de Strings:
       * Se ha confirmado que tanto en ODS (estilo Default) como en ODS_Standard (estilo Normal), la alineación predeterminada es a la izquierda, por lo
         que al detectar correctamente el estilo de un string, este queda alineado a la izquierda automáticamente según el template.
   3. Tests Integrados y Exhaustivos:
       * Se ha actualizado test_block_from_lod_with_null_first_row en tests/test_helpers.py para incluir todos los tipos de datos soportados (int,
         timedelta, currency, percentage, datetime, date, time, bool, float, string) y una columna con valores totalmente nulos.
       * El test verifica que todos estos tipos se detectan y estilizan correctamente (incluyendo la alineación a la izquierda para strings mediante el
         estilo Normal).
       * Se han limpiado los archivos temporales de prueba.
@turulomio turulomio linked an issue Jun 7, 2026 that may be closed by this pull request
@turulomio turulomio merged commit 52d230b into main Jun 7, 2026
1 check passed
@turulomio turulomio deleted the 201-block_from_lod-bad-dates-if-first-vlue-is-none branch June 7, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[block_from_lod] Bad dates if first vlue is None

1 participant