sws-spark-dissemination-helper 0.0.111__tar.gz → 0.0.113__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.111 → sws_spark_dissemination_helper-0.0.113}/PKG-INFO +1 -1
  2. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/pyproject.toml +1 -1
  3. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/src/sws_spark_dissemination_helper/SWSSilverIcebergSparkHelper.py +7 -3
  4. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/.gitignore +0 -0
  5. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/LICENSE +0 -0
  6. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/README.md +0 -0
  7. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/old_requirements.txt +0 -0
  8. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/requirements.txt +0 -0
  9. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/src/sws_spark_dissemination_helper/SWSBronzeIcebergSparkHelper.py +0 -0
  10. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/src/sws_spark_dissemination_helper/SWSGoldIcebergSparkHelper.py +0 -0
  11. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/src/sws_spark_dissemination_helper/SWSPostgresSparkReader.py +0 -0
  12. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/src/sws_spark_dissemination_helper/__init__.py +0 -0
  13. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/src/sws_spark_dissemination_helper/constants.py +0 -0
  14. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/src/sws_spark_dissemination_helper/utils.py +0 -0
  15. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/tests/__init__.py +0 -0
  16. {sws_spark_dissemination_helper-0.0.111 → sws_spark_dissemination_helper-0.0.113}/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.111
3
+ Version: 0.0.113
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.111"
7
+ version = "0.0.113"
8
8
  dependencies = [
9
9
  "annotated-types==0.7.0",
10
10
  "boto3==1.36.18",
@@ -10,7 +10,7 @@ from pyspark.sql.window import Window
10
10
  from sws_api_client import Tags
11
11
  from sws_api_client.tags import BaseDisseminatedTagTable, TableLayer, TableType
12
12
 
13
- from .constants import IcebergDatabases, IcebergTables
13
+ from .constants import IcebergDatabases, IcebergTables, DatasetDatatables
14
14
  from .SWSPostgresSparkReader import SWSPostgresSparkReader
15
15
  from .utils import (
16
16
  get_or_create_tag,
@@ -164,6 +164,9 @@ class SWSSilverIcebergSparkHelper:
164
164
  logging.info(f"Checking time validity for {col_name} of type {col_type}")
165
165
 
166
166
  if col_type == "area":
167
+ logging.info(
168
+ f'Changing start and end year according to "{DatasetDatatables.MAPPING_CODE_CORRECTION.name}"'
169
+ )
167
170
  df_start_year_correction = self.df_mapping_code_correction.filter(
168
171
  col("var_type") == lit("start_year")
169
172
  )
@@ -232,10 +235,11 @@ class SWSSilverIcebergSparkHelper:
232
235
  .withColumn(
233
236
  f"new_{col_name}_end_date",
234
237
  F.when(
235
- col("valid_new_end_year"), F.to_date(col("ey.new_code"))
238
+ col("valid_new_end_year"),
239
+ F.to_date(F.concat(col("ey.new_code"), lit("-12-31"))),
236
240
  ).otherwise(col(f"d.{col_name}_end_date")),
237
241
  )
238
- .selectExpr(
242
+ .select(
239
243
  *cols_to_select,
240
244
  col("new_note").alias("note"),
241
245
  col(f"new_{col_name}_start_date").alias(f"{col_name}_start_date"),