Skip to content

fix(dataset): add missing currency_code_column to DatasetPostSchema#38853

Open
richardfogaca wants to merge 5 commits intoapache:masterfrom
richardfogaca:fix/dataset-post-missing-currency-code-column
Open

fix(dataset): add missing currency_code_column to DatasetPostSchema#38853
richardfogaca wants to merge 5 commits intoapache:masterfrom
richardfogaca:fix/dataset-post-missing-currency-code-column

Conversation

@richardfogaca
Copy link
Contributor

@richardfogaca richardfogaca commented Mar 25, 2026

User description

SUMMARY

The currency_code_column field was added to DatasetPutSchema (update) but was missed in DatasetPostSchema (create) in superset/datasets/schemas.py.

This caused the API to reject currency_code_column with "Unknown field." when creating a new dataset via POST /api/v1/dataset/, while accepting it on PUT /api/v1/dataset/<id>.

Fixes #38852

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

POST /api/v1/dataset/ with currency_code_column
→ {"message": {"currency_code_column": ["Unknown field."]}}

After:

POST /api/v1/dataset/ with currency_code_column
→ 201 Created (field accepted)

TESTING INSTRUCTIONS

  1. Send a POST request to /api/v1/dataset/ including "currency_code_column": "some_column" in the JSON body.
  2. Verify the field is accepted and no Unknown field error is returned.
  3. Verify PUT /api/v1/dataset/<id> with currency_code_column still works as before.

ADDITIONAL INFORMATION


CodeAnt-AI Description

Accept currency code column when creating a dataset

What Changed

  • Creating a dataset now accepts currency_code_column in the request body
  • This matches the field already accepted when updating an existing dataset
  • Requests no longer fail with an “Unknown field” error for this value during dataset creation

Impact

✅ Fewer dataset creation errors
✅ Consistent create and update behavior
✅ Clearer API responses for dataset setup

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Mar 25, 2026

Code Review Agent Run #067b1b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 9706564..9706564
    • superset/datasets/schemas.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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

@dosubot dosubot bot added api Related to the REST API data:dataset Related to dataset configurations labels Mar 25, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Mar 25, 2026
@codeant-ai-for-open-source
Copy link
Contributor

Sequence Diagram

This PR updates dataset creation validation to include currency code column, matching update behavior. A create request that includes this field now passes schema validation and proceeds to dataset creation.

sequenceDiagram
    participant Client
    participant DatasetAPI
    participant DatasetPostSchema
    participant DatasetService

    Client->>DatasetAPI: Create dataset with currency code column
    DatasetAPI->>DatasetPostSchema: Validate request fields
    DatasetPostSchema-->>DatasetAPI: Valid including currency code column
    DatasetAPI->>DatasetService: Create dataset with provided fields
    DatasetService-->>Client: Created response 201
Loading

Generated by CodeAnt AI

@richardfogaca richardfogaca self-assigned this Mar 25, 2026
@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.19%. Comparing base (16f5a2a) to head (4b78f34).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #38853      +/-   ##
==========================================
- Coverage   65.54%   64.19%   -1.36%     
==========================================
  Files        1823     2532     +709     
  Lines       73154   130091   +56937     
  Branches    23437    30029    +6592     
==========================================
+ Hits        47951    83511   +35560     
- Misses      25203    45114   +19911     
- Partials        0     1466    +1466     
Flag Coverage Δ
hive 40.38% <100.00%> (?)
mysql 61.31% <100.00%> (?)
postgres 61.40% <100.00%> (?)
presto 40.40% <100.00%> (?)
python 63.00% <100.00%> (?)
sqlite 61.02% <100.00%> (?)
unit 100.00% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

@netlify
Copy link

netlify bot commented Mar 25, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 967ce65
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69c42702bc0c7b00088663e2
😎 Deploy Preview https://deploy-preview-38853--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions github-actions bot removed the api Related to the REST API label Mar 25, 2026
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Mar 25, 2026

Code Review Agent Run #78cc5c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 9706564..4b78f34
    • tests/unit_tests/datasets/schema_tests.py
    • tests/integration_tests/datasets/api_tests.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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

data:dataset Related to dataset configurations size/M size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

currency_code_column rejected as 'Unknown field' when creating a dataset via API

1 participant