-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The defaultvalue argument is supposed to be optional in getProperty
, but if it's not provided I get the following error:
Traceback (most recent call last):
File "/opt/spark/jobs/pipelines/usgs-api-data/usgs_api_data_driver.py", line 31, in <module>
ingest = Ingest().execute_step()
File "/opt/spark/.local/lib/python3.9/site-packages/usgs_api_data/generated/step/ingest_base.py", line 56, in execute_step
outbound = self.execute_step_impl()
File "/opt/spark/.local/lib/python3.9/site-packages/usgs_api_data/step/ingest.py", line 44, in execute_step_impl
self.config.query_additional(),
File "/opt/spark/.local/lib/python3.9/site-packages/usgs_api_data/config/usgs_config.py", line 122, in query_additional
raw_values = self.properties.getProperty("query.additional")
File "/opt/spark/.local/lib/python3.9/site-packages/krausening/properties/property_manager.py", line 182, in getProperty
return os.path.expandvars(defaultValue)
File "/usr/local/lib/python3.9/posixpath.py", line 284, in expandvars
path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType
This is the calling code:
import os
from datetime import date, datetime
from krausening.properties import PropertyManager
from krausening.logging import LogManager
class UsgsConfig:
def __init__(self):
self.properties = PropertyManager.get_instance().get_properties(
"usgs.properties"
)
def query_additional(self) -> {str, str}:
raw_values = self.properties.getProperty("query.additional")
additional = {}
if raw_values is not None:
for pair in raw_values.split("&"):
key, value = pair.split("=")
additional[key] = value
return additional
Metadata
Metadata
Assignees
Labels
No labels