-
Notifications
You must be signed in to change notification settings - Fork 110
Add support for table comments #308
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
Merged
susodapop
merged 12 commits into
databricks:sqlalchemy-staging
from
cbornet:table-comment
Jan 23, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
cfdf3f3
Add support for table comments
cbornet ba5ad75
Use per-table DTE to get the table comments
cbornet 439fe6a
Merge branch 'sqlalchemy-staging' into table-comment
57b6802
Revert pytest.ini change
bd68ea8
Fix typo in test name for columns. Move .engine and .compile into a base
7c94ce3
Add unit tests for table comments
c09ae2b
Revert overrides since these aren't needed after #328
8f8fef0
Stop skipping table comment portions of ComponentReflectionTest
78a5ad0
Move DTE parsing into _parse.py
2aa5805
Add e2e test using inspector
f65324f
Add unit test for new method in _parse.py
7b6fefb
Fix assertion in column comment test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,7 @@ | |
ComponentReflectionTest, | ||
ComponentReflectionTestExtra, | ||
CTETest, | ||
FutureTableDDLTest, | ||
InsertBehaviorTest, | ||
TableDDLTest, | ||
) | ||
from sqlalchemy.testing.suite import ( | ||
ArrayTest, | ||
|
@@ -53,7 +51,6 @@ class FutureFeature(Enum): | |
PROVISION = "event-driven engine configuration" | ||
REGEXP = "_visit_regexp" | ||
SANE_ROWCOUNT = "sane_rowcount support" | ||
TBL_COMMENTS = "table comment reflection" | ||
TBL_OPTS = "get_table_options method" | ||
TEST_DESIGN = "required test-fixture overrides" | ||
TUPLE_LITERAL = "tuple-like IN markers completely" | ||
|
@@ -251,36 +248,7 @@ class FutureWeCanSetDefaultSchemaWEventsTest(FutureWeCanSetDefaultSchemaWEventsT | |
pass | ||
|
||
|
||
class FutureTableDDLTest(FutureTableDDLTest): | ||
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. Perfect! |
||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_add_table_comment(self): | ||
"""We could use requirements.comment_reflection here to disable this but prefer a more meaningful skip message""" | ||
pass | ||
|
||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_drop_table_comment(self): | ||
"""We could use requirements.comment_reflection here to disable this but prefer a more meaningful skip message""" | ||
pass | ||
|
||
|
||
class TableDDLTest(TableDDLTest): | ||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_add_table_comment(self, connection): | ||
"""We could use requirements.comment_reflection here to disable this but prefer a more meaningful skip message""" | ||
pass | ||
|
||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_drop_table_comment(self, connection): | ||
"""We could use requirements.comment_reflection here to disable this but prefer a more meaningful skip message""" | ||
pass | ||
|
||
|
||
class ComponentReflectionTest(ComponentReflectionTest): | ||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_get_multi_table_comment(self): | ||
"""There are 84 permutations of this test that are skipped.""" | ||
pass | ||
|
||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_OPTS, True)) | ||
def test_multi_get_table_options_tables(self): | ||
"""It's not clear what the expected ouput from this method would even _be_. Requires research.""" | ||
|
@@ -302,22 +270,6 @@ def test_get_multi_pk_constraint(self): | |
def test_get_multi_check_constraints(self): | ||
pass | ||
|
||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_get_comments(self): | ||
pass | ||
|
||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_get_comments_with_schema(self): | ||
pass | ||
|
||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_comments_unicode(self): | ||
pass | ||
|
||
@pytest.mark.skip(reason=render_future_feature(FutureFeature.TBL_COMMENTS)) | ||
def test_comments_unicode_full(self): | ||
pass | ||
|
||
|
||
class ComponentReflectionTestExtra(ComponentReflectionTestExtra): | ||
@pytest.mark.skip(render_future_feature(FutureFeature.CHECK)) | ||
|
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
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
Oops, something went wrong.
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.
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.
Good catch 🙏