Skip to content

fix invalid datatype. - #864

Merged
jt2594838 merged 1 commit into
developfrom
fix_invalid_datatype
Jul 13, 2026
Merged

jt2594838 merged 1 commit into
developfrom
fix_invalid_datatype

Conversation

@ColinLeeo

@ColinLeeo ColinLeeo commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Tree by-row query with limit=0 (or offset past the end) fails on a
single-path query — Python raises ValueError: 254 is not a valid TSDataType
(254 = C++ NULL_TYPE).

Cause

In QDSWithoutTimeGenerator::init_internal, column types were taken from the
first decoded TsBlock, falling back to NULL_TYPE when none exists. For a
single path, limit == 0 makes the scan iterator return no block, so the type
became NULL_TYPE (254), which the Python enum rejects.

Fix

Capture the column type from the timeseries index (via the SSI) in the alloc
loop — before any TsBlock is read — and use it as the fallback instead of
NULL_TYPE. This matches how Java derives types (from metadata, not from data).

Tests

  • C++ LimitZero / OffsetExceedsTotalRows: assert the metadata type is the
    real type (INT64), not NULL_TYPE.
  • Python test_query_tree_by_row_limit_zero: single-path (INT64/DOUBLE/BOOLEAN/
    STRING), multi-path, and offset-past-end.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.53%. Comparing base (86252e5) to head (39ce529).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #864   +/-   ##
========================================
  Coverage    60.52%   60.53%           
========================================
  Files          735      735           
  Lines        48439    48447    +8     
  Branches      7679     7679           
========================================
+ Hits         29319    29328    +9     
  Misses       17718    17718           
+ Partials      1402     1401    -1     

☔ 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.

@jt2594838
jt2594838 merged commit b4646b6 into develop Jul 13, 2026
29 checks passed
@jt2594838
jt2594838 deleted the fix_invalid_datatype branch July 13, 2026 06:36
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.

4 participants