Ë
    Ìi˜K  ã                  ó  — U d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 d dlm
Z
 d dlmZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZ d d	lmZ d d
lm Z m!Z!  ejD                  e#«      Z$ edee    ¬«      Z%eZ&de'd<    G d„ de(«      Z) G d„ de(«      Z*	 	 	 	 d&d„Z+d'd„Z,d(d„Z-d)d„Z.d)d„Z/d*d„Z0 G d„ de«      Z1 ede1¬«      Z2 G d„ d«      Z3 G d„ d«      Z4 G d „ d!«      Z5 e
d"¬#«       G d$„ d%«      «       Z6y)+é    )ÚannotationsN)ÚABC)Ú	NameError)Ú	dataclass)ÚEnum)ÚAnyÚClassVarÚDictÚOptionalÚSequenceÚSetÚTupleÚTypeÚTypeVarÚUnionÚget_argsÚ
get_originÚget_type_hints)Ú	TypeAlias)Úpformat_big_objects)Ú	BaseModelÚcreate_modelÚ	PydanticT)Úboundr   ÚAnyValueTypec                  ó   — e Zd ZdZy)ÚUnknownClassErrorzRRaised when there's an issue getting type information for a SerializableDataclass.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úp/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/dbt_semantic_interfaces/dataclass_serialization.pyr   r   )   s   „ Ù\àr$   r   c                  ó   — e Zd ZdZy)ÚDataclassDeserializationErrorz9Raised when there is any error deserializing a dataclass.Nr   r#   r$   r%   r'   r'   /   s   „ ÙCàr$   r'   c                ó<  — t        j                  | «      sJ ‚	 t        | i ¬«      }t        j                  | «      }|D �ci c]1  }|j                  t        ||j                     |j                  ¬«      “Œ3 c}S c c}w # t        $ r}t        d| › d�«      |‚d}~ww xY w)zbReturns the types of fields in a dataclass. Returns a dict from the name of the field to the type.)Úlocalns©Ú
field_typeÚdefault_valuez'Error getting type hints for dataclass zS. Please see the nested exception as a required class may not be imported properly.N)	ÚdataclassesÚis_dataclassr   ÚfieldsÚnameÚFieldDefinitionÚdefaultr   r   )Údataclass_typeÚ
type_hintsr/   ÚfieldÚes        r%   Ú _get_dataclass_field_definitionsr7   5   s²   € ô ×#Ñ# NÔ3Ð3Ð3ðÜ# N¸BÔ?ˆ
Ü×#Ñ# NÓ3ˆð  ö
àð �J‰Jœ°:¸e¿j¹jÑ3IÐY^×YfÑYfÔgÑgò
ð 	
ùò 
øô
 ò ÜØ5°nÐ5Eð F2ð 3ó
