Skip to content

fix(deck): pass custom num rows; detect missing columns fix - #793

Merged
igorDykhta merged 3 commits into
mainfrom
igr/deck-maps-fixes-24
Jul 3, 2026
Merged

igorDykhta merged 3 commits into
mainfrom
igr/deck-maps-fixes-24

Conversation

@igorDykhta

@igorDykhta igorDykhta commented Jul 3, 2026 •

Copy link
Copy Markdown
Collaborator
  1. dataPolicy.maxRows override now respected
  2. detectMissingColumns no longer reports false-positives for expressions:
  • Before checking a @@= accessor reference, validates it's a simple identifier (/^[A-Za-z_$][\w$]*$/)
  • Complex expressions like @@=population * 10 or @@=[255, val, 0] are now skipped instead of being incorrectly flagged as missing columns
  1. Now, when a column isn't found, instead of deleting the prop or guessing a fallback, it falls through to compileGeoArrowAccessor which already handles missing columns properly
  2. return undefined when we have a batch but can't resolve the field in it

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Improved missing-column detection for complex binding expressions to prevent incorrect warnings.
    • Fixed GeoArrow field lookup to avoid mixing data across batches when a field can’t be resolved.
    • Adjusted GeoArrow accessor behavior so absent columns compile to per-row undefined instead of being removed.
  • New Features

    • Updated map data sampling to respect the configured maximum row limit, including updating the “data sampled” notice to reflect the applied value.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ae9652f2-559a-43b1-862c-7ec838629c5e

📥 Commits

Reviewing files that changed from the base of the PR and between 847e5ff and 1b7f426.

📒 Files selected for processing (1)
  • packages/deck/src/dashboard.tsx

📝 Walkthrough

Walkthrough

Adjusts dashboard missing-column detection for @@= bindings, makes map sampling use mapConfig.dataPolicy.maxRows, and changes GeoArrow missing-field and missing-accessor handling to return undefined instead of reading the wrong row or removing the accessor.

Changes

Deck dashboard and GeoArrow fixes

Layer / File(s) Summary
Dashboard binding and sampling updates
packages/deck/src/dashboard.tsx
@@= missing-column detection now checks extracted identifiers, and map sampling uses mapConfig.dataPolicy.maxRows with the configured limit reflected in the query id and sampled-data banner.
GeoArrow missing field handling
packages/deck/src/json/compileColorScale.ts, packages/deck/src/json/rewriteGeoArrowAccessors.ts
Missing batch-local GeoArrow fields now return undefined, and missing simple accessor columns now fall through to compileGeoArrowAccessor with updated warning text.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • sqlrooms/sqlrooms#745: Shares the GeoArrow accessor compilation path and related missing-binding behavior.
  • sqlrooms/sqlrooms#783: Touches the same dashboard.tsx missing-column detection path and generated-column handling.
  • sqlrooms/sqlrooms#789: Also affects GeoArrow accessor rewriting and related color-scale compilation behavior.

Suggested reviewers: ilyabo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is directly related to the main changes, covering custom row limits and missing-column handling in deck.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch igr/deck-maps-fixes-24

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown

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: e693173cc0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/deck/src/dashboard.tsx Outdated
Comment thread packages/deck/src/dashboard.tsx
Signed-off-by: Ihor Dykhta <[email protected]>
@igorDykhta igorDykhta self-assigned this Jul 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
packages/deck/src/json/compileColorScale.ts (1)

88-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding a regression test for the batch-missing-field case.

This fixes a real correctness bug (reading the wrong row across batches), but no test appears to cover the new undefined return path when a batch is present without the requested field. As per coding guidelines, "Add or update tests when changing behavior or public API, when practical."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/deck/src/json/compileColorScale.ts` around lines 88 - 97, Add a
regression test for the new batch-missing-field behavior in compileColorScale,
covering the path where a batch is present but the requested field is absent and
the function returns undefined instead of reading from the global vector. Update
or extend the tests around compileColorScale and its mapper behavior to verify
nullColor is applied for this GeoArrow batch-local case.

Source: Coding guidelines

packages/deck/src/json/rewriteGeoArrowAccessors.ts (1)

58-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add test coverage for the missing-column fallthrough path.

This changes observable behavior (accessor is now compiled with an undefined-producing binding instead of being dropped from props). As per coding guidelines, "Add or update tests when changing behavior or public API, when practical," and no test appears to cover this branch.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/deck/src/json/rewriteGeoArrowAccessors.ts` around lines 58 - 64, Add
or update tests for the missing-column fallthrough path in
rewriteGeoArrowAccessors, covering the branch where vector is absent and
compileGeoArrowAccessor is still used with an undefined-producing binding.
Verify the accessor remains on props and produces undefined per row instead of
being dropped, and reference the rewriteGeoArrowAccessors behavior in the test
name or assertions so the new fallback path is explicitly exercised.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/deck/src/json/compileColorScale.ts`:
- Around line 88-97: Add a regression test for the new batch-missing-field
behavior in compileColorScale, covering the path where a batch is present but
the requested field is absent and the function returns undefined instead of
reading from the global vector. Update or extend the tests around
compileColorScale and its mapper behavior to verify nullColor is applied for
this GeoArrow batch-local case.

In `@packages/deck/src/json/rewriteGeoArrowAccessors.ts`:
- Around line 58-64: Add or update tests for the missing-column fallthrough path
in rewriteGeoArrowAccessors, covering the branch where vector is absent and
compileGeoArrowAccessor is still used with an undefined-producing binding.
Verify the accessor remains on props and produces undefined per row instead of
being dropped, and reference the rewriteGeoArrowAccessors behavior in the test
name or assertions so the new fallback path is explicitly exercised.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a2512c9c-b788-4ebb-8d9c-52e47701bf28

📥 Commits

Reviewing files that changed from the base of the PR and between e693173 and 847e5ff.

📒 Files selected for processing (2)
  • packages/deck/src/json/compileColorScale.ts
  • packages/deck/src/json/rewriteGeoArrowAccessors.ts

Signed-off-by: Ihor Dykhta <[email protected]>
@igorDykhta
igorDykhta merged commit b56e8b5 into main Jul 3, 2026
2 of 3 checks passed
@igorDykhta
igorDykhta deleted the igr/deck-maps-fixes-24 branch July 3, 2026 22:53
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.

2 participants