QueryExpression#

class pandas::QueryExpression#

Query engine class for expression evaluation.

Example#

#include <pandas/pandas.h>
using namespace pandas;

// Use QueryExpression
QueryExpression obj;
// ... operations ...

Constructors#

Signature

Location

Example

QueryExpression(const std::string& expr)

pd_query.h:780

Comparison#

Signature

Return Type

Location

Example

Lexer lexer(expr)

Lexer

pd_query.h:781

Other Methods#

Signature

Return Type

Location

Example

void collect_columns(const ASTNode\* node)

void

pd_query.h:725

collect_columns(and_node->left.get())

pd_query.h:761

collect_columns(and_node->right.get())

pd_query.h:762

collect_columns(or_node->left.get())

pd_query.h:767

collect_columns(or_node->right.get())

pd_query.h:768

collect_columns(not_node->operand.get())

pd_query.h:773

collect_columns(root_.get())

pd_query.h:785

Parser parser(std::move(tokens))

Parser

pd_query.h:783

const std::unordered_set<std::string>& referenced_columns() const

const std::unordered_set<std::string>&

pd_query.h:790

const ASTNode\* root() const { return root_.get()

const ASTNode*

pd_query.h:788

View

Code Examples#

The following examples are extracted from the test suite.

root (pd_test_4_all.cpp:4471)
4461//
4462// Drop-in snippet for pandas_tests/pd_test_repr_mismatch.cpp implementing the
4463// reproducers from do/plan_repr_timeseries.md:
4464//   1. comp.isocalendar        (DatetimeIndex index-name header missing)
4465//   2. resample.base_df        (max_rows=60 truncation footer mismatch)
4466//
4467// Self-contained standalone harness via REPR_MISMATCH_TIMESERIES_STANDALONE.
4468// When folded into pd_test_repr_mismatch.cpp, drop the #ifdef helpers, the
4469// main(), and the standalone dispatcher block at the bottom.
4470//
4471// Run this snippet from the main solution root (D:/Projects/Cpp2) so the
4472// relative fixture paths under pandas_tests/data/repr_mismatch/ resolve.
4473// Data files holding the seeded np.random.randn(1000,3) columns live in the
4474// worktree tree and are loaded via an absolute path.
4475//
4476// Fixture-truth rule: the plan references expected_*.txt, but pandasCore
4477// currently produces the buggy_*.txt bytes; we load buggy_*.txt so the
4478// snippet passes on the (buggy) current formatter and flips to FAIL once the
4479// formatter is fixed (at which point the fixture switches to expected_*.txt).
4480//
4481// No `using namespace`. No emojis.