You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
调用如下接口,参数“515670”,报异常
adata.fund.market.get_market_etf("515670")
To Reproduce
Steps to reproduce the behavior:
pip install adata
open a new .py file and paste following
import adata
adata.fund.market.get_market_etf("515670")
Run
Expected behavior
Function crash
Screenshots
Crash Log:
Traceback (most recent call last):
File "d:\projects\outsource_data\main.py", line 37, in
adata.fund.market.get_market_etf("515670")
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\adata\fund\market\etf_market.py", line 30, in get_market_etf
return self.ths.get_market_etf_ths(fund_code, k_type, start_date, end_date)
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\adata\fund\market\etf_market_ths.py", line 50, in get_market_etf_ths
result_df = pd.DataFrame(data=data, columns=['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount'])
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\frame.py", line 851, in init
arrays, columns, index = nested_data_to_arrays(
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\internals\construction.py", line 520, in nested_data_to_arrays arrays, columns, index = nested_data_to_arrays(
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\internals\construction.py", line 845, in to_arraysuction.py", line 520, in nested_data_to_arrays
arrays, columns = to_arrays(data, columns, dtype=dtype) uction.py", line 942, in _finalize_columns_and_data
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\internals\construction.py", line 845, in to_arrays
content, columns = _finalize_columns_and_data(arr, columns, dtype)
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\internals\construction.py", line 942, in _finalize_columns_and_data
raise ValueError(err) from err
ValueError: 7 columns passed, passed data had 1 columns
Desktop (please complete the following information):
OS: windows 10
Browser Chrome
Python 3.10
Additional context
看上去是没有处理数据源返回的“空数据”。
The text was updated successfully, but these errors were encountered:
Describe the bug
调用如下接口,参数“515670”,报异常
adata.fund.market.get_market_etf("515670")
To Reproduce
Steps to reproduce the behavior:
import adata
adata.fund.market.get_market_etf("515670")
Run
Expected behavior
Function crash
Screenshots
Crash Log:
Traceback (most recent call last):
File "d:\projects\outsource_data\main.py", line 37, in
adata.fund.market.get_market_etf("515670")
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\adata\fund\market\etf_market.py", line 30, in get_market_etf
return self.ths.get_market_etf_ths(fund_code, k_type, start_date, end_date)
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\adata\fund\market\etf_market_ths.py", line 50, in get_market_etf_ths
result_df = pd.DataFrame(data=data, columns=['trade_date', 'open', 'high', 'low', 'close', 'volume', 'amount'])
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\frame.py", line 851, in init
arrays, columns, index = nested_data_to_arrays(
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\internals\construction.py", line 520, in nested_data_to_arrays arrays, columns, index = nested_data_to_arrays(
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\internals\construction.py", line 845, in to_arraysuction.py", line 520, in nested_data_to_arrays
arrays, columns = to_arrays(data, columns, dtype=dtype) uction.py", line 942, in _finalize_columns_and_data
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\internals\construction.py", line 845, in to_arrays
content, columns = _finalize_columns_and_data(arr, columns, dtype)
File "d:\InstalledApp\conda\envs\outsource_data\lib\site-packages\pandas\core\internals\construction.py", line 942, in _finalize_columns_and_data
raise ValueError(err) from err
ValueError: 7 columns passed, passed data had 1 columns
Desktop (please complete the following information):
Additional context
看上去是没有处理数据源返回的“空数据”。
The text was updated successfully, but these errors were encountered: