Skip to content

Commit

Permalink
fix(datasource): saving new calculated columns (#23783)
Browse files Browse the repository at this point in the history
  • Loading branch information
Always-prog committed Apr 24, 2023
1 parent 71106cf commit 742c2cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
),
columns: currentDatasource?.columns?.map(
(column: Record<string, unknown>) => ({
id: column.id,
id: typeof column.id === 'number' ? column.id : undefined,
column_name: column.column_name,
type: column.type,
advanced_data_type: column.advanced_data_type,
Expand Down
2 changes: 1 addition & 1 deletion superset/datasets/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def validate_python_date_format(value: str) -> None:


class DatasetColumnsPutSchema(Schema):
id = fields.Integer()
id = fields.Integer(required=False)
column_name = fields.String(required=True, validate=Length(1, 255))
type = fields.String(allow_none=True)
advanced_data_type = fields.String(allow_none=True, validate=Length(1, 255))
Expand Down

0 comments on commit 742c2cd

Please sign in to comment.