Ë
    èlÖià  ã                   óh   — d dl Z d dlZd dlmZ d dlmZmZ d dlmZm	Z	 ddej                  dddfd„Zy)	é    N)Úformat_decimal)ÚconfigÚutils)ÚNumberÚTexté   é   é   c                 óÂ  ‡ ‡‡‡‡‡— |€t        ‰ j                  «      }|€t        ‰ j                  «      }|€t        d«      }t	        j
                  d«      }t	        j
                  d«      }t        |«      }	t	        j
                  d«      Št	        j
                  d«      Š|xs t	        j
                  d«      }|t        ‰ j                  «      k  }
|t        ‰ j                  «      k  }g }‰ j                  d| D ]?  }|�*t        |«      |kD  r|j                  |d||	z
   ›|›�«       Œ/|j                  |«       ŒA |r|j                  |«       |D �cg c]  }t        |«      ‘Œ c}Šg }g }t        ‰ j                  «      D ]€  \  }}||k\  r nvt        |j                  t        «      rIt        j                  |d| «      }d}||kD  rd	}|}|j                  t        j                  ||«      «       Œp|j                  d«       Œ‚ t        ‰ j                  «      D ]É  \  }}||k\  r n¿g }t        |«      D ]œ  \  }}||k\  r|}n<|€d
}n7||   �'t!        j"                  |«      st%        |||   |¬«      }nt'        |«      }|�t        |«      |kD  r|d||	z
   ›|›�}t        |«      ‰|   kD  rt        |«      ‰|<   |j                  |«       ||k\  sŒœ n |j                  |«       ŒË ˆfd„Šˆ ˆˆˆfd„}dj)                  ‰dj+                  ˆfd„‰D «       «      ¬«      } ||«        ‰|«       |D ]
  } ||«       Œ |
r ||D �cg c]  }|‘Œ c}«       yyc c}w c c}w )a~  
    Print a text-based view of the data in this table.

    The output of this method is GitHub Flavored Markdown (GFM) compatible.

    :param max_rows:
        The maximum number of rows to display before truncating the data. This
        defaults to :code:`20` to prevent accidental printing of the entire
        table. Pass :code:`None` to disable the limit.
    :param max_columns:
        The maximum number of columns to display before truncating the data.
        This defaults to :code:`6` to prevent wrapping in most cases. Pass
        :code:`None` to disable the limit.
    :param output:
        A file-like object to print to.
    :param max_column_width:
        Truncate all columns to at most this width. The remainder will be
        replaced with ellipsis.
    :param locale:
        Provide a locale you would like to be used to format the output.
        By default it will use the system's setting.
    :max_precision:
        Puts a limit on the maximum precision displayed for number types.
        Numbers with lesser precision won't be affected.
        This defaults to :code:`3`. Pass :code:`None` to disable limit.
    NÚinfÚellipsis_charsÚtext_truncation_charsÚhorizontal_line_charÚvertical_line_charÚdefault_localeFTÚ )ÚformatÚlocalec                 ó.   •— ‰j                  | dz   «       y )Nú
)Úwrite)ÚlineÚoutputs    €ú\/var/www/html/strategist-ai/venv_dbt/lib/python3.12/site-packages/agate/table/print_table.pyr   zprint_table.<locals>.writew   s   ø€ Ø�‰�T˜D‘[Õ!ó    c                 ó(  •— g }t        | «      D ]b  \  }}t        ‰j                  |   t        «      rd|j	                  ‰|   «      z  }nd|j                  ‰|   «      z  }|j                  |«       Œd ‰j                  |«      } ‰	‰› |› ‰› �«       y)z?
        Helper function that formats individual rows.
        z %s N)Ú	enumerateÚ
isinstanceÚ_column_typesr   ÚljustÚrjustÚappendÚjoin)
Úformatted_rowÚ
row_outputÚjÚdr   ÚtextÚselfÚv_lineÚwidthsr   s
         €€€€r   Ú	write_rowzprint_table.<locals>.write_rowz   s˜   ø€ ð ˆ
