sws-spark-dissemination-helper 0.0.151__tar.gz → 0.0.152__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.151 → sws_spark_dissemination_helper-0.0.152}/PKG-INFO +1 -1
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/pyproject.toml +1 -1
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/SWSEasyIcebergSparkHelper.py +14 -13
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/.gitignore +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/LICENSE +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/README.md +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/SWSBronzeIcebergSparkHelper.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/SWSDatatablesExportHelper.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/SWSGoldIcebergSparkHelper.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/SWSPostgresSparkReader.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/SWSSilverIcebergSparkHelper.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/__init__.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/constants.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/src/sws_spark_dissemination_helper/utils.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/tests/__init__.py +0 -0
- {sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/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.152
|
|
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>
|
|
@@ -511,11 +511,9 @@ class SWSEasyIcebergSparkHelper:
|
|
|
511
511
|
.drop("m.observation_id")
|
|
512
512
|
)
|
|
513
513
|
|
|
514
|
-
def write_data_to_iceberg_and_csv(self, sql=
|
|
514
|
+
def write_data_to_iceberg_and_csv(self, sql=True) -> DataFrame:
|
|
515
515
|
if sql:
|
|
516
516
|
self.df_denorm = self._gen_denormalied_data_sql()
|
|
517
|
-
elif from_tag:
|
|
518
|
-
self.df_denorm = self._gen_denormalied_data_sql_from_tag()
|
|
519
517
|
else:
|
|
520
518
|
self.df_denorm = self._gen_denormalied_data()
|
|
521
519
|
|
|
@@ -586,18 +584,21 @@ class SWSEasyIcebergSparkHelper:
|
|
|
586
584
|
logging.info("Unfiltered data tags successfully written")
|
|
587
585
|
|
|
588
586
|
def write_filtered_data_to_iceberg_and_csv(
|
|
589
|
-
self, dimensions: Dict[str, List[str]]
|
|
587
|
+
self, dimensions: Dict[str, List[str]] = None, from_tag=False
|
|
590
588
|
) -> DataFrame:
|
|
591
589
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
)
|
|
590
|
+
if from_tag:
|
|
591
|
+
self.filtered_df = self._gen_denormalied_data_sql_from_tag()
|
|
592
|
+
else:
|
|
593
|
+
self.filtered_df = self.df_denorm
|
|
594
|
+
|
|
595
|
+
for dimension_name, codes in dimensions.items():
|
|
596
|
+
logging.info(f"dimension_name: {dimension_name}")
|
|
597
|
+
logging.info(f"codes: {codes}")
|
|
598
|
+
if len(codes) != 0:
|
|
599
|
+
self.filtered_df = self.filtered_df.filter(
|
|
600
|
+
col(dimension_name).isin(codes)
|
|
601
|
+
)
|
|
601
602
|
|
|
602
603
|
self.filtered_df.writeTo(
|
|
603
604
|
self.iceberg_tables.TABLE_FILTERED.iceberg_id
|
{sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/.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
|
|
File without changes
|
{sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/tests/__init__.py
RENAMED
|
File without changes
|
{sws_spark_dissemination_helper-0.0.151 → sws_spark_dissemination_helper-0.0.152}/tests/test.py
RENAMED
|
File without changes
|