Skip to content

[ui-importer] Public API integration #4137

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

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft

Conversation

ramprasadagarwal
Copy link
Collaborator

What changes were proposed in this pull request?

  • (Please fill in changes proposed in this fix)

How was this patch tested?

  • (Please explain how this patch was tested. Ex: unit tests, manual tests)
  • (If this patch involves UI changes, please attach a screen-shot; otherwise, remove this)

Please review Hue Contributing Guide before opening a pull request.

Harshg999 and others added 12 commits April 25, 2025 18:44
Improves file handling with dedicated metadata detection API:
- Adds API error handler decorator for consistent error responses
- Introduces libmagic for more reliable file type detection
- Separates upload and metadata detection functionality
- Adds support for TSV files and multiple sheet Excel detection
- Enhances metadata output with column types and sample data

Removes commented-out legacy format detection code
Adds new endpoint for file metadata detection functionality
Introduces python-magic library for file type detection
Adds polars with calamine support for enhanced data handling

Updates URL pattern for file upload endpoint to be more precise with trailing slash handling
Extracts file processing logic into a separate operation module
Adds TSV to supported file formats
Updates API documentation with clearer descriptions

The change simplifies the upload endpoint by moving file handling logic
to a dedicated operation, making the code more maintainable and
easier to test.
Changes the file metadata detection endpoint to be more efficient and accurate:
- Renames endpoint from 'detect_metadata' to 'guess_metadata'
- Switches to GET method and improves parameter handling
- Optimizes file reading by using sampling instead of full file loads
- Simplifies metadata response to include only essential information
- Adds support for both local and remote file systems
- Improves memory usage by using file streams and BytesIO

The changes make the API more RESTful and improve performance for large files by using content sampling.
Changes request data source from body to query params for file metadata
Adds proper UTF-8 decoding for file samples
Enhances error logging with full stack traces

Improves robustness of CSV/delimited file handling by properly handling byte streams
Removes unnecessary file existence check that could cause false negatives
Enhances file type detection reliability by:
- Adding proper error handling for python-magic import
- Removing dependency on file extensions for type detection
- Simplifying delimiter-based file format detection logic
- Improving error messaging when magic lib is unavailable

Makes file type detection more robust and maintainable by focusing on content analysis rather than extensions.
Implements new preview endpoint to support file imports with:
- Excel file preview with sheet selection
- Delimited file preview (CSV, TSV) with configurable separators
- SQL type mapping for multiple dialects (Hive, Impala, Trino, Phoenix, SparkSQL)
- Automatic header detection
- Error handling improvements for file processing

Enhances the importer API with robust data preview capabilities before import
@ramprasadagarwal ramprasadagarwal changed the base branch from master to new-importer-working-dir May 6, 2025 15:20
Copy link

github-actions bot commented May 6, 2025

✅ Test files were modified. Ensure that the tests cover all relevant changes. ✅

Harshg999 added 10 commits May 6, 2025 20:57
Improves file handling with dedicated metadata detection API:
- Adds API error handler decorator for consistent error responses
- Introduces libmagic for more reliable file type detection
- Separates upload and metadata detection functionality
- Adds support for TSV files and multiple sheet Excel detection
- Enhances metadata output with column types and sample data

Removes commented-out legacy format detection code
Adds new endpoint for file metadata detection functionality
Introduces python-magic library for file type detection
Adds polars with calamine support for enhanced data handling

Updates URL pattern for file upload endpoint to be more precise with trailing slash handling
Extracts file processing logic into a separate operation module
Adds TSV to supported file formats
Updates API documentation with clearer descriptions

The change simplifies the upload endpoint by moving file handling logic
to a dedicated operation, making the code more maintainable and
easier to test.
Changes the file metadata detection endpoint to be more efficient and accurate:
- Renames endpoint from 'detect_metadata' to 'guess_metadata'
- Switches to GET method and improves parameter handling
- Optimizes file reading by using sampling instead of full file loads
- Simplifies metadata response to include only essential information
- Adds support for both local and remote file systems
- Improves memory usage by using file streams and BytesIO

The changes make the API more RESTful and improve performance for large files by using content sampling.
Changes request data source from body to query params for file metadata
Adds proper UTF-8 decoding for file samples
Enhances error logging with full stack traces

