Skip to content

[Bug]: _showSegmentsSub('composition') 호출 시 ShapeError — 컬럼 높이 불일치? #17

@ghostflare76

Description

@ghostflare76

DartLab Version

0.7.15

Python Version

Other

Area

Company / Core

Description

사업부문별 매출 비중 데이터가 필요해서 company._showSegmentsSub('composition')으로 사업부문별 매출 비중 데이터를 조회하면, 내부 toDataFrame() 호출 시 polars ShapeError가 발생합니다. 세그먼트 테이블의 컬럼 간 행 수가 불일치하여 DataFrame 생성에 실패합니다. region과 product 타입은 동일 종목에서 정상 동작합니다.

추가 정보:

  • region 결과: cols=['계정명', '미주', '유럽', '아시아 및 아프리카', '중국'] — 정상
  • product 결과: cols=['계정명', 'TV, 모니터 등', '스마트폰 등', '메모리', '디스플레이 패널'] — 정상
  • composition만 컬럼 간 행 수 불일치로 실패

Steps to Reproduce

import dartlab

 c = dartlab.Company("005930")  # 삼성전자

 # region, product는 정상
 r1 = c._showSegmentsSub("region")   # OK — 1 row
 r2 = c._showSegmentsSub("product")  # OK — 1 row

 # composition에서 에러 발생
 r3 = c._showSegmentsSub("composition")  # ShapeError

Expected Behavior

composition 타입도 정상적으로 DataFrame 반환:

  • 사업부문별 매출 비중 (예: DX 부문, DS 부문, SDC, 하만 등)
  • region/product와 동일한 형태의 1행 DataFrame

Actual Behavior

polars.exceptions.ShapeError: could not create a new DataFrame:
height of column 'DX 부문' (8) does not match height of column '계정명' (4)

Error Output / Logs


Operating System

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions