fa45d8aa5f
- health_checklist.json: 192.168.1.122→node122
- ocr_client.py: docstring IP→node122
- docs/market-data-requirements.md: IP→node122
- 所有API调用通过ProxyHandler({})绕过系统代理
Privoxy对node122:18003返回500,直连正常
31 lines
659 B
Python
31 lines
659 B
Python
"""
|
|
Helpers for sharing tests between DataFrame/Series
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
from pandas import DataFrame
|
|
|
|
if TYPE_CHECKING:
|
|
from pandas._typing import DtypeObj
|
|
|
|
|
|
def get_dtype(obj) -> DtypeObj:
|
|
if isinstance(obj, DataFrame):
|
|
# Note: we are assuming only one column
|
|
return obj.dtypes.iat[0]
|
|
else:
|
|
return obj.dtype
|
|
|
|
|
|
def get_obj(df: DataFrame, klass):
|
|
"""
|
|
For sharing tests using frame_or_series, either return the DataFrame
|
|
unchanged or return it's first column as a Series.
|
|
"""
|
|
if klass is DataFrame:
|
|
return df
|
|
return df._ixs(0, axis=1)
|