From 30def8040651dad52d9aadf122a05501f5ce25f2 Mon Sep 17 00:00:00 2001 From: Katy Baulch <46493669+katybaulch@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:22:11 +0100 Subject: [PATCH 1/3] Driveby fix codeowners --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 18f1cf9..cc78a4e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ ############################################################################### -# GitHub Code-owner Configuration for bulk-import +# GitHub Code-owner Configuration for GCF Data Mapper # # Each line is a file pattern followed by one or more owners. See this link: # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file @@ -8,8 +8,8 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, members -# of @climatepolicyradar/tech-devs will be requested for +# of @climatepolicyradar/software will be requested for # review when someone opens a pull request. Teams should # be identified in the format @org/team-name. Teams must have # explicit write access to the repository. -* @climatepolicyradar/tech-devs +* @climatepolicyradar/software From cf98ece76b570a52b7b5936b327b102e5482c7b6 Mon Sep 17 00:00:00 2001 From: Katy Baulch <46493669+katybaulch@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:22:23 +0100 Subject: [PATCH 2/3] Bump to 0.1.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4bdbdea..5a56a7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gcf-data-mapper" -version = "0.1.2" +version = "0.1.3" description = "A CLI tool to wrangle GCF data into format recognised by the bulk-import tool." authors = ["CPR-dev-team "] license = "Apache-2.0" From ecca27ca66c6475b0bb29232af96c8b9a0897cfe Mon Sep 17 00:00:00 2001 From: Katy Baulch <46493669+katybaulch@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:24:32 +0100 Subject: [PATCH 3/3] Revert "Remove family skeleton" This reverts commit 74e13d1dbd8ae49c4015018cc07ea15f8e65f7f8. --- gcf_data_mapper/cli.py | 3 ++- gcf_data_mapper/parsers/family.py | 17 +++++++++++++++++ tests/unit_tests/parsers/family/test_family.py | 9 +++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gcf_data_mapper/parsers/family.py create mode 100644 tests/unit_tests/parsers/family/test_family.py diff --git a/gcf_data_mapper/cli.py b/gcf_data_mapper/cli.py index 980f244..15b2609 100644 --- a/gcf_data_mapper/cli.py +++ b/gcf_data_mapper/cli.py @@ -4,6 +4,7 @@ import click from gcf_data_mapper.parsers.collection import collection +from gcf_data_mapper.parsers.family import family @click.command() @@ -43,7 +44,7 @@ def wrangle_to_json(debug) -> dict[str, list[Optional[dict[str, Any]]]]: """ return { "collections": collection(debug), - "families": [], + "families": family(debug), "documents": [], "events": [], } diff --git a/gcf_data_mapper/parsers/family.py b/gcf_data_mapper/parsers/family.py new file mode 100644 index 0000000..8231344 --- /dev/null +++ b/gcf_data_mapper/parsers/family.py @@ -0,0 +1,17 @@ +from typing import Any, Optional + +import click + + +def family(debug: bool) -> list[Optional[dict[str, Any]]]: + """Map the GCF family info to new structure. + + :param bool debug: Whether debug mode is on. + :return list[Optional[dict[str, Any]]]: A list of GCF families in + the 'destination' format described in the GCF Data Mapper Google + Sheet. + """ + if debug: + click.echo("📝 Wrangling GCF family data.") + + return [] diff --git a/tests/unit_tests/parsers/family/test_family.py b/tests/unit_tests/parsers/family/test_family.py new file mode 100644 index 0000000..6a5ef2f --- /dev/null +++ b/tests/unit_tests/parsers/family/test_family.py @@ -0,0 +1,9 @@ +import pytest + +from gcf_data_mapper.parsers.family import family + + +@pytest.mark.parametrize("debug", [True, False]) +def test_returns_empty(debug: bool): + family_data = family(debug) + assert family_data == []