Canner / wren-engine

🤖 The semantic engine for LLMs, bringing semantic context to AI agents. 🔥
https://getwren.ai/oss
Apache License 2.0
129 stars 34 forks source link

chore(ibis): introduce a script for query locally #869

Closed goldmedal closed 2 weeks ago

goldmedal commented 2 weeks ago

Description

This PR implements a simple Python script to execute an SQL locally. Currently, only implement the BigQuery connection in this PR. Given the required environment variables, we can input an SQL file like

poetry run python tools/query_local_run.py < test.sql
goldmedal commented 2 weeks ago

How about using an env var WREN_CONFIG_ROOT and using fixed file names like manifest.json, function_list, connection_info.json?

In my use case, I won't put them in the same folder. I could get the manifest from another project and the function list from the ibis resource. I think it's more flexible.

goldmedal commented 2 weeks ago

Because I also use dotenv in this script, the user can maintain all of them in the .env file.

grieve54706 commented 2 weeks ago

How about a config.properties file to collect these variables? There are too many environment variables for me now.

goldmedal commented 2 weeks ago

How about a config.properties file to collect these variables? There are too many environment variables for me now.

hmm.. I think it is just a script for testing locally, not for production. I don't prefer to have an additional config file for it. Why not just use .env file to maintain them?

grieve54706 commented 2 weeks ago

Oh! cool. The .env is fine to me. I didn't catch that you meant that before.

goldmedal commented 2 weeks ago

Thanks @grieve54706