richardfogaca opened a new issue, #38852:
URL: https://github.com/apache/superset/issues/38852

   ### Bug description
   
   When creating a new dataset via `POST /api/v1/dataset/` with the 
`currency_code_column` field, the API returns:
   
   ```json
   {
     "message": {
       "currency_code_column": ["Unknown field."]
     }
   }
   ```
   
   However, updating an existing dataset via `PUT /api/v1/dataset/<id>` with 
the same field works correctly.
   
   ### How to reproduce
   
   1. Send a POST request to `/api/v1/dataset/` with `currency_code_column` in 
the payload:
   
   ```bash
   curl -X POST '/api/v1/dataset/' \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
       "database": 1,
       "table_name": "my_table",
       "schema": "public",
       "currency_code_column": "currency_code"
     }'
   ```
   
   2. Observe the `Unknown field` error for `currency_code_column`.
   
   ### Expected results
   
   The `currency_code_column` field should be accepted on dataset creation, 
just as it is on dataset update.
   
   ### Actual results
   
   ```json
   {"message": {"currency_code_column": ["Unknown field."]}}
   ```
   
   ### Root cause
   
   The `currency_code_column` field was added to `DatasetPutSchema` but was 
missed in `DatasetPostSchema` in `superset/datasets/schemas.py`. The DB 
migration (`9787190b3d89`) and the model (`SqlaTable.currency_code_column`) are 
correct.
   
   ### Environment
   
   - superset version: master


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to