-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[deploy] 0.2.4 - Dev: performance update & data loader improvement #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…emove-redundant-code remove redundant code
Added PostgreSQL dataloade
PostgreSQL support
Adding support for MSSQL data loader
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ime-format-in-kusto
…tables-and-fix-datetime-format-in-kusto [Kusto] add filter tables and fix datetime format
| try: | ||
| df = pd.DataFrame(json.loads(raw_data)) | ||
| except Exception as e: | ||
| return jsonify({"status": "error", "message": f"Invalid JSON data: {str(e)}, it must be in the format of a list of dictionaries"}), 400 |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
To fix the issue, we will replace the direct inclusion of the exception message (str(e)) in the response with a generic error message. The detailed exception message will be logged on the server for debugging purposes. This ensures that sensitive information is not exposed to the user while still allowing developers to diagnose issues using the logs.
Specifically:
- Replace the direct use of
str(e)in the response with a generic message like "Invalid JSON data provided." - Log the detailed exception message (
str(e)) on the server using the existing logger.
-
Copy modified lines R319-R320
| @@ -318,3 +318,4 @@ | ||
| except Exception as e: | ||
| return jsonify({"status": "error", "message": f"Invalid JSON data: {str(e)}, it must be in the format of a list of dictionaries"}), 400 | ||
| logger.error(f"Invalid JSON data: {str(e)}") | ||
| return jsonify({"status": "error", "message": "Invalid JSON data provided. It must be in the format of a list of dictionaries."}), 400 | ||
|
|
|
This pull request introduces several updates across multiple files to enhance functionality, improve logging, and refine the development experience. Key changes include updates to data loaders, improved logging mechanisms, and modifications to the application startup process. Data Loader Enhancements:
Logging Improvements:
Application Startup Modifications:
Dependency Updates:
Additional Changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances front-end performance via memoization and selector optimizations, integrates SSE for real-time updates, and improves data loader and UI components.
- Refactor chart rendering with
dfSelectors.getAllCharts,useMemo, andmemoto reduce unnecessary re-renders - Add SSE client/server support for real-time data formulation updates
- Update dialogs, grids, and snackbars with new slotProps, cleaner layouts, and raw data syncing
Reviewed Changes
Copilot reviewed 40 out of 42 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/views/VisualizationView.tsx | Refactored chart skeleton utility and menu layout; switched to memoized selectors |
| src/views/MessageSnackbar.tsx | Grouped system messages, added expand/collapse and count UI |
| src/views/DataThread.tsx | Memoized chart elements and integrated pending SSE status |
| src/app/dfSlice.tsx | Added SSE message handling state and selector utilities |
| py-src/data_formulator/tables_routes.py | Extended table creation endpoint for raw_data and sanitization |
Comments suppressed due to low confidence (2)
src/views/DataThread.tsx:728
_.isEqualis used without importing lodash. Addimport _ from 'lodash';or replace with another deep-equality check.
_.isEqual(prevProps.chart.encodingMap, nextProps.chart.encodingMap) &&
py-src/data_formulator/tables_routes.py:71
- You reference
pd.DataFrame()but pandas (pd) is not imported at the top of this file. Addimport pandas as pd.
sample_rows = db.execute(f"SELECT * FROM {table_name} LIMIT 1000").fetchdf() if row_count > 0 else pd.DataFrame()
|
Huge thanks to all contributors to this PR! |
Improves front-end performance, data loader utility, and prepares functionality for the next updates.