diff --git a/src/datarepo/core/tables/metadata.py b/src/datarepo/core/tables/metadata.py index 617c130..f43ee29 100644 --- a/src/datarepo/core/tables/metadata.py +++ b/src/datarepo/core/tables/metadata.py @@ -23,6 +23,7 @@ class TableMetadata: class TablePartition(TypedDict): column_name: str + operator: str type_annotation: str value: Any diff --git a/src/datarepo/core/tables/parquet_table.py b/src/datarepo/core/tables/parquet_table.py index c2c45fe..d26ba4d 100644 --- a/src/datarepo/core/tables/parquet_table.py +++ b/src/datarepo/core/tables/parquet_table.py @@ -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, ) diff --git a/src/datarepo/export/static_site/src/lib/codegen.ts b/src/datarepo/export/static_site/src/lib/codegen.ts index d675e9d..ab64322 100644 --- a/src/datarepo/export/static_site/src/lib/codegen.ts +++ b/src/datarepo/export/static_site/src/lib/codegen.ts @@ -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})`) } /* diff --git a/src/datarepo/export/static_site/src/lib/types.ts b/src/datarepo/export/static_site/src/lib/types.ts index 936f9e4..e8393ca 100644 --- a/src/datarepo/export/static_site/src/lib/types.ts +++ b/src/datarepo/export/static_site/src/lib/types.ts @@ -1,5 +1,6 @@ export interface ExportedTablePartition { column_name: string + operator: string type_annotation: string | null value: string | number }