Skip to content

Commit

Permalink
Feature/pdct 1398 Add skeleton for GCF family mapping (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
katybaulch authored Aug 27, 2024
2 parents a2c1413 + ecca27c commit fce28ca
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
3 changes: 2 additions & 1 deletion gcf_data_mapper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import click

from gcf_data_mapper.parsers.collection import collection
from gcf_data_mapper.parsers.family import family


@click.command()
Expand Down Expand Up @@ -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": [],
}
Expand Down
17 changes: 17 additions & 0 deletions gcf_data_mapper/parsers/family.py
Original file line number Diff line number Diff line change
@@ -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 []
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "Apache-2.0"
Expand Down
9 changes: 9 additions & 0 deletions tests/unit_tests/parsers/family/test_family.py
Original file line number Diff line number Diff line change
@@ -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 == []

0 comments on commit fce28ca

Please sign in to comment.