Ë
    èlÖi×  ã                   ó$   — d dl mZ d dlmZ dd„Zy)é    )Úutils)ÚRowNc                 ó€  — t        | j                  «      }t        j                  |«      s|g}t	        |«      dk(  r"t        d„ |D «       «      r|D �cg c]  }|g‘Œ }}|D �cg c]  }| j                  j                  |«      ‘Œ }}|D �cg c]  }| j                  j                  |«      ‘Œ }}|D �	�
�cg c]<  }	t        |	«      D �
�cg c]#  \  }
}||
   j                  j                  |«      ‘Œ% c}}
‘Œ> }}
}	}t        |Ž }t        t        t        t         |«      «      t        |«      z
  «      }|D ]×  }t#        |«      r	 ||«      }nY|�t        |«      }n%dgt	        | j                  «      t	        |«      z
  z  }t        ||«      D ]  \  }
}|j%                  |
|«       Œ t        |«      D �
�cg c]-  \  }
}| j                  |
   j                  j                  |«      ‘Œ/ }}
}|j'                  t)        || j                  «      «       ŒÙ | j+                  |g ¬«      S c c}w c c}w c c}w c c}}
w c c}}
}	w c c}}
w )aJ  
    Fill in missing rows in a series.

    This can be used, for instance, to add rows for missing years in a time
    series.

    Missing rows are found by comparing the values in the :code:`key` columns
    with those provided as :code:`compare_values`.

    Values not found in the table will be used to generate new rows with
    the given :code:`default_row`.

    :code:`default_row` should be an array of values or an array-generating
    function. If not specified, the new rows will have :code:`None` in columns
    all columns not specified in :code:`key`.

    If :code:`default_row` is an array of values, its length should be row
    length minus the number of column names provided in the :code:`key`.

    If it is an array-generating function, the function should take an array
    of missing values for each new row and output a full row including those
    values.

    :param key:
        Either a column name or a sequence of such names.
    :param compare_values:
        Either an array of column values if key is a single column name or a
        sequence of arrays of values if key is a sequence of names. It can
        also be a generator that yields either of the two. A row is created for
        each value or list of values not found in the rows of the table.
    :param default_row:
        An array of values or a function to generate new rows. The length of
        the input array should be equal to row length minus column_names
        count. The length of array generated by the function should be the
        row length.
    :returns:
        A new :class:`.Table`.
    é   c              3   óH   K  — | ]  }t        j                  |«       –— Œ y ­w©N)r   Ú
issequence)Ú.0Úcompare_values     ú[/var/www/html/strategist-ai/venv_dbt/lib/python3.12/site-packages/agate/table/homogenize.pyú	<genexpr>zhomogenize.<locals>.<genexpr>2   s   è ø€ ÒW°}”5×#Ñ# MÓ2Ô2ÑWùs   ‚ "N)Ú	row_names)ÚlistÚ_rowsr   r	   ÚlenÚanyÚ_columnsÚgetÚ_column_namesÚindexÚ	enumerateÚ	data_typeÚcastÚzipÚsetÚmapÚtupleÚcallableÚinsertÚappendr   Ú_fork)ÚselfÚkeyÚcompare_valuesÚdefault_rowÚrowsr   ÚnameÚcolumn_valuesÚcolumn_indexesÚvaluesÚiÚvÚdifferencesÚ
differenceÚnew_rowÚds                   r   Ú
homogenizer1      s  € ôN �—
‘
Ó€Dä×Ñ˜CÔ Øˆeˆä
ˆ3ƒx�1‚}ÜÑWÈÔWÔWØCQÖR°-˜}šoÐRˆNÐRà9<Ö=°�T—]‘]×&Ñ& tÕ,Ð=€MÐ=ØADÖE¸�d×(Ñ(×.Ñ.¨tÕ4ÐE€NÐEàgu×vÐvÐ]cÄiÐPVÓFW×X¹d¸aÀ�} QÑ'×1Ñ1×6Ñ6°qÕ9ÕXÐv€NÒvä˜Ð'€MÜ”sœ3œu nÓ5Ó6¼¸]Ó9KÑKÓL€Kà!ò 6ˆ
Ü�KÔ Ù! *Ó-‰GàÐ&Ü˜{Ó+‘à˜&¤C¨×(:Ñ(:Ó$;¼cÀ#»hÑ$FÑG�ä˜N¨JÓ7ò %‘��1Ø—‘˜q !Õ$ð%ô CLÈGÓBT×U¹$¸!¸Q�4—=‘= Ñ#×-Ñ-×2Ñ2°1Õ5ÐUˆÑUØ�‰”C˜ ×!3Ñ!3Ó4Õ5ð6ð  �:‰:�d bˆ:Ó)Ð)ùò5 Sùâ=ùÚEùãXùÔvùó" Vs0   Á
HÁ""H#Â
"H(Â4H3Ã(H-Ã/H3Æ/2H:È-H3r   )Úagater   Ú
agate.rowsr   r1   © ó    r   ú<module>r6      s   ðÝ Ý ôH*r5   