Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/datarepo/core/tables/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class TableMetadata:

class TablePartition(TypedDict):
column_name: str
operator: str
type_annotation: str
value: Any

Expand Down
1 change: 1 addition & 0 deletions src/datarepo/core/tables/parquet_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def get_schema(self) -> TableSchema:
partitions = [
TablePartition(
column_name=filter.column,
operator=filter.operator,
type_annotation=type(filter.value).__name__,
value=filter.value,
)
Expand Down
2 changes: 1 addition & 1 deletion src/datarepo/export/static_site/src/lib/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function genTableCode({ catalog, database, table, formatSqlFilter }: GenT

for (const partition of table.partitions) {
const value = isStringPartition(partition) ? `"${partition.value}"` : partition.value
filters.push(`Filter("${partition.column_name}", "=", ${value})`)
filters.push(`Filter("${partition.column_name}", "${partition.operator}", ${value})`)
}

/*
Expand Down
1 change: 1 addition & 0 deletions src/datarepo/export/static_site/src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface ExportedTablePartition {
column_name: string
operator: string
type_annotation: string | null
value: string | number
}
Expand Down
Loading