Improves robustness of CSV/delimited file handling by properly handling byte streams
Removes unnecessary file existence check that could cause false negatives
Enhances file type detection reliability by:
- Adding proper error handling for python-magic import
- Removing dependency on file extensions for type detection
- Simplifying delimiter-based file format detection logic
- Improving error messaging when magic lib is unavailable

Makes file type detection more robust and maintainable by focusing on content analysis rather than extensions.
Implements new preview endpoint to support file imports with:
- Excel file preview with sheet selection
- Delimited file preview (CSV, TSV) with configurable separators
- SQL type mapping for multiple dialects (Hive, Impala, Trino, Phoenix, SparkSQL)
- Automatic header detection
- Error handling improvements for file processing

Enhances the importer API with robust data preview capabilities before import
@Harshg999 Harshg999 force-pushed the new-importer-working-dir branch from 92bb7d1 to 5ed73c2 Compare May 6, 2025 15:29
Copy link

github-actions bot commented May 6, 2025

@ramprasadagarwal ramprasadagarwal self-assigned this May 7, 2025
Harshg999 added 8 commits May 12, 2025 17:12
Improves file handling with dedicated metadata detection API:
- Adds API error handler decorator for consistent error responses
- Introduces libmagic for more reliable file type detection
- Separates upload and metadata detection functionality
- Adds support for TSV files and multiple sheet Excel detection
- Enhances metadata output with column types and sample data

Removes commented-out legacy format detection code
Adds new endpoint for file metadata detection functionality
Introduces python-magic library for file type detection
Adds polars with calamine support for enhanced data handling

Updates URL pattern for file upload endpoint to be more precise with trailing slash handling
Extracts file processing logic into a separate operation module
Adds TSV to supported file formats
Updates API documentation with clearer descriptions

The change simplifies the upload endpoint by moving file handling logic
to a dedicated operation, making the code more maintainable and
easier to test.
Changes the file metadata detection endpoint to be more efficient and accurate:
- Renames endpoint from 'detect_metadata' to 'guess_metadata'
- Switches to GET method and improves parameter handling
- Optimizes file reading by using sampling instead of full file loads
- Simplifies metadata response to include only essential information
- Adds support for both local and remote file systems
- Improves memory usage by using file streams and BytesIO

The changes make the API more RESTful and improve performance for large files by using content sampling.
Changes request data source from body to query params for file metadata
Adds proper UTF-8 decoding for file samples
Enhances error logging with full stack traces

Improves robustness of CSV/delimited file handling by properly handling byte streams
Removes unnecessary file existence check that could cause false negatives
Enhances file type detection reliability by:
- Adding proper error handling for python-magic import
- Removing dependency on file extensions for type detection
- Simplifying delimiter-based file format detection logic
- Improving error messaging when magic lib is unavailable

Makes file type detection more robust and maintainable by focusing on content analysis rather than extensions.
Implements new preview endpoint to support file imports with:
- Excel file preview with sheet selection
- Delimited file preview (CSV, TSV) with configurable separators
- SQL type mapping for multiple dialects (Hive, Impala, Trino, Phoenix, SparkSQL)
- Automatic header detection
- Error handling improvements for file processing

Enhances the importer API with robust data preview capabilities before import
@Harshg999 Harshg999 force-pushed the new-importer-working-dir branch from 5ed73c2 to 04bcf00 Compare May 12, 2025 11:48
@Harshg999 Harshg999 force-pushed the new-importer-working-dir branch from 7771b36 to f0d3ecb Compare May 19, 2025 15:49
@Harshg999 Harshg999 force-pushed the new-importer-working-dir branch from 583a86d to 708e75a Compare May 28, 2025 19:42
Base automatically changed from new-importer-working-dir to master May 30, 2025 10:32
Copy link

github-actions bot commented Jun 6, 2025

UI Coverage Report

Lines Statements Branches Functions
Coverage: 32%
39.15% (30527/77959) 31.01% (14247/45936) 23.89% (2130/8915)

Copy link

github-actions bot commented Jun 6, 2025

Python Code Coverage

Python Coverage Report •
FileStmtsMissCoverMissing
TOTAL541852707850% 
report-only-changed-files is enabled. No files were changed during this commit :)

Pytest Report

Tests Skipped Failures Errors Time
1186 106 💤 0 ❌ 0 🔥 6m 0s ⏱️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants