Skip to content

Commit

Permalink
ignore monkey patch/api plugin import error (pinterest#1269)
Browse files Browse the repository at this point in the history
  • Loading branch information
jczhong84 authored and aidenprice committed Jan 3, 2024
1 parent bbd2051 commit 464e474
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion querybook/server/datasources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
from . import ai_assistant

# Keep this at the end of imports to make sure the plugin APIs override the default ones
import api_plugin
try:
import api_plugin
except ImportError:
pass # No api_plugin found

# Flake8 :(
admin
Expand Down
5 changes: 4 additions & 1 deletion querybook/server/lib/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def monkey_patch_disable_watchdog():

def monkey_patch_plugin():
"""This enables monkey patching any module or function through the monkey_patch_plugin."""
import monkey_patch_plugin # noqa: F401
try:
import monkey_patch_plugin # noqa: F401
except ImportError:
pass # No monkey_patch_plugin found


def patch_all():
Expand Down

0 comments on commit 464e474

Please sign in to comment.