From 5dcee5398fef32f0cddf7732427351235ce94d66 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Wed, 30 Apr 2025 03:25:25 -0700 Subject: [PATCH 1/2] fix: refactor datetime to remove deprecation warnings Signed-off-by: Emmanuel Ferdman --- src/ydata_profiling/model/describe.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ydata_profiling/model/describe.py b/src/ydata_profiling/model/describe.py index 74bdf924a..1df8456c6 100644 --- a/src/ydata_profiling/model/describe.py +++ b/src/ydata_profiling/model/describe.py @@ -1,5 +1,5 @@ """Organize the calculation of statistics for each series in this DataFrame.""" -from datetime import datetime +from datetime import datetime, timezone from typing import Any, Dict, Optional, Union import pandas as pd @@ -82,7 +82,7 @@ def describe( disable=not config.progress_bar, position=0, ) as pbar: - date_start = datetime.utcnow() + date_start = datetime.now(timezone.utc) # Variable-specific pbar.total += len(df.columns) @@ -187,7 +187,7 @@ def describe( pbar.set_postfix_str("Completed") - date_end = datetime.utcnow() + date_end = datetime.now(timezone.utc) analysis = BaseAnalysis(config.title, date_start, date_end) time_index_analysis = None From 40746eab43905571dc8ba503ffc070a7281ca6b3 Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Sat, 14 Jun 2025 04:02:14 -0700 Subject: [PATCH 2/2] fix: refactor datetime to remove deprecation warnings Signed-off-by: Emmanuel Ferdman --- src/ydata_profiling/model/describe.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ydata_profiling/model/describe.py b/src/ydata_profiling/model/describe.py index 1df8456c6..1c770ee6b 100644 --- a/src/ydata_profiling/model/describe.py +++ b/src/ydata_profiling/model/describe.py @@ -82,7 +82,7 @@ def describe( disable=not config.progress_bar, position=0, ) as pbar: - date_start = datetime.now(timezone.utc) + date_start = datetime.now(timezone.utc).replace(tzinfo=None) # Variable-specific pbar.total += len(df.columns) @@ -187,7 +187,7 @@ def describe( pbar.set_postfix_str("Completed") - date_end = datetime.now(timezone.utc) + date_end = datetime.now(timezone.utc).replace(tzinfo=None) analysis = BaseAnalysis(config.title, date_start, date_end) time_index_analysis = None