sql-glider 0.1.8__py3-none-any.whl → 0.1.10__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.
- {sql_glider-0.1.8.dist-info → sql_glider-0.1.10.dist-info}/METADATA +1 -1
- {sql_glider-0.1.8.dist-info → sql_glider-0.1.10.dist-info}/RECORD +7 -7
- sqlglider/_version.py +2 -2
- sqlglider/lineage/analyzer.py +28 -1
- {sql_glider-0.1.8.dist-info → sql_glider-0.1.10.dist-info}/WHEEL +0 -0
- {sql_glider-0.1.8.dist-info → sql_glider-0.1.10.dist-info}/entry_points.txt +0 -0
- {sql_glider-0.1.8.dist-info → sql_glider-0.1.10.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql-glider
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: SQL Utility Toolkit for better understanding, use, and governance of your queries in a native environment.
|
|
5
5
|
Project-URL: Homepage, https://github.com/rycowhi/sql-glider/
|
|
6
6
|
Project-URL: Repository, https://github.com/rycowhi/sql-glider/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlglider/__init__.py,sha256=gDf7s52dMcX7JuCZ1SLawcB1vb3U0yJCohu9RQAATBY,125
|
|
2
|
-
sqlglider/_version.py,sha256=
|
|
2
|
+
sqlglider/_version.py,sha256=uf7mpKSLRNNF3RxSXHssYzKadEgmCS7IlRw4lFPAcUg,706
|
|
3
3
|
sqlglider/cli.py,sha256=9sweHRVLk2iBSzCzT2Gcj8y1g1XKzq26iApQsMaFbx4,51786
|
|
4
4
|
sqlglider/global_models.py,sha256=2vyJXAuXOsXQpE-D3F0ejj7eR9z0nDWFjTkielhzM8k,356
|
|
5
5
|
sqlglider/catalog/__init__.py,sha256=2PqFPyzFXJ14FpSUcBmVK2L-a_ypWQHAbHFHxLDk_LE,814
|
|
@@ -17,7 +17,7 @@ sqlglider/graph/models.py,sha256=EYmjv_WzDSNp_WfhJ6H-qBIOkAcoNKS7GRUryfKrHuY,933
|
|
|
17
17
|
sqlglider/graph/query.py,sha256=LHU8Cvn7ZPPSEnqdDn2pF8f1_LQjIvNIrZqs8cFlb6U,9433
|
|
18
18
|
sqlglider/graph/serialization.py,sha256=vMXn7s35jA499e7l90vNVaJE_3QR_VHf3rEfQ9ZlgTQ,2781
|
|
19
19
|
sqlglider/lineage/__init__.py,sha256=llXMeI5_PIZaiBo8tKk3-wOubF4m_6QBHbn1FtWxT7k,256
|
|
20
|
-
sqlglider/lineage/analyzer.py,sha256=
|
|
20
|
+
sqlglider/lineage/analyzer.py,sha256=dHjzESzJRf4RNF-PdtZK7YdJuWt1UJXZBJFzgnaohsQ,65873
|
|
21
21
|
sqlglider/lineage/formatters.py,sha256=_Y9wcTX4JXn1vVnZ1xI656g1FF2rMjcAVc-GHjbd9QA,10389
|
|
22
22
|
sqlglider/templating/__init__.py,sha256=g3_wb6rSDI0usq2UUMDpn-J5kVwlAw3NtLdwbxL6UHs,1435
|
|
23
23
|
sqlglider/templating/base.py,sha256=y5bWAW7qXl_4pPyo5KycfHwNVvt1-7slZ63DAsvTE1s,2902
|
|
@@ -27,8 +27,8 @@ sqlglider/templating/variables.py,sha256=5593PtLBcOxsnMCSRm2pGAD5I0Y9f__VV3_J_Hf
|
|
|
27
27
|
sqlglider/utils/__init__.py,sha256=KGp9-UzKz_OFBOTFoSy-g-NXDZsvyWXG_9-1zcC6ePE,276
|
|
28
28
|
sqlglider/utils/config.py,sha256=iNJgSXFw3pmL2MCdvW3SJp4X2T3AQP2QyQuXIXT-6H0,4761
|
|
29
29
|
sqlglider/utils/file_utils.py,sha256=5_ff28E0r1R7emZzsOnRuHd-7zIX6873eyr1SuPEr4E,1093
|
|
30
|
-
sql_glider-0.1.
|
|
31
|
-
sql_glider-0.1.
|
|
32
|
-
sql_glider-0.1.
|
|
33
|
-
sql_glider-0.1.
|
|
34
|
-
sql_glider-0.1.
|
|
30
|
+
sql_glider-0.1.10.dist-info/METADATA,sha256=ZUlH3RU_iwgXDJgrrqESBN-uCiPYXjxgojgET2DhHbc,28446
|
|
31
|
+
sql_glider-0.1.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
32
|
+
sql_glider-0.1.10.dist-info/entry_points.txt,sha256=HDuakHqHS5C0HFKsMIxMYmDU7-BLBGrnIJcYaVRu-s0,251
|
|
33
|
+
sql_glider-0.1.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
34
|
+
sql_glider-0.1.10.dist-info/RECORD,,
|
sqlglider/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.1.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 1,
|
|
31
|
+
__version__ = version = '0.1.10'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 1, 10)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
sqlglider/lineage/analyzer.py
CHANGED
|
@@ -615,6 +615,12 @@ class LineageAnalyzer:
|
|
|
615
615
|
if isinstance(target, exp.Table):
|
|
616
616
|
return (self._get_qualified_table_name(target), ObjectType.UNKNOWN)
|
|
617
617
|
|
|
618
|
+
# CACHE TABLE
|
|
619
|
+
elif isinstance(self.expr, exp.Cache):
|
|
620
|
+
target = self.expr.this
|
|
621
|
+
if isinstance(target, exp.Table):
|
|
622
|
+
return (self._get_qualified_table_name(target), ObjectType.TABLE)
|
|
623
|
+
|
|
618
624
|
# DELETE FROM table
|
|
619
625
|
elif isinstance(self.expr, exp.Delete):
|
|
620
626
|
target = self.expr.this
|
|
@@ -706,6 +712,10 @@ class LineageAnalyzer:
|
|
|
706
712
|
elif isinstance(self.expr, exp.Drop):
|
|
707
713
|
return table_node is self.expr.this
|
|
708
714
|
|
|
715
|
+
# For CACHE TABLE, the target is self.expr.this
|
|
716
|
+
elif isinstance(self.expr, exp.Cache):
|
|
717
|
+
return table_node is self.expr.this
|
|
718
|
+
|
|
709
719
|
return False
|
|
710
720
|
|
|
711
721
|
def _analyze_column_lineage_internal(
|
|
@@ -741,7 +751,12 @@ class LineageAnalyzer:
|
|
|
741
751
|
|
|
742
752
|
lineage_items = []
|
|
743
753
|
# Get SQL for current expression only (not full multi-query SQL)
|
|
744
|
-
|
|
754
|
+
# For CACHE TABLE, pass just the SELECT since sqlglot.lineage doesn't
|
|
755
|
+
# natively understand CACHE statements
|
|
756
|
+
if isinstance(self.expr, exp.Cache) and self.expr.expression:
|
|
757
|
+
current_query_sql = self.expr.expression.sql(dialect=self.dialect)
|
|
758
|
+
else:
|
|
759
|
+
current_query_sql = self.expr.sql(dialect=self.dialect)
|
|
745
760
|
|
|
746
761
|
for col in columns_to_analyze:
|
|
747
762
|
try:
|
|
@@ -889,6 +904,7 @@ class LineageAnalyzer:
|
|
|
889
904
|
"Drop": f"DROP {getattr(target_expr, 'kind', '')}".strip(),
|
|
890
905
|
"Alter": "ALTER",
|
|
891
906
|
"Truncate": "TRUNCATE",
|
|
907
|
+
"Cache": "CACHE TABLE",
|
|
892
908
|
"Command": "COMMAND",
|
|
893
909
|
}
|
|
894
910
|
|
|
@@ -943,6 +959,17 @@ class LineageAnalyzer:
|
|
|
943
959
|
):
|
|
944
960
|
return (target_name, select_node)
|
|
945
961
|
|
|
962
|
+
# Check for CACHE TABLE AS SELECT
|
|
963
|
+
elif isinstance(self.expr, exp.Cache):
|
|
964
|
+
target = self.expr.this
|
|
965
|
+
if isinstance(target, exp.Table):
|
|
966
|
+
target_name = self._get_qualified_table_name(target)
|
|
967
|
+
select_node = self.expr.expression
|
|
968
|
+
if isinstance(
|
|
969
|
+
select_node, (exp.Select, exp.Union, exp.Intersect, exp.Except)
|
|
970
|
+
):
|
|
971
|
+
return (target_name, select_node)
|
|
972
|
+
|
|
946
973
|
# Check for MERGE statement
|
|
947
974
|
elif isinstance(self.expr, exp.Merge):
|
|
948
975
|
target = self.expr.this
|
|
File without changes
|
|
File without changes
|
|
File without changes
|