Skip to content

Commit 61b1932

Browse files
authored
chore: add logger to Semantics class. (#1286)
* chore: add logger to Semantics class. * skip static method
1 parent bdee173 commit 61b1932

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

bigframes/core/log_adapter.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ def class_logger(decorated_cls):
109109
"""Decorator that adds logging functionality to each method of the class."""
110110
for attr_name, attr_value in decorated_cls.__dict__.items():
111111
if callable(attr_value) and (attr_name not in _excluded_methods):
112-
setattr(decorated_cls, attr_name, method_logger(attr_value, decorated_cls))
112+
if isinstance(attr_value, staticmethod):
113+
# TODO(b/390244171) support for staticmethod
114+
pass
115+
else:
116+
setattr(
117+
decorated_cls, attr_name, method_logger(attr_value, decorated_cls)
118+
)
113119
elif isinstance(attr_value, property):
114120
setattr(
115121
decorated_cls, attr_name, property_logger(attr_value, decorated_cls)

bigframes/operations/semantics.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@
2121
import numpy as np
2222

2323
from bigframes import dtypes, exceptions
24-
from bigframes.core import guid
24+
from bigframes.core import guid, log_adapter
2525

2626

27+
@log_adapter.class_logger
2728
class Semantics:
2829
def __init__(self, df) -> None:
2930
import bigframes

0 commit comments

Comments
 (0)