Fix scalar logging bug with Fire (#1301)

Fixes `_patched_call` using under Fire scope, see #1300
This commit is contained in:
Rafael Tvelov 2024-07-31 14:19:31 +03:00 committed by GitHub
parent 462b01ee0e
commit a7b5890028
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,7 @@ except ImportError:
fire = None fire = None
import inspect import inspect
from .frameworks import _patched_call # noqa from .frameworks import _patched_call_no_recursion_guard # noqa
from ..config import get_remote_task_id, running_remotely from ..config import get_remote_task_id, running_remotely
from ..utilities.dicts import cast_str_to_bool from ..utilities.dicts import cast_str_to_bool
@ -57,9 +57,9 @@ class PatchFire:
if not cls.__patched: if not cls.__patched:
cls.__patched = True cls.__patched = True
if running_remotely(): if running_remotely():
fire.core._Fire = _patched_call(fire.core._Fire, PatchFire.__Fire) fire.core._Fire = _patched_call_no_recursion_guard(fire.core._Fire, PatchFire.__Fire)
else: else:
fire.core._CallAndUpdateTrace = _patched_call( fire.core._CallAndUpdateTrace = _patched_call_no_recursion_guard(
fire.core._CallAndUpdateTrace, PatchFire.__CallAndUpdateTrace fire.core._CallAndUpdateTrace, PatchFire.__CallAndUpdateTrace
) )