ð ð	ûðús(   ™&A= ¿6A8Á5A= Á8A= Á=	BÂBÂBc                óŠ   — t        | «      t        u r2t        | «      }t        |«      dk(  rt	        |d   t        d«      «      ryy)zlReturns true if the given type is an optional type. Python represents optional as Union[SomeType, NoneType].é   é   NTF)r   r   r   ÚlenÚ
issubclassÚtype)Útype_to_checkÚargss     r%   Ú_is_optional_typer@   I   s;   € ä�-Ó ¤EÑ)Ü˜Ó&ˆÜˆt‹9˜Š>œj¨¨a©´$°t³*Ô=ØØr$   c                ó8   — t        | «      sJ ‚t        | «      d   S )z1Given Union[SomeType, NoneType], return SomeType.r   )r@   r   )r>   s    r%   Ú _get_type_parameter_for_optionalrB   R   s    € ä˜]Ô+Ð+Ð+Ü�MÓ" 1Ñ%Ð%r$   c                ó
  — t        | «      xr t        t        | «      «      xsá t        | «      xr t        t	        | «      «      xs¾ t        | t        «      xs¬ t        | t        «      xsš t        | t        «      xsˆ t        | t        «      xsv t        | t        «      xsd t        | t        j                  «      xsH t        | t        j                  «      xs, t        | t        j                  «      xs t        | t        «      S )z±Returns if a type of a given field in a SerializableDatclass is supported.

    For container classes, this does not check the type of the type parameter for the container.
    )Ú_is_sequence_like_tuple_typeÚ2_is_supported_field_type_in_serializable_dataclassÚ0_get_type_parameter_for_sequence_like_tuple_typer@   rB   r<   r   ÚSerializableDataclassÚintÚfloatÚstrÚdatetimeÚdateÚ	timedeltar   ©r+   s    r%   rE   rE   X   sô   € ô )¨Ó4ò ÜBÜ@ÀÓLóò	-ô ˜jÓ)ò qÜBÔCcÐdnÓCoÓpò	-ô �j¤$Ó'ò	-ô �jÔ"7Ó8ò	-ô �j¤#Ó&ò	-ô �j¤%Ó(ò	-ô �j¤#Ó&ò	-ô �j¤(×"3Ñ"3Ó4ò	-ô  �j¤(§-¡-Ó0ò!	-ô" �j¤(×"4Ñ"4Ó5ò#	-ô$ �j¤)Ó,ð'r$   c                ór   — t        | «      t        u r&t        | «      }t        |«      dk(  xr |d   t        u S y)zÕReturns true for tuple types that are like sequences.

    In a dataclass definition:

        foo: Tuple[SomeType, ...]

    would return true, but

       foo: Tuple[SomeType, SomeOtherType]

    would not.
    r9   r:   F)r   Útupler   r;   ÚEllipsis©r+   r?   s     r%   rD   rD   t   s:   € ô �*Ó¤Ñ&Ü˜
Ó#ˆÜ�4‹y˜A‰~Ò5 $ q¡'¬XÐ"5Ð5Ør$   c                ó<   — t        | «      sJ ‚t        | «      }|d   S )z Return the type parameter for a sequence like tuple type in a daclass definition.

    e.g.

        foo: Tuple[SomeType, ...]

    should return SomeType.
    r   )rD   r   rR   s     r%   rF   rF   ‡   s%   € ô (¨
Ô3Ð3Ð3Ü�JÓ€DØ�‰7€Nr$   c                  óF   ‡ — e Zd ZU dZdZded<   edd„«       Zdˆ fd„Zˆ xZ	S )	rG   a²  Describes a dataclass that can be serialized using `DataclassSerializer`.

    Previously, Pydantic has been used for defining objects as it provides built in support for serialization and
    deserialization. However, Pydantic object is slow compared to dataclass initialization, with tests showing 10x-100x
    slower performance. This is an issue if many objects are created, which can happen in during plan generation. Using
    the BaseModel.construct() is still not as fast as dataclass initialization, and it also makes for an awkward
    developer interface. Because of this, MF implements a simple custom serializer / deserializer to work with the
    built-in Python dataclass.

    The dataclass must have concrete types for all fields and not all types are supported. Please see implementation
    details in DataclassSerializer. Not adding post_init checks as there have been previous issues with slow object
    initialization.
    Nz4ClassVar[Optional[Set[Type[SerializableDataclass]]]]Ú_concrete_subclass_registryc                ó:   — t        | j                  xs dd„ ¬«      S )z–Returns subclasses that implement this interface.

        This is intended to be used in tests to verify the ability to serialize the class.
        r#   c                ó2   — | j                   | j                  fS ©N)r    r   )Ú
class_types    r%   ú<lambda>zGSerializableDataclass.concrete_subclasses_for_testing.<locals>.<lambda>®   s   € È:×K`ÑK`Ðbl×buÑbuÐJv€ r$   )Úkey)ÚsortedrU   )Úclss    r%   Úconcrete_subclasses_for_testingz5SerializableDataclass.concrete_subclasses_for_testing§   s"   € ô Ø×+Ñ+Ò1¨rÑ7vô
ð 	
r$   c                óÔ   •— t        ‰| �  di |¤Ž t        j                  €t	        «       t        _        t        j                  | «      s t        j                  j                  | «       yy)a1  Adds the implementing class to the registry and check for non-concrete fields.

        It would be helpful to check that the fields of the dataclass are concrete fields, but that would need to be
        done after class initialization, and checking in `__post_init__` adds significant overhead.
        Nr#   )ÚsuperÚ__init_subclass__rG   rU   ÚsetÚinspectÚ
