feat(tht): promoted_columns_for helper (curated column set)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import json
|
||||
from tht.cli.sql_cmd import promoted_columns_for
|
||||
|
||||
|
||||
def test_promoted_columns_for(tmp_path):
|
||||
sid = "sess1"
|
||||
sdir = tmp_path / sid
|
||||
sdir.mkdir(parents=True)
|
||||
(sdir / "schema_linking.json").write_text(json.dumps({
|
||||
"question": "q",
|
||||
"candidates": [
|
||||
{"kind": "table", "name": "dim_patient", "decision": "promoted"},
|
||||
{"kind": "column", "name": "dim_patient.cod_paz", "decision": "promoted"},
|
||||
{"kind": "column", "name": "dim_patient.nome", "decision": "excluded"},
|
||||
],
|
||||
"joins": [], "excluded": [],
|
||||
}))
|
||||
|
||||
class Cfg:
|
||||
class paths: # noqa: N801
|
||||
sessions = tmp_path
|
||||
assert promoted_columns_for(Cfg, sid) == {"dim_patient.cod_paz"}
|
||||
Reference in New Issue
Block a user