Profiler settings drawer white-screens instead of degrading on an unrecognised partitionIntervalType
Corrected after review. This was originally filed claiming the backend supports these interval types while the UI crashes on them. That framing was wrong — the UI's four-type restriction is intentional and correct. What remains is a small robustness gap plus a schema design smell. Severity downgraded accordingly; the original framing is preserved at the bottom for the record.
Affected module
UI (Data Quality / Profiler)
Describe the bug
ProfilerSettingsModal.tsx:157-166 indexes SUPPORTED_COLUMN_DATA_TYPE_FOR_INTERVAL with the stored partitionIntervalType and calls .includes() on the result without a guard:
const filter = partitionIntervalType
? SUPPORTED_COLUMN_DATA_TYPE_FOR_INTERVAL[partitionIntervalType]
: [];
if (filter.includes(column.dataType)) {
The map (profiler.constant.ts:314-320) covers four of the seven PartitionIntervalTypes members and is cast as Record<PartitionIntervalTypes, DataType[]>. For ENUM, INJECTED or OTHER the lookup yields undefined and .includes() throws TypeError: Cannot read properties of undefined (reading 'includes'). It runs in a useMemo during render, so the whole drawer fails to mount rather than degrading.
The four-type restriction is correct and deliberate — that is not the bug. partitionIntervalTypes is a single enum shared by two structures with different domains:
| Structure | Meaning | Values used |
|---|---|---|
tablePartition.columns[].intervalType |
the source table's discovered physical partitioning | includes OTHER (BigQuery), INJECTED (Athena) |
tableProfilerConfig.partitioning.partitionIntervalType |
the user's profiler sampling config — what this drawer edits | only the four the profiler can build a predicate for |
No ingestion path writes the extra three into a profiler config. sampler/partition.py:_handle_bigquery_partition maps only TIME_UNIT, INGESTION_TIME and INTEGER_RANGE, and for anything else logs Unknown partition type ... Cannot infer partition and returns None. validate_athena_injected_partitioning only requires that a user-defined profiler config exist for an INJECTED physical partition — it never writes INJECTED into one. Across the whole ingestion tree, intervalType= is only ever set on TablePartition, and ENUM is never emitted at all.
So the UI offers exactly the set the profiler supports. The only way to reach the crash is an API call setting a value the profiler could not have used anyway.
To Reproduce
Only reachable by hand-crafting the config; there is no product path to it. The API accepts the values (verified against a local 2.0.0-SNAPSHOT stack — all three return 200), and rendering the drawer against such a config throws:
ENUM ✕ TypeError: Cannot read properties of undefined (reading 'includes')
INJECTED ✕ TypeError: Cannot read properties of undefined (reading 'includes')
OTHER ✕ TypeError: Cannot read properties of undefined (reading 'includes')
INGESTION-TIME ✓ renders
Expected behavior
A config the UI does not recognise should not white-screen the drawer — fall back to an empty filter and show the stored value, so the user can see and correct it.
OS
macOS 15 (Darwin 25.6.0)
OpenMetadata version
2.0.0-SNAPSHOT (main)
Additional context
Two candidate fixes, in increasing order of value:
- Guard the lookup —
SUPPORTED_COLUMN_DATA_TYPE_FOR_INTERVAL[partitionIntervalType] ?? []. One line, removes the white-screen. - Drop the unsound cast — typing the map
Partial<Record<PartitionIntervalTypes, DataType[]>>makes the lookupDataType[] | undefinedand forces callers to handle the miss. Theas Record<...>is what asserts total coverage the map does not have. - Consider splitting the enum (the underlying smell). One enum serving both "physical partitioning we discovered" and "sampling strategy the profiler supports" is why a partial map looked total. A narrower
partitionProfilerIntervalTypesfor the profiler config would make the UI's restriction schema-enforced rather than a convention maintained by hand, and would let the generated types carry it into every language.
Given it is not reachable through the product, this is cleanup rather than a defect worth prioritising — filing so the unguarded lookup and the cast are on record.
Found while working on #32661 (a genuine data-loss defect in the same component); kept out of that PR to keep the diff focused.
Unrelated and much smaller, same file — ProfilerSettingsModal.tsx:621 sets partitionData: [''] in initialValues where partitionValues: [''] was intended. No field is named partitionData, so the key is inert: a COLUMN-VALUE config with no stored values renders zero value rows instead of one, and the user must click + before typing. Worth folding into whatever touches this file next.
Please assign this to me .
Closing this — I filed it, and on further checking it is not reachable through the product.
The four types the drawer offers are the four the profiler sampler can build a predicate for. That restriction is intentional and correct. partitionIntervalTypes is a single enum shared by two structures with different domains: tablePartition.columns[].intervalType (the source table's discovered physical partitioning, where OTHER and INJECTED legitimately appear) and tableProfilerConfig.partitioning.partitionIntervalType (the user's sampling config, which this drawer edits).
For the crash to happen, a table would need a stored profiler config carrying one of the unmapped types. Every path that could produce one is closed:
| Path | Result |
|---|---|
| The drawer's own dropdown | INTERVAL_TYPE_OPTIONS derives from the same 4-entry map |
| Ingestion → profiler config | _handle_bigquery_partition maps TIME_UNIT / INGESTION_TIME / INTEGER_RANGE; anything else logs Unknown partition type ... Cannot infer partition and returns None. validate_athena_injected_partitioning only requires that a user-defined profiler config exist for an INJECTED physical partition — it never writes INJECTED into one |
| Legacy data | Checked the pre-refactor version at c68a45e7d8^ (utils/partition.py) — structurally identical and equally guarded, so no upgraded installation carries such a config either |
Profiler workflow YAML partitionConfig |
Runtime-only input to the sampler; not persisted |
SDK create_or_update_table_profiler_config |
Defined but has no callers in the ingestion framework — the profiler never writes the config back |
Across the whole ingestion tree intervalType= is only ever set on TablePartition, and ENUM is never emitted at all.
The only way I reproduced the crash was writing the config directly with curl. That demonstrated I could construct the state, not that the product can reach it — which is what the original report conflated.
What is left is genuinely small: ProfilerSettingsModal.tsx:159 indexes the map without a guard, and profiler.constant.ts:320 casts a 4-entry map as Record<PartitionIntervalTypes, DataType[]>, which is what made a correct narrowing look like total coverage to tsc. Both are worth a ?? [] and a Partial<...> if anyone is already working in that file — not worth tracking separately.
Recording the design note for anyone who revisits this: if the profiler config had its own narrower enum rather than sharing one with tablePartition, the UI's restriction would be schema-enforced and carried into every generated language, instead of a convention maintained by hand.
No action needed. Ref #32661 / #33117, where this was originally noticed.