Support/v1#3
Open
deeedub wants to merge 12 commits into
Open
Conversation
…n v1.0.1
Three fixes:
1. cancelStatement on poll timeout (acceptance criteria: 'cancel on timeout')
pollToCompletion() now calls cancelStatement() when MAX_POLL_ATTEMPTS are
exceeded before returning. This frees Snowflake compute resources. The
doLookup caller now shows a descriptive error ('timed out after Xs, cancelled')
instead of the 'Check Status' button — which would be confusing for a
cancelled query.
2. Copy button for statement handle (acceptance criteria: 'PolarityCopyButton
available for statement handle')
Added copyText() action to block.js and a copy button in the metadata
section of the template. Uses navigator.clipboard.writeText().
3. spinner-third → circle-notch
spinner-third is Font Awesome Pro only and does not exist in FA Free (which
Polarity bundles). circle-notch is the FA Free equivalent and renders
correctly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- block.js: Add transformedPagedData computed property to detect JSON strings
in VARCHAR column values and expand them into parsedEntries [{k, v}] for
table rendering in the overlay
- block.hbs: Render JSON columns as key-value tables (.snow-j-tbl) when
parsedEntries is present; use transformedPagedData instead of pagedData
- dataTransformations.js: Fix float precision for REAL columns using
toPrecision(7); add timestamp/date/time column type formatting
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
@copilot resolve the merge conflicts in this pull request |
There was a problem hiding this comment.
Pull request overview
This PR updates the Snowflake integration’s result rendering and query-handling behavior by adding client-side JSON expansion in the UI, formatting certain Snowflake data types during result mapping, and changing how long-running async queries are handled (cancel + error instead of “pending”).
Changes:
- UI: Render JSON-looking attribute values as key/value tables; add a “copy statement handle” button in the metadata section.
- Backend: Format timestamp/date/time (and round
real) values when mapping result rows. - Backend: Cancel async statements after max polling attempts and surface a timeout error; bump package version to
3.0.0.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/block.hbs | Uses transformedPagedData, adds JSON table rendering and a copy button for statement handles |
| components/block.js | Adds transformedPagedData JSON parsing and a clipboard copy action |
| src/dataTransformations.js | Adds type-based formatting during row mapping (timestamps/dates/times/real) and related helpers |
| integration.js | Cancels async statements after poll budget and returns a timeout error result |
| styles/styles.less | Adds styling for the statement-handle copy button/row |
| package.json | Bumps integration version to 3.0.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5
to
+8
| const TIMESTAMP_TYPES = new Set(['timestamp_ntz', 'timestamp_ltz', 'timestamp_tz', 'timestamp']); | ||
| const DATE_TYPES = new Set(['date']); | ||
| const TIME_TYPES = new Set(['time']); | ||
| const SEMI_STRUCTURED_TYPES = new Set(['variant', 'object', 'array']); |
| raw, // retained for summary tag resolution | ||
| resultAsString: JSON.stringify(raw).toLowerCase() // for the filter input | ||
| raw, | ||
| resultAsString: JSON.stringify(raw).toLowerCase() |
Comment on lines
+153
to
+157
| // Timed out — query was cancelled; surface a clear error | ||
| return buildErrorResult( | ||
| entity, | ||
| data: { | ||
| summary: ['⏳ Query Running'], | ||
| details: { | ||
| complete: false, | ||
| statementHandle, | ||
| elapsedMs: pollResult.elapsedMs, | ||
| executionStats: { elapsedSeconds: (pollResult.elapsedMs / 1000).toFixed(1) } | ||
| } | ||
| } | ||
| }; | ||
| `Query timed out after ${(pollResult.elapsedMs / 1000).toFixed(1)}s and was cancelled. ` + | ||
| `Try increasing the Query Timeout setting or simplifying your SQL.` |
Comment on lines
+147
to
151
| copyText(text) { | ||
| if (navigator && navigator.clipboard) { | ||
| navigator.clipboard.writeText(text).catch(() => {}); | ||
| } | ||
| } |
| <div class="snow-attr-row snow-attr-row-copy"> | ||
| <span class="p-key">Statement Handle:</span> | ||
| <span class="p-value snow-mono">{{details.statementHandle}}</span> | ||
| <button class="btn btn-polarity btn-xs snow-copy-btn" {{action "copyText" details.statementHandle}} title="Copy statement handle"> |
| { | ||
| "name": "snowflake", | ||
| "version": "1.0.0", | ||
| "version": "3.0.0", |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Conflicts are resolved and the branch now merges cleanly. Addressed in commit |
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.
No description provided.