File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,20 @@ def _generate_staleness_report_per_image(
73
73
# Use previous month to get full month of data
74
74
previous_month = (datetime .now () - relativedelta (months = 1 )).strftime ("%Y-%m" )
75
75
pkg_list = list (package_versions_in_upstream .keys ())
76
- # Suppress FutureWarning from pandas so it doesn't show in report
77
- with warnings .catch_warnings ():
78
- warnings .filterwarnings ("ignore" , category = FutureWarning )
79
- conda_download_stats = overall (pkg_list , month = previous_month )
76
+
77
+ # Process packages individually to handle exceptions per package
78
+ conda_download_stats = {}
79
+ for pkg in pkg_list :
80
+ try :
81
+ # Suppress FutureWarning from pandas so it doesn't show in report
82
+ with warnings .catch_warnings ():
83
+ warnings .filterwarnings ("ignore" , category = FutureWarning )
84
+ # Get stats for single package
85
+ pkg_stats = overall ([pkg ], month = previous_month )
86
+ conda_download_stats [pkg ] = pkg_stats .get (pkg , "N/A" )
87
+ except ValueError as e :
88
+ print (f"Warning: Unable to fetch download statistics for { pkg } : { str (e )} " )
89
+ conda_download_stats [pkg ] = "N/A"
80
90
81
91
for package in package_versions_in_upstream :
82
92
version_in_sagemaker_distribution = str (target_packages_match_spec_out [package ].get ("version" )).removeprefix (
You can’t perform that action at this time.
0 commit comments