This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the lack of private datasets in group entities
- Loading branch information
Mateusz Kulas
committed
Sep 5, 2023
1 parent
2b5d55d
commit 57cce2d
Showing
4 changed files
with
33 additions
and
20 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
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
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
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
from collections import defaultdict | ||
from typing import Any | ||
|
||
from oddrn_generator import CKANGenerator | ||
|
||
|
||
def get_metadata(data: dict[str, Any], excluded_keys: list[str]) -> dict[str, Any]: | ||
return {key: data[key] for key in data if key not in excluded_keys} | ||
|
||
|
||
def get_groups(data: dict[str, Any]) -> dict[str, Any]: | ||
transformed_data = data.copy() | ||
transformed_groups = {group["name"]: group for group in transformed_data["groups"]} | ||
transformed_data["groups"] = transformed_groups | ||
return transformed_data | ||
def group_dataset_oddrns( | ||
generator: CKANGenerator, dataset: str, groups: list[str], res: defaultdict | ||
): | ||
oddrn = generator.get_oddrn_by_path("datasets", dataset) | ||
for group in groups: | ||
res[group].append(oddrn) |