Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schemachange cli command returns Error: Empty SQL statement if .sql file ends with comments #240

Open
ArnauMunsOrenga opened this issue Mar 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ArnauMunsOrenga
Copy link

Describe the bug

When creating a new .sql file to implement a change in our Snowflake database, the schemachange cli command returns an error: SQL compilation error: Empty SQL statement if the .sql file terminates with a comment.

The error does not appear if the file terminates with a valid SQL command.

To Reproduce
Steps to reproduce the behavior:

  1. Create an .sql script with some SQL command to be implemented in snowflake database
  2. Make sure the file ends with some comments --some comment
  3. Run schemachange CLI command
  4. See error

Expected behavior
I would expect schemachange not to return an "Empty SQL statement" error if the .sql file ends with some comments. I would expect it executes the SQL commands it finds in the .sql script, and implements changes on the database successfully.

Screenshots
image

Schemachange (please complete the following information):

  • schemachange: 3.6.1
  • Python 3.9.19
  • snowflake-connector-python 2.8.3

Additional context
Add any other context about the problem here.

@ArnauMunsOrenga ArnauMunsOrenga added the bug Something isn't working label Mar 26, 2024
@opodoprigora
Copy link
Contributor

We run into the same issue but it's unlikely to get fixed due to #130 (comment).

We postfix all commented out scripts with a dummy sql command like SELECT 1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants