sws-spark-dissemination-helper 0.0.180__tar.gz → 0.0.185__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.
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/PKG-INFO +2 -2
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/pyproject.toml +2 -2
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/SWSGoldIcebergSparkHelper.py +20 -9
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/SWSSilverIcebergSparkHelper.py +2 -2
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/.gitignore +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/LICENSE +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/README.md +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/SWSBronzeIcebergSparkHelper.py +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/SWSDatatablesExportHelper.py +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/SWSEasyIcebergSparkHelper.py +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/SWSPostgresSparkReader.py +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/__init__.py +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/constants.py +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/src/sws_spark_dissemination_helper/utils.py +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/tests/__init__.py +0 -0
- {sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/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.
|
|
3
|
+
Version: 0.0.185
|
|
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>
|
|
@@ -49,7 +49,7 @@ Requires-Dist: pytz==2025.2
|
|
|
49
49
|
Requires-Dist: requests==2.32.3
|
|
50
50
|
Requires-Dist: s3transfer>=0.11.2
|
|
51
51
|
Requires-Dist: six==1.17.0
|
|
52
|
-
Requires-Dist: sws-api-client==2.3
|
|
52
|
+
Requires-Dist: sws-api-client==2.7.3
|
|
53
53
|
Requires-Dist: typing-extensions>=4.12.2
|
|
54
54
|
Requires-Dist: tzdata==2025.2
|
|
55
55
|
Requires-Dist: urllib3==1.26.20
|
{sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/pyproject.toml
RENAMED
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "sws-spark-dissemination-helper"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.185"
|
|
8
8
|
dependencies = [
|
|
9
9
|
"annotated-types==0.7.0",
|
|
10
10
|
"boto3>=1.40.0",
|
|
@@ -25,7 +25,7 @@ dependencies = [
|
|
|
25
25
|
"requests==2.32.3",
|
|
26
26
|
"s3transfer>=0.11.2",
|
|
27
27
|
"six==1.17.0",
|
|
28
|
-
"sws_api_client==2.3
|
|
28
|
+
"sws_api_client==2.7.3",
|
|
29
29
|
"typing_extensions>=4.12.2",
|
|
30
30
|
"tzdata==2025.2",
|
|
31
31
|
"urllib3==1.26.20"
|
|
@@ -88,10 +88,13 @@ class SWSGoldIcebergSparkHelper:
|
|
|
88
88
|
def apply_diss_flag_filter(self, df: DataFrame) -> DataFrame:
|
|
89
89
|
return df.filter(col("diss_flag"))
|
|
90
90
|
|
|
91
|
-
def keep_dim_val_attr_columns(
|
|
91
|
+
def keep_dim_val_attr_columns(
|
|
92
|
+
self, df: DataFrame, additional_columns: List[str] = []
|
|
93
|
+
):
|
|
92
94
|
cols_to_keep_sws = self.cols_to_keep_sws
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
for additional_column in additional_columns:
|
|
96
|
+
if additional_column in df.columns:
|
|
97
|
+
cols_to_keep_sws = cols_to_keep_sws + [additional_column]
|
|
95
98
|
if "unit_of_measure_symbol" in df.columns:
|
|
96
99
|
cols_to_keep_sws = cols_to_keep_sws + ["unit_of_measure_symbol"]
|
|
97
100
|
return df.select(*cols_to_keep_sws)
|
|
@@ -156,18 +159,26 @@ class SWSGoldIcebergSparkHelper:
|
|
|
156
159
|
self.iceberg_tables.SILVER.iceberg_id
|
|
157
160
|
)
|
|
158
161
|
|
|
159
|
-
def gen_gold_sws_disseminated_data(
|
|
162
|
+
def gen_gold_sws_disseminated_data(
|
|
163
|
+
self, additional_columns: List[str] = []
|
|
164
|
+
) -> DataFrame:
|
|
160
165
|
return (
|
|
161
166
|
self.read_silver_data()
|
|
162
167
|
.transform(self.apply_diss_flag_filter)
|
|
163
|
-
.transform(self.keep_dim_val_attr_columns)
|
|
168
|
+
.transform(self.keep_dim_val_attr_columns, additional_columns)
|
|
164
169
|
)
|
|
165
170
|
|
|
166
|
-
def gen_gold_sws_data(self) -> DataFrame:
|
|
167
|
-
return self.read_bronze_data().transform(
|
|
171
|
+
def gen_gold_sws_data(self, additional_columns: List[str] = []) -> DataFrame:
|
|
172
|
+
return self.read_bronze_data().transform(
|
|
173
|
+
self.keep_dim_val_attr_columns, additional_columns
|
|
174
|
+
)
|
|
168
175
|
|
|
169
|
-
def gen_gold_sws_validated_data(
|
|
170
|
-
|
|
176
|
+
def gen_gold_sws_validated_data(
|
|
177
|
+
self, additional_columns: List[str] = []
|
|
178
|
+
) -> DataFrame:
|
|
179
|
+
return self.read_silver_data().transform(
|
|
180
|
+
self.keep_dim_val_attr_columns, additional_columns
|
|
181
|
+
)
|
|
171
182
|
|
|
172
183
|
def write_gold_sws_validated_data_to_iceberg_and_csv(
|
|
173
184
|
self, df: DataFrame
|
|
@@ -209,7 +209,7 @@ class SWSSilverIcebergSparkHelper:
|
|
|
209
209
|
F.array_append(
|
|
210
210
|
col("d.diss_note"),
|
|
211
211
|
F.concat(
|
|
212
|
-
col("sy.
|
|
212
|
+
col("sy.note"),
|
|
213
213
|
lit(" from "),
|
|
214
214
|
col("sy.old_code"),
|
|
215
215
|
lit(" to "),
|
|
@@ -225,7 +225,7 @@ class SWSSilverIcebergSparkHelper:
|
|
|
225
225
|
F.array_append(
|
|
226
226
|
col("new_diss_note"),
|
|
227
227
|
F.concat(
|
|
228
|
-
col("ey.
|
|
228
|
+
col("ey.note"),
|
|
229
229
|
lit(" from "),
|
|
230
230
|
col("ey.old_code"),
|
|
231
231
|
lit(" to "),
|
{sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/.gitignore
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/tests/__init__.py
RENAMED
|
File without changes
|
{sws_spark_dissemination_helper-0.0.180 → sws_spark_dissemination_helper-0.0.185}/tests/test.py
RENAMED
|
File without changes
|