소스 검색

small fix in processing function

Johannes Gütschow 7 달 전
부모
커밋
98171aeb7f
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      src/unfccc_ghg_data/helper/functions.py

+ 8 - 4
src/unfccc_ghg_data/helper/functions.py

@@ -321,7 +321,7 @@ def process_data_for_country(  # noqa PLR0913, PLR0912, PLR0915
         # aggregate gases if desired
         if "aggregate_gases" in processing_info_country:
             data_country = data_country.pr.add_aggregates_variables(
-                gases=processing_info_country["aggregate_gases"],
+                gas_baskets=processing_info_country["aggregate_gases"],
             )
 
     # 3: map categories
@@ -355,9 +355,13 @@ def process_data_for_country(  # noqa PLR0913, PLR0912, PLR0915
         )
 
     # amend title and comment
-    data_country.attrs["comment"] = (
-        data_country.attrs["comment"] + f" Processed on " f"{date.today()}"
-    )
+    if "comment" in data_country.attrs.keys():
+        data_country.attrs["comment"] = (
+            data_country.attrs["comment"] + f" Processed on " f"{date.today()}"
+        )
+    else:
+        data_country.attrs["comment"] = f"Processed on " f"{date.today()}"
+
     data_country.attrs["title"] = (
         data_country.attrs["title"] + f" Processed on " f"{date.today()}"
     )