isabstractÚadd)r]   ÚkwargsÚ	__class__s     €r%   ra   z'SerializableDataclass.__init_subclass__±   sS   ø€ ô 	‰Ñ!Ñ+ FÒ+ä ×<Ñ<ÐDÜ@CÃÔ!Ô=ä×!Ñ! #Ô&Ü!×=Ñ=×AÑAÀ#ÕFð 'r$   )Úreturnz%Sequence[Type[SerializableDataclass]]©rh   ÚNone)
r   r    r!   r"   rU   Ú__annotations__Úclassmethodr^   ra   Ú__classcell__)rg   s   @r%   rG   rG   •   s6   ø… ñð Y]ÐÐ!UÓ\àò
ó ð
÷Gñ Gr$   rG   ÚSerializableDataclassTc                  ó6   — e Zd ZdZdd„Z	 d	 	 	 	 	 dd„Zd	d„Zy)
ÚDataclassSerializeraª  Serializer that serializes SerializableDataclasses.

    Pydantic is useful for serialization, but it has issues serializing dataclasses. We've seen issues with forward
    references and recursion errors, but it's helpful for other data types. To serialize dataclasses, this class uses
    the type annotation defined in the dataclass to create a Pydantic model, and then uses Pydantic to serialize to a
    JSON string.
    c                ó"   — t        «       | _        y rX   ©Ú$DataClassTypeToPydanticTypeConverterÚ_to_pydantic_type_converter©Úselfs    r%   Ú__init__zDataclassSerializer.__init__Ì   ó   € Ü+OÓ+QˆÕ(r$   Nc                óš  ‡ ‡	— t        |«      st        d|› �«      ‚t        |«      r!|€y t        |«      }‰ j	                  ||¬«      S t        |«      r#|€y t        |«      Š	t        ˆ ˆ	fd„|D «       «      S t        |t        «      rÅt        j                  |«      st        |› d�«      ‚t        |t        «      st        |› d�«      ‚t        |t        «      sJ ‚‰ j                  j                  |«      }t        |«      }i }|j!                  «       D ]/  \  }}‰ j	                  |j"                  t%        ||«      ¬«      ||<   Œ1  |di |¤ŽS |S )NzUnsupported field type: ©Úobject_typeÚobjc              3  óD   •K  — | ]  }‰j                  ‰|¬ «      –— Œ y­w)rz   N)Ú-_convert_dataclass_instance_to_pydantic_model)Ú.0Úxrv   Útuple_field_type_parameters     €€r%   ú	<genexpr>zTDataclassSerializer._convert_dataclass_instance_to_pydantic_model.<locals>.<genexpr>à   s2   øè ø€ ò ð
 ð	 ×BÑBØ :Øð C÷ ñùó   ƒ z is not a dataclassz is not a SerializableDataclassr#   )rE   ÚRuntimeErrorr@   rB   r~   rD   rF   rP   r<   rG   r-   r.   Ú
