fix: filter empty SQL commands at execute_snowflake_statement call sites#6249
Open
jials wants to merge 4 commits intofeast-dev:masterfrom
Open
fix: filter empty SQL commands at execute_snowflake_statement call sites#6249jials wants to merge 4 commits intofeast-dev:masterfrom
jials wants to merge 4 commits intofeast-dev:masterfrom
Conversation
607c1da to
aeff56c
Compare
Signed-off-by: Jia Le <5955220+jials@users.noreply.github.com>
aeff56c to
f18f4ed
Compare
Author
|
There are still other issues with the existing Snowflake Registry codebase. Will raise a followup PR to fix the rest of the issues. |
ntkathole
reviewed
Apr 10, 2026
|
|
||
|
|
||
| def execute_snowflake_statement(conn: SnowflakeConnection, query) -> SnowflakeCursor: | ||
| if not query.strip(): |
Member
There was a problem hiding this comment.
I think the real fix should be in the caller, silently returning a cursor for an empty query in a shared utility function masks potential bugs.
something like:
for command in sql_cmds:
query = command.replace("REGISTRY_PATH", f"{self.registry_path}")
if query.strip():
execute_snowflake_statement(conn, query)
…ring in execute_snowflake_statement Signed-off-by: Jia Le <5955220+jials@users.noreply.github.com>
a96b783 to
bb67029
Compare
Signed-off-by: Jia Le <5955220+jials@users.noreply.github.com>
Signed-off-by: Jia Le <5955220+jials@users.noreply.github.com>
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.
What this PR does / why we need it:
When SnowflakeRegistry splits
.sqlfiles by;, trailing semicolons produce empty strings that get passed to execute_snowflake_statement. The PR moves that filtering to the call sites, stripping and discarding empty commands before execution.Which issue(s) this PR fixes:
Fixes #5204 (partially)
Checks
git commit -s)Testing Strategy
Misc