o
    NDi	                     @   sf   d dl Z d dlZd dlmZ d dlmZ edZedZedZe 	e
Zdd Zd	d
 Zdd ZdS )    N)warn)Versionz6.0.0z5.1.13z6.0.5c                 C   sZ   z| j pd}W n ty   tdjt | d d}Y nw t| }|r+d||fS |S )zS
    Best-effort method for getting the namespace in which a class is defined.
     zPUnable to obtain namespace for {cls} for Insights, returning ''. Exception: 
{e})ecls.)
__module__	Exceptionr   format	traceback
format_exc*_module_internal_namespace_or_emtpy_stringjoin)r   modulemodule_internal_namespace r   Y/var/www/Datamplify/venv/lib/python3.10/site-packages/cassandra/datastax/insights/util.py	namespace   s   
r   c                 C   s8   z| j }W n
 ty   Y dS w d|ddd S )z
    Best-effort method for getting the module-internal namespace in which a
    class is defined -- i.e. the namespace _inside_ the module.
    r   r   N)__qualname__AttributeErrorr   split)r   qualnamer   r   r   r   0   s   
r   c                 C   s^   | r-zt | } t|   kotk n  pt| kW S  ty,   tdjt | d Y dS w dS )NzXUnable to check version {v} for Insights compatibility, returning False. Exception: 
{e})r   vF)	r   DSE_51_MIN_SUPPORTEDDSE_60DSE_60_MIN_SUPPORTEDr	   r   r
   r   r   )dse_versionr   r   r   version_supports_insights@   s   

r   )loggingr   warningsr   cassandra.utilr   r   r   r   	getLogger__name__logr   r   r   r   r   r   r   <module>   s   
