Skip to content

Commit fc415f0

Browse files
committed
fix(testing): Reset log adapter in mock session
The mock session was not preserving the @log_adapter.class_logger decorator from the Session class, causing issues in the mock environment. This change resets the API methods tracking after session creation in the mock, ensuring that the decorator system works correctly.
1 parent 4223cb5 commit fc415f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bigframes/testing/mocks.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ def query_and_wait_mock(query, *args, job_config=None, **kwargs):
160160
)
161161
session._queries = queries # type: ignore
162162
session._job_configs = job_configs # type: ignore
163+
164+
# Reset the log adapter to clear any session creation tracking
165+
import bigframes.core.log_adapter as log_adapter
166+
167+
log_adapter.get_and_reset_api_methods()
168+
163169
return session
164170

165171

0 commit comments

Comments
 (0)