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

chore(wren-ai-service): minor updates #854

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading