Skip to content

chore(importers): log field names instead of full config on validation failure#42399

Open
rusackas wants to merge 2 commits into
masterfrom
chore/import-validation-debug-log
Open

chore(importers): log field names instead of full config on validation failure#42399
rusackas wants to merge 2 commits into
masterfrom
chore/import-validation-debug-log

Conversation

@rusackas

Copy link
Copy Markdown
Member

SUMMARY

When schema validation fails during an import, the debug log dumps the entire parsed config dict. Those blobs can be enormous (inline example data, multi-line keys) and bury the actual validation error that's logged right above. This trims the debug line to the file name plus its top-level field names, which is what you actually need to correlate the failure.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A (log output only)

TESTING INSTRUCTIONS

pytest tests/unit_tests/commands/importers/v1/

With debug logging enabled, import a bundle with an invalid config and confirm the log shows the field-name list instead of the full config dump.

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

🤖 Generated with Claude Code

…n failure

The debug log dumped the entire parsed config dict when schema
validation failed. Those blobs can be enormous (inline example data,
multi-line keys) and bury the actual validation error logged just
above. Log the file name and its top-level field names instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rusackas
rusackas requested review from sadpandajoe and sha174n July 24, 2026 20:40
@dosubot dosubot Bot added the logging Creates a UI or API endpoint that could benefit from logging. label Jul 24, 2026
@bito-code-review

bito-code-review Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #49d1ab

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 0155015..0155015
    • superset/commands/importers/v1/utils.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset/commands/importers/v1/utils.py Fixed
@bito-code-review

Copy link
Copy Markdown
Contributor

The code change in superset/commands/importers/v1/utils.py addresses the security concern by removing the logging of the full config object, which could contain sensitive information. Instead, it now logs only the sorted list of field names present in the configuration. This change effectively mitigates the risk of clear-text logging of sensitive data while still providing useful debugging information.

superset/commands/importers/v1/utils.py

# Log field names only; full values can be huge (e.g. inline
                # example data) and drown out the validation error above.
                logger.debug(
                    "Config fields present in %s: %s", file_name, sorted(config)
                )

Comment thread superset/commands/importers/v1/utils.py Outdated
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.23%. Comparing base (83ea9a1) to head (9b85a06).
⚠️ Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
superset/commands/importers/v1/utils.py 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #42399      +/-   ##
==========================================
- Coverage   65.27%   65.23%   -0.04%     
==========================================
  Files        2795     2795              
  Lines      157555   157629      +74     
  Branches    36041    36056      +15     
==========================================
- Hits       102839   102837       -2     
- Misses      52739    52814      +75     
- Partials     1977     1978       +1     
Flag Coverage Δ
hive 38.39% <0.00%> (-0.04%) ⬇️
mysql 57.57% <50.00%> (-0.06%) ⬇️
postgres 57.61% <50.00%> (-0.07%) ⬇️
presto 40.31% <0.00%> (-0.05%) ⬇️
python 59.02% <50.00%> (-0.06%) ⬇️
sqlite 57.24% <50.00%> (-0.06%) ⬇️
unit 100.00% <ø> (ø)

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.

…ng and unsortable configs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bito-code-review

bito-code-review Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #c24ae3

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 0155015..9b85a06
    • superset/commands/importers/v1/utils.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logging Creates a UI or API endpoint that could benefit from logging. size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants