[Bug]: Python SDK to_string() crashes with AttributeError on queries with limit/offset or literal filters

Open Beginner friendly
#3,440 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
api, database

Research direction

Start in python/infinity_sdk/infinity/remote_thrift/utils.py, where parsed_expression_to_string() serializes query expressions, and follow RemoteTable.to_string() from the reproduction. Run the no-server examples for filter, limit, and offset, then add or run the regression coverage mentioned in the issue. Done means these cases return the expected JSON description without AttributeError.

Written by the indexing model from the issue text.

Description

bug
Is there an existing issue for the same bug?
  • I have checked the existing issues.
Version or Commit ID

main @ 4954148 (current main as of 2026-09-08)

Other environment information

Actual behavior and How to reproduce it

parsed_expression_to_string() in python/infinity_sdk/infinity/remote_thrift/utils.py reads literal values from the wrong object: expr_type.i64_value / f64_value / str_value / i64_array_value / ... instead of expr_type.constant_expr.. Only the Boolean case uses the right object. ParsedExprType has no such attributes, so RemoteTable.to_string() raises AttributeError on any query carrying a limit, an offset, or a literal in its filter.

Repro (no server needed):

from infinity.remote_thrift.table import RemoteTable
t = RemoteTable(conn=None, db_name="default_db", table_name="t")
t.output(["c1"]).limit(10).to_string()
# AttributeError: 'ParsedExprType' object has no attribute 'i64_value'

Also crashes: .filter("c2 > 3"), .offset(5), or a string literal like .filter("name = 'abc'").

Expected behavior

to_string() returns the JSON description of the query, e.g. {"db": "default_db", "table": "t", "columns": ["c1"], "limit": "10"}.

Additional information

Fix: read the fields from expr_type.constant_expr in every literal case. PR with the fix plus a regression test (filter + limit + offset through to_string()) coming.

Dominant language
C++
Stars
4.7k
Forks
445
Avg merge
2d 9h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from infiniflow/infinity

All issues in infiniflow/infinity

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.