Skip to content

Commit

Permalink
fix: Pass the config file to the YAML parser
Browse files Browse the repository at this point in the history
  • Loading branch information
rsavoye committed Oct 12, 2023
1 parent a2e89ad commit ef665b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions osm_fieldwork/filter_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def parse(
"tourism",
)
self.keep = list(keep)
if "keep" in config["keep"]:
self.keep.extend(config["keep"])
if "keep" in config.config["keep"]:
self.keep.extend(config.config["keep"])

return title, extract

Expand Down
4 changes: 3 additions & 1 deletion osm_fieldwork/make_data_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from osm_fieldwork.data_models import data_models_path
from osm_fieldwork.filter_data import FilterData
from osm_fieldwork.xlsforms import xlsforms_path
from osm_rawdata.config import QueryConfig

# Instantiate logger
log = logging.getLogger(__name__)
Expand Down Expand Up @@ -81,6 +82,7 @@ def __init__(
else:
file = open(f"{xlsforms_path}/{xlsfile}", "rb")
self.xls = BytesIO(file.read())
self.config = QueryConfig(config)

def getFeatures(
self,
Expand Down Expand Up @@ -126,7 +128,7 @@ def cleanFeatures(
"""
log.debug("Cleaning features")
cleaned = FilterData()
cleaned.parse(self.xls)
cleaned.parse(self.xls, self.config)
new = cleaned.cleanData(collection)
# jsonfile = open(filespec, "w")
# dump(new, jsonfile)
Expand Down

0 comments on commit ef665b3

Please sign in to comment.