-
Notifications
You must be signed in to change notification settings - Fork 31
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
SQLAlchemy/DDL: Allow to turn off column store #555
Changes from all commits
3a2b2aa
b70f90c
da8cae3
b839e11
29804b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,3 +232,30 @@ class DummyTable(self.Base): | |
a = sa.Column(Geopoint, crate_index=False) | ||
with self.assertRaises(sa.exc.CompileError): | ||
self.Base.metadata.create_all(bind=self.engine) | ||
|
||
def test_text_column_without_columnstore(self): | ||
class DummyTable(self.Base): | ||
Check notice Code scanning / CodeQL Unused local variable
Variable DummyTable is not used.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We know this admonition by CodeQL on those occasions. They can be dismissed as false positive. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah... I was already wondering if there is a way to make CodeQL ignore it. I'm happy with them being dismissed tho. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, dismissing them is the maximum we can do here. But unfortunately, the corresponding admonition items will never be collapsed. Instead, they will be displayed "expanded" here, into eternity, even if we would resolve this conversation about it. Unfortunately, there is also no other way to mitigate warnings on such spots, or to acknowledge them upfront, for example, by placing corresponding annotations into the code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi again. CodeQL admonition items will be made collapsible, it's so sweet. Thank you, @anaarmas. |
||
__tablename__ = 't' | ||
pk = sa.Column(sa.String, primary_key=True) | ||
a = sa.Column(sa.String, crate_columnstore=False) | ||
b = sa.Column(sa.String, crate_columnstore=True) | ||
c = sa.Column(sa.String) | ||
|
||
self.Base.metadata.create_all(bind=self.engine) | ||
|
||
fake_cursor.execute.assert_called_with( | ||
('\nCREATE TABLE t (\n\t' | ||
'pk STRING NOT NULL, \n\t' | ||
'a STRING STORAGE WITH (columnstore = false), \n\t' | ||
'b STRING, \n\t' | ||
'c STRING, \n\t' | ||
'PRIMARY KEY (pk)\n)\n\n'), ()) | ||
|
||
def test_non_text_column_without_columnstore(self): | ||
class DummyTable(self.Base): | ||
Check notice Code scanning / CodeQL Unused local variable
Variable DummyTable is not used.
|
||
__tablename__ = 't' | ||
pk = sa.Column(sa.String, primary_key=True) | ||
a = sa.Column(sa.Integer, crate_columnstore=False) | ||
|
||
with self.assertRaises(sa.exc.CompileError): | ||
self.Base.metadata.create_all(bind=self.engine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be fine. Thank you for adding this constraint. Do you acknowledge this, @seut or @matriv?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With crate/crate@837db42, it is also supported on
numeric
andtimestamp
types but this is not yet released, master/nightly only (will be part of CrateDB5.4
. So yes fine like that for now.