| 
40 | 40 | )  | 
41 | 41 | from pydiverse.pipedag.context.run_context import DeferredTableStoreOp  | 
42 | 42 | from pydiverse.pipedag.errors import CacheError  | 
43 |  | -from pydiverse.pipedag.materialize.details import resolve_materialization_details_label  | 
 | 43 | +from pydiverse.pipedag.materialize.details import BaseMaterializationDetails, resolve_materialization_details_label  | 
44 | 44 | from pydiverse.pipedag.materialize.materializing_task import MaterializingTask  | 
45 | 45 | from pydiverse.pipedag.materialize.metadata import (  | 
46 | 46 |     LazyTableMetadata,  | 
@@ -344,7 +344,7 @@ def __init__(  | 
344 | 344 | 
 
  | 
345 | 345 |         self.default_materialization_details = default_materialization_details  | 
346 | 346 | 
 
  | 
347 |  | -        self._set_materialization_details(materialization_details)  | 
 | 347 | +        self.materialization_details = self._create_materialization_details(materialization_details)  | 
348 | 348 | 
 
  | 
349 | 349 |         self.logger.info(  | 
350 | 350 |             "Initialized SQL Table Store",  | 
@@ -611,18 +611,27 @@ def drop_subquery_table(  | 
611 | 611 |     def check_materialization_details_supported(self, label: str | None) -> None:  | 
612 | 612 |         if label is None:  | 
613 | 613 |             return  | 
614 |  | -        error_msg = f"Materialization details are not supported for store {type(self).__name__}."  | 
 | 614 | +        if self.materialization_details and label in self.materialization_details:  | 
 | 615 | +            return  | 
 | 616 | +        msg = f"{label} is an unknown materialization details label."  | 
615 | 617 |         if self.strict_materialization_details:  | 
616 |  | -            raise ValueError(f"{error_msg} To silence this exception set strict_materialization_details=False")  | 
 | 618 | +            raise ValueError(f"{msg} To silence this exception set strict_materialization_details=False")  | 
617 | 619 |         else:  | 
618 |  | -            self.logger.warning(f"{error_msg}")  | 
 | 620 | +            self.logger.warning(msg)  | 
 | 621 | + | 
 | 622 | +    def _create_materialization_details(  | 
 | 623 | +        self, materialization_details: dict[str, dict[str | list[str]]] | None  | 
 | 624 | +    ) -> BaseMaterializationDetails | None:  | 
 | 625 | +        """This function causes an error or exception if materialization details are specified for a table  | 
 | 626 | +        store that does not support them.  | 
619 | 627 | 
  | 
620 |  | -    def _set_materialization_details(self, materialization_details: dict[str, dict[str | list[str]]] | None) -> None:  | 
 | 628 | +        Any table store that supports materialization details should override this method."""  | 
621 | 629 |         if materialization_details is not None or self.default_materialization_details is not None:  | 
622 |  | -            error_msg = f"{type(self).__name__} does not support materialization details."  | 
 | 630 | +            msg = f"{type(self).__name__} does not support materialization details."  | 
623 | 631 |             if self.strict_materialization_details:  | 
624 |  | -                raise TypeError(f"{error_msg} To suppress this exception, use strict_materialization_details=False")  | 
625 |  | -            self.logger.error(error_msg)  | 
 | 632 | +                raise ValueError(f"{msg} To silence this exception, use strict_materialization_details=False")  | 
 | 633 | +            self.logger.warning(msg)  | 
 | 634 | +        return None  # no materialization details object  | 
626 | 635 | 
 
  | 
627 | 636 |     def get_unlogged(self, materialization_details_label: str | None) -> bool:  | 
628 | 637 |         _ = materialization_details_label  | 
 | 
0 commit comments