Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions src/pt_snap_cli/query/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import warnings
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -57,8 +58,8 @@ def _load_templates(self) -> None:
try:
config = QueryConfig.load_yaml(yaml_file)
self._configs[yaml_file.stem] = config
except Exception:
pass
except Exception as e:
warnings.warn(f"Failed to load query template from {yaml_file}: {e}", stacklevel=2)

def render(
self,
Expand Down
9 changes: 5 additions & 4 deletions src/pt_snap_cli/query/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import warnings
from collections.abc import Callable
from pathlib import Path

Expand Down Expand Up @@ -266,8 +267,8 @@ def _load_yaml_templates(template_dir: Path | str | None = None) -> None:
config = QueryConfig.load_yaml(yaml_file)
for _query_name, template in config.queries.items():
_registry.register(template)
except Exception:
pass
except Exception as e:
warnings.warn(f"Failed to load query template from {yaml_file}: {e}", stacklevel=2)


def _load_all_templates() -> None:
Expand All @@ -277,5 +278,5 @@ def _load_all_templates() -> None:

try:
_load_all_templates()
except Exception:
pass
except Exception as e:
warnings.warn(f"Failed to load query templates: {e}", stacklevel=2)
Loading