Skip to content

chore: Explicitly disable multi-statements in Snowflake#60119

Merged
tomasfarias merged 1 commit into
masterfrom
chore/explicitly-disable-multi-statements-in-snowflake-session
May 27, 2026
Merged

chore: Explicitly disable multi-statements in Snowflake#60119
tomasfarias merged 1 commit into
masterfrom
chore/explicitly-disable-multi-statements-in-snowflake-session

Conversation

@tomasfarias
Copy link
Copy Markdown
Contributor

Problem

Multi-statements are disabled in Snowflake, but this is implicit.

Changes

Make it explicit by setting the approppiate session parameter.

How did you test this code?

Ran Snowflake tests. All passing.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Publish to changelog?

No

Docs update

No

🤖 Agent context

Used it to write it, then formatted the comment.

@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team May 26, 2026 17:33
@tomasfarias tomasfarias force-pushed the chore/explicitly-disable-multi-statements-in-snowflake-session branch from 1fc6875 to afdacc9 Compare May 26, 2026 17:34
@tomasfarias tomasfarias added the stamphog Request AI review from stamphog label May 26, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 26, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
products/batch_exports/backend/temporal/destinations/snowflake_batch_export.py:588-592
The session-parameters dict is defined inline here and as `_SNOWFLAKE_SESSION_PARAMETERS` in the destination-tests file — two places to update if the parameter set ever changes. Extracting a module-level constant here would follow the same pattern used in the test file and satisfy OnceAndOnlyOnce within this module.

```suggestion
                    # Pin Snowflake's per-session statement count to 1 to block
                    # multi-statement execution. This is already the connector default,
                    # but setting it explicitly means an account-level override cannot
                    # accidentally enable multi-statement execution.
                    session_parameters=_SNOWFLAKE_SESSION_PARAMETERS,
```

Reviews (1): Last reviewed commit: "chore: Explicitly disable multi-statemen..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Simple defensive hardening that explicitly sets MULTI_STATEMENT_COUNT=1 to prevent account-level overrides from enabling multi-statement execution. The bot comment about extracting a shared constant is a style suggestion, not a showstopper.

@tomasfarias tomasfarias merged commit aa9b6f5 into master May 27, 2026
312 of 325 checks passed
@tomasfarias tomasfarias deleted the chore/explicitly-disable-multi-statements-in-snowflake-session branch May 27, 2026 08:22
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented May 27, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-05-27 08:43 UTC Run
prod-us ✅ Deployed 2026-05-27 09:07 UTC Run
prod-eu ✅ Deployed 2026-05-27 09:11 UTC Run

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

Labels

stamphog Request AI review from stamphog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant