SIENTIAPDE-1712
SIENTIAPDE-1712 Refactor logging in MinioDataFramePayload class to utilize custom_debug method for improved clarity and consistency. Enhanced DataFrame size logging by integrating a dedicated debug method, streamlining the logging process.
This commit is contained in:
@@ -98,7 +98,7 @@ class MinioDataFramePayload:
|
|||||||
"""
|
"""
|
||||||
if logger is None:
|
if logger is None:
|
||||||
return
|
return
|
||||||
logger.debug(message, metadata)
|
logger.custom_debug(message, metadata)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, raw: 'dict[str, Any] | MinioDataFramePayload') -> 'MinioDataFramePayload':
|
def from_dict(cls, raw: 'dict[str, Any] | MinioDataFramePayload') -> 'MinioDataFramePayload':
|
||||||
@@ -152,8 +152,11 @@ class MinioDataFramePayload:
|
|||||||
except Exception:
|
except Exception:
|
||||||
size = len(pickle.dumps(df))
|
size = len(pickle.dumps(df))
|
||||||
|
|
||||||
if logger is not None:
|
MinioDataFramePayload._debug(
|
||||||
logger.debug(f'DataFrame size: {size} bytes', metadata)
|
logger,
|
||||||
|
f'DataFrame size: {size} bytes',
|
||||||
|
metadata,
|
||||||
|
)
|
||||||
return size
|
return size
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user