sql-code-graph 1.36.1__py3-none-any.whl → 1.36.2__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sql-code-graph
3
- Version: 1.36.1
3
+ Version: 1.36.2
4
4
  Summary: SQL code graph analyzer and lineage tracer
5
5
  Project-URL: Homepage, https://github.com/Warhorze/sql-code-graph
6
6
  Project-URL: Repository, https://github.com/Warhorze/sql-code-graph
@@ -1,4 +1,4 @@
1
- sqlcg/__init__.py,sha256=1pTarvYKeyADzesOkchbID_Tn8DRtdOiq2qMb535jXQ,116
1
+ sqlcg/__init__.py,sha256=lDqeTiiKtYlwFCXOBJv--TA4e7oisecgTT3NeETH6eY,116
2
2
  sqlcg/__main__.py,sha256=1YoFLcqEgTwYq1J3TbUwpkdG0zeeLIf2fJvwWI-CLFU,109
3
3
  sqlcg/cli/__init__.py,sha256=W8fD0LpMq2xm_5WKGNMvJh2WBL1ho5E8hUeAqXQYT1g,28
4
4
  sqlcg/cli/coverage.py,sha256=Xm9ITzZDHv2mJ70Q5jCacVuhDStVrE3gq12_-Ypvtd8,43823
@@ -44,7 +44,7 @@ sqlcg/lineage/schema_resolver.py,sha256=iXt6LYF6UVWsGUpcfbmjmGn9wCgXl721lTGf_8Aa
44
44
  sqlcg/metrics/__init__.py,sha256=hLJ6wm4St8qqYwKh3o9QG7lcEt1BEYM31ccqO9tGpIg,133
45
45
  sqlcg/metrics/store.py,sha256=KuDtxvyAgug9_KtiSCpvgKM2VZM7VSaI3D11uMLjJJk,10604
46
46
  sqlcg/parsers/__init__.py,sha256=AamA8wBbDZV9_zEtZCI4Hyen5UAVKHmBwjTghTt2PZE,785
47
- sqlcg/parsers/ansi_parser.py,sha256=RX6eVj7gt1qmsHNJLAF_a4jyW3RCI5W2oF4rd53cKNg,39336
47
+ sqlcg/parsers/ansi_parser.py,sha256=7pudMxij87m419OcCzmaus124x2vHJ62bIGhBTBlZDw,40348
48
48
  sqlcg/parsers/base.py,sha256=d5s5_LSv96jrww9vx52GujjrLHwpxy_UOhmIlWcKglw,106489
49
49
  sqlcg/parsers/bigquery_parser.py,sha256=g0B6aIpMyxLMVQ3ohAAjzR4nEmMh-WGkFcYLMiKdLxs,3177
50
50
  sqlcg/parsers/dynamic_name.py,sha256=q0QAa9iAcmRW4e_0G2b2j-xTbI3VR1-Wwa-nJRLtrQw,6836
@@ -73,7 +73,7 @@ sqlcg/viz/render.py,sha256=BINkGbJbbb_iqhrkN795RaQsdg8nqCiJtsEFF1yo22Y,2737
73
73
  sqlcg/viz/tags.py,sha256=6zRnGlHjuGmEeB6yN1uhzm8rqL7ZGoyL1Ki7jI5oM6A,5368
74
74
  sqlcg/viz/assets/force-graph.min.js,sha256=jNdYdDdrYiUdUlElxRkolPBt30rstQk2q15Q32VVdzc,177272
75
75
  sqlcg/viz/assets/template.html,sha256=9_j-mvo1ZxwgiJPDdVrNmca37dTrTjjYVd3977u-DxE,12294
76
- sql_code_graph-1.36.1.dist-info/METADATA,sha256=NR-127QkvaJ20LcGYPpd2HRAhZPDXHAPUdjNc0kmp6M,19208
77
- sql_code_graph-1.36.1.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
78
- sql_code_graph-1.36.1.dist-info/entry_points.txt,sha256=Wfe49sVzV9p4eVFGo5RxcV-frr3HOP0yzzst8JBxQLQ,46
79
- sql_code_graph-1.36.1.dist-info/RECORD,,
76
+ sql_code_graph-1.36.2.dist-info/METADATA,sha256=if10KHC8utK49r0BY4N9DmsK98-Uz1mUlauVqTiFEaE,19208
77
+ sql_code_graph-1.36.2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
78
+ sql_code_graph-1.36.2.dist-info/entry_points.txt,sha256=Wfe49sVzV9p4eVFGo5RxcV-frr3HOP0yzzst8JBxQLQ,46
79
+ sql_code_graph-1.36.2.dist-info/RECORD,,
sqlcg/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  """SQL Code Graph - SQL lineage and dependency analysis tool."""
2
2
 
3
- __version__ = "1.36.1"
3
+ __version__ = "1.36.2"
4
4
 
5
5
  __all__ = ["__version__"]
@@ -564,12 +564,26 @@ class AnsiParser(SqlParser):
564
564
  # DML (a separate node the gate never touches), so gating PROCEDURE is
565
565
  # edge-neutral. This single gate feeds all three
566
566
  # `referenced_tables.extend(query_node.sources)` sites
567
- # (ansi_parser.py:246, snowflake_parser.py:784 / :944).
567
+ # (ansi_parser.py:246, snowflake_parser.py:894 / :1054).
568
568
  is_non_table_create = isinstance(stmt, exp.Create) and stmt.kind not in ("TABLE", "VIEW")
569
569
 
570
+ # Phantom source-node gate part 2 (#161 part 2,
571
+ # plan/sprints/fix_drop_alter_phantom_source_node.md): DROP / ALTER /
572
+ # TRUNCATE reference their TARGET object, not a data-flow source. No SELECT
573
+ # body is structurally possible, so build_scope() returns None for them and
574
+ # _fallback_table_scan below would otherwise scoop the target name into
575
+ # `sources`, minting a phantom degree-0 island SqlTable node + a phantom
576
+ # SELECTS_FROM edge (measured: 169 sole-DROP/ALTER/TRUNCATE-origin nodes,
577
+ # 1,308 phantom SELECTS_FROM edges on the DWH corpus). Keyed off the AST
578
+ # type (independent of _classify/QueryKind), and PER-STATEMENT: a table
579
+ # legitimately created/read by a *different* statement keeps its node + real
580
+ # edges; only the source the DROP/ALTER/TRUNCATE statement would have
581
+ # contributed is suppressed.
582
+ is_non_flow_ddl = isinstance(stmt, (exp.Drop, exp.Alter, exp.TruncateTable))
583
+
570
584
  # Try to extract table references using scope analysis
571
585
  try:
572
- if is_non_table_create:
586
+ if is_non_table_create or is_non_flow_ddl:
573
587
  sources = []
574
588
  else:
575
589
  # Use pre-built scope if provided, otherwise build it here (fallback)