GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Sqlalchemy dev POC by overcoil · Pull Request #30 · databricks/databricks-sql-python Conversation
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: setup-python | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: 3.7 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
does this work on other versions of python3 as well? any limitation on the supported python version?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It should. Note that I cribbed from code-quality-checks.yml for this action to test out some ideas. Now that I think about it, this action won't be operative since I've since removed the Pytest test. I will remove this action completely.
(The current plan is to not turn on Github Action in the OSS repo; contributors are encouraged to do so and to use these though.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Rectified
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| DATABRICKS_SCHEMA: ${{ secrets.REPOSEC_DATABRICKS_SCHEMA }} | ||
|
|
||
| run: | | ||
| echo y | dbsqlcli --hostname $DATABRICKS_SERVER_HOSTNAME --http-path $DATABRICKS_HTTP_PATH --access-token $DATABRICKS_TOKEN -e "USE $DATABRICKS_SCHEMA; DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS tabletest; DROP TABLE IF EXISTS integer_table;" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
what happens if there are concurrent PRs? are they going to use the same database name and table name and hence one PR CI may fail because of other PR CI writing to the same table?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Refer to my answers to your other comment on this action.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| @@ -1,18 +0,0 @@ | |||
| # Following official SQLAlchemy guide: | |||
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
where did this class come from? did we already have some sql-alchemy related code in the main branch?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This was created initially from the rough scaffolding that Jesse and I put together earlier on (commit 0378460). I ended up tossing it after I figured out that I won't be using SA's test suite.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if type_.precision is None: | ||
| return "DECIMAL" | ||
| elif type_.scale is None: | ||
| return "DECIMAL(%(precision)s)" % {"precision": type_.precision} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
do we have test covering the methods of this class?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I will revisit integration.py to include both the default and specified scales.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Rectified.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| supports_unicode_statements = True | ||
| supports_unicode_binds = True | ||
| returns_unicode_strings = True | ||
| description_encoding = None |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
what's description_encoding?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
According to what I found in SA's doc (https://github.com/sqlalchemy/sqlalchemy/blob/main/doc/build/changelog/changelog_05.rst), it "is used for encoding the column name when processing the metadata. This usually defaults to utf-8." I went with "None" as for all the other dialects I studied.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # provide a way to debug | ||
| debugbreakpoint = os.getenv("DATABRICKS_DIALECT_DEBUG") or False | ||
|
|
||
| class DatabricksDialect(default.DefaultDialect): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
seems src/databricks/sqlalchemy/dialect.py already existed before. Where did this come from?
did we have some sort of support for sqlalchemy dialect previously?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The pre-existing src/databricks/sqlalchemy/dialect.py was a rough scaffolding that Jesse and I put together earlier on (see commit 0378460). I built on this scaffolding.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… specified scales Signed-off-by: George Chow <[email protected]>
|
Closing in favour of #57 although I will incorporate many of these tests into that PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.