o
    PDiO                     @   s:   d dl mZ d dlmZ d dlmZ G dd dedZdS )   )ArrowArrayImpl)BaseMetaClass)errorsc                   @   s   e Zd ZdZdd Zdd Zdd Zdd	 Zed
d Z	edd Z
dddZdd ZedefddZedefddZedefddZedefddZdS )
ArrowArrayNc                 C   s   t t j d S N)r   
_raise_errERR_INTERNAL_CREATION_REQUIREDself r   M/var/www/Datamplify/venv/lib/python3.10/site-packages/oracledb/arrow_array.py__init__)   s   zArrowArray.__init__c                 C   s   | j S r   )num_rowsr	   r   r   r   __len__,   s   zArrowArray.__len__c                 C   s   d| j  d| j d| j dS )NzArrowArray(name=z, len=z, type=))namer   dtyper	   r   r   r   __repr__/   s   
zArrowArray.__repr__c                 C   s   |   S r   )r   r	   r   r   r   __str__6   s   zArrowArray.__str__c                 C   s   |  | }t||_|S r   )__new__r   from_arrow_array_impl)clsobjarrayr   r   r   _from_arrow9   s   
zArrowArray._from_arrowc                 C   s   |  | }||_|S r   )r   r   )r   implr   r   r   r   
_from_impl?   s   
zArrowArray._from_implc                 C   s$   |durt d| j | j fS )zV
        Returns a tuple containing an ArrowSchema and ArrowArray PyCapsules.
        Nrequested_schema)NotImplementedErrorr   get_schema_capsuleget_array_capsule)r
   r   r   r   r   __arrow_c_array__E   s
   zArrowArray.__arrow_c_array__c                 C   
   | j  S )z3
        Returns an ArrowSchema PyCapsule.
        )r   r    r	   r   r   r   __arrow_c_schema__P   s   
zArrowArray.__arrow_c_schema__returnc                 C   r#   )zB
        Returns the data type associated with the array.
        )r   get_data_typer	   r   r   r   r   V      
zArrowArray.dtypec                 C   r#   )z=
        Returns the name associated with the array.
        )r   get_namer	   r   r   r   r   ]   r'   zArrowArray.namec                 C   r#   )zF
        Returns the number of rows that contain null values.
        )r   get_null_countr	   r   r   r   
null_countd   r'   zArrowArray.null_countc                 C   r#   )z:
        Returns the number of rows in the array.
        )r   get_num_rowsr	   r   r   r   r   k   r'   zArrowArray.num_rowsr   )__name__
__module____qualname__r   r   r   r   r   classmethodr   r   r"   r$   propertystrr   r   intr*   r   r   r   r   r   r   &   s(    


r   )	metaclassN)
arrow_implr   baser    r   r   r   r   r   r   <module>   s   