Skip to content

Constant mapping#48

Merged
thomasp85 merged 10 commits intoposit-dev:mainfrom
thomasp85:constant-mapping
Jan 12, 2026
Merged

Constant mapping#48
thomasp85 merged 10 commits intoposit-dev:mainfrom
thomasp85:constant-mapping

Conversation

@thomasp85
Copy link
Copy Markdown
Collaborator

Fix #42

This turned out to be a much larger ordeal than anticipated but in the end I prevailed. Constants in MAPPING are now materialised as a column in the data. If the layer is using the global data then the column is materialised there rather than copying over the global data to the layer. This ensures that faceting still works in the face of constant mappings.

I this PR I also fix setting aesthetics to literals inside SETTING. Examples of this are littered over the code base but it has never worked - it does now.

Lastly I have formalised how labels are derived from mappings (Manual labels > column name > aesthetic name)

thomasp85 and others added 6 commits January 9, 2026 11:05
- Add Literal variant to GlobalMappingItem
- Add HashSet import for compute_aesthetic_labels
- Fix resolve_global_mappings to handle Literal variants
- Add compute_aesthetic_labels method

These features were lost during the merge resolution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@thomasp85 thomasp85 requested a review from georgestagg January 9, 2026 13:49
Copy link
Copy Markdown
Collaborator

@georgestagg georgestagg left a comment

Choose a reason for hiding this comment

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

LGTM!

Just a minor issue below.

Comment thread doc/examples.qmd Outdated
Comment thread ggsql-jupyter/tests/quarto/doc.qmd Outdated
@thomasp85 thomasp85 merged commit 6ea5a9f into posit-dev:main Jan 12, 2026
1 check passed
@thomasp85 thomasp85 mentioned this pull request Jan 12, 2026
@teunbrand teunbrand mentioned this pull request Jan 14, 2026
@thomasp85 thomasp85 deleted the constant-mapping branch February 17, 2026 14:02
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.

Allow mapping constants

2 participants