Skip to content

Commit

Permalink
Fix error in resources #386
Browse files Browse the repository at this point in the history
  • Loading branch information
Oskar.Oetken committed Mar 29, 2023
1 parent 7cd6690 commit 1b96672
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions open_mastr/soap_api/metadata/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,36 +240,32 @@ def create_datapackage_meta_json(
raw_fields.append({"name": name, **specification, "unit": None})

if "raw" in data:
resource = [
{
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}_raw",
"path": filenames["raw"][tech]["joined"],
"format": "PostgreSQL",
"encoding": "utf-8",
"schema": {
"fields": raw_fields,
"primaryKey": ["EinheitMastrNummer"],
},
"dialect": {"delimiter": ","},
}
]
resource = {
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}_raw",
"path": filenames["raw"][tech]["joined"],
"format": "PostgreSQL",
"encoding": "utf-8",
"schema": {
"fields": raw_fields,
"primaryKey": ["EinheitMastrNummer"],
},
"dialect": {"delimiter": ","},
}
resources_meta["resources"].append(resource)
if "cleaned" in data:
resource = [
{
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}_cleaned",
"path": filenames["cleaned"][tech],
"format": "PostgreSQL",
"encoding": "utf-8",
"schema": {
"fields": raw_fields,
"primaryKey": ["EinheitMastrNummer"],
},
"dialect": {"delimiter": ","},
}
]
resource = {
"profile": "tabular-data-resource",
"name": f"bnetza_mastr_{tech}_cleaned",
"path": filenames["cleaned"][tech],
"format": "PostgreSQL",
"encoding": "utf-8",
"schema": {
"fields": raw_fields,
"primaryKey": ["EinheitMastrNummer"],
},
"dialect": {"delimiter": ","},
}
resources_meta["resources"].append(resource)
if "postprocessed" in data:
processed_fields = [
Expand Down

0 comments on commit 1b96672

Please sign in to comment.