chore(style): Enforce optional chaining (#21614)

This commit is contained in:
Evan Rusackas
2022-10-03 08:17:20 -07:00
committed by GitHub
parent 3edc656f20
commit 4245bc3f38
40 changed files with 83 additions and 114 deletions

View File

@@ -151,13 +151,12 @@ const DndFilterSelect = (props: DndFilterSelectProps) => {
endpoint: `/api/v1/database/${dbId}/table_extra/${name}/${schema}/`,
})
.then(({ json }: { json: Record<string, any> }) => {
if (json && json.partitions) {
if (json?.partitions) {
const { partitions } = json;
// for now only show latest_partition option
// when table datasource has only 1 partition key.
if (
partitions &&
partitions.cols &&
partitions?.cols &&
Object.keys(partitions.cols).length === 1
) {
setPartitionColumn(partitions.cols[0]);