Skip to content

fix(uploads): skip folder and system entries in columnar ZIP uploads - #45617

Merged
rusackas merged 4 commits into
apache:masterfrom
L4XB:fix/columnar-zip-folder-entries
Nov 23, 2026
Merged

rusackas merged 4 commits into
apache:masterfrom
L4XB:fix/columnar-zip-folder-entries

Conversation

@L4XB

@L4XB L4XB commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

A columnar (Parquet) upload accepts a ZIP of several files. ColumnarReader._yield_files collected 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 sales writes a folder entry sales/, whose suffix is empty.
  • On macOS, ditto -c -k --sequesterRsrc --keepParent sales sales.zip also writes __MACOSX/ folders and an AppleDouble __MACOSX/sales/._<name> entry next to each file with extended attributes.
  • A folder can also hold .DS_Store, or marker files such as Spark's _SUCCESS.

The two archives, built from a folder with two Parquet files:

zip -r: ['sales/', 'sales/a.parquet', 'sales/b.parquet']
ditto:  ['sales/', 'sales/a.parquet', '__MACOSX/', '__MACOSX/sales/', '__MACOSX/sales/._a.parquet',
         'sales/b.parquet', '__MACOSX/sales/._b.parquet']

On master, both fail with ZIP file contains multiple file types, in file_to_dataframe (the upload) and in file_metadata (the upload metadata endpoint). With this PR, both read the three rows of the two files.

Changes:

  • _yield_files reads 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_config in superset/commands/importers/v1/utils.py).
  • The "multiple file types" check looks at the data entries only. A ZIP that mixes Parquet files with other data files is still refused.
  • A ZIP without any data entry now fails with ZIP file contains no data files. On master, a ZIP that holds only a folder entry failed with Parsing error: ... Parquet file size is 0 bytes, because the folder entry was read as a file, and an empty ZIP raised an unhandled ValueError: No objects to concatenate from pd.concat.

TESTING INSTRUCTIONS

  • pytest tests/unit_tests/commands/databases/columnar_reader_test.py: 17 passed.
  • New test_columnar_reader_zip_of_a_folder, test_columnar_reader_zip_of_a_folder_metadata and test_columnar_reader_zip_without_data_files fail on master. The archive they use has folder entries, __MACOSX AppleDouble files, .DS_Store and _SUCCESS around 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, and pylint rates the file 10.00/10. mypy --check-untyped-defs reports one message in columnar_reader.py, on the unchanged yield file line (FileStorage vs IO[bytes]). master reports 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 upload folder.zip as a columnar file. On this branch both files load. On master the upload fails with ZIP file contains multiple file types.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: aadf4002fce7

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.65%. Comparing base (f357ec3) to head (aadf400).
⚠️ Report is 7 commits behind head on master.

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     
Flag Coverage Δ
hive 34.00% <22.22%> (-0.01%) ⬇️
mysql 51.66% <22.22%> (-0.01%) ⬇️
postgres 51.70% <22.22%> (?)
presto 35.69% <22.22%> (-0.01%) ⬇️
python 88.30% <100.00%> (+<0.01%) ⬆️
sqlite 51.37% <22.22%> (-0.01%) ⬇️
unit 83.57% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The columnar reader now raises "ZIP file contains no data files" through _(), so the committed template has to carry it for check_pot_drift.
@github-actions github-actions Bot added the i18n Namespace | Anything related to localization label Oct 22, 2026
@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit a8d30d4
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ae2d0ef2c8e603fd36d2421
😎 Deploy Preview https://deploy-preview-45617--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @L4XB, LGTM! Nice to see the tests covering both the upload and the metadata path.

@rusackas
rusackas merged commit 11f4e38 into apache:master Nov 23, 2026
72 of 73 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n Namespace | Anything related to localization size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants