Skip to content

Commit 7c1e3b5

Browse files
committed
refactor: use semicolon to separate module path from variable
1 parent 1a8feb2 commit 7c1e3b5

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ The application is configurable via environment variables.
117117
- **Example:**
118118
```json
119119
{
120-
"cls": "my_package.filters.OrganizationFilter",
120+
"cls": "my_package.filters:OrganizationFilter",
121121
"args": ["org1"],
122122
"kwargs": {
123123
"field_name": "properties.organization"

src/stac_auth_proxy/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class ClassInput(BaseModel):
2323

2424
def __call__(self):
2525
"""Dynamically load a class and instantiate it with args & kwargs."""
26-
module_path, class_name = self.cls.rsplit(".", 1)
26+
assert self.cls.count(":")
27+
module_path, class_name = self.cls.rsplit(":", 1)
2728
module = importlib.import_module(module_path)
2829
cls = getattr(module, class_name)
2930
return cls(*self.args, **self.kwargs)

tests/test_filters_jinja2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def _build_client(
132132
app = app_factory(
133133
upstream_url=src_api_server,
134134
items_filter={
135-
"cls": "stac_auth_proxy.filters.Template",
135+
"cls": "stac_auth_proxy.filters:Template",
136136
"args": [template_expr.strip()],
137137
},
138138
default_public=True,

0 commit comments

Comments
 (0)