Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mmwinther committed Jul 24, 2024
1 parent db3aefb commit 663a439
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/datadoc/backend/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def _extract_metadata_from_files(self) -> None:
- The 'contains_personal_data' attribute is set to False if not specified.
- A lookup dictionary for variables is created based on their short names.
"""
extracted_metadata: model.DatadocMetadata | None = None
existing_metadata: model.DatadocMetadata | None = None
if self.metadata_document is not None and self.metadata_document.exists():
existing_metadata = self._extract_metadata_from_existing_document(
self.metadata_document,
Expand Down
3 changes: 3 additions & 0 deletions src/datadoc/backend/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)
from datadoc.enums import Assessment
from datadoc.enums import DataSetState
from datadoc.enums import VariableRole


def normalize_path(path: str) -> pathlib.Path | CloudPath:
Expand Down Expand Up @@ -87,6 +88,8 @@ def set_default_values_variables(variables: list) -> None:
v.id = uuid.uuid4()
if v.is_personal_data is None:
v.is_personal_data = model.IsPersonalData.NOT_PERSONAL_DATA
if v.variable_role is None:
v.variable_role = VariableRole.MEASURE


def set_default_values_dataset(dataset: model.Dataset) -> None:
Expand Down

0 comments on commit 663a439

Please sign in to comment.