-
Notifications
You must be signed in to change notification settings - Fork 127
Sqlalchemy dev POC #30
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
Changes from 30 commits
dd3cf40
e13fb3b
0ee8d26
2742a92
c6c1322
a594e7c
595178b
d7e72a8
59bf8b7
44a9e32
6463fef
d3bd5d2
8716645
d75710a
55e4448
dc70f90
d6f98dd
8e480ad
d68ddb5
c6a9386
01f5a16
d121881
55aa104
6655473
629a510
01a4d00
dd79718
2a8b36d
1fcdfc2
488b94d
7ba1f2a
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 |
|---|---|---|
| @@ -0,0 +1,178 @@ | ||
| name: SQLAlchemy dialect test | ||
| on: | ||
| push: | ||
| branches: | ||
| - sqlalchemy-dev | ||
| paths: | ||
| - Makefile | ||
| - src/databricks/sqlalchemy | ||
| - tests/sqlalchemy | ||
| - .github/workflows/sqlalchemy-dialect.yml | ||
| jobs: | ||
| run-tests: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| #---------------------------------------------- | ||
| # check-out repo and set-up python | ||
| #---------------------------------------------- | ||
| - name: Check out repository | ||
| uses: actions/checkout@v2 | ||
| - name: Set up python | ||
| id: setup-python | ||
| uses: actions/setup-python@v2 | ||
| with: | ||
| python-version: 3.7 | ||
| #---------------------------------------------- | ||
| # ----- install databricks-sql-cli ----- | ||
| #---------------------------------------------- | ||
| - name: Install databricks-sql-cli & initalize dbsqlclirc | ||
| run: | | ||
| python -m pip install databricks-sql-cli | ||
| dbsqlcli || true | ||
|
|
||
| #---------------------------------------------- | ||
| # ----- install & configure poetry ----- | ||
| #---------------------------------------------- | ||
| - name: Install Poetry | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| virtualenvs-create: true | ||
| virtualenvs-in-project: true | ||
| installer-parallel: true | ||
|
|
||
| #---------------------------------------------- | ||
| # load cached venv if cache exists | ||
| #---------------------------------------------- | ||
| - name: Load cached venv | ||
| id: cached-poetry-dependencies | ||
| uses: actions/cache@v2 | ||
| with: | ||
| path: .venv | ||
| key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }} | ||
| #---------------------------------------------- | ||
| # install dependencies if cache does not exist | ||
| #---------------------------------------------- | ||
| - name: Install dependencies | ||
| if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
| run: poetry install --no-interaction --no-root | ||
| #---------------------------------------------- | ||
| # install your root project, if required | ||
| #---------------------------------------------- | ||
| - name: Install library | ||
| run: poetry install --no-interaction | ||
| #---------------------------------------------- | ||
| # run test suite | ||
| #---------------------------------------------- | ||
| - name: Run tests | ||
| #---------------------------------------------- | ||
| # import secrets from the Github env | ||
| #---------------------------------------------- | ||
| env: | ||
| DATABRICKS_SERVER_HOSTNAME: ${{ secrets.REPOSEC_DATABRICKS_SERVER_HOSTNAME }} | ||
| DATABRICKS_HTTP_PATH: ${{ secrets.REPOSEC_DATABRICKS_HTTP_PATH }} | ||
| DATABRICKS_TOKEN: ${{ secrets.REPOSEC_DATABRICKS_TOKEN }} | ||
| 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;" | ||
|
||
| poetry run pytest tests/sqlalchemy/test_full_sa.py::IntegerTest --dburi "databricks+thrift://token:$DATABRICKS_TOKEN@$DATABRICKS_SERVER_HOSTNAME/$DATABRICKS_SCHEMA?http_path=$DATABRICKS_HTTP_PATH" | ||
| 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;" | ||
|
|
||
| # check-linting: | ||
| # runs-on: ubuntu-latest | ||
| # steps: | ||
| # #---------------------------------------------- | ||
| # # check-out repo and set-up python | ||
| # #---------------------------------------------- | ||
| # - name: Check out repository | ||
| # uses: actions/checkout@v2 | ||
| # - name: Set up python | ||
| # id: setup-python | ||
| # uses: actions/setup-python@v2 | ||
| # with: | ||
| # python-version: 3.7 | ||
| # #---------------------------------------------- | ||
| # # ----- install & configure poetry ----- | ||
| # #---------------------------------------------- | ||
| # - name: Install Poetry | ||
| # uses: snok/install-poetry@v1 | ||
| # with: | ||
| # virtualenvs-create: true | ||
| # virtualenvs-in-project: true | ||
| # installer-parallel: true | ||
|
|
||
| # #---------------------------------------------- | ||
| # # load cached venv if cache exists | ||
| # #---------------------------------------------- | ||
| # - name: Load cached venv | ||
| # id: cached-poetry-dependencies | ||
| # uses: actions/cache@v2 | ||
| # with: | ||
| # path: .venv | ||
| # key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }} | ||
| # #---------------------------------------------- | ||
| # # install dependencies if cache does not exist | ||
| # #---------------------------------------------- | ||
| # - name: Install dependencies | ||
| # if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
| # run: poetry install --no-interaction --no-root | ||
| # #---------------------------------------------- | ||
| # # install your root project, if required | ||
| # #---------------------------------------------- | ||
| # - name: Install library | ||
| # run: poetry install --no-interaction | ||
| # #---------------------------------------------- | ||
| # # black the code | ||
| # #---------------------------------------------- | ||
| # - name: Black | ||
| # run: poetry run black --check src | ||
|
|
||
| # check-types: | ||
| # runs-on: ubuntu-latest | ||
| # steps: | ||
| # #---------------------------------------------- | ||
| # # check-out repo and set-up python | ||
| # #---------------------------------------------- | ||
| # - name: Check out repository | ||
| # uses: actions/checkout@v2 | ||
| # - name: Set up python | ||
| # id: setup-python | ||
| # uses: actions/setup-python@v2 | ||
| # with: | ||
| # python-version: 3.7 | ||
| # #---------------------------------------------- | ||
| # # ----- install & configure poetry ----- | ||
| # #---------------------------------------------- | ||
| # - name: Install Poetry | ||
| # uses: snok/install-poetry@v1 | ||
| # with: | ||
| # virtualenvs-create: true | ||
| # virtualenvs-in-project: true | ||
| # installer-parallel: true | ||
|
|
||
| # #---------------------------------------------- | ||
| # # load cached venv if cache exists | ||
| # #---------------------------------------------- | ||
| # - name: Load cached venv | ||
| # id: cached-poetry-dependencies | ||
| # uses: actions/cache@v2 | ||
| # with: | ||
| # path: .venv | ||
| # key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }} | ||
| # #---------------------------------------------- | ||
| # # install dependencies if cache does not exist | ||
| # #---------------------------------------------- | ||
| # - name: Install dependencies | ||
| # if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
| # run: poetry install --no-interaction --no-root | ||
| # #---------------------------------------------- | ||
| # # install your root project, if required | ||
| # #---------------------------------------------- | ||
| # - name: Install library | ||
| # run: poetry install --no-interaction | ||
| # #---------------------------------------------- | ||
| # # black the code | ||
| # #---------------------------------------------- | ||
| # - name: Mypy | ||
| # run: poetry run mypy src | ||
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.
does this work on other versions of python3 as well? any limitation on the supported python version?
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.
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.)
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.
Rectified