Skip to content

Result Labels False "Omitted" Message #281

@PierreRaybaut

Description

@PierreRaybaut

Bug Fix Summary: Result Labels False "Omitted" Message

Technical Details

Root Cause

In datalab/adapters_metadata/common.py at line 368, the code used:

num_rows = len(adapter.result)

However, TableResult.__len__() (defined in sigima/objects/scalar/table.py:349) returns:

def __len__(self) -> int:
    """Return the number of names in the table."""
    return len(self.headers)  # Returns column count, not row count!

This caused confusion between columns and rows, leading to false truncation messages.

Solution

Changed to use the correct row count from the DataFrame:

num_rows = len(df)  # Correctly returns the number of data rows

Impact Analysis

  • Severity: Low (cosmetic/display issue only)
  • Affected: All table-based result labels (pulse features, statistics, etc.)
  • User Impact: Confusing display suggesting hidden data when none exists
  • Data Integrity: No impact - only affects label display

Testing

Created datalab/tests/features/signal/pulse_label_test.py which:

  1. Creates a signal with pulse features (single row, 13 columns)
  2. Generates the HTML label
  3. Verifies no "omitted" text appears in the label
  4. Confirms the DataFrame has exactly 1 row
  5. Notes that len(adapter.result) returns column count by design

Test passes with the fix applied.

French Translation Fix

The translation "%s omitted" → "%s non affichés" was corrected to the feminine form
"%s non affichées" because the %s placeholder contains feminine nouns:

  • "lignes" (lines) - feminine
  • "colonnes" (columns) - feminine

This grammatical correction ensures proper French language agreement.

Files Modified

  1. datalab/adapters_metadata/common.py: Core bug fix (1 line)
  2. datalab/locale/fr/LC_MESSAGES/datalab.po: French translation fix
  3. datalab/locale/fr/LC_MESSAGES/datalab.mo: Compiled translation (auto-generated)
  4. datalab/tests/features/signal/pulse_label_test.py: New test file
  5. doc/release_notes/release_1.00.md: Release notes updated
  6. issues/pulse_label_omitted_bug.md: Bug documentation

Verification Steps

  1. Run the new test:

    python scripts/run_with_env.py python -m pytest datalab/tests/features/signal/pulse_label_test.py -v
  2. Manual verification:

    • Open DataLab
    • Create a signal
    • Run pulse features extraction
    • Check that the label shows only the data table without false "omitted" text
  3. Check with ROIs:

    • Add ROIs to a signal
    • Run pulse features
    • Verify truncation still works correctly when there actually are multiple rows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions