sws-spark-dissemination-helper 0.0.98__tar.gz → 0.0.100__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.
Files changed (16) hide show
  1. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/PKG-INFO +1 -1
  2. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/pyproject.toml +1 -1
  3. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/src/sws_spark_dissemination_helper/SWSBronzeIcebergSparkHelper.py +19 -18
  4. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/.gitignore +0 -0
  5. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/LICENSE +0 -0
  6. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/README.md +0 -0
  7. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/old_requirements.txt +0 -0
  8. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/requirements.txt +0 -0
  9. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/src/sws_spark_dissemination_helper/SWSGoldIcebergSparkHelper.py +0 -0
  10. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/src/sws_spark_dissemination_helper/SWSPostgresSparkReader.py +0 -0
  11. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/src/sws_spark_dissemination_helper/SWSSilverIcebergSparkHelper.py +0 -0
  12. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/src/sws_spark_dissemination_helper/__init__.py +0 -0
  13. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/src/sws_spark_dissemination_helper/constants.py +0 -0
  14. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/src/sws_spark_dissemination_helper/utils.py +0 -0
  15. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/tests/__init__.py +0 -0
  16. {sws_spark_dissemination_helper-0.0.98 → sws_spark_dissemination_helper-0.0.100}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sws-spark-dissemination-helper
3
- Version: 0.0.98
3
+ Version: 0.0.100
4
4
  Summary: A Python helper package providing streamlined Spark functions for efficient data dissemination processes
5
5
  Project-URL: Repository, https://bitbucket.org/cioapps/sws-it-python-spark-dissemination-helper
6
6
  Author-email: Daniele Mansillo <danielemansillo@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sws-spark-dissemination-helper"
7
- version = "0.0.98"
7
+ version = "0.0.100"
8
8
  dependencies = [
9
9
  "annotated-types==0.7.0",
10
10
  "boto3==1.36.18",
@@ -464,6 +464,7 @@ class SWSBronzeIcebergSparkHelper:
464
464
  logging.info(f"bronze refs: {refs}")
465
465
 
466
466
  create_branch_query = f"ALTER TABLE {self.iceberg_tables.BRONZE.iceberg_id}.`tag_{self.tag_name}` CREATE OR REPLACE BRANCH `diss_tag_{self.tag_name}`" # AS OF VERSION `{tag_name}`
467
+ create_branch_query = f"ALTER TABLE {self.iceberg_tables.BRONZE.iceberg_id} CREATE OR REPLACE BRANCH `diss_tag_{self.tag_name}`"
467
468
  logging.info(f"create_branch_query: {create_branch_query}")
468
469
  create_branch_query_result = self.spark.sql(create_branch_query).collect()
469
470
 
@@ -493,27 +494,27 @@ class SWSBronzeIcebergSparkHelper:
493
494
  logging.info(f"dimension_name: {dimension_name}")
494
495
  logging.info(f"codes: {codes}")
495
496
  if len(codes) != 0:
496
- # not_in_codes = ",".join([f"'{code}'" for code in codes])
497
- # delete_from_branch_query = f"DELETE FROM {self.iceberg_tables.BRONZE.iceberg_id}.`branch_diss_tag_{self.tag_name}` WHERE {dimension_name} NOT IN ({not_in_codes})"
498
- # logging.info(f"delete_from_branch_query: {delete_from_branch_query}")
499
- # delete_from_branch_query_result = self.spark.sql(
500
- # delete_from_branch_query
501
- # ).collect()
502
-
503
- # logging.info(
504
- # f"result of delete_from_branch_query: {delete_from_branch_query_result}"
505
- # )
506
- self.disseminated_tag_df = self.disseminated_tag_df.filter(
507
- col(dimension_name).isin(codes)
497
+ not_in_codes = ",".join([f"'{code}'" for code in codes])
498
+ delete_from_branch_query = f"DELETE FROM {self.iceberg_tables.BRONZE.iceberg_id}.`branch_diss_tag_{self.tag_name}` WHERE {dimension_name} NOT IN ({not_in_codes})"
499
+ logging.info(f"delete_from_branch_query: {delete_from_branch_query}")
500
+ delete_from_branch_query_result = self.spark.sql(
501
+ delete_from_branch_query
502
+ ).collect()
503
+
504
+ logging.info(
505
+ f"result of delete_from_branch_query: {delete_from_branch_query_result}"
508
506
  )
507
+ # self.disseminated_tag_df = self.disseminated_tag_df.filter(
508
+ # col(dimension_name).isin(codes)
509
+ # )
509
510
 
510
- # self.disseminated_tag_df = self.spark.read.option(
511
- # "branch", f"`diss_tag_{self.tag_name}`"
512
- # ).table(self.iceberg_tables.BRONZE.iceberg_id)
511
+ self.disseminated_tag_df = self.spark.read.option(
512
+ "branch", f"`diss_tag_{self.tag_name}`"
513
+ ).table(self.iceberg_tables.BRONZE.iceberg_id)
513
514
 
514
- self.disseminated_tag_df.writeTo(
515
- f"{self.iceberg_tables.BRONZE.iceberg_id}.`branch_diss_tag_{self.tag_name}`"
516
- ).overwritePartitions()
515
+ # self.disseminated_tag_df.writeTo(
516
+ # f"{self.iceberg_tables.BRONZE.iceberg_id}.`branch_diss_tag_{self.tag_name}`"
517
+ # ).overwritePartitions()
517
518
 
518
519
  disseminated_tag_df = self.disseminated_tag_df.withColumn(
519
520
  "metadata", F.to_json(col("metadata"))