Skip to content

Commit fde7493

Browse files
committed
FEAT: Support main SQL syntax
1 parent 6009b57 commit fde7493

25 files changed

+4344
-1
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xorbits_sql/_version.py export-subst
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
### Describe the bug
11+
A clear and concise description of what the bug is.
12+
13+
### To Reproduce
14+
To help us to reproduce this bug, please provide information below:
15+
16+
1. Your Python version
17+
2. The version of Xorbits and SQLGlot you use
18+
3. Versions of crucial packages, such as numpy, scipy and pandas
19+
4. Full stack of the error.
20+
5. Minimized code to reproduce the error.
21+
22+
### Expected behavior
23+
A clear and concise description of what you expected to happen.
24+
25+
### Additional context
26+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
### Is your feature request related to a problem? Please describe
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
### Describe the solution you'd like
14+
A clear and concise description of what you want to happen.
15+
16+
### Describe alternatives you've considered
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
### Additional context
20+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/other.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Other
3+
about: Submit other issues here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Note that the issue tracker is NOT the place for general support. For
11+
discussions about development, questions about usage, or any general questions,
12+
contact us on https://discuss.xorbits.io/.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--
2+
Thank you for your contribution!
3+
-->
4+
5+
## What do these changes do?
6+
7+
<!-- Please give a short brief about these changes. -->
8+
9+
## Related issue number
10+
11+
<!-- Are there any issues opened that will be resolved by merging this change? -->
12+
Fixes #xxxx
13+
14+
## Check code requirements
15+
16+
- [ ] tests added / passed (if needed)
17+
- [ ] Ensure all linting tests pass

.github/codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 90%
6+
threshold: 1%

.github/mergify.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pull_request_rules:
2+
- name: automatic update
3+
conditions:
4+
- -conflict # skip PRs with conflicts
5+
- -draft # filter-out GH draft PRs
6+
actions:
7+
update:
8+
- name: Automatic merge
9+
conditions:
10+
- "#approved-reviews-by>=2"
11+
- check-success=lint (ubuntu-latest, 3.10)
12+
- check-success=build_test_job (ubuntu-latest, 3.8, ray)
13+
- check-success=build_test_job (ubuntu-latest, 3.9, ray)
14+
- check-success=build_test_job (ubuntu-latest, 3.10, ray)
15+
- check-success=build_test_job (ubuntu-latest, 3.11, ray)
16+
- check-success=codecov/project
17+
- base=main
18+
actions:
19+
merge:
20+
method: squash

.github/workflows/assign.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Assign
2+
on:
3+
issue_comment:
4+
types: created
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
issue_assign:
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- if: github.event.comment.body == 'take'
17+
run: |
18+
echo "Assigning issue ${{ github.event.issue.number }} to ${{ github.event.comment.user.login }}"
19+
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees

.github/workflows/build-wheel.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build and upload to PyPI
2+
3+
on:
4+
schedule:
5+
# trigger build every day at 4:30 UTC
6+
- cron: '30 4 * * *'
7+
push:
8+
tags:
9+
- '*'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build_wheel:
17+
name: Build wheel
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
submodules: recursive
24+
25+
- name: Build wheel
26+
run: python setup.py bdist_wheel --python-tag py3
27+
28+
- uses: actions/upload-artifact@v3
29+
with:
30+
path: ./dist/*.whl
31+
32+
build_sdist:
33+
name: Build source distribution
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
with:
38+
fetch-depth: 0
39+
submodules: recursive
40+
41+
- name: Build sdist
42+
run: pipx run build --sdist
43+
44+
- uses: actions/upload-artifact@v3
45+
with:
46+
path: ./dist/*.tar.gz
47+
48+
upload_pypi:
49+
needs: [build_wheel, build_sdist]
50+
runs-on: ubuntu-latest
51+
# upload to PyPI on every tag starting with 'v'
52+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
53+
steps:
54+
- uses: actions/download-artifact@v3
55+
with:
56+
# unpacks default artifact into dist/
57+
# if `name: artifact` is omitted, the action will create extra parent dir
58+
name: artifact
59+
path: dist
60+
61+
# if is xprobe repo, upload to pypi
62+
- uses: pypa/[email protected]
63+
if: github.repository == 'xorbitsai/xorbits_sql'
64+
with:
65+
user: __token__
66+
password: ${{ secrets.PYPI_PASSWORD }}
67+
68+
# if is not xorbitsai repo, upload to test
69+
- uses: pypa/[email protected]
70+
if: github.repository != 'xorbitsai/xorbits_sql'
71+
with:
72+
user: __token__
73+
password: ${{ secrets.TEST_PYPI_PASSWORD }}
74+
verbose: true
75+
repository_url: https://test.pypi.org/legacy/

.github/workflows/python.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
types: ['opened', 'reopened', 'synchronize']
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
lint:
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ "ubuntu-latest" ]
21+
python-version: [ "3.10" ]
22+
23+
steps:
24+
- name: Check out code
25+
uses: actions/checkout@v3
26+
with:
27+
fetch-depth: 0
28+
submodules: recursive
29+
- name: Set up Python environment
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: "3.10"
33+
- name: flake8 Lint
34+
uses: py-actions/flake8@v2
35+
with:
36+
path: "xorbits_sql"
37+
args: "--config setup.cfg"
38+
- name: black
39+
uses: psf/black@stable
40+
with:
41+
src: "xorbits_sql"
42+
options: "--check"
43+
- uses: isort/isort-action@master
44+
with:
45+
sortPaths: "xorbits_sql"
46+
configuration: "--check-only --diff --sp setup.cfg"
47+
- name: mypy
48+
run: pip install mypy && mypy xorbits_sql
49+
- name: codespell
50+
run: pip install codespell && codespell xorbits_sql
51+
52+
build_test_job:
53+
runs-on: ${{ matrix.os }}
54+
needs: lint
55+
env:
56+
CONDA_ENV: xorbits_sql-test
57+
defaults:
58+
run:
59+
shell: bash -l {0}
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
64+
python-version: ["3.8", "3.9", "3.10", "3.11"]
65+
module: ["xorbits_sql"]
66+
exclude:
67+
- { os: macos-latest, python-version: 3.9 }
68+
- { os: macos-latest, python-version: 3.10 }
69+
- { os: windows-latest, python-version: 3.9 }
70+
- { os: windows-latest, python-version: 3.10 }
71+
72+
steps:
73+
- name: Check out code
74+
uses: actions/checkout@v3
75+
with:
76+
fetch-depth: 0
77+
submodules: recursive
78+
79+
- name: Set up conda ${{ matrix.python-version }}
80+
uses: conda-incubator/setup-miniconda@v2
81+
with:
82+
python-version: ${{ matrix.python-version }}
83+
activate-environment: ${{ env.CONDA_ENV }}
84+
85+
- name: Install dependencies
86+
env:
87+
MODULE: ${{ matrix.module }}
88+
run: |
89+
pip install cython coverage flaky
90+
pip install -e ".[dev]"
91+
working-directory: .
92+
93+
- name: Test with pytest
94+
env:
95+
MODULE: ${{ matrix.module }}
96+
run: |
97+
pytest --cov-config=setup.cfg --cov-report=xml --cov=xorbits_sql --durations=0 \
98+
--log-level=DEBUG --timeout=200 xorbits_sql
99+
working-directory: .
100+
101+
- name: Report coverage data
102+
uses: codecov/codecov-action@v3
103+
with:
104+
working-directory: .
105+
flags: unittests

0 commit comments

Comments
 (0)