isinstancert   Úto_pydantic_typer7   ÚitemsÚannotated_field_typeÚgetattr)
rv   r{   r|   Úoptional_field_type_parameterÚPydanticModelÚ
field_dictÚfield_valuesÚ
field_nameÚfield_definitionr�   s
   `        @r%   r~   zADataclassSerializer._convert_dataclass_instance_to_pydantic_modelÏ   sy  ù€ ô BÀ+ÔNÜÐ!9¸+¸ÐGÓHÐHÜ˜{Ô+Øˆ{ØÜ,LÈ[Ó,YÐ)Ø×EÑEØ9¸sð Fó ð ô *¨+Ô6Øˆ{Øä)YÐZeÓ)fÐ&Üô ð
 ôó ð ô ˜Ô%:Ô;Ü×+Ñ+¨KÔ8Ü" k ]Ð2EÐ#FÓGÐGÜ˜cÔ#8Ô9Ü" c UÐ*IÐ#JÓKÐKô ˜kÔ+@ÔAÐAÐAà ×<Ñ<×MÑMÈkÓZˆMä9¸+ÓFˆJØ46ˆLØ0:×0@Ñ0@Ó0Bò Ñ,�
Ð,Ø+/×+]Ñ+]Ø 0× EÑ EÜ  ZÓ0ð ,^ó ,�˜ZÒ(ðñ
 !Ñ0 <Ñ0Ð0àˆ
r$   c                ó>  — |j                   }t        j                  |«      sJ d|j                  › �«       ‚t	        |t
        «      sJ d|j                  › �«       ‚t        |t
        «      sJ d|j                  › �«       ‚| j                  ||¬«      j                  «       S )NúGot object of type: zGot object type: rz   )	rg   r-   r.   r   r…   rG   r<   r~   Újson)rv   r|   Ú	obj_classs      r%   Úpydantic_serializez&DataclassSerializer.pydantic_serializeý   s¦   € à—M‘Mˆ	Ü×'Ñ'¨Ô,ÐYÐ0DÀY×EWÑEWÐDXÐ.YÓYÐ,Ü˜#Ô4Ô5ÐbÐ9MÈi×N`ÑN`ÐMaÐ7bÓbÐ5Ü˜)Ô%:Ô;ÐeÐ?PÐQZ×QcÑQcÐPdÐ=eÓeÐ;à×AÑAØ!Øð Bó 
÷ ‰$‹&ð	r$   ri   rX   )r{   r   r|   úOptional[AnyValueType]rh   r   )r|   rn   rh   rJ   )r   r    r!   r"   rw   r~   r”   r#   r$   r%   rp   rp   Ã   s7   „ ñóRð @Dð,Øð,Ø&<ð,à	ó,ô\
r$   rp   c                  óV   — e Zd ZdZdd„Z	 d	 	 	 	 	 d	d„Z	 	 	 	 	 	 d
d„Z	 	 	 	 	 	 dd„Zy)ÚDataClassDeserializerzVCorresponding deserializer for datclasses that were serialized by DataClassSerializer.c                ó"   — t        «       | _        y rX   rr   ru   s    r%   rw   zDataClassDeserializer.__init__  rx   r$   Nc                óL  ‡ ‡— t        |«      st        d|› �«      ‚t        |«      r!t        |«      }|€y ‰ j	                  ||¬«      S t        |«      r2t        |t        «      sJ ‚t        |«      Št        ˆ ˆfd„|D «       «      S t        |t        «      r�t        j                  d|› dt        |«      › �«       t        |t        «      sJ d|j                  › �«       ‚t        |t        t        f«      sJ d|j                   j                  › �«       ‚‰ j#                  ||¬«      S |S )	NúUnsupported type: ©r+   r|   c              3  óD   •K  — | ]  }‰j                  ‰|¬ «      –— Œ y­w)r›   N)Ú2_convert_field_in_pydantic_object_to_actual_object)r   r€   rv   Útuple_type_parameters     €€r%   r‚   z[DataClassDeserializer._convert_field_in_pydantic_object_to_actual_object.<locals>.<genexpr>!  s2   øè ø€ ò ð
 ð	 ×GÑGØ3Øð H÷ ñùrƒ   zHandling field_type=z object=zGot field type: r‘   ©r3   r|   )rE   r„   r@   rB   r�   rD   r…   rP   rF   r<   rG   ÚloggerÚdebugÚreprr   r   rg   Ú/_construct_dataclass_from_dataclass_like_object)rv   r+   r|   rŠ   rž   s   `   @r%   r�   zHDataClassDeserializer._convert_field_in_pydantic_object_to_actual_object  sE  ù€ ô BÀ*ÔMÜÐ!3°J°<Ð@ÓAÐAÜ˜zÔ*Ü,LÈZÓ,XÐ)Øˆ{Øà×JÑJØ8Øð Kó ð ô *¨*Ô5Ü˜c¤5Ô)Ð)Ð)Ü#SÐT^Ó#_Ð Üô ð
 ôó ð ô ˜
