-
Notifications
You must be signed in to change notification settings - Fork 95
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] Add table and column comment support #329
Conversation
--------- Signed-off-by: Christophe Bornet <cbornet@hotmail.com> Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> Co-authored-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Fix: this allows component reflection test to pass Databricks returns an empty string in the REMARKS column rather than a `NoneType`. Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
* Add support for table comments Signed-off-by: Christophe Bornet <cbornet@hotmail.com> * Use per-table DTE to get the table comments Signed-off-by: Christophe Bornet <cbornet@hotmail.com> * Revert pytest.ini change Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> * Fix typo in test name for columns. Move .engine and .compile into a base class. Scaffold in the Table Comment unit tests. Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> * Add unit tests for table comments Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> * Revert overrides since these aren't needed after #328 Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> * Stop skipping table comment portions of ComponentReflectionTest Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> * Move DTE parsing into _parse.py Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> * Add e2e test using inspector Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> * Add unit test for new method in _parse.py Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> * Fix assertion in column comment test This was missed in #328 Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> --------- Signed-off-by: Christophe Bornet <cbornet@hotmail.com> Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com> Co-authored-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
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.
LGTM
|
||
comment = inspector.get_table_comment(tbl_name) | ||
|
||
assert comment == {"text": "table comment"} |
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.
Could also check column comments with inspector.get_columns
?
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.
Yes, you already did this with the test_column_comments
, no? I can rewrite it to use the same fixtures and be more efficient.
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.
woof, haven't had my coffee yet. i understand your comment now. I've added an extra method to this test class that simply checks for reflection of the column comment. thank you!
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.
Awesome 👍 !
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase ( |
Description
This PR consolidates the changes from #306 and #308 after review + tests + refactor which I placed into a staging branch to coordinate reviews and testing.