sql-dag-flow 0.5.2__tar.gz → 0.5.4__tar.gz
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.
- {sql_dag_flow-0.5.2/src/sql_dag_flow.egg-info → sql_dag_flow-0.5.4}/PKG-INFO +4 -2
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/README.md +3 -1
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/pyproject.toml +1 -1
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow/main.py +21 -3
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow/parser.py +1 -1
- sql_dag_flow-0.5.2/src/sql_dag_flow/static/assets/index-BPI03jTK.js → sql_dag_flow-0.5.4/src/sql_dag_flow/static/assets/index-BEi2iL86.js +45 -45
- sql_dag_flow-0.5.4/src/sql_dag_flow/static/assets/index-HIS38g9M.css +1 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow/static/index.html +2 -2
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4/src/sql_dag_flow.egg-info}/PKG-INFO +4 -2
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow.egg-info/SOURCES.txt +2 -2
- sql_dag_flow-0.5.2/src/sql_dag_flow/static/assets/index-BM6GPh_j.css +0 -1
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/LICENSE +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/MANIFEST.in +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/setup.cfg +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow/__init__.py +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow/static/vite.svg +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow/test_api_endpoints.py +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow/test_parser.py +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow/verify_counts.py +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow.egg-info/dependency_links.txt +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow.egg-info/entry_points.txt +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow.egg-info/requires.txt +0 -0
- {sql_dag_flow-0.5.2 → sql_dag_flow-0.5.4}/src/sql_dag_flow.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql-dag-flow
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.4
|
|
4
4
|
Summary: A sophisticated SQL lineage visualization tool for Medallion Architectures.
|
|
5
5
|
Author-email: Flavio Sandoval <dsandovalflavio@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -65,6 +65,7 @@ Specially optimized for the **Medallion Architecture** (Bronze, Silver, Gold) an
|
|
|
65
65
|
* Powered by **ELK (Eclipse Layout Kernel)**.
|
|
66
66
|
* Minimizes edge crossings and optimizes flow direction.
|
|
67
67
|
* Intelligent "Port" handling for cleaner connections.
|
|
68
|
+
* **Startup Configuration Selector**: Instantly resume previous sessions by selecting any `.json` configuration file found in your project directory upon launching the app.
|
|
68
69
|
|
|
69
70
|
### 🎮 Interactive Graph
|
|
70
71
|
* **Smart Context Menu**:
|
|
@@ -99,6 +100,7 @@ Specially optimized for the **Medallion Architecture** (Bronze, Silver, Gold) an
|
|
|
99
100
|
* **Column-Level Lineage (New in v0.4.9 🆕)**: Traces how each output column derives from source columns. Shows transformation chain (e.g., `order_timestamp ← orders_raw.order_date via CAST(... AS DATETIME)`).
|
|
100
101
|
* **SQL Syntax Validation (New in v0.4.9 🆕)**: Detects SQL parse errors and displays structured warnings with line/column references. Shows ⚠️ badge on nodes with syntax issues.
|
|
101
102
|
* **Large DAG Support & Safe Cycle Detection (New in v0.5.1 🚀)**: Optimized cycle detection algorithm prevents backend hanging and "Failed to fetch" browser errors when analyzing massive projects (50+ nodes). Employs quick DAG verifications and bounded iterator loops.
|
|
103
|
+
* **Performance Optimizations (New in v0.5.2 ⚡)**: Includes backend parsing TTL caching and frontend request deduplication to prevent server overload when refreshing large numbers of un-cached SQL files simultaneously.
|
|
102
104
|
* **Batch Hide from Toolbar**: Select multiple nodes → click "Hide" in the selection toolbar to hide them all at once.
|
|
103
105
|
* **Discovery Mode Fix**: Ghost nodes from Discovery Mode are now hidden when their connected source nodes are hidden, preventing orphan ghost nodes.
|
|
104
106
|
|
|
@@ -145,7 +147,7 @@ Install easily via `pip`:
|
|
|
145
147
|
pip install sql-dag-flow
|
|
146
148
|
```
|
|
147
149
|
|
|
148
|
-
To update to the latest version (**v0.5.
|
|
150
|
+
To update to the latest version (**v0.5.3**):
|
|
149
151
|
|
|
150
152
|
```bash
|
|
151
153
|
pip install --upgrade sql-dag-flow
|
|
@@ -40,6 +40,7 @@ Specially optimized for the **Medallion Architecture** (Bronze, Silver, Gold) an
|
|
|
40
40
|
* Powered by **ELK (Eclipse Layout Kernel)**.
|
|
41
41
|
* Minimizes edge crossings and optimizes flow direction.
|
|
42
42
|
* Intelligent "Port" handling for cleaner connections.
|
|
43
|
+
* **Startup Configuration Selector**: Instantly resume previous sessions by selecting any `.json` configuration file found in your project directory upon launching the app.
|
|
43
44
|
|
|
44
45
|
### 🎮 Interactive Graph
|
|
45
46
|
* **Smart Context Menu**:
|
|
@@ -74,6 +75,7 @@ Specially optimized for the **Medallion Architecture** (Bronze, Silver, Gold) an
|
|
|
74
75
|
* **Column-Level Lineage (New in v0.4.9 🆕)**: Traces how each output column derives from source columns. Shows transformation chain (e.g., `order_timestamp ← orders_raw.order_date via CAST(... AS DATETIME)`).
|
|
75
76
|
* **SQL Syntax Validation (New in v0.4.9 🆕)**: Detects SQL parse errors and displays structured warnings with line/column references. Shows ⚠️ badge on nodes with syntax issues.
|
|
76
77
|
* **Large DAG Support & Safe Cycle Detection (New in v0.5.1 🚀)**: Optimized cycle detection algorithm prevents backend hanging and "Failed to fetch" browser errors when analyzing massive projects (50+ nodes). Employs quick DAG verifications and bounded iterator loops.
|
|
78
|
+
* **Performance Optimizations (New in v0.5.2 ⚡)**: Includes backend parsing TTL caching and frontend request deduplication to prevent server overload when refreshing large numbers of un-cached SQL files simultaneously.
|
|
77
79
|
* **Batch Hide from Toolbar**: Select multiple nodes → click "Hide" in the selection toolbar to hide them all at once.
|
|
78
80
|
* **Discovery Mode Fix**: Ghost nodes from Discovery Mode are now hidden when their connected source nodes are hidden, preventing orphan ghost nodes.
|
|
79
81
|
|
|
@@ -120,7 +122,7 @@ Install easily via `pip`:
|
|
|
120
122
|
pip install sql-dag-flow
|
|
121
123
|
```
|
|
122
124
|
|
|
123
|
-
To update to the latest version (**v0.5.
|
|
125
|
+
To update to the latest version (**v0.5.3**):
|
|
124
126
|
|
|
125
127
|
```bash
|
|
126
128
|
pip install --upgrade sql-dag-flow
|
|
@@ -36,6 +36,24 @@ STATIC_DIR = os.path.join(BASE_DIR, "static")
|
|
|
36
36
|
CURRENT_DIRECTORY = os.getcwd() # Default, updated by start()
|
|
37
37
|
DIAGRAM_FILE = "sql_diagram.json"
|
|
38
38
|
|
|
39
|
+
# Parse cache to avoid re-parsing on concurrent/rapid requests
|
|
40
|
+
_parse_cache = {"key": None, "tables": None, "time": 0}
|
|
41
|
+
PARSE_CACHE_TTL = 5 # seconds
|
|
42
|
+
|
|
43
|
+
def _cached_parse(directory, subfolders_tuple, dialect):
|
|
44
|
+
"""Parse with simple TTL cache. Prevents re-parsing on concurrent requests."""
|
|
45
|
+
cache_key = (directory, subfolders_tuple, dialect)
|
|
46
|
+
now = time.time()
|
|
47
|
+
if _parse_cache["key"] == cache_key and (now - _parse_cache["time"]) < PARSE_CACHE_TTL:
|
|
48
|
+
return _parse_cache["tables"]
|
|
49
|
+
|
|
50
|
+
subfolders_list = list(subfolders_tuple) if subfolders_tuple else None
|
|
51
|
+
tables = parse_sql_files(directory, allowed_subfolders=subfolders_list, dialect=dialect)
|
|
52
|
+
_parse_cache["key"] = cache_key
|
|
53
|
+
_parse_cache["tables"] = tables
|
|
54
|
+
_parse_cache["time"] = now
|
|
55
|
+
return tables
|
|
56
|
+
|
|
39
57
|
@app.get("/graph")
|
|
40
58
|
def get_graph(dialect: str = "bigquery", discovery: bool = False, expanded_nodes: str = ""):
|
|
41
59
|
"""Parses SQL files in the current directory and returns graph data."""
|
|
@@ -44,7 +62,7 @@ def get_graph(dialect: str = "bigquery", discovery: bool = False, expanded_nodes
|
|
|
44
62
|
|
|
45
63
|
exp_nodes_list = [n.strip() for n in expanded_nodes.split(",")] if expanded_nodes else []
|
|
46
64
|
try:
|
|
47
|
-
tables =
|
|
65
|
+
tables = _cached_parse(CURRENT_DIRECTORY, None, dialect)
|
|
48
66
|
nodes, edges, cycles = build_graph(tables, discovery_mode=discovery, expanded_nodes=exp_nodes_list)
|
|
49
67
|
return {"nodes": nodes, "edges": edges, "cycles": cycles}
|
|
50
68
|
except Exception as e:
|
|
@@ -61,8 +79,8 @@ def set_path(path_data: dict = Body(...)):
|
|
|
61
79
|
if not path or not os.path.exists(path):
|
|
62
80
|
raise HTTPException(status_code=400, detail="Directory does not exist")
|
|
63
81
|
|
|
64
|
-
|
|
65
82
|
CURRENT_DIRECTORY = path
|
|
83
|
+
_parse_cache["key"] = None # Invalidate cache on path change
|
|
66
84
|
return {"message": "Path updated", "path": CURRENT_DIRECTORY}
|
|
67
85
|
|
|
68
86
|
@app.post("/scan/folders")
|
|
@@ -105,7 +123,7 @@ def get_filtered_graph(data: dict = Body(...)):
|
|
|
105
123
|
expanded_nodes = data.get("expanded_nodes", [])
|
|
106
124
|
|
|
107
125
|
try:
|
|
108
|
-
tables =
|
|
126
|
+
tables = _cached_parse(CURRENT_DIRECTORY, tuple(subfolders) if subfolders else None, dialect)
|
|
109
127
|
nodes, edges, cycles = build_graph(tables, discovery_mode=discovery, expanded_nodes=expanded_nodes)
|
|
110
128
|
return {"nodes": nodes, "edges": edges, "cycles": cycles}
|
|
111
129
|
except Exception as e:
|
|
@@ -650,7 +650,7 @@ def parse_sql_files(directory, allowed_subfolders=None, dialect="bigquery"):
|
|
|
650
650
|
# ===== Column-Level Lineage =====
|
|
651
651
|
# For each table, trace how each output column derives from source columns
|
|
652
652
|
# Protected: skip if project is very large (>100 tables) and cap columns per table
|
|
653
|
-
MAX_LINEAGE_TABLES =
|
|
653
|
+
MAX_LINEAGE_TABLES = 500
|
|
654
654
|
MAX_COLS_PER_TABLE = 30
|
|
655
655
|
LINEAGE_TIME_BUDGET = 1.5 # seconds per table
|
|
656
656
|
|