Repository navigation
fix(uploads): skip folder and system entries in columnar ZIP uploads - #45617
Merged
Merged
Conversation
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #45617 +/- ##
==========================================
- Coverage 85.66% 85.65% -0.02%
==========================================
Files 3111 3108 -3
Lines 214938 214750 -188
Branches 50908 50794 -114
==========================================
- Hits 184136 183949 -187
- Misses 27381 27385 +4
+ Partials 3421 3416 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The columnar reader now raises "ZIP file contains no data files" through _(), so the committed template has to carry it for check_pot_drift.
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
jprinet
added a commit
to jprinet/superset
that referenced
this pull request
Nov 23, 2026
* origin/master: (393 commits) fix(a11y): name the semantic view description input (apache#46458) docs(semantic): explain datasource list modification eligibility (apache#46462) docs(semantic-layer): document NULL-preserving exclusion filters (apache#46447) fix(uploads): skip folder and system entries in columnar ZIP uploads (apache#45617) fix(i18n-es): promote 47 of the zero-context backfill entries (apache#45847) fix(mcp): return structured ChartError on SQLAlchemyError in get_chart_sql (apache#44351) fix(datasets): follow semantic view modification permissions (apache#46448) fix(docker): account for container memory limits in frontend-mem-nag.sh (apache#46373) fix(reports): carry the report's native filters in the email and Slack link (apache#46062) fix(explore): apply the dataset timezone to grained temporal filter values (apache#46175) fix(i18n): enforce the do-not-translate registry across the catalogs (apache#45974) chore(logging): log unparseable virtual dataset SQL at debug in the RLS lookup (apache#46139) fix(i18n): split parameter-suggestion plural into two messages (apache#46049) test(partition-mapping): cover Hive/Impala mirrored SQL, cache outage and migration (apache#46319) perf(dashboard): look up the dashboard once per filter_state read (apache#46314) fix(i18n): load the dayjs locale for every language with a catalog (apache#45982) test(semantic-layer): make date export parametrization deterministic (apache#46449) fix(oauth2): idempotent OAuth2 completion and resilient listener (apache#40292) fix(explore): prevent full table scan when SQL expression is used as x-axis (apache#41339) feat(mcp): radar chart type plugin (apache#43571) ... # Conflicts: # .github/workflows/docker.yml # .github/workflows/superset-frontend.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
A columnar (Parquet) upload accepts a ZIP of several files.
ColumnarReader._yield_filescollected the suffix of every name in the archive and refused the upload when it found more than one, and then read every name as a Parquet file. A ZIP made from a folder holds more names than its data files, so these uploads failed:zip -r sales.zip saleswrites a folder entrysales/, whose suffix is empty.ditto -c -k --sequesterRsrc --keepParent sales sales.zipalso writes__MACOSX/folders and an AppleDouble__MACOSX/sales/._<name>entry next to each file with extended attributes..DS_Store, or marker files such as Spark's_SUCCESS.The two archives, built from a folder with two Parquet files:
On
master, both fail withZIP file contains multiple file types, infile_to_dataframe(the upload) and infile_metadata(the upload metadata endpoint). With this PR, both read the three rows of the two files.Changes:
_yield_filesreads only data entries. It skips folder entries and names that start with.or_. pyarrow's dataset discovery applies the same rule by default (ignore_prefixes=['.', '_']), and superset's import bundles skip the same names (is_valid_configinsuperset/commands/importers/v1/utils.py).ZIP file contains no data files. Onmaster, a ZIP that holds only a folder entry failed withParsing error: ... Parquet file size is 0 bytes, because the folder entry was read as a file, and an empty ZIP raised an unhandledValueError: No objects to concatenatefrompd.concat.TESTING INSTRUCTIONS
pytest tests/unit_tests/commands/databases/columnar_reader_test.py: 17 passed.test_columnar_reader_zip_of_a_folder,test_columnar_reader_zip_of_a_folder_metadataandtest_columnar_reader_zip_without_data_filesfail onmaster. The archive they use has folder entries,__MACOSXAppleDouble files,.DS_Storeand_SUCCESSaround two Parquet files.pytest tests/unit_tests/databases/api_test.py -k "columnar or upload": 90 passed.ruff check/ruff format(0.9.7) are clean, andpylintrates the file 10.00/10.mypy --check-untyped-defsreports one message incolumnar_reader.py, on the unchangedyield fileline (FileStoragevsIO[bytes]).masterreports the same message.To check by hand, put two Parquet files with the same columns in a folder, run
zip -r folder.zip folder, and uploadfolder.zipas a columnar file. On this branch both files load. Onmasterthe upload fails withZIP file contains multiple file types.ADDITIONAL INFORMATION