Skip to content

Commit

Permalink
chore(wren-ai-service): minor updates (#854)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyeh authored Nov 1, 2024
1 parent 14f48b5 commit be21189
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions wren-ai-service/src/pipelines/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ async def _task(result: Dict[str, str]):
- YOU MUST USE "JOIN" if you choose columns from multiple tables!
- YOU MUST USE "lower(<column_name>) = lower(<value>)" function for case-insensitive comparison!
- DON'T USE "DATE_ADD" or "DATE_SUB" functions for date operations, instead use syntax like this "current_date - INTERVAL '7' DAY"!
- DON'T USE "COUNT(*) FILTER(WHERE <condition>)"
- ALWAYS ADD "timestamp" to the front of the timestamp literal, ex. "timestamp '2024-02-20 12:00:00'"
- USE THE VIEW TO SIMPLIFY THE QUERY.
- DON'T MISUSE THE VIEW NAME. THE ACTUAL NAME IS FOLLOWING THE CREATE VIEW STATEMENT.
Expand Down
7 changes: 4 additions & 3 deletions wren-ai-service/tests/pytest/test_usecases.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import aiohttp
import orjson
import requests
import toml

from demo.utils import _get_connection_info, _replace_wren_engine_env_variables

Expand All @@ -24,11 +25,11 @@ def test_load_mdl_and_questions():
with open("tests/data/hubspot/mdl.json", "r") as f:
mdl_str = orjson.dumps(json.load(f)).decode("utf-8")

with open("tests/data/hubspot/questions.json", "r") as f:
questions = json.load(f)["questions"]
data = toml.load("tests/data/hubspot/eval_dataset.toml")
questions = [item["question"] for item in data.get("eval_dataset", [])]
except FileNotFoundError:
raise Exception(
"tests/data/hubspot/mdl.json or tests/data/hubspot/questions.json not found"
"tests/data/hubspot/mdl.json or tests/data/hubspot/eval_dataset.toml not found"
)

return mdl_str, questions
Expand Down

0 comments on commit be21189

Please sign in to comment.