ä˜mÓ,ò 	&‰DˆAˆqä˜$×,Ñ,¨QÑ/´Ô6Ø !§'¡'¨&°©)Ó"4Ñ4‘à !§'¡'¨&°©)Ó"4Ñ4�à×Ñ˜fÕ%ð	&ð �{‰{˜:Ó&ˆá��˜˜˜v˜hÐ'Õ(r   z{v_line} {columns} {v_line}z | c              3   ó(   •K  — | ]	  }‰|z  –— Œ y ­w)N© )Ú.0ÚwÚh_lines     €r   ú	<genexpr>zprint_table.<locals>.<genexpr>�   s   øè ø€ Ò6¨!˜6 A�:Ñ6ùs   ƒ)r*   Úcolumns)ÚlenÚ_rowsÚ_columnsÚfloatr   Ú
get_optionÚ_column_namesÚcolumn_namesr"   r   r   Ú	data_typer   r   Úmax_precisionÚmake_number_formatterÚmathÚisinfr   Ústrr   r#   )r)   Úmax_rowsÚmax_columnsr   Úmax_column_widthr   r<   ÚellipsisÚ
truncationÚlen_truncationÚrows_truncatedÚcolumns_truncatedr:   Úcolumn_nameÚnÚnumber_formattersÚformatted_dataÚiÚcÚ
max_placesÚadd_ellipsisÚrowr$   r&   Úvr,   Údividerr1   r*   r+   r   s   `  `                       @@@@r   Úprint_tablerT   
   sv  ý€ ð8 ÐÜ�t—z‘z“?ˆàÐÜ˜$Ÿ-™-Ó(ˆàÐÜ˜e›ˆä× Ñ Ð!1Ó2€HÜ×"Ñ"Ð#:Ó;€JÜ˜“_€NÜ×ÑÐ5Ó6€FÜ×ÑÐ3Ó4€FØÒ:”v×(Ñ(Ð)9Ó:€Fà¤ D§J¡J£Ñ/€NØ#¤c¨$×*<Ñ*<Ó&=Ñ=ÐØ€LØ×(Ñ(¨¨+Ð6ò -ˆØÐ'¬C°Ó,<Ð?OÒ,OØ×Ñ¨+Ð6XÐ7GÈ.Ñ7XÑ*YÑ[eÐ fÕgà×Ñ Õ,ð	-ñ Ø×Ñ˜HÔ%à*Ö+˜Œc�!�fÒ+€FØÐØ€Nô ˜$Ÿ-™-Ó(ò +‰ˆˆ1Ø�ÒÙä�a—k‘k¤6Ô*Ü×,Ñ,¨Q¨y°¨\Ó:ˆJØ ˆLØ˜MÒ)Ø#�Ø*�
Ø×$Ñ$¤U×%@Ñ%@ÀÈ\Ó%ZÕ[à×$Ñ$ TÕ*ð+ô ˜DŸJ™JÓ'ò -‰ˆˆ3Ø�Š=Ùàˆä˜c“Nò 	‰DˆAˆqØ�KÒØ‘Ø�Ø‘Ø" 1Ñ%Ð1¼$¿*¹*ÀQ¼-Ü"ØØ,¨QÑ/Ø!ô‘ô ˜“F�àÐ+´°A³Ð9IÒ0IØÐ BÐ!1°NÑ!BÑCÁZÐP�ä�1‹v˜˜q™	Ò!Ü ›F��q‘	à× Ñ  Ô#à�KÓÙð/	ð2 	×Ñ˜mÕ,ð?-ôB"÷)ð& ,×2Ñ2ØØ—
‘
Ó6¨vÔ6Ó6ð 3ó €Gñ ˆlÔÙ	ˆ'„Nð (ò !ˆÙ�-Õ ð!ñ Ù \Ö2 ’8Ò2Õ3ð ùòs ,ùòt 3s   ÅMÍ	M)r>   ÚsysÚbabel.numbersr   Úagater   r   Úagate.data_typesr   r   ÚstdoutrT   r.   r   r   ú<module>rZ      s0   ðÛ Û 
å (ç ß )ð  "¨q¸¿¹ÐVXÐaeØôR4r   