Skip to content
Closed
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dd3cf40
Scaffold basic file structure for a new dialect
susodapop Jul 7, 2022
e13fb3b
barebone (& non-working) DatabricksDialect implementation
overcoil Jul 13, 2022
0ee8d26
reminder about TABLE_SCHEM
overcoil Jul 13, 2022
2742a92
initial checkin with working pytest test suites.
overcoil Jul 19, 2022
c6c1322
remove secret in comment
overcoil Jul 19, 2022
a594e7c
minor corrections
overcoil Jul 19, 2022
595178b
add cleanup and notes for self
overcoil Jul 20, 2022
d7e72a8
add sample programs & prelim README
overcoil Jul 20, 2022
59bf8b7
add prelim support for string and derived types
overcoil Jul 22, 2022
44a9e32
tidy up for the week; pulled out partial interval support for the while
overcoil Jul 22, 2022
6463fef
add a block of test suites from SA
overcoil Jul 26, 2022
d3bd5d2
Trial add of Github Action for the SQLAlchemy dialect
overcoil Jul 26, 2022
8716645
yml error
overcoil Jul 26, 2022
d75710a
add self-reference to trigger a run when the action is update
overcoil Jul 26, 2022
55e4448
correct usage of env var
overcoil Jul 27, 2022
dc70f90
move to repo secrets instead
overcoil Jul 27, 2022
d6f98dd
correct drop pseudo-targets
overcoil Jul 27, 2022
8e480ad
add trigger on the top-level Makefile (convenience)
overcoil Jul 27, 2022
d68ddb5
add dbsqlcli for cleanup
overcoil Jul 27, 2022
c6a9386
add init invocation of dbsqlcli
overcoil Jul 27, 2022
01f5a16
override the return code
overcoil Jul 27, 2022
d121881
wrong conjunction!
overcoil Jul 27, 2022
55aa104
correct table name
overcoil Jul 27, 2022
6655473
restrict to the dev branch for the while
overcoil Jul 27, 2022
629a510
various minor items
overcoil Aug 4, 2022
01a4d00
Merge branch 'sqlalchemy-dev' of https://github.com/overcoil/fork-dat…
overcoil Aug 9, 2022
dd79718
Cleaned up and reformatted
overcoil Aug 10, 2022
2a8b36d
removed unneeded cruft from earlier experiments
overcoil Aug 10, 2022
1fcdfc2
missed the other Makefile
overcoil Aug 10, 2022
488b94d
revert unneeded changes; remove dead template
overcoil Aug 10, 2022
7ba1f2a
remove unneeded action; expand decimal test case to cover default and…
overcoil Aug 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions .github/workflows/sqlalchemy-dialect.yml
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
Copy link
Collaborator

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?

Copy link
Author

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.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rectified

#----------------------------------------------
# ----- 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;"
Copy link
Collaborator

Choose a reason for 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?

Copy link
Author

Choose a reason for 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.

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
Loading