Skip to content

Commit

Permalink
Correct half-year months and type hint supported_date_formats
Browse files Browse the repository at this point in the history
  • Loading branch information
tilen1976 committed Jan 29, 2024
1 parent ff14aee commit 81f95ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/datadoc/backend/dapla_dataset_path_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,16 @@ class SsbDateFormat:
time_frame={
"H1": {
"start": "01",
"end": "07",
"end": "06",
},
"H2": {
"start": "08",
"start": "07",
"end": "12",
},
},
)


SUPPORTED_DATE_FORMATS = [
SUPPORTED_DATE_FORMATS: list[IsoDateFormat | SsbDateFormat] = [
ISO_YEAR,
ISO_YEAR_MONTH,
ISO_YEAR_MONTH_DAY,
Expand Down Expand Up @@ -242,7 +241,7 @@ def convert_ssb_period(
>>> ssb_half_year_period_start = convert_ssb_period("1898H2","start",SSB_HALF_YEAR)
>>> ssb_half_year_period_start
189808
189807
>>> ssb_half_year_period_end = convert_ssb_period("1898H2","end",SSB_HALF_YEAR)
>>> ssb_half_year_period_end
Expand Down
2 changes: 1 addition & 1 deletion tests/backend/test_dapla_dataset_path_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DatasetPathTestCase:
DatasetPathTestCase(
path="personinntekt_p2022H1_v1.parquet",
expected_contains_data_from=datetime.date(2022, 1, 1),
expected_contains_data_until=datetime.date(2022, 7, 31),
expected_contains_data_until=datetime.date(2022, 6, 30),
),
DatasetPathTestCase(
path="nybilreg_p2022T1_v1.parquet",
Expand Down

0 comments on commit 81f95ce

Please sign in to comment.