Add support for table comments - #308
Conversation
0e6a2ec to
9c8cbed
Compare
Signed-off-by: Christophe Bornet <cbornet@hotmail.com>
| """This test confirms that a table comment can be dropped. | ||
| The difference with TableDDLTest is that the comment value is '' and not None after | ||
| being dropped. | ||
| """ |
There was a problem hiding this comment.
BTW this is surprising. From the docs we could expect the comment to be set to NULL and not ''.
But that's what I get when I test on databricks cloud.
There was a problem hiding this comment.
I adapted for this in #328 by simply coercing the '' value into a NoneType. This passes SQLAlchemy's reusable tests.
5e82562 to
e49eed3
Compare
Signed-off-by: Christophe Bornet <cbornet@hotmail.com>
|
@susodapop can we get help taking a peek at this one? |
|
Hello @nagyryan @susodapop @yansonggao-db @andrefurlan-db can one you help @cbornet get this reviewed and merged please? For context @cbornet and I are working on some LangChain apps and require this PR. Ideally we would use an official release instead of using a fork. We know of other devs that in same situation too |
|
Please let @cbornet or I know if there is anything we can do to move this along |
|
This is being reviewed and tested internally as we need to enable a few e2e
test and run the whole suite.
…On Tue, Jan 23, 2024 at 12:25 PM Nadir J ***@***.***> wrote:
Please let @cbornet <https://github.com/cbornet> or I know if there is
anything we can do move this along
—
Reply to this email directly, view it on GitHub
<#308 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AECG7B3D2HGQ2XMJYCDWSPTYP7W77AVCNFSM6AAAAABBEKINDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBWGU3DEOJWGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
susodapop
left a comment
There was a problem hiding this comment.
Overall the change code looks great. I'm running all the tests and going to add some unit tests for the statement rendering.
| """ | ||
| if column is column.table._autoincrement_column or column.autoincrement is True: | ||
| logger.warn( | ||
| logger.warning( |
|
|
||
| @requirements.comment_reflection | ||
| @util.provide_metadata | ||
| def test_drop_table_comment(self, connection): |
There was a problem hiding this comment.
Since I merged #328 do we still need to override this test?
| pass | ||
|
|
||
|
|
||
| class FutureTableDDLTest(FutureTableDDLTest): |
| TIMEZONE_OPT = "timezone-optional TIMESTAMP fields" | ||
| TRANSACTIONS = "transactions" | ||
| UNIQUE = "UNIQUE constraints" | ||
| DROP_TBL = "drop table comment" |
There was a problem hiding this comment.
Since '' is identical to None as far as sqlalchemy is concerned, I think we needn't list this as unsupported. We can just document the behaviour. Thoughts?
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
class. Scaffold in the Table Comment unit tests. Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
| table_name=table_name, | ||
| schema_name=schema, | ||
| ) | ||
| # Type ignore is because mypy knows that self._describe_table_extended *can* |
There was a problem hiding this comment.
We can actually catch this using isinstance to avoid the mypy error like we do in get_pk_constraint.
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
|
I pushed a few commits making these changes:
I concur with your choice not to use the thrift |
This was missed in databricks#328 Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
|
Awesome ! |
NB: I didn't find a way to get the comments of temporary views
information_schemaDESCRIBE TABLE EXTENDEDdoesn't return anything for temporary viewsSHOW CREATE TABLEisn't supported for temporary viewsSHOW TABLE EXTENDEDdoesn't report comments for temporary views (it does for default views)TGetTablesRespmessage contains the temporary views but theREMARKSfield is empty for all tablesThe TCK tests
test_comments_unicodeandtest_comments_unicode_fullare still skipped at the moment since they also test column comments which are added in another PR: #306