Skip to content

Conversation

Copy link

Copilot AI commented Jul 30, 2025

The cruxShopifyThemes.sql query was causing lens filtering to fail for all lenses except "ALL". When specific lenses (like top1k, wordpress, etc.) were applied, the SQL generation would produce malformed queries such as:

FROM
  `chrome-ux-report.materialized.device_summary` WHERE   experimental.popularity.rank <= 1000000 
JOIN archive_pages
ON

This occurred because the query structure was incompatible with the lens injection mechanism for CrUX queries. The lens system attempts to inject WHERE clauses or JOINs, but the cruxShopifyThemes query had a structure that broke this process.

Root Cause

The lens filtering system works differently for CrUX queries:

  • Regular queries: Lens conditions are added to existing WHERE clauses
  • CrUX queries: Special crux_histograms.sql files define JOINs to be injected after table references

The cruxShopifyThemes query structure was not compatible with either approach, resulting in malformed SQL generation.

Solution

Following guidance from maintainers in the issue comments:

  • @max-ostapenko mentioned creating an alternative implementation
  • @tunetheweb noted that this query only makes sense for the "ALL" lens anyway
  • Shopify sites are by definition not WordPress/Magento/Drupal sites, so lens filtering doesn't apply

Removing the problematic query file resolves the lens filtering failures while preserving all other CrUX query functionality. The lens system continues to work correctly for other CrUX queries like cruxLcp.sql, cruxFcp.sql, etc.

Fixes #212.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Lenses fail in cruxShopifyThemes Remove cruxShopifyThemes.sql to fix lens filtering failures Jul 30, 2025
Copilot AI requested a review from max-ostapenko July 30, 2025 17:28
@max-ostapenko max-ostapenko marked this pull request as ready for review July 30, 2025 17:30
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.

Lenses fail in cruxShopifyThemes

2 participants