Conversation
services/apps/snowflake_connectors/src/consumer/transformerConsumer.ts
Outdated
Show resolved
Hide resolved
themarolt
approved these changes
Mar 3, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
|
|
||
| UPDATE integration."snowflakeExportJobs" SET "sourceName" = 'event-registrations' WHERE platform = 'cvent'; | ||
|
|
||
| ALTER TABLE integration."snowflakeExportJobs" ALTER COLUMN "sourceName" SET NOT NULL; |
There was a problem hiding this comment.
Migration fails if non-cvent rows exist in table
Low Severity
The UPDATE on line 3 only sets sourceName for rows WHERE platform = 'cvent', but line 5 then applies a NOT NULL constraint to all rows. If any rows exist in snowflakeExportJobs with a platform value other than 'cvent', those rows will still have NULL for sourceName, and the ALTER COLUMN SET NOT NULL will fail, blocking the migration. Updating all rows unconditionally (or using a DEFAULT on the column) would be more resilient.
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.


This pull request introduces a significant refactor to the Snowflake export pipeline to support multiple data sources per platform, enabling more granular and flexible data exports. The changes include new abstractions for data sources, updates to workflows and activities to handle source names, and improvements to S3 path structure and error handling.
Multi-source platform support and abstractions:
DataSourceabstraction andDataSourceNameenum inintegrations/types.ts, allowing each platform to define multiple exportable sources, each with its own query and transformer. Platform definitions now include asourcesarray instead of a single transformer/query. [1] [2]event-registrationsas the first defined data source. [1] [2]Workflow and activity changes for source names:
sourceNameas a parameter. [1] [2] [3] [4] [5]getDataSourceNamesForPlatformactivity and supporting integration methods to enumerate available sources for a platform. [1] [2] [3]S3 path and transformer improvements:
Other improvements:
SnowflakeExporter.Note
Medium Risk
Refactors the Snowflake export/transform pipeline and S3 path conventions to be source-aware; incorrect source naming or path parsing could break exports/consumers or create duplicate/missing jobs.
Overview
Adds multi-source support per platform by introducing
DataSource/DataSourceNameand changing platform definitions to expose asourceslist, plus new lookup helpers (getDataSource,getDataSourceNames).Updates the Temporal workflow and export activity to run exports per (platform, source), include
sourceNamein workflow IDs/args, and write S3 files under{bucketPath}/{platform}/{sourceName}/...with improved logging context.Adjusts the transformer consumer to select the correct transformer by parsing
sourceNamefrom the S3 path, and tweaksSnowflakeExporterto only invokeonBatchCompletewhen a batch actually exported rows.Written by Cursor Bugbot for commit 66e0f4c. This will update automatically on new commits. Configure here.