-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Found a circular reference in the code
- Loading branch information
Showing
5 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ruff: noqa: F403 | ||
|
||
from .macros import * |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import logging | ||
import os | ||
|
||
connected_to_sqlmesh_logs = False | ||
|
||
|
||
def add_metrics_tools_to_sqlmesh_logging(): | ||
"""sqlmesh won't automatically add metrics_tools logging. This will enable | ||
logs from any of the metrics tools utilities. If sqlmesh is the runner""" | ||
import __main__ | ||
|
||
global connected_to_sqlmesh_logs | ||
|
||
class MetricsToolsFilter(logging.Filter): | ||
def filter(self, record): | ||
return record.name == "metrics_tools" | ||
|
||
app_name = os.path.basename(__main__.__file__) | ||
if app_name == "sqlmesh" and not connected_to_sqlmesh_logs: | ||
app_logger = logging.getLogger(app_name) | ||
app_logger.addFilter(MetricsToolsFilter()) | ||
connected_to_sqlmesh_logs = True |