Ô$9Ô:Ü�L‰LÐ/°
¨|¸8ÄDÈÃIÀ;ÐOÔPä˜jÔ*?Ô@ÐjÐDTÐU_×UhÑUhÐTiÐBjÓjÐ@Ü˜cÔ$9¼9Ð#EÔFÐwÐJ^Ð_b×_lÑ_l×_uÑ_uÐ^vÐHwÓwÐFØ×GÑGØ)Øð Hó ð ð
 ˆJr$   c                óø   — t         j                  d|› dt        |«      › �«       i }t        |«      }|j	                  «       D ]/  \  }}| j                  |j                  t        ||«      ¬«      ||<   Œ1  |di |¤ŽS )NzConstructing dataclass of type z from r›   r#   )r    r¡   r¢   r7   r‡   r�   rˆ   r‰   )rv   r3   r|   Úobject_argsrŒ   rŽ   r�   s          r%   r£   zEDataClassDeserializer._construct_dataclass_from_dataclass_like_object4  s�   € ô 	�‰Ð6°~Ð6FÀfÌTÐRUËYÈKÐXÔYØˆÜ5°nÓEˆ
Ø,6×,<Ñ,<Ó,>ò 	Ñ(ˆJÐ(Ø&*×&]Ñ&]Ø+×@Ñ@Ü˜C Ó,ð '^ó 'ˆK˜
Ò#ð	ñ Ñ, Ñ,Ð,r$   c                óè   — 	 | j                   j                  |«      }t        j                  d|› d|› �«       |j	                  |«      }| j                  ||¬«      S # t        $ r}t        |‚d }~ww xY w)Nz"Serialized object for creation of z is rŸ   )rt   r†   r    r¡   Ú	parse_rawr£   Ú	Exceptionr'   )rv   r3   Úserialized_objÚClassAsPydanticÚpydantic_objectr6   s         r%   Úpydantic_deserializez*DataClassDeserializer.pydantic_deserializeB  s„   € ð
	7Ø"×>Ñ>×OÑOÐP^Ó_ˆOÜ�L‰LÐ=¸oÐ=NÈdÐSaÐRbÐcÔdØ-×7Ñ7¸ÓGˆOØ×GÑGØ-Ø#ð Hó ð øô
 ò 	7Ü/°QÐ6ûð	7ús   ‚AA Á	A1Á%A,Á,A1ri   rX   )r+   r   r|   r•   rh   r   )r3   úType[SerializableDataclassT]r|   z'Union[SerializableDataclass, BaseModel]rh   rn   )r3   r­   r©   rJ   rh   rn   )r   r    r!   r"   rw   r�   r£   r¬   r#   r$   r%   r—   r—   
  si   „ Ù`óRð ?Cð"Øð"Ø%;ð"à	ó"ðH-Ø:ð-ØAhð-à	ó-ð7Ø:ð7ØLOð7à	ô7r$   r—   c                  óL   — e Zd ZdZdd„Zdd„Ze	 	 	 	 d	d„«       Zed
d„«       Zy)rs   z€Class that converts a SerializableDataclass into an equivalent Pydantic object.

    Includes caching to make it efficient.
    c                ó   — i | _         y rX   )Ú _dataclass_type_to_pydantic_typeru   s    r%   rw   z-DataClassTypeToPydanticTypeConverter.__init__X  s
   € ØMOˆÕ-r$   c                ó€   — || j                   vr"t        j                  |«      | j                   |<   | j                   |   S rX   )r°   rs   Ú(_convert_dataclass_type_to_pydantic_type)rv   r3   s     r%   r†   z5DataClassTypeToPydanticTypeConverter.to_pydantic_type[  sG   € Ø ×!FÑ!FÑFô 5×]Ñ]Ð^lÓmð ×1Ñ1Øñð ×4Ñ4°^ÑDÐDr$   c                óÔ  — t         j                  d| j                  › d�«       t        | t        «      sJ ‚t        j                  | «      sJ ‚t        | «      }i }t         j                  dt        |j                  «       «      › �«       |j                  «       D ]R  \  }}t        j                  |«      }|j                  «       ||<   t         j                  d|› d|j                  › �«       ŒT | j                  dz   }t         j                  d|› dt        |«      › �«       t        |fi |¤Ž}t         j                  d	|› �«       t         j                  d
| j                  › d�«       |S )NzConverting z to a pydantic classzNeed to add: zAdding z with type Ú
AsPydanticzCreating Pydantic model z with fields:
z!Finished creating Pydantic model zFinished converting )r    r¡   r   r<   rG   r-   r.   r7   r   Úkeysr‡   rs   Ú_convert_nested_fieldsÚas_pydantic_field_tuplerˆ   r   )r3   rŒ   Úfields_for_pydantic_modelrŽ   r�   Ú
class_nameÚpydantic_models          r%   r²   zMDataClassTypeToPydanticTypeConverter._convert_dataclass_type_to_pydantic_typeb  sb  € ô 	�‰�{ >×#:Ñ#:Ð";Ð;OÐPÔQÜ˜.Ô*?Ô@Ð@Ð@Ü×'Ñ'¨Ô7Ð7Ð7ä5°nÓEˆ
ð KMÐ!Ü�‰�}Ô%8¸¿¹Ó9JÓ%KÐ$LÐMÔNØ,6×,<Ñ,<Ó,>ò 	cÑ(ˆJÐ(ÜC×ZÑZÐ[kÓlÐØ4D×4\Ñ4\Ó4^Ð% jÑ1Ü�L‰L˜7 : ,¨kÐ:J×:_Ñ:_Ð9`ÐaÕbð	cð
 $×,Ñ,¨|Ñ;ˆ
