clickzetta-semantic-model-generator 1.0.11__py3-none-any.whl → 1.0.12__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.
- {clickzetta_semantic_model_generator-1.0.11.dist-info → clickzetta_semantic_model_generator-1.0.12.dist-info}/METADATA +1 -1
- {clickzetta_semantic_model_generator-1.0.11.dist-info → clickzetta_semantic_model_generator-1.0.12.dist-info}/RECORD +5 -5
- semantic_model_generator/clickzetta_utils/clickzetta_connector.py +39 -19
- {clickzetta_semantic_model_generator-1.0.11.dist-info → clickzetta_semantic_model_generator-1.0.12.dist-info}/LICENSE +0 -0
- {clickzetta_semantic_model_generator-1.0.11.dist-info → clickzetta_semantic_model_generator-1.0.12.dist-info}/WHEEL +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
semantic_model_generator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
semantic_model_generator/clickzetta_utils/clickzetta_connector.py,sha256=
|
2
|
+
semantic_model_generator/clickzetta_utils/clickzetta_connector.py,sha256=JVcvfny_baOQnmy0mzjA8cU4QQ74kQfGhkML8jIIssE,36168
|
3
3
|
semantic_model_generator/clickzetta_utils/env_vars.py,sha256=8cbL6R75c1-aVQ2i1TDr9SiHCUjTrgvXbIRz4MbcmbE,7664
|
4
4
|
semantic_model_generator/clickzetta_utils/utils.py,sha256=UBfWy9qOTyut8tL02gOHHbh6Uz8RqRz5Mm2YdKWFN54,4950
|
5
5
|
semantic_model_generator/data_processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -32,7 +32,7 @@ semantic_model_generator/validate/context_length.py,sha256=HL-GfaRXNcVji1-pAFGXG
|
|
32
32
|
semantic_model_generator/validate/keywords.py,sha256=frZ5HjRXP69K6dYAU5_d86oSp40_3yoLUg1eQwU3oLM,7080
|
33
33
|
semantic_model_generator/validate/schema.py,sha256=eL_wl5yscIeczwNBRUKhF_7QqWW2wSGimkgaOhMFsrA,5893
|
34
34
|
semantic_model_generator/validate_model.py,sha256=Uq-V-GfPeF2Dy4l9uF5Guv104gDCDGh0Cxz1AJOu5dk,836
|
35
|
-
clickzetta_semantic_model_generator-1.0.
|
36
|
-
clickzetta_semantic_model_generator-1.0.
|
37
|
-
clickzetta_semantic_model_generator-1.0.
|
38
|
-
clickzetta_semantic_model_generator-1.0.
|
35
|
+
clickzetta_semantic_model_generator-1.0.12.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
36
|
+
clickzetta_semantic_model_generator-1.0.12.dist-info/METADATA,sha256=k7Qwn3GRGFzcXSbuZiDZFpDph4kLq6e-AibtyzxvL8Y,7817
|
37
|
+
clickzetta_semantic_model_generator-1.0.12.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
38
|
+
clickzetta_semantic_model_generator-1.0.12.dist-info/RECORD,,
|
@@ -491,33 +491,52 @@ def _fetch_columns_via_show(
|
|
491
491
|
table_token = str(table_name).strip()
|
492
492
|
if not table_token:
|
493
493
|
continue
|
494
|
-
|
494
|
+
|
495
|
+
identifier_candidates: List[str] = []
|
496
|
+
fully_qualified = join_quoted_identifiers(
|
495
497
|
*(part for part in (catalog, schema_token, table_token) if part)
|
496
498
|
)
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
499
|
+
if fully_qualified:
|
500
|
+
identifier_candidates.append(fully_qualified)
|
501
|
+
schema_qualified = (
|
502
|
+
join_quoted_identifiers(schema_token, table_token)
|
503
|
+
if schema_token
|
504
|
+
else ""
|
505
|
+
)
|
506
|
+
if schema_qualified:
|
507
|
+
identifier_candidates.append(schema_qualified)
|
508
|
+
bare_identifier = join_quoted_identifiers(table_token)
|
509
|
+
if bare_identifier:
|
510
|
+
identifier_candidates.append(bare_identifier)
|
511
|
+
|
512
|
+
df = pd.DataFrame()
|
513
|
+
df_source = ""
|
514
|
+
for identifier in identifier_candidates:
|
515
|
+
query = f"SHOW COLUMNS IN {identifier}"
|
508
516
|
try:
|
509
|
-
|
517
|
+
df = session.sql(query).to_pandas()
|
518
|
+
df_source = "SHOW COLUMNS"
|
510
519
|
except Exception as exc:
|
511
520
|
logger.debug(
|
512
|
-
"
|
521
|
+
"SHOW COLUMNS fallback failed for {}: {}", identifier, exc
|
513
522
|
)
|
514
|
-
|
515
|
-
if
|
516
|
-
|
517
|
-
|
523
|
+
df = pd.DataFrame()
|
524
|
+
if df.empty:
|
525
|
+
describe_query = f"DESCRIBE TABLE {identifier}"
|
526
|
+
try:
|
527
|
+
describe_df = session.sql(describe_query).to_pandas()
|
528
|
+
except Exception as exc:
|
529
|
+
logger.debug(
|
530
|
+
"DESCRIBE TABLE fallback failed for {}: {}", identifier, exc
|
531
|
+
)
|
532
|
+
describe_df = pd.DataFrame()
|
533
|
+
if not describe_df.empty:
|
534
|
+
df = describe_df
|
535
|
+
df_source = "DESCRIBE TABLE"
|
536
|
+
if not df.empty:
|
537
|
+
break
|
518
538
|
if df.empty:
|
519
539
|
continue
|
520
|
-
df.columns = [str(col).upper() for col in df.columns]
|
521
540
|
if df_source == "DESCRIBE TABLE":
|
522
541
|
if "KIND" in df.columns:
|
523
542
|
df = df[df["KIND"].astype(str).str.upper() == "COLUMN"]
|
@@ -530,6 +549,7 @@ def _fetch_columns_via_show(
|
|
530
549
|
df = df.rename(columns=rename_map)
|
531
550
|
if df.empty:
|
532
551
|
continue
|
552
|
+
df.columns = [str(col).upper() for col in df.columns]
|
533
553
|
schema_col = next(
|
534
554
|
(col for col in ("TABLE_SCHEMA", "SCHEMA_NAME") if col in df.columns), None
|
535
555
|
)
|
File without changes
|
File without changes
|