a
    cOjQ                     @   sF   d Z ddlmZ ddlZee jjd d Zg dZ	d	ddZ
dS )
u   
监管风险信号（立案调查等）。

数据来源：ocf/data/regulatory_investigation_stocks.csv
规则：已被监管机构立案调查的股票 → 直接剔除
对应 signal_type：regulatory_investigation
    )PathNdataz#regulatory_investigation_stocks.csv)3Z603169Z601162Z300111000567Z002855Z600481Z300169Z002759300500Z300670Z300703Z300071Z603273Z601208Z300200Z002420Z300941Z300587Z603421Z605255Z600348Z600281Z601319Z600157Z300201Z600338Z603717Z300796Z002290Z603160Z603200Z300243Z603067Z300109Z603018Z603353Z002943Z600067Z002273Z000863Z000900Z000034Z000876Z601696Z600926Z300070Z002878Z603222Z300032Z002984Z300437c                 C   sv   |rt |nt}| r<tj|dtid}|d   }nt}|sTtj	ddgdS t	d|i}d|d< |ddg S )uR  
    读取被立案调查股票名单，返回 flag DataFrame。

    参数：
        pg_conn: 保留与现有信号模块一致的接口，当前未使用。
        csv_path: 自定义 CSV 路径，默认使用 ocf/data/regulatory_investigation_stocks.csv。

    返回：
        DataFrame: code, regulatory_investigation_flag
    code)dtyperegulatory_investigation_flag)columns   )
r   DEFAULT_CSVexistspdread_csvstrdrop_duplicatestolistREGULATORY_INVESTIGATION_CODES	DataFrame)pg_conncsv_pathpathdfcodes r   5/Users/admin/quant_ocf/ocf/signals/regulatory_risk.py$fetch_regulatory_investigation_flags    s    r   )NN)__doc__pathlibr   pandasr   __file__resolveparentr   r   r   r   r   r   r   <module>   s
   