Enhance frontend dashboard UX and backend SDK with improved error handling and type hints#699
Conversation
|
Hi team! |
| # Measure and log query execution time for performance monitoring | ||
| start_time = time.time() | ||
| df_result = service.data_manager.query(sql, source_name) | ||
| elapsed_time = time.time() - start_time |
There was a problem hiding this comment.
This should probably be removed since its not used
| if (!components || !components.rows) { | ||
| return ( | ||
| <div className="dashboard-loading-container"> | ||
| <LoadingState |
There was a problem hiding this comment.
Doesn't seem wise to remove loadingstate component
| customText={!components ? 'Loading components' : 'Invalid components data'} | ||
| /> | ||
| <div className="dashboard-empty"> | ||
| <p className="dashboard-empty-text"> |
There was a problem hiding this comment.
I think the existing loadingstate component is good
| <div className="dashboard-empty"> | ||
| <p className="dashboard-empty-text">No components to display</p> | ||
| <p className="dashboard-empty-text"> | ||
| No components to display. Try running a query or verifying your configuration settings. |
| return df_result | ||
| except Exception as e: | ||
| logger.error(f"Error querying data source: {e}") | ||
| return None |
There was a problem hiding this comment.
imo, should error out instead of returning None
name: Pull Request
about: Create a pull request to contribute to the project
title: 'This PR improves the developer and user experience in Preswald apps across both frontend and backend layers.
'
labels: ''
assignees: ''
Related Issue
Also github issue Fix #698
Description of Changes
This pull request introduces UX and SDK improvements that enhance the developer and user experience.
Frontend (
Dashboard.jsx):components.rowsbeing undefined or emptyBackend SDK (
interfaces/):connect(),query(), andget_df()functionsType of Change
Testing
componentsstate and observed fallback messagingChecklist