o
    <i
                  
   @   s   d dl mZ d dlmZ d dlmZ dZ	ddeeef dede	dB d	e	dB fd
dZ
	ddeeef dededB d	edB fddZdeeef deded	efddZdeded	edB fddZded	efddZdS )    )Any)
Properties)	strtoboolzheader.N
propertiesproperty_namedefaultreturnc              
   C   L   |  | }r$zt|W S  ty# } ztd| d| |d }~ww |S )NCould not parse table property z to an integer: )getint
ValueErrorr   r   r   valuee r   W/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/pyiceberg/utils/properties.pyproperty_as_int      
r   c              
   C   r	   )Nr
   z to a float: )r   floatr   r   r   r   r   property_as_float*   r   r   c              
   C   r	   )Nr
   z to a boolean: )r   r   r   r   r   r   r   property_as_bool8   s   
r   property_namesc                 G   s$   |D ]}|  | }r|  S qd S N)r   )r   r   r   property_valuer   r   r   get_first_property_valueE   s
   r   c                    s   t t  fdd|  D S )Nc                    s(   i | ]\}}| tr| d  |qS r   )
startswithHEADER_PREFIX).0keyr   header_prefix_lenr   r   
<dictcomp>S   s   ( z)get_header_properties.<locals>.<dictcomp>)lenr   items)r   r   r    r   get_header_propertiesO   s   r%   r   )typingr   pyiceberg.typedefr   pyiceberg.typesr   r   dictstrr   r   r   r   boolr   r   r%   r   r   r   r   <module>   sZ   







