clickzetta-semantic-model-generator 1.0.7__py3-none-any.whl → 1.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: clickzetta-semantic-model-generator
3
- Version: 1.0.7
3
+ Version: 1.0.10
4
4
  Summary: Curate a Semantic Model for ClickZetta Lakehouse
5
5
  License: Apache Software License; BSD License
6
6
  Author: qililiang
@@ -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=ZGsBNOJ79gDSRqfLaQvtvegX-ouiqTepgIlY_4CWN_0,34512
2
+ semantic_model_generator/clickzetta_utils/clickzetta_connector.py,sha256=Qjh79E7TSfkeGiXITwWnWSXEpVTMKMbynDCr4vln2sc,34299
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.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
36
- clickzetta_semantic_model_generator-1.0.7.dist-info/METADATA,sha256=sfjkgnNn6-Md3p3-m-gMsINMCy9BXCKyzU56Fx49TBY,7816
37
- clickzetta_semantic_model_generator-1.0.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
- clickzetta_semantic_model_generator-1.0.7.dist-info/RECORD,,
35
+ clickzetta_semantic_model_generator-1.0.10.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
36
+ clickzetta_semantic_model_generator-1.0.10.dist-info/METADATA,sha256=x-Z3VZhV7l0K_1tjpaoXfgFXrCgwIveIdM3BDP4CvNc,7817
37
+ clickzetta_semantic_model_generator-1.0.10.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
+ clickzetta_semantic_model_generator-1.0.10.dist-info/RECORD,,
@@ -481,29 +481,20 @@ def _fetch_columns_via_show(
481
481
 
482
482
  rows: List[pd.DataFrame] = []
483
483
  category = _catalog_category(session, workspace)
484
- is_shared_catalog = category in {"SHARED", "EXTERNAL"}
484
+ is_shared_catalog = category == "SHARED"
485
485
  catalog = workspace if is_shared_catalog else workspace.upper()
486
- schema = (
487
- table_schema or ""
488
- )
489
- if schema and not is_shared_catalog:
490
- schema = schema.upper()
486
+ schema_token = table_schema or ""
487
+ if schema_token and not is_shared_catalog:
488
+ schema_token = schema_token.upper()
491
489
 
492
490
  for table_name in table_names:
493
- qualified_parts = [
494
- part
495
- for part in (
496
- catalog,
497
- schema,
498
- table_name.upper() if not is_shared_catalog else table_name,
499
- )
500
- if part
501
- ]
502
- qualified_table = ".".join(qualified_parts)
503
- if is_shared_catalog:
504
- query = f"SHOW COLUMNS IN SHARE {qualified_table}"
505
- else:
506
- query = f"SHOW COLUMNS IN {qualified_table}"
491
+ table_token = str(table_name).strip()
492
+ if not table_token:
493
+ continue
494
+ qualified_table = join_quoted_identifiers(
495
+ *(part for part in (catalog, schema_token, table_token) if part)
496
+ )
497
+ query = f"SHOW COLUMNS IN {qualified_table}"
507
498
  try:
508
499
  df = session.sql(query).to_pandas()
509
500
  except Exception as exc:
@@ -564,7 +555,7 @@ def get_valid_schemas_tables_columns_df(
564
555
  table_names: Optional[List[str]] = None,
565
556
  ) -> pd.DataFrame:
566
557
  category = _catalog_category(session, workspace)
567
- skip_information_schema = category in {"SHARED", "EXTERNAL"}
558
+ skip_information_schema = category == "SHARED"
568
559
 
569
560
  result = pd.DataFrame()
570
561
  if not skip_information_schema:
@@ -591,7 +582,7 @@ def get_valid_schemas_tables_columns_df(
591
582
  session=session, schema_name=schema_identifier
592
583
  )
593
584
  tables_for_show = [
594
- table.split(".")[-1].upper()
585
+ table.split(".")[-1]
595
586
  for table in tables_for_show
596
587
  if table
597
588
  ]
@@ -682,7 +673,7 @@ def fetch_tables_views_in_schema(
682
673
  workspace = parts[0]
683
674
  schema = parts[1] if len(parts) > 1 else ""
684
675
  category = _catalog_category(session, workspace)
685
- is_shared_catalog = category in {"SHARED", "EXTERNAL"}
676
+ is_shared_catalog = category == "SHARED"
686
677
 
687
678
  workspace_token = workspace if is_shared_catalog else workspace.upper()
688
679
  schema_token = schema if is_shared_catalog else schema.upper()