Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/titiler/core/titiler/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ def get_dependency_query_params(

Important: We assume the `callable` in not a co-routine.
"""
dep = get_dependant(path="", call=dependency)
cache_attr = "_titiler_gdp_cached_dep"
if hasattr(dependency, cache_attr):
dep = getattr(dependency, cache_attr)
else:
dep = get_dependant(path="", call=dependency)
setattr(dependency, cache_attr, dep)

qp = (
QueryParams(urlencode(params, doseq=True))
Expand Down Expand Up @@ -190,6 +195,9 @@ def extract_query_params(
params: Union[QueryParams, Dict],
) -> Tuple[ValidParams, Errors]:
"""Extract query params given list of dependencies."""
if isinstance(params, Dict):
params = QueryParams(urlencode(params, doseq=True))

values = {}
errors = []
for dep in dependencies:
Expand Down