#143에 대한 패치 이후 analyze_xbrl()에서 에러가 발생하는 케이스
Closed this issue · 5 comments
sukwoo1414 commented
#143 에 댓글로 추가했다가 다시 이슈 올립니다.
v0.4.5 버전 사용시 다수 종목에서 아래와 같은 오류가 발생합니다.
종목은 035460, 03490, 034810, ... 등입니다. dart에서 보면 해당 종목의 재무제표가 정상적으로 올라와있습니다
Traceback (most recent call last):
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/reports.py", line 404, in load_xbrl
file_path = download_xbrl(path=path, rcept_no=self.rcept_no)
File "/home/swy/.local/lib/python3.10/site-packages/dart_fss/api/finance/xbrl.py", line 38, in download_xbrl
resp = request.download(url=url, path=temp, payload=payload)
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/utils/request.py", line 248, in download
raise FileNotFoundError('target does not exist')
FileNotFoundError: target does not exist
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/swyang/test/report.py", line 162, in do_get_fn_from_report
return analyze_xbrl(report,
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/fs/extract.py", line 1098, in analyze_xbrl
xbrl = report.xbrl
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/reports.py", line 395, in xbrl
self.load_xbrl()
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/reports.py", line 407, in load_xbrl
xbrl_attached = self._get_xbrl()
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/reports.py", line 428, in _get_xbrl
attached_files = self.find_all(**query)
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/reports.py", line 389, in find_all
dataset[s] = func_set[s]()
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/reports.py", line 376, in fn_xbrlviewer
def fn_xbrlviewer(): return self.xbrlviewer.find_all(**kwargs)
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/reports.py", line 312, in xbrlviewer
self.extract_xbrlviewer()
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/reports.py", line 317, in extract_xbrlviewer
self._xbrlviewer = XBRLViewer(self.rcp_no, lazy_loading=False)
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/xbrl_viewer.py", line 36, in __init__
self.load()
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/xbrl_viewer.py", line 109, in load
self.extract_attached_files()
File "/home/swyang/.local/lib/python3.10/site-packages/dart_fss/filings/xbrl_viewer.py", line 100, in extract_attached_files
url_path = tds[1].find('a')['href']
analyze_xbrl() 호출시 사용한 코드는 아래와 같습니다.
from dart_fss.fs.extract import analyze_xbrl
...
def do_get_fn_from_report(report):
try:
return analyze_xbrl(report,
separate=True,
show_abstract=False,
show_class=False,
show_concept=True,
)
...
재시도해도 동일한 종목에서 동일한 에러가 발생합니다. 제 로컬 문제일까요?
josw123 commented
오늘 중으로 확인해서 답변드리도록 하겠습니다
josw123 commented
sukwoo1414 commented
사용한 환경은 Ubuntu 22.04, Python3.10이고 가상환경은 사용하지않고 있습니다. 오늘 해보니 며칠전과 에러나는 종목들이 약간 달라졌는데, 여전히 많은 수의 종목에서 위와 같은 에러가 발생하고 있습니다. 제 코드와 댓글로 달아주신 코드로 각각 확인했습니다. 아래는 문제가 발생한 종목코드들의 일부입니다.
000100, 002760, 003090, 003490, 003920, 004430, 004690, 005430, 009410, 010950, 016580, 033630, 033920, 036220, ..
위 종목코드에서 문제가 없다면 제 로컬 문제로 봐야 할 것 같습니다
josw123 commented
josw123 commented
관련 버그를 수정하여 배포(v0.4.7) 하였습니다.
버그리포트 감사합니다.