Skip to content

Commit

Permalink
Extract time period from dapla dataset path - set up class, method an…
Browse files Browse the repository at this point in the history
…d test for extracting date from
  • Loading branch information
tilen1976 committed Jan 24, 2024
1 parent d2fa8c8 commit 4d53ede
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/datadoc/backend/dapla_dataset_path_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Extract info from an path following SSB`s naming convention."""


class DaplaDatasetPathInfo:
"""Extract info from an path following SSB`s naming convention."""

def __init__(self, dataset_path: str) -> None:
"""Read info from an path following SSB`s naming convention."""

def contains_data_from(self) -> None:
"""Read dataset from date in ISO format year-month-day."""
return
9 changes: 9 additions & 0 deletions tests/backend/test_dapla_dataset_path_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import datetime

from datadoc.backend.dapla_dataset_path_info import DaplaDatasetPathInfo


def test_exctract_period_info_date_from():
file_name = "ufo_observasjoner_p2019_p2020_v1.parquet"
dapla_dataset = DaplaDatasetPathInfo(file_name)
assert dapla_dataset.contains_data_from() == datetime.date(2019, 1, 1)

0 comments on commit 4d53ede

Please sign in to comment.