Ë ¿L ioãó¢—dZddlmZddlmZmZddlmZddlm Z erddl m Z m Z m Z ddlmZdd„Z d dd „Zdd „Zdd „Zdd „Zdd„Zy )ztData marshalling utilities for ArrowTable protobufs, which are used by CustomComponent for dataframe serialization. é)Ú annotations)Ú TYPE_CHECKINGÚAny)Údataframe_util)Úpandas_styler_utils)Ú DataFrameÚIndexÚSeries)Ú ArrowTablecó<—t|t«r t|«S|S)z;Convert a tuple to a list. Leave as is if it's not a tuple.)Ú isinstanceÚtupleÚlist)Úitems úm/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/streamlit/components/v1/component_arrow.pyÚ_maybe_tuple_to_listr s€ä# D¬%Ô0Œ4‹:Ð:°dÐ:óNcóö—tj|«rtj|||«tj|«}t ||j «t||j«t||«y)a:Marshall data into an ArrowTable proto. Parameters ---------- proto : proto.ArrowTable Output. The protobuf for a Streamlit ArrowTable proto. data : pandas.DataFrame, pandas.Styler, numpy.ndarray, Iterable, dict, or None Something that is or can be converted to a dataframe. N) rÚis_pandas_stylerrÚmarshall_stylerÚconvert_anything_to_pandas_dfÚ_marshall_indexÚindexÚ_marshall_columnsÚcolumnsÚ_marshall_data)ÚprotoÚdataÚ default_uuidÚdfs rÚmarshallr!%sZ€ô×&Ñ& tÔ,Ü×+Ñ+¨E°4¸ÔFä × 5Ñ 5°dÓ ;€BÜE˜2Ÿ8™8Ô$Üe˜RŸZ™ZÔ(Ü5˜"Õrcó–—ddl}tt|j«}|j |«}t j |«|_y)aHMarshall pandas.DataFrame index into an ArrowTable proto. Parameters ---------- proto : proto.ArrowTable Output. The protobuf for a Streamlit ArrowTable proto. index : pd.Index Index to use for resulting frame. Will default to RangeIndex (0, 1, 2, ..., n) if no index is provided. rN)ÚpandasÚmaprÚvaluesrrÚ convert_pandas_df_to_arrow_bytesr)rrÚpdÚ index_valuesÚindex_dfs rrr<s8€óäÔ+¨U¯\©\Ó:€LØ|‰|˜LÓ)€HÜ ×AÑAÀ(ÓK€E…Krcó–—ddl}tt|j«}|j |«}t j |«|_y)a[Marshall pandas.DataFrame columns into an ArrowTable proto. Parameters ---------- proto : proto.ArrowTable Output. The protobuf for a Streamlit ArrowTable proto. columns : Series Column labels to use for resulting frame. Will default to RangeIndex (0, 1, 2, ..., n) if no column labels are provided. rN)r#r$rr%rrr&r)rrr'r%Ú columns_dfs rrrPs8€óä Ô% w§~¡~Ó 6€FØ—‘˜fÓ%€JÜ"×CÑCÀJÓO€E…Mrcó8—tj|«|_y)zõMarshall pandas.DataFrame data into an ArrowTable proto. Parameters ---------- proto : proto.ArrowTable Output. The protobuf for a Streamlit ArrowTable proto. df : pandas.DataFrame A dataframe to marshall. N)rr&r)rr s rrrds€ô ×@Ñ@ÀÓD€E…Jrcóà—tjd«r td«‚ddl}tj|j «}tj|j «}tj|j«}|j|j«|j«jj«|j«jj«¬«S)zConvert ArrowTable proto to pandas.DataFrame. Parameters ---------- proto : proto.ArrowTable Output. pandas.DataFrame z14.0.1zThe installed pyarrow version is not compatible with this component. Please upgrade to 14.0.1 or higher: pip install -U pyarrowrN)rr) rÚis_pyarrow_version_less_thanÚ RuntimeErrorr#Ú convert_arrow_bytes_to_pandas_dfrrrrÚto_numpyÚTÚtolist)rr'rrrs rÚarrow_proto_to_dataframer4ss¹€ô×2Ñ2°8Ô<Üð Ió ð ó ä × :Ñ :¸5¿:¹:Ó F€DÜ × ;Ñ ;¸E¿K¹KÓ H€EÜ×=Ñ=¸e¿m¹mÓL€Gà <‰<Ø ‰ ‹Øn‰nÓ× Ñ ×'Ñ'Ó)Ø× Ñ Ó"×$Ñ$×+Ñ+Ó-ð ó ðr)rrÚreturnr)N)rÚArrowTableProtorrrz str | Noner5ÚNone)rr6rr r5r7)rr6rr r5r7)rr6r rr5r7)rr6r5r)Ú__doc__Ú __future__rÚtypingrrÚ streamlitrÚstreamlit.elements.librr#rr r Ústreamlit.proto.Components_pb2r r6rr!rrrr4©rrúr?slðñõ#ç%å$Ý6áß/Ñ/åLó;ð CGðØ ðØ"%ðØ5?ðà óó.Ló(Pó( Eôr