Skip to content

Commit

Permalink
use format_url_kwargs instead of url_to_ast
Browse files Browse the repository at this point in the history
  • Loading branch information
jmosbacher committed Jul 18, 2023
1 parent 03ab8b8 commit 18242f5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions straxen/url_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,8 @@ def evaluate_dry(cls, url: str, **kwargs):
:keyword: any additional kwargs are passed to self.dispatch (see example)
:return: evaluated value of the URL.
"""
protocol, url_arg, url_kwarg = cls.url_to_ast(url)

combined_kwargs = dict(url_kwarg, **kwargs)
url = cls.format_url_kwargs(url, **kwargs)
_, combined_kwargs = cls.split_url_kwargs(url)

for k, v in combined_kwargs.items():
if isinstance(v, str) and cls.PLUGIN_ATTR_PREFIX in v:
Expand All @@ -536,8 +535,8 @@ def evaluate_dry(cls, url: str, **kwargs):
f"Try passing {k} as a keyword argument."
f"e.g.: `URLConfig.evaluate_dry({url}, {k}=SOME_VALUE)`"
)

return cls.eval(protocol, url_arg, combined_kwargs)
return cls.eval(url)


@URLConfig.register("cmt")
Expand Down

0 comments on commit 18242f5

Please sign in to comment.