diff --git a/iox_catalog/src/interface.rs b/iox_catalog/src/interface.rs index 627ba6758f..f8c899d1f4 100644 --- a/iox_catalog/src/interface.rs +++ b/iox_catalog/src/interface.rs @@ -146,11 +146,6 @@ pub enum Error { #[snafu(display("could not delete namespace: {source}"))] CouldNotDeleteNamespace { source: sqlx::Error }, - - #[snafu(display("invalid partition template: {source}"))] - InvalidPartitionTemplate { - source: data_types::partition_template::ValidationError, - }, } /// A specialized `Error` for Catalog errors diff --git a/iox_catalog/src/lib.rs b/iox_catalog/src/lib.rs index 9430a37cf5..d58d367e88 100644 --- a/iox_catalog/src/lib.rs +++ b/iox_catalog/src/lib.rs @@ -227,9 +227,10 @@ where table_name, // This table is being created implicitly by this write, so there's no // possibility of a user-supplied partition template here, which is why there's - // a hardcoded `None`. + // a hardcoded `None`. If there is a namespace template, it must be valid because + // validity was checked during its creation, so that's why there's an `expect`. TablePartitionTemplateOverride::try_new(None, namespace_partition_template) - .map_err(|source| Error::InvalidPartitionTemplate { source })?, + .expect("no table partition template; namespace partition template has been validated"), namespace_id, ) .await;