@vespermcp/mcp-server 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/build/config/secure-keys.js +51 -0
- package/build/config/user-config.js +48 -0
- package/build/fusion/engine.js +69 -0
- package/build/index.js +813 -25
- package/build/ingestion/hf-downloader.js +12 -3
- package/build/ingestion/ingestor.js +33 -9
- package/build/metadata/kaggle-source.js +70 -0
- package/build/metadata/scraper.js +34 -10
- package/build/python/config.py +259 -0
- package/build/python/export_engine.py +148 -52
- package/build/python/fusion_engine.py +368 -0
- package/build/python/kaggle_engine.py +204 -0
- package/build/python/row_count.py +54 -0
- package/build/python/test_fusion_engine.py +89 -0
- package/build/scripts/build-index.js +5 -5
- package/build/search/jit-orchestrator.js +74 -14
- package/package.json +8 -2
- package/scripts/refresh-index.cjs +87 -0
- package/src/python/__pycache__/export_engine.cpython-312.pyc +0 -0
- package/src/python/__pycache__/fusion_engine.cpython-312.pyc +0 -0
- package/src/python/config.py +259 -0
- package/src/python/export_engine.py +148 -52
- package/src/python/fusion_engine.py +368 -0
- package/src/python/kaggle_engine.py +204 -0
- package/src/python/row_count.py +54 -0
- package/src/python/test_fusion_engine.py +89 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import tempfile
|
|
3
|
+
import polars as pl
|
|
4
|
+
from fusion_engine import fuse_datasets
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def run_basic_tests():
|
|
8
|
+
tmp = tempfile.gettempdir()
|
|
9
|
+
|
|
10
|
+
# ----- Test 1: concat -----
|
|
11
|
+
p1 = os.path.join(tmp, "fuse_test_a.csv")
|
|
12
|
+
p2 = os.path.join(tmp, "fuse_test_b.csv")
|
|
13
|
+
out_concat = os.path.join(tmp, "fuse_test_concat.feather")
|
|
14
|
+
|
|
15
|
+
df1 = pl.DataFrame({
|
|
16
|
+
"id": [1, 2, 3],
|
|
17
|
+
"text": ["a", "b", "c"],
|
|
18
|
+
"price": [10.0, 20.0, 30.0],
|
|
19
|
+
})
|
|
20
|
+
df2 = pl.DataFrame({
|
|
21
|
+
"id": [4, 5, 3],
|
|
22
|
+
"text": ["d", "e", "c"],
|
|
23
|
+
"price": [40.0, 50.0, 30.0],
|
|
24
|
+
"image_path": ["img1.jpg", "img2.jpg", "img3.jpg"],
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
df1.write_csv(p1)
|
|
28
|
+
df2.write_csv(p2)
|
|
29
|
+
|
|
30
|
+
concat_res = fuse_datasets(
|
|
31
|
+
sources=[p1, p2],
|
|
32
|
+
strategy="concat",
|
|
33
|
+
dedup=True,
|
|
34
|
+
run_quality_after=False,
|
|
35
|
+
leakage_check=True,
|
|
36
|
+
output_path=out_concat,
|
|
37
|
+
output_format="feather",
|
|
38
|
+
compression="lz4",
|
|
39
|
+
preview=True,
|
|
40
|
+
id_column="id",
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
assert concat_res.get("success") is True, f"Concat failed: {concat_res}"
|
|
44
|
+
assert os.path.exists(out_concat), "Concat output file missing"
|
|
45
|
+
|
|
46
|
+
# ----- Test 2: join with conflicting column names -----
|
|
47
|
+
p3 = os.path.join(tmp, "fuse_test_c.csv")
|
|
48
|
+
p4 = os.path.join(tmp, "fuse_test_d.csv")
|
|
49
|
+
out_join = os.path.join(tmp, "fuse_test_join.parquet")
|
|
50
|
+
|
|
51
|
+
left = pl.DataFrame({
|
|
52
|
+
"id": [1, 2, 3],
|
|
53
|
+
"price": [100, 200, 300],
|
|
54
|
+
"text": ["x", "y", "z"],
|
|
55
|
+
})
|
|
56
|
+
right = pl.DataFrame({
|
|
57
|
+
"id": [2, 3, 4],
|
|
58
|
+
"price": [999, 888, 777],
|
|
59
|
+
"caption": ["two", "three", "four"],
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
left.write_csv(p3)
|
|
63
|
+
right.write_csv(p4)
|
|
64
|
+
|
|
65
|
+
join_res = fuse_datasets(
|
|
66
|
+
sources=[p3, p4],
|
|
67
|
+
strategy="join",
|
|
68
|
+
join_on="id",
|
|
69
|
+
how="inner",
|
|
70
|
+
dedup=True,
|
|
71
|
+
run_quality_after=False,
|
|
72
|
+
leakage_check=False,
|
|
73
|
+
output_path=out_join,
|
|
74
|
+
output_format="parquet",
|
|
75
|
+
compression="snappy",
|
|
76
|
+
preview=True,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
assert join_res.get("success") is True, f"Join failed: {join_res}"
|
|
80
|
+
assert os.path.exists(out_join), "Join output file missing"
|
|
81
|
+
assert len(join_res.get("stats", {}).get("conflict_renames", [])) >= 1, "Expected conflict rename for price column"
|
|
82
|
+
|
|
83
|
+
print("✅ Fusion tests passed")
|
|
84
|
+
print("Concat:", concat_res["stats"])
|
|
85
|
+
print("Join:", join_res["stats"])
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
if __name__ == "__main__":
|
|
89
|
+
run_basic_tests()
|