Single Quotes for COLLATE statements (New PR)
Please answer these questions before submitting your pull requests. Thanks!
-
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
This solves the issue described in #186, unfortunately, there was no issue referenced there.
-
Fill out the following pre-review checklist:
- [x] I am adding a new automated test(s) to verify correctness of my new code
- [ ] I am adding new logging messages
- [ ] I am adding new credentials
- [ ] I am adding a new dependency
-
Please describe how your code solves the related issue.
The initial problem description can be viewed here. TL;DR: When creating tables with columns that have collation in sqlalchemy
table = sqlalchemy.Table("table1", Column("char_column", String(collation="en")))
the resulting SQL statements use double quotes
CREATE TABLE table1 (char_column VARCHAR COLLATE "en")
which is allowed in other database engines but does not work in snowflake.
This PR fixes that issue by overwriting the rendering in the SQLAlchemy statement Compiler for text columns and adding at least one new test.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
My initial idea was to write a test that validates if the column is sorted according to the specified collation.
I think, however, that that is something snowflake itself should have to test. Therefore I am just validating that the information was passed correctly.
Previously, before this feature, it was not even possible to create tables with collation information so that is tested implicitly as well.
@sfc-gh-mkeller do you have some time or know someone from snowflake who could have a look at this?
Just checking to see if there is an update on this issue.