Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(native-filters): Assume that temporal columns exist if column_types is undefined #15324

Merged
merged 2 commits into from Jun 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -275,9 +275,10 @@ const FILTER_TYPE_NAME_MAPPING = {
};

// TODO: add column_types field to DatasourceMeta
// We return true if column_types is undefined as a precaution against backend failing to return column_types
const hasTemporalColumns = (
dataset: DatasourceMeta & { column_types: GenericDataType[] },
) => dataset?.column_types?.includes(GenericDataType.TEMPORAL);
) => dataset?.column_types?.includes(GenericDataType.TEMPORAL) ?? true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make it even more bulletproof by checking for length of column_types? Something like !dataset?.column_types?.length || dataset?.column_types?.includes(GenericDataType.TEMPORAL)? The reason is I suspect the Druid connector might return an empty array.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍


/**
* The configuration form for a specific filter.
Expand Down