@mariodefe/sap-datasphere-mcp 1.0.9
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/CHANGELOG_v1.0.9.md +196 -0
- package/LICENSE +21 -0
- package/README.md +1037 -0
- package/bin/sap-datasphere-mcp.js +116 -0
- package/package.json +51 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Changelog v1.0.9 - Enhanced Aggregation & Improved Logging
|
|
2
|
+
|
|
3
|
+
**Release Date:** December 15, 2025
|
|
4
|
+
**Type:** Enhancement Release
|
|
5
|
+
**Based on:** Kiro's v1.0.8 testing feedback
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## đ v1.0.8 Success Confirmed
|
|
10
|
+
|
|
11
|
+
Kiro's testing confirmed v1.0.8 fixed the critical aggregation fallback bug:
|
|
12
|
+
- â
GROUP BY queries with client-side aggregation working correctly
|
|
13
|
+
- â
LIMIT optimization working perfectly
|
|
14
|
+
- â
Enhanced error messages with actionable steps
|
|
15
|
+
- â
Basic queries functioning flawlessly
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## ⨠Enhancements in v1.0.9
|
|
20
|
+
|
|
21
|
+
### 1. Simple Aggregation Support (WITHOUT GROUP BY)
|
|
22
|
+
|
|
23
|
+
**Issue:** Queries like `SELECT COUNT(*) FROM table` failed because client-side aggregation required GROUP BY.
|
|
24
|
+
|
|
25
|
+
**Fix:** Enhanced `perform_client_side_aggregation()` to support both modes:
|
|
26
|
+
- **Case 1:** Simple aggregation (no GROUP BY) - Returns single row with aggregate over all data
|
|
27
|
+
- **Case 2:** GROUP BY aggregation - Returns grouped results (existing behavior)
|
|
28
|
+
|
|
29
|
+
**Examples Now Supported:**
|
|
30
|
+
```sql
|
|
31
|
+
-- Simple COUNT
|
|
32
|
+
SELECT COUNT(*) FROM SAP_SC_FI_V_ProductsDim
|
|
33
|
+
-- Returns: {"COUNT_ALL": 35}
|
|
34
|
+
|
|
35
|
+
-- Simple aggregations
|
|
36
|
+
SELECT COUNT(*), AVG(PRICE), MAX(PRICE) FROM SAP_SC_FI_V_ProductsDim
|
|
37
|
+
-- Returns single row with all aggregates
|
|
38
|
+
|
|
39
|
+
-- GROUP BY (already worked)
|
|
40
|
+
SELECT CATEGORY, COUNT(*), AVG(PRICE) FROM Products GROUP BY CATEGORY
|
|
41
|
+
-- Returns: Multiple rows, one per category
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Implementation:**
|
|
45
|
+
- Checks for GROUP BY clause first
|
|
46
|
+
- If no GROUP BY: aggregates over entire dataset, returns single row
|
|
47
|
+
- If GROUP BY: groups data and aggregates per group (existing logic)
|
|
48
|
+
- Improved regex to avoid ORDER BY false positives
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### 2. Enhanced Asset Capability Detection
|
|
53
|
+
|
|
54
|
+
**Issue:** False "Asset not found" warnings even when queries succeeded.
|
|
55
|
+
|
|
56
|
+
**Fix:** Multi-strategy asset search:
|
|
57
|
+
1. **Strategy 1:** Exact name match (`name eq 'table'`)
|
|
58
|
+
2. **Strategy 2:** Contains match for views with schema prefixes
|
|
59
|
+
3. **Fallback:** Assume asset exists (avoid false negatives)
|
|
60
|
+
|
|
61
|
+
**Benefits:**
|
|
62
|
+
- Fewer false warnings
|
|
63
|
+
- Better case-insensitive matching
|
|
64
|
+
- Graceful degradation when catalog search has limitations
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### 3. Improved Logging & User Experience
|
|
69
|
+
|
|
70
|
+
**Before:**
|
|
71
|
+
```
|
|
72
|
+
â ī¸ Asset 'SAP_SC_FI_V_ProductsDim' not found - will attempt query anyway
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**After:**
|
|
76
|
+
```
|
|
77
|
+
âšī¸ Asset not in catalog search - may still exist
|
|
78
|
+
â Asset found: type=view, analytical=false
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Changes:**
|
|
82
|
+
- Changed warning emoji (â ī¸) to info emoji (âšī¸) for non-critical messages
|
|
83
|
+
- More accurate descriptions ("not in catalog" vs "not found")
|
|
84
|
+
- Only show suggestions when query likely to fail
|
|
85
|
+
- Clearer asset capability reporting
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## đ What's Fixed
|
|
90
|
+
|
|
91
|
+
| Issue | v1.0.8 | v1.0.9 |
|
|
92
|
+
|-------|--------|--------|
|
|
93
|
+
| **Simple COUNT(*)** | Failed (no GROUP BY) | Works â
|
|
|
94
|
+
| **Simple aggregations** | Failed (no GROUP BY) | Works â
|
|
|
95
|
+
| **GROUP BY queries** | Works â
| Works â
|
|
|
96
|
+
| **False "not found" warnings** | Frequent â ī¸ | Rare âšī¸ |
|
|
97
|
+
| **Asset detection** | Exact match only | Multi-strategy â
|
|
|
98
|
+
| **ORDER BY in GROUP BY** | Parse issues | Improved regex â
|
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## đ§ Technical Details
|
|
103
|
+
|
|
104
|
+
### Enhanced Aggregation Function
|
|
105
|
+
|
|
106
|
+
**Location:** [sap_datasphere_mcp_server.py:2326-2455](sap_datasphere_mcp_server.py#L2326-L2455)
|
|
107
|
+
|
|
108
|
+
**Key Changes:**
|
|
109
|
+
```python
|
|
110
|
+
# New: Check for GROUP BY with improved regex
|
|
111
|
+
group_by_match = re.search(
|
|
112
|
+
r'GROUP\s+BY\s+([\w,\s]+?)(?:\s+ORDER\s+BY|\s+HAVING|\s+LIMIT|$)',
|
|
113
|
+
query_str,
|
|
114
|
+
re.IGNORECASE
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
# Case 1: Simple aggregation (NEW in v1.0.9)
|
|
118
|
+
if not group_by_match:
|
|
119
|
+
result = {}
|
|
120
|
+
# Aggregate over all data
|
|
121
|
+
for func, column, alias in agg_functions:
|
|
122
|
+
# Calculate aggregate...
|
|
123
|
+
return [result] # Single row
|
|
124
|
+
|
|
125
|
+
# Case 2: GROUP BY aggregation (existing)
|
|
126
|
+
# ... group and aggregate logic ...
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Enhanced Asset Detection
|
|
130
|
+
|
|
131
|
+
**Location:** [sap_datasphere_mcp_server.py:2285-2336](sap_datasphere_mcp_server.py#L2285-L2336)
|
|
132
|
+
|
|
133
|
+
**Multi-Strategy Search:**
|
|
134
|
+
1. Exact match
|
|
135
|
+
2. Contains match with case-insensitive filter
|
|
136
|
+
3. Graceful fallback
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## đ Statistics
|
|
141
|
+
|
|
142
|
+
**v1.0.9 by the numbers:**
|
|
143
|
+
- **2 major enhancements** (simple aggregation + asset detection)
|
|
144
|
+
- **1 UX improvement** (better logging)
|
|
145
|
+
- **~130 lines** of code modified
|
|
146
|
+
- **100% backward compatible**
|
|
147
|
+
- **45 tools** total (no new tools)
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## đ Upgrade Instructions
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pip install --upgrade sap-datasphere-mcp
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Verification:**
|
|
158
|
+
```bash
|
|
159
|
+
python -c "import sap_datasphere_mcp; print(sap_datasphere_mcp.__version__)"
|
|
160
|
+
# Should output: 1.0.9
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## đ Acknowledgments
|
|
166
|
+
|
|
167
|
+
- **Kiro (Testing Agent):** Comprehensive v1.0.8 testing & detailed feedback
|
|
168
|
+
- Identified simple aggregation edge cases
|
|
169
|
+
- Reported false "not found" warnings
|
|
170
|
+
- Suggested ORDER BY parsing improvements
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## đ Related Documentation
|
|
175
|
+
|
|
176
|
+
- [CHANGELOG_v1.0.8.md](CHANGELOG_v1.0.8.md) - Previous hotfix
|
|
177
|
+
- [CHANGELOG_v1.0.7.md](CHANGELOG_v1.0.7.md) - Original aggregation implementation
|
|
178
|
+
- [V1.0.7_IMPLEMENTATION_PLAN.md](V1.0.7_IMPLEMENTATION_PLAN.md) - Implementation plan
|
|
179
|
+
- [README.md](README.md) - Main documentation
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Summary
|
|
184
|
+
|
|
185
|
+
v1.0.9 completes the aggregation feature by adding support for simple aggregations without GROUP BY, improves asset detection to reduce false warnings, and enhances logging for better user experience.
|
|
186
|
+
|
|
187
|
+
**All Query Types Now Supported:**
|
|
188
|
+
1. â
Simple queries: `SELECT * FROM table`
|
|
189
|
+
2. â
Simple aggregations: `SELECT COUNT(*) FROM table`
|
|
190
|
+
3. â
GROUP BY aggregations: `SELECT category, COUNT(*) FROM table GROUP BY category`
|
|
191
|
+
4. â
Complex GROUP BY with ORDER BY: `SELECT category, COUNT(*) FROM table GROUP BY category ORDER BY COUNT(*) DESC`
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
**Full Changelog:** https://github.com/MarioDeFelipe/sap-datasphere-mcp/compare/v1.0.8...v1.0.9
|
|
196
|
+
**PyPI Release:** https://pypi.org/project/sap-datasphere-mcp/1.0.9/
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SAP Datasphere AWS Glue Metadata Sync Platform
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|