-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract time period from dapla dataset path - set up class, method an…
…d test for extracting date from
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |