feat(schema): add Explore query JSON Schema generator and Rust batch validator - #49
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a strongly-typed Looker Explore query schema generator and validator under the lkr schema CLI command. It features a high-performance validator implemented in Rust using PyO3 and Rayon for parallel batch validation, along with a testing harness that validates real queries from Looker's system activity history. The review feedback is highly constructive, identifying a potential ReDoS vulnerability in the date-time filter regex, suggesting memory allocation optimizations in the Rust validator, recommending stricter type validation for custom measure filters, and advising better error handling for missing or malformed local explore files.
…ayload, filters validation, error handling)
…ust steps, uv-pre-commit, and AGENTS.md
…ce public PyPI in uv-lock hook
…rich console reload issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds strongly-typed Looker Explore query JSON Schema generation (
lkr schema generate) and high-performance Rust/PyO3 + rayon query validation (lkr schema validate), along with the developer history validation harness inscripts/schema/.Key Changes
lkr schema generate: Generates Draft 2020-12 JSON Schemas for any LookML Explore (--model,--explore), extracting visible dimensions, measures, filters, parameters, typed filter expression definitions ($defs), sort regexes, and dynamic fields (CustomDimension,CustomMeasure,TableCalculation).lkr schema validate: High-throughput Rust + PyO3 +rayonvalidator (lkr/schema/rust/src/lib.rs) validating query payloads against Explore schemas, including${view.field}formula reference validation acrossdynamic_fieldsandfilter_expression, read-onlyQuerysanitization, andcolumn_limitwithoutpivotswarnings.scripts/schema/: Developer harness for fetching and batch-validating completed queries fromsystem__activity::history.