Skip to content
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

feat(substitute): add model substitute API #1002

Merged
merged 16 commits into from
Dec 23, 2024
Merged

Conversation

grieve54706
Copy link
Contributor

@grieve54706 grieve54706 commented Dec 20, 2024

Provide an API to substitute models for tables in data source SQL.
It also checks whether the table is in the manifest and dry-runs the substituted sql to check the sql worked.

POST /v2/connector/{data_source}/model-substitute
POST /v3/connector/{data_source}/model-substitute

Request

{
  "manifestStr": {
    "catalog": "wren_catalog",
    "schema": "wren_schema",
    "models": [
      {
        "name": "Orders",
        "tableReference": {
          "schema": "public",
          "table": "orders"
        }
      }
    ]
  },
  "connectionInfo": "...",
  "sql": "SELECT * FROM public.orders"
}

Response

SELECT * FROM "wren_catalog"."wren_schema"."Orders"

@github-actions github-actions bot added ibis dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Dec 20, 2024
@grieve54706 grieve54706 marked this pull request as ready for review December 20, 2024 06:34
Copy link
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

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

Thanks @grieve54706 looks great 👍

@@ -24,7 +24,9 @@ httpx = "0.28.1"
python-dotenv = "1.0.1"
orjson = "3.10.12"
pandas = "2.2.3"
sqlglot = ">=23.4,<25.21"
sqlglot = { extras = [
"rs",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@goldmedal goldmedal merged commit f8f96f0 into main Dec 23, 2024
7 checks passed
@goldmedal goldmedal deleted the feature/transpile-api branch December 23, 2024 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file ibis python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants