Skip to content

Add pure Rust Python test parity harness#179

Open
nicosuave wants to merge 1 commit into
mainfrom
pure-rust-python-test-parity
Open

Add pure Rust Python test parity harness#179
nicosuave wants to merge 1 commit into
mainfrom
pure-rust-python-test-parity

Conversation

@nicosuave
Copy link
Copy Markdown
Member

Adds a test-only pure Rust Python test parity harness that drives the pure Rust implementation through existing Python semantic-layer behavior instead of handwritten smoke cases.

Includes:

  • Cargo example JSON adapter for pure Rust validate, compile, rewrite, graph, and symmetric aggregate operations.
  • Python pytest adapter and parity inventory for core graph, SQL generation, SQL rewriter, metrics, joins, dates, segments, and symmetric aggregate tests.
  • Rust parity fixes for graph-level metrics, config-loaded metrics, composite keys, relationship dimensions, date granularity SQL, relative dates, and symmetric aggregate SQL.

Current local validation:

  • Full Python suite: 4220 passed, 40 skipped, 70 xfailed, 77 deselected.
  • Pure Rust Python test parity file: 257 passed, 52 expected xfailed; stale xfail audit clean.
  • Rust tests passed.
  • Ruff check and format check passed.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cde744052

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sidemantic-rs/src/core/graph.rs Outdated
Comment on lines +230 to +234
metric.r#type,
MetricType::TimeComparison | MetricType::Conversion
) && !self.metrics.contains_key(&metric.name)
{
self.metrics.insert(metric.name.clone(), metric.clone());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Synchronize graph metric index when models are replaced

The new self.metrics index is now populated during add_model, but replace_model does not update or clear entries for that model. In flows that call replace_model (e.g., FFI update paths), this leaves stale time-comparison/conversion metrics addressable via get_metric and can incorrectly block later add_metric calls with "already exists" for metrics that were removed from the model.

Useful? React with 👍 / 👎.

Comment on lines +434 to +435
} else if Self::is_relationship_foreign_key_dimension(model, &dim_ref.name) {
format!("{}.{}", alias, self.quote_identifier(&dim_ref.name))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject granularity suffix on implicit relationship key dims

When a referenced field is only an implicit relationship foreign key, the new fallback accepts it even if a __granularity suffix was parsed. For inputs like orders.customer_id__month, this path emits raw customer_id while keeping the __month alias, so the query silently returns un-truncated/grouped values instead of raising an invalid granularity error.

Useful? React with 👍 / 👎.

@nicosuave nicosuave force-pushed the pure-rust-python-test-parity branch from 7cde744 to 497a87a Compare May 24, 2026 19:24
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

1 participant