Skip to content

Commit

Permalink
Fix: Fallback logic for when the inspect.stack() call fails (TobikoDa…
Browse files Browse the repository at this point in the history
  • Loading branch information
izeigerman authored May 15, 2024
1 parent f9c7625 commit e543d69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sqlmesh/core/analytics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def wrapper(*args: t.List[t.Any], **kwargs: t.Any) -> t.Any:
from sqlmesh import magics

should_log = True
for frame in inspect.stack():

try:
stack = inspect.stack()
except Exception:
stack = []

for frame in stack:
if "click/" in frame.filename or frame.filename == magics.__file__:
# Magics and CLI are reported separately.
should_log = False
Expand Down

0 comments on commit e543d69

Please sign in to comment.