Ë
    Ìi½  ã                   óx   — d dl mZmZmZmZmZ d dlmZmZ d dl	m
Z
 d dlmZmZmZmZ  G d„ dee   ee   «      Zy)é    )ÚDictÚGenericÚListÚSequenceÚSet)ÚSemanticManifestTÚ	TimeSpine)ÚTimeGranularity)ÚSemanticManifestValidationRuleÚValidationIssueÚValidationWarningÚvalidate_safelyc                   óH   — e Zd ZdZe ed¬«      dedee   fd„«       «       Z	y)ÚTimeSpineRulez0Checks that time spines are configured properly.z=running model validation to ensure that time spines are valid)Úwhats_being_doneÚsemantic_manifestÚreturnc                 ó@  — g }| j                   s|S | j                  j                  }|s|S i }t        «       }|D ]Z  }|j                  j
                  }||v r||   j                  |«       n|g||<   t        ||   «      dkD  sŒJ|j                  |«       Œ\ |r[i }|D ]6  }||   D �cg c]  }|j                  j                  ‘Œ c}||j                  <   Œ8 |j                  t        d|› �¬«      «       | j                   D ��	ch c]5  }|j                  D ]$  }	|	j                  r|	j                  j
                  ’Œ& Œ7 }
}}	t        |
«      }t        |j!                  «       «      }||k  r+|j                  t        d|j                  › d|› �¬«      «       |S c c}w c c}	}w )a]  Validate time spine configs.

        Note that some validation happens separately in the core parser before building this object:
        - error if no time spine configured and legacy time spine model doeesn't exist
        - error if granularity is missing for primary column
        - error if primary column does not exist in the model
        é   zBOnly one time spine is supported per granularity. Got duplicates: )Úmessagez¤To avoid unexpected query errors, configuring a time spine at or below the smallest time dimension granularity is recommended. Smallest time dimension granularity: z#; Smallest time spine granularity: )Úsemantic_modelsÚproject_configurationÚtime_spinesÚsetÚprimary_columnÚtime_granularityÚappendÚlenÚaddÚnode_relationÚrelation_nameÚnamer   Ú
dimensionsÚtype_paramsÚminÚkeys)r   Úissuesr   Útime_spines_by_granularityÚ'granularities_with_multiple_time_spinesÚ
time_spineÚgranularityÚ!duplicate_granularity_time_spinesÚsemantic_modelÚ	dimensionÚdimension_granularitiesÚsmallest_dim_granularityÚsmallest_time_spine_granularitys                úp/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/dbt_semantic_interfaces/validations/time_spines.pyÚvalidate_manifestzTimeSpineRule.validate_manifest   sé  € ð )+ˆà ×0Ò0ØˆMà'×=Ñ=×IÑIˆÙØˆMð NPÐ"ÜHKËÐ/Ø%ò 	IˆJØ$×3Ñ3×DÑDˆKØÐ8Ñ8Ø*¨;Ñ7×>Ñ>¸zÕJà;E¸,Ð*¨;Ñ7ÜÐ-¨kÑ:Ó;¸aÓ?Ø7×;Ñ;¸KÕHð	Iñ 3ØFHÐ-ØFò �àMgÐhsÑMtöGØ?I�J×,Ñ,×:Ó:òGÐ1°+×2BÑ2BÒCðð �M‰MÜ!Ø`Ø8Ð9ð;ôôð #4×"CÑ"C÷#
àØ+×6Ñ6ò#
ð Ø×$Ò$ð ×!Ñ!×2Ó2ð#
Ø2ð#
Ðñ #
ô $'Ð'>Ó#?Ð Ü*-Ð.H×.MÑ.MÓ.OÓ*PÐ'Ø#Ð&EÒEØ�M‰MÜ!ðbà/×4Ñ4Ð5Ð5XØ6Ð7ð9ôôð ˆùò;Gùó#
s   Â&FÄ:FN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr   r   r   r   r3   © ó    r2   r   r      s:   „ Ù:àÙÐ&eÔfð=Ð->ð =À8ÈOÑC\ò =ó gó ñ=r:   r   N)Útypingr   r   r   r   r   Ú!dbt_semantic_interfaces.protocolsr   r	   Ú"dbt_semantic_interfaces.type_enumsr
   Ú5dbt_semantic_interfaces.validations.validator_helpersr   r   r   r   r   r9   r:   r2   ú<module>r?      s8   ðß 5Õ 5ç JÝ >÷ó ôBÐ2Ð3DÑEÀwÐO`ÑGaõ Br:   