Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje committed Feb 7, 2022
1 parent 1503925 commit 18ebae0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const RowCount = ({

enum FormatPickerValue {
Formatted,
Epoch,
Original,
}

const FormatPicker = ({
Expand All @@ -129,7 +129,7 @@ const FormatPicker = ({
}) => (
<Radio.Group value={value} onChange={onChange}>
<Space direction="vertical">
<Radio value={FormatPickerValue.Epoch}>{t('Original value')}</Radio>
<Radio value={FormatPickerValue.Original}>{t('Original value')}</Radio>
<Radio value={FormatPickerValue.Formatted}>{t('Formatted date')}</Radio>
</Space>
</Radio.Group>
Expand Down Expand Up @@ -167,7 +167,10 @@ const DataTableTemporalHeaderCell = ({
if (!datasourceId) {
return;
}
if (e.target.value === FormatPickerValue.Epoch && isColumnTimeFormatted) {
if (
e.target.value === FormatPickerValue.Original &&
isColumnTimeFormatted
) {
dispatch(
unsetTimeFormattedColumn(datasourceId, timeFormattedColumnIndex),
);
Expand Down Expand Up @@ -204,7 +207,7 @@ const DataTableTemporalHeaderCell = ({
value={
isColumnTimeFormatted
? FormatPickerValue.Formatted
: FormatPickerValue.Epoch
: FormatPickerValue.Original
}
/>
</FormatPickerContainer>
Expand Down
2 changes: 1 addition & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def get_raw_results(self, viz_obj: BaseViz) -> FlaskResponse:
return self.json_response(
{
"data": payload["df"].to_dict("records"),
"colnames": payload["colnames"],
"colnames": payload.get("colnames"),
"coltypes": payload.get("coltypes"),
},
)
Expand Down
2 changes: 1 addition & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def get_samples(self) -> Dict[str, Any]:
payload = self.get_df_payload(query_obj) # leverage caching logic
return {
"data": payload["df"].to_dict(orient="records"),
"colnames": payload["colnames"],
"colnames": payload.get("colnames"),
"coltypes": payload.get("coltypes"),
}

Expand Down

0 comments on commit 18ebae0

Please sign in to comment.