gL i ddlZddlZddlZddlmZejjdejddfejddfejdd fejd d fejd d fejddfejddfejddfejddfejddfejddfejddfejdgjdfejdgjdjdfejdgdfejd dfgd!Z ejjd"gd#id$gd%idgdid gd id gdidgdidgdidgd id gdidgdidgdidgdidgdidgd&idgd'id(ggd)gd*gd+gd,d-id.gd/id0gd1d2d id3gd1d2d4id5gd1d2d6id7gd1d2d8idgd1d8d9d:d;ggd<gd=gd>gd?d@dAdBdCdDgdEZy)FNdtype_to_arrow_c_fmtzpandas_dtype, c_stringboolbint8cuint8Cint16suint16Sint32iuint32Iint64luint64Lfloat16efloat32ffloat64gauzdatetime64[ns]ztsn:Oc$t||k(sJy)z/Test ``dtype_to_arrow_c_fmt`` utility function.Nr) pandas_dtypec_strings i/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/tests/interchange/test_utils.pytest_dtype_to_arrow_c_fmtr$s4 - 99 9zpa_dtype, args_kwargs, c_stringnullnbool_stringbinaryz)time32r tts)r,msttm)time64usttu)r2nsttndate32tdDdate64tdm timestampunitztss:r0ztsm:r4ztsu:r7UTC)r>tzztsn:UTC)durationr-tDs)rAr/tDm)rAr3tDu)rAr6tDn decimal128) precisionscalezd:4,2ctjd}|st||}n2t|trt|||}nt||di|}t j |}t||k(sJy)Npyarrow)pytest importorskipgetattr isinstancetuplepd ArrowDtyper)pa_dtype args_kwargsr"papa_type arrow_types r#$test_dtype_to_arrow_c_fmt_arrowdtyperZ+s}L   Y 'B ''"h') K '''"h'5''"h'6+6w'J  +x 77 7r%)numpynprNpandasrSpandas.core.interchange.utilsrmark parametrizedtypeSeriesastypeCategoricalDtyper$rZrMr%r#res > & 3 & 3 ' C ' C ( S! ' C ( S! ' C ( S! ) c" ) c" ) c" C5   % BIIqcN ! !"2 3 9 9     cU #S) #'0:10: %  S  "c  "c  2s  2s  2s  S  "c  "c  "c  B  B  B  2s  2s  "! " ## $ #% & #' ( 2u) * 2u+ , vsmV,- . vtnf-/ 0 vtnf-1 2 vtnf-3 4 t519=5 6 $7 8 %9 : %; < %= > Q3W=? #H 8I#H 8r%