Skip to content

fix(r): read a Snowflake semantic view's base table names as SQL identifiers - #448

Draft
jat255 wants to merge 2 commits into
jat255/441-typed-null-date-shiftfrom
jat255/446-semantic-quoted-base-tables
Draft

jat255 wants to merge 2 commits into
jat255/441-typed-null-date-shiftfrom
jat255/446-semantic-quoted-base-tables

Conversation

@jat255

@jat255 jat255 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #446

This PR makes R read the base table names in a Snowflake semantic view's YAML as SQL identifiers. A quoted name such as "orders" kept its quotes, so a source scoped to the view's tables could not find them.

Details (agent-written)

snowflake_semantic_dependencies() now unquotes a quoted name (a doubled quote stands for one) and folds an unquoted name to upper case, which is how Snowflake resolved it when the view was created. A database or schema that the YAML leaves out comes from the view's own id, which is already exact, so it is not folded.

Testing: the full R suite passes, with new cases for a quoted name, an unquoted one, an escaped quote, and an inherited mixed-case namespace. On live Snowflake, "live Snowflake scopes models associated with physical tables" passes against the views that #431 provisions.

Kata: whhh.

R changes

Reading a Snowflake semantic view now records its base tables under the names Snowflake resolved (catalog-snowflake.R). A view over "orders" used to depend on a table literally named with quotes, and data_source(con, tables = model$dependencies) failed with "not on the connection". It now finds orders. An unquoted lowercase name in the YAML now resolves to the upper-case table, where it used to be quoted as written. NEWS has a bullet.

@jat255 jat255 added bug Something isn't working r Affects the R implementation needs-manual-review Agent-created work that needs a human review labels Oct 22, 2026
…tifiers

The view's YAML keeps a quoted name's quotes, so a base table created as "orders" was recorded as a table literally named with quotes, and scoping a source to the view's dependencies failed. Quoted names are now unquoted, with a doubled quote standing for one, and unquoted names fold to upper case.

Closes #446
A namespace the YAML leaves out comes from the view's own id, which Snowflake already reports exactly, so folding it to upper case broke a view in a quoted mixed-case database or schema.
@jat255
jat255 force-pushed the jat255/446-semantic-quoted-base-tables branch from dc6a57f to 421986a Compare October 23, 2026 22:23
@jat255
jat255 added this pull request to stack #454 October 23, 2026 22:25
@github-actions

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (dogfood.team.pct.posit.it): https://dogfood.team.pct.posit.it/connect/#/apps/d7a36cae-8f27-448b-a478-61b81fbe3942/draft/382690

Deployed from commit 421986a.

@github-actions

Copy link
Copy Markdown
Contributor

Preview deployed to Connect (connect.staging.pct.posit.it): https://connect.staging.pct.posit.it/connect/#/apps/ad662e1b-5048-4acc-9ad7-f9478c92274e/draft/3771

Deployed from commit 421986a.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working needs-manual-review Agent-created work that needs a human review r Affects the R implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

R keeps the quotes in a Snowflake semantic view's quoted base table names

1 participant