sws-spark-dissemination-helper 0.0.101__tar.gz → 0.0.103__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.101 → sws_spark_dissemination_helper-0.0.103}/PKG-INFO +1 -1
  2. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/pyproject.toml +1 -1
  3. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/src/sws_spark_dissemination_helper/SWSBronzeIcebergSparkHelper.py +6 -9
  4. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/src/sws_spark_dissemination_helper/SWSSilverIcebergSparkHelper.py +3 -2
  5. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/.gitignore +0 -0
  6. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/LICENSE +0 -0
  7. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/README.md +0 -0
  8. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/old_requirements.txt +0 -0
  9. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/requirements.txt +0 -0
  10. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/src/sws_spark_dissemination_helper/SWSGoldIcebergSparkHelper.py +0 -0
  11. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/src/sws_spark_dissemination_helper/SWSPostgresSparkReader.py +0 -0
  12. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/src/sws_spark_dissemination_helper/__init__.py +0 -0
  13. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/src/sws_spark_dissemination_helper/constants.py +0 -0
  14. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/src/sws_spark_dissemination_helper/utils.py +0 -0
  15. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/tests/__init__.py +0 -0
  16. {sws_spark_dissemination_helper-0.0.101 → sws_spark_dissemination_helper-0.0.103}/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.101
3
+ Version: 0.0.103
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.101"
7
+ version = "0.0.103"
8
8
  dependencies = [
9
9
  "annotated-types==0.7.0",
10
10
  "boto3==1.36.18",
@@ -387,18 +387,12 @@ class SWSBronzeIcebergSparkHelper:
387
387
 
388
388
  logging.info(f"Bronze table written to {self.iceberg_tables.BRONZE.iceberg_id}")
389
389
 
390
+ self.spark.sql(
391
+ f"ALTER ICEBERG TABLE {self.iceberg_tables.BRONZE.iceberg_id} REFRESH;"
392
+ )
390
393
  self.spark.sql(
391
394
  f"ALTER TABLE {self.iceberg_tables.BRONZE.iceberg_id} CREATE TAG `{self.tag_name}`"
392
395
  )
393
- while (
394
- self.spark.sql(
395
- f"SELECT * FROM {self.iceberg_tables.BRONZE.iceberg_id}.refs"
396
- )
397
- .filter((col("type") == lit("TAG")) & (col("name") == lit(self.tag_name)))
398
- .count()
399
- ) == 0:
400
- logging.info(f"Waiting for the tag {self.tag_name} to be created")
401
- time.sleep(2)
402
396
 
403
397
  logging.info(f"bronze tag '{self.tag_name}' created")
404
398
 
@@ -476,6 +470,9 @@ class SWSBronzeIcebergSparkHelper:
476
470
  f"Bronze disseminated tag table written to {self.iceberg_tables.BRONZE_DISS_TAG.iceberg_id}"
477
471
  )
478
472
 
473
+ self.spark.sql(
474
+ f"ALTER ICEBERG TABLE {self.iceberg_tables.BRONZE_DISS_TAG.iceberg_id} REFRESH;"
475
+ )
479
476
  self.spark.sql(
480
477
  f"ALTER TABLE {self.iceberg_tables.BRONZE_DISS_TAG.iceberg_id} CREATE TAG `{self.tag_name}`"
481
478
  )
@@ -110,9 +110,10 @@ class SWSSilverIcebergSparkHelper:
110
110
  return self.spark.read.option("tag", self.tag_name).table(
111
111
  self.iceberg_tables.BRONZE.iceberg_id
112
112
  )
113
+
113
114
  def read_bronze_diss_tag_data(self) -> DataFrame:
114
- return self.spark.read.option("branch", f"diss_tag_{self.tag_name}").table(
115
- self.iceberg_tables.BRONZE.iceberg_id
115
+ return self.spark.read.option("tag", self.tag_name).table(
116
+ self.iceberg_tables.BRONZE_DISS_TAG.iceberg_id
116
117
  )
117
118
 
118
119
  def _get_dim_time_flag_columns(self) -> Tuple[List[str], List[str], str, List[str]]: