Skip to content

Commit

Permalink
Merge branch 'main' into test/all-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
grieve54706 committed Nov 29, 2024
2 parents 2aba5dc + 689caf8 commit 71a697e
Show file tree
Hide file tree
Showing 60 changed files with 839 additions and 936 deletions.
12 changes: 8 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ documentation:
- changed-files:
- any-glob-to-any-file: ['**/*.md']

trino:
- changed-files:
- any-glob-to-any-file: ['**/*trino*']

bigquery:
- changed-files:
- any-glob-to-any-file: ['**/*bigquery*']

ci:
- changed-files:
- any-glob-to-any-file: ['.github/**']

v1-engine-changed:
- changed-files:
- any-glob-to-any-file: ['wren-base/**', 'wren-main/**', 'wren-server/**', 'wren-tests/**', 'trino-parser/**', 'pom.xml']
9 changes: 6 additions & 3 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.ENGINE_IMAGE }}
tags: ${{ needs.prepare-tag.outputs.tags }}
tags: |
${{ needs.prepare-tag.outputs.tags }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -152,7 +153,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.IBIS_IMAGE }}
tags: ${{ needs.prepare-tag.outputs.tags }}
tags: |
${{ needs.prepare-tag.outputs.tags }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -162,9 +164,10 @@ jobs:
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
TAGS=$(echo "${{ steps.meta.outputs.tags }}" | awk '{printf "--tag %s ", $0}')
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.IBIS_IMAGE }}@sha256:%s ' *) \
--tag ${{ steps.meta.outputs.tags }}
$TAGS
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ steps.meta.outputs.tags }}
197 changes: 0 additions & 197 deletions .github/workflows/core-py-mult-platform-ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/maven-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:
jobs:
maven-tests:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'v1-engine-changed' }}
if: contains(github.event.pull_request.labels.*.name, 'v1-engine-changed')
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ jobs:
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
TAGS=$(echo "${{ steps.meta.outputs.tags }}" | awk '{printf "--tag %s ", $0}')
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.IBIS_IMAGE }}@sha256:%s ' *) \
--tag ${{ steps.meta.outputs.tags }}
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ steps.meta.outputs.tags }}
$TAGS
4 changes: 2 additions & 2 deletions ibis-server/app/mdl/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def analyze(manifest_str: str, sql: str) -> list[dict]:
)
return r.raise_for_status().json()
except httpx.ConnectError as e:
raise ConnectionError(f"Can not connect to Wren Engine: {e}") from e
raise ConnectionError(f"Can not connect to Java Engine: {e}") from e
except httpx.HTTPStatusError as e:
raise AnalyzeError(e.response.text)

Expand All @@ -32,7 +32,7 @@ def analyze_batch(manifest_str: str, sqls: list[str]) -> list[list[dict]]:
)
return r.raise_for_status().json()
except httpx.ConnectError as e:
raise ConnectionError(f"Can not connect to Wren Engine: {e}") from e
raise ConnectionError(f"Can not connect to Java Engine: {e}") from e
except httpx.HTTPStatusError as e:
raise AnalyzeError(e.response.text)

Expand Down
4 changes: 2 additions & 2 deletions ibis-server/app/mdl/rewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def rewrite(self, sql: str) -> str:
)
return r.raise_for_status().text.replace("\n", " ")
except httpx.ConnectError as e:
raise WrenEngineError(f"Can not connect to Wren Engine: {e}")
raise WrenEngineError(f"Can not connect to Java Engine: {e}")
except httpx.TimeoutException as e:
raise WrenEngineError(f"Timeout when connecting to Wren Engine: {e}")
raise WrenEngineError(f"Timeout when connecting to Java Engine: {e}")
except httpx.HTTPStatusError as e:
raise RewriteError(e.response.text)

Expand Down
2 changes: 1 addition & 1 deletion ibis-server/app/middleware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async def dispatch(self, request: Request, call_next) -> Response:
if body:
json_obj = orjson.loads(body)
if "connectionInfo" in json_obj:
json_obj["connectionInfo"] = "REMOVED_SENSITIVE_DATA"
json_obj["connectionInfo"] = "REDACTED"
body = orjson.dumps(json_obj)
logger.info("Request body: {body}", body=body.decode("utf-8"))
try:
Expand Down
9 changes: 1 addition & 8 deletions ibis-server/app/model/metadata/snowflake.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from contextlib import closing

import ibis

from app.model import SnowflakeConnectionInfo
from app.model.data_source import DataSource
from app.model.metadata.dto import (
Expand Down Expand Up @@ -83,12 +81,7 @@ def get_constraints(self) -> list[Constraint]:
"""
with closing(self.connection.raw_sql(sql)) as cur:
fields = [field[0] for field in cur.description]
result = [dict(zip(fields, row)) for row in cur.fetchall()]
res = (
ibis.memtable(result).to_pandas().to_dict(orient="records")
if len(result) > 0
else []
)
res = [dict(zip(fields, row)) for row in cur.fetchall()]
constraints = []
for row in res:
constraints.append(
Expand Down
4 changes: 2 additions & 2 deletions ibis-server/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ To start the server:
- Run the container: `just docker-run`

### Run the testing
- Prepare the Wren Engine server (see [Wren Engine Example](../../example/README.md))
- Use the `.env` file to set the `WREN_ENGINE_ENDPOINT` environment variable to change the endpoint of the Wren Engine server.
- Prepare the Java Engine server (see [Java Engine Example](../../example/README.md))
- Use the `.env` file to set the `WREN_ENGINE_ENDPOINT` environment variable to change the endpoint of the Java Engine server.
```
WREN_ENGINE_ENDPOINT=http://localhost:8080
```
Expand Down
Loading

0 comments on commit 71a697e

Please sign in to comment.