Fixed widget metadata issues in Jupyter notebooks that were causing nbconvert errors during GitHub Actions workflows.
Notebooks contained a "widgets" metadata section with the structure:
"widgets": {
"state": {},
"version": "1.1.2"
}This caused nbconvert to fail with the error:
KeyError: 'application/vnd.jupyter.widget-state+json'
The error occurred because nbconvert expected the widgets state to contain a specific MIME type key that was missing.
Removed the entire "widgets" metadata section from all affected notebooks since it was empty and not needed.
- ✅ Visualization/Geospatial-Visualization-with-Folium-and-Pandas.ipynb
- ✅ Visualization/Matplotlib-Line-Plots-and-Canadian-Immigration-Exploration.ipynb
- ✅ Visualization/Pie-Charts-Box-Plots-Scatter-Plots-and-Bubble-Plots-py-v2.0.ipynb
- ✅ Visualization/Waffle-WordCloud-Regression-Visualization-Project.ipynb
- ✅ SQL/Sayem_ChicagoData_Analysis.ipynb
- ✅ SQL/Sayem_ChicagoSchools_SQLPractice.ipynb
- ✅ SQL/Sayem_PeerAssignment.ipynb
- ✅ SQL/Sayem_RealWorldData_SQL.ipynb
- ✅ SQL/Sayem_SQL_Analysis.ipynb
- ✅ SQL/Sayem_SQL_Connecting.ipynb
- ✅ SQL/Sayem_SQL_Querying.ipynb
- ✅ ML/Classification/Decision-Trees-Topic-Based.ipynb
- ✅ ML/Classification/Logistic-Regression-Topic-Based.ipynb
- ✅ ML/Clustering/DBSCAN-Clustering-Topic-Based.ipynb
- ✅ ML/Clustering/K-Means-Clustering-Topic-Based.ipynb
- ✅ ML/Recommender Systems/Collaborative-Filtering-Recommender-Topic-Based.ipynb
- ✅ ML/Recommender Systems/Content-Based-Recommender-Topic-Based.ipynb
- ✅ ML/Regression/Multiple-Linear-Regression-Topic-Based.ipynb
- ✅ ML/Regression/Polynomial-Regression-Topic-Based.ipynb
- ✅ ML/Regression/Simple-Linear-Regression-Topic-Based.ipynb
- ✅ Data_Analysis/king-county-house-sales-analysis.ipynb
- ✅ NLP/Utils_and_Resources/Lab/Files/tf/C4W3_HF_Lab1_QA_BERT.ipynb
- ✅ NLP/Utils_and_Resources/Lab/Files/tf/.ipynb_checkpoints/C4W3_HF_Lab1_QA_BERT-checkpoint.ipynb
- ✅ All notebooks now have valid JSON structure
- ✅ Test conversions to HTML are successful
- ✅ No more widget metadata found in any notebooks
- ✅ GitHub Actions workflow should now complete without widget-related errors
fix_notebook_widgets.py- Python script used to fix all notebooks automatically
The GitHub Actions workflow should now run successfully without the widget metadata errors. All 23 notebooks can be converted to HTML format without issues.