Skip to content

fix(datainsights): prevent TypeError when other_modes is None - #1416

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/datainsights-other-modes-none
Open

fix(datainsights): prevent TypeError when other_modes is None#1416
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/datainsights-other-modes-none

Conversation

@sentry

@sentry sentry Bot commented Jun 20, 2026

Copy link
Copy Markdown

This PR addresses issue DALGO-BACKEND-22D by adding None guards for the other_modes field in the parse_results methods for both string and numeric type insights.

Previously, if the database returned None for other_modes (e.g., when no additional modes exist), a TypeError: 'NoneType' object is not iterable would occur during list comprehension.

The fix involves changing result[0]["other_modes"] to (result[0]["other_modes"] or []) in:

  • ddpui/core/datainsights/insights/string_type/queries.py (line 248)
  • ddpui/core/datainsights/insights/numeric_type/queries.py (line 127)

This ensures that the list comprehension always iterates over an iterable (an empty list if other_modes is None), preventing the TypeError.

Fixes DALGO-BACKEND-22D

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.26%. Comparing base (11a5843) to head (4d2fc62).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1416   +/-   ##
=======================================
  Coverage   60.26%   60.26%           
=======================================
  Files         146      146           
  Lines       17222    17222           
=======================================
  Hits        10378    10378           
  Misses       6844     6844           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

0 participants