sws-spark-dissemination-helper 0.0.178__py3-none-any.whl → 0.0.180__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.
@@ -130,14 +130,20 @@ class SWSGoldIcebergSparkHelper:
130
130
  )
131
131
 
132
132
  df = df.withColumn(
133
- "display_decimals", F.coalesce(col("display_decimals"), lit("0"))
133
+ "display_decimals",
134
+ F.coalesce(col("display_decimals"), lit("0")).cast("INT"),
134
135
  ).withColumn(
135
136
  "value",
136
137
  F.round(
137
- col("value").cast("FLOAT"), col("display_decimals").cast("FLOAT")
138
- ).cast("STRING"),
138
+ F.col("value").cast("FLOAT") * F.pow(10, F.col("display_decimals")), 0
139
+ )
140
+ / F.pow(10, F.col("display_decimals")).cast("STRING"),
139
141
  )
140
142
 
143
+ # F.round(
144
+ # col("value").cast("FLOAT"), col("display_decimals").cast("INT")
145
+ # ).cast("STRING"),
146
+
141
147
  return df
142
148
 
143
149
  def read_bronze_data(self) -> DataFrame:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sws-spark-dissemination-helper
3
- Version: 0.0.178
3
+ Version: 0.0.180
4
4
  Summary: A Python helper package providing streamlined Spark functions for efficient data dissemination processes
5
5
  Project-URL: Repository, https://github.com/un-fao/fao-sws-it-python-spark-dissemination-helper
6
6
  Author-email: Daniele Mansillo <danielemansillo@gmail.com>
@@ -1,13 +1,13 @@
1
1
  sws_spark_dissemination_helper/SWSBronzeIcebergSparkHelper.py,sha256=N0eQ2LXtpPeZQCWYi85sMLmpXRzLA2erECiba8tqOAY,29595
2
2
  sws_spark_dissemination_helper/SWSDatatablesExportHelper.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  sws_spark_dissemination_helper/SWSEasyIcebergSparkHelper.py,sha256=csqKyYglBkJSBvEkEa1_keHarZZAIJHaV0d64gGJy98,26379
4
- sws_spark_dissemination_helper/SWSGoldIcebergSparkHelper.py,sha256=SfCahji4dc7KbhOMjPuqtgYLG5saYVBehT3DYu369VA,27170
4
+ sws_spark_dissemination_helper/SWSGoldIcebergSparkHelper.py,sha256=CYrKqUZQiJVbfXECiuWLsmEwn_79I7u4xDg7VdHtgoY,27377
5
5
  sws_spark_dissemination_helper/SWSPostgresSparkReader.py,sha256=V_rH4UYoFZfMUc82U-KxeL_o8F44HnMHfLLXoyNxHxs,20016
6
6
  sws_spark_dissemination_helper/SWSSilverIcebergSparkHelper.py,sha256=EXpqPHbxld8MPShE6Vo8h4y1vpBt_BjMtS4RPJcPeTU,26355
7
7
  sws_spark_dissemination_helper/__init__.py,sha256=42TPbk7KxAud_qY3Sr_F4F7VjyofUlxEJkUXAFQsjRo,327
8
8
  sws_spark_dissemination_helper/constants.py,sha256=cVjTS3xbJNKz-1i7c1dJk2PcOZzQhvuHUp9i4PNIPh4,14055
9
9
  sws_spark_dissemination_helper/utils.py,sha256=Ge8zXsUIcvFihALDNLF5kCu_tAdRQUE04xE6Yn9xQF4,22008
10
- sws_spark_dissemination_helper-0.0.178.dist-info/METADATA,sha256=sb2XDaU4bl4ts0JKErScAq19GNCElMv4sNq-wxuG5-o,2822
11
- sws_spark_dissemination_helper-0.0.178.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
- sws_spark_dissemination_helper-0.0.178.dist-info/licenses/LICENSE,sha256=zFzeb_j_6pXEHwH8Z0OpIkKFJk7vmhZjdem-K0d4zU4,1073
13
- sws_spark_dissemination_helper-0.0.178.dist-info/RECORD,,
10
+ sws_spark_dissemination_helper-0.0.180.dist-info/METADATA,sha256=hDbxBYDO7BTQIb_1Lz7oVnKbM1VoZpMf9raQ_Pz7-4U,2822
11
+ sws_spark_dissemination_helper-0.0.180.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ sws_spark_dissemination_helper-0.0.180.dist-info/licenses/LICENSE,sha256=zFzeb_j_6pXEHwH8Z0OpIkKFJk7vmhZjdem-K0d4zU4,1073
13
+ sws_spark_dissemination_helper-0.0.180.dist-info/RECORD,,