Ü�‰Ø& z l°/ÔBUÐVoÓBpÐAqÐrô	
ô & jÑNÐ4MÑNˆÜ�‰Ð8¸¸ÐEÔFÜ�‰Ð+¨N×,CÑ,CÐ+DÐDXÐYÔZØÐr$   c                óÖ  — t        | j                  «      st        d| j                  › �«      ‚t        | j                  «      rft	        | j                  «      }t
        j                  t        |¬«      «      }t        t        |j                  t        d«      f   | j                  «      S t        | j                  «      r]t        | j                  «      }t
        j                  t        |¬«      «      }t        t        |j                  df   | j                  «      S t        | j                  t         «      r4t        t
        j#                  | j                  «      | j                  ¬«      S | S )aÆ  Recursively converts a given field definition into a fully serializable type specification.

        The initial set of FieldDefinitions sourced from the dataclass might contain arbitrarily
        nested SerializableDataclass objects, which would need further parsing in order to be fully
        serializable via our Pydantic conversion. This method does that traversal and returns the complete
        set of Pydantic-compatible nested types.
        rš   rN   N.r*   )rE   rˆ   r„   r@   rB   rs   r¶   r1   r   r+   r=   r,   rD   rF   r   r<   rG   r²   )r�   rŠ   Úconverted_field_definitionr�   s       r%   r¶   z;DataClassTypeToPydanticTypeConverter._convert_nested_fields}  sS  € ô BÐBR×BgÑBgÔhÜÐ!3Ð4D×4YÑ4YÐ3ZÐ[Ó\Ð\ÜÐ/×DÑDÔEÜ,LÐM]×MrÑMrÓ,sÐ)Ü)M×)dÑ)dÜÐ+HÔIó*Ð&ô #ÜÐ0×;Ñ;¼TÀ$»ZÐGÑHØ ×.Ñ.óð ô *Ð*:×*OÑ*OÔPÜ)YØ ×5Ñ5ó*Ð&ô *N×)dÑ)dÜÐ+EÔFó*Ð&ô #ÜÐ0×;Ñ;¸SÐ@ÑAØ ×.Ñ.óð ô Ð(×=Ñ=Ô?TÔUÜ"Ü?×hÑhØ$×9Ñ9óð /×<Ñ<ô	ð ð $Ð#r$   Nri   )r3   zType[SerializableDataclass]rh   úType[BaseModel])r3   r   rh   r½   )r�   r1   rh   r1   )	r   r    r!   r"   rw   r†   Ústaticmethodr²   r¶   r#   r$   r%   rs   rs   R  sK   „ ñó
PóEð ðØðà	òó ðð4 ò&$ó ñ&$r$   rs   T)Úfrozenc                  óL   — e Zd ZU dZded<   dZded<   dd„Zdd„Zedd	„«       Z	y
)r1   a„  Describes the field definition in a dataclass as described by the annotation.

    Note the default_value follows Pydantic semantics. A default value of ... indicates that there is no default, and
    as such a value must be provided for this field in the Pydantic BaseModel or Dataclass representation. We cannot
    use None for this, as None is a valid default for optional types.
    r   r+   .r•   r,   c                ór   — | j                   €+t        | j                  «      sJ d| j                  › d�«       ‚yy)z9Validate the combination of default_value and field_type.Nz=Invalid default of None provided for field definition - type z: will not allow it! Use ... or dataclasses.MISSING instead)r,   r@   r+   ru   s    r%   Ú__post_init__zFieldDefinition.__post_init__³  sF   € à×ÑÐ%Ü$ T§_¡_Ô5ð ØOÐPT×P_ÑP_ÐO`ð a9ð :óÑ5ð &r$   c                ót   — | j                   t        j                  k7  r| j                   nd}| j                  |fS )zfPydantic fields can be initialized with a Tuple[Type, Any], the second parameter is the default value..)r,   r-   ÚMISSINGrˆ   )rv   r2   s     r%   r·   z'FieldDefinition.as_pydantic_field_tuple»  s4   € à(,×(:Ñ(:¼k×>QÑ>QÒ(Q�$×$Ò$ÐWZˆØ×)Ñ)¨7Ð3Ð3r$   c                ó   — | j                   S rX   rN   ru   s    r%   rˆ   z$FieldDefinition.annotated_field_typeÀ  s   € à�‰Ðr$   Nri   )rh   zTuple[Type, AnyValueType])rh   r   )
r   r    r!   r"   rk   r,   rÂ   r·   Úpropertyrˆ   r#   r$   r%   r1   r1   §  s8   … ñð ÓØ,/€MÐ)Ó/óó4ð
 òó ñr$   r1   )r3   r   rh   zDict[str, FieldDefinition])r>   r   rh   Úbool)r>   r   rh   r   )r+   r   rh   rÇ   )r+   r   rh   r   )7Ú
__future__r   r-   rK   rc   ÚloggingÚabcr   Úbuiltinsr   r   Úenumr   Útypingr   r	   r
   r   r   r   r   r   r   r   r   r   r   Útyping_extensionsr   Ú$dbt_semantic_interfaces.pretty_printr   Údsi_pydantic_shimr   r   Ú	getLoggerr   r    r   r   rk   r¨   r   r'   r7   r@   rB   rE   rD   rF   rG   rn   rp   r—   rs   r1   r#   r$   r%   ú<module>rÒ      s  ðÞ "ã Û Û Û Ý Ý Ý !Ý ÷÷ ÷ õ õ  (å Dß 5à	ˆ×	Ñ	˜8Ó	$€ñ �K t¨I¡Ô7€	à€ˆiÓ ô	˜	ô 	ô	 Iô 	ðØðàóó(ó&óó8ó&ô(G˜Cô (GñV !Ð!9ÐAVÔWÐ ÷Dñ D÷NE7ñ E7÷PR$ñ R$ñj �$Ô÷ð ó ñr$   