eido crashes on missing values when converting to CSV

オープン 初心者向け
#88 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
data

調査の方向性

トレースバックは eido/output_formatters.py、特に float を受け取る join の箇所にある _convert_sample_to_row を指しています。CSV 変換は eido/conversion_plugins.py から始まります。これらのパスを読み、空の値がどのようにフォーマッターに渡されるかを確認してください。空の列を含む PEP を変換したときに型エラーを起こさず CSV が生成されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

I have a PEP project where some columns can be empty. When this happens eido crashes when producing CSV output:

  File "mambaforge/envs/PEP2/bin/eido", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "mambaforge/envs/PEP2/lib/python3.15/site-packages/eido/cli.py", line 123, in main
    convert_project(p, args.format, plugin_kwargs)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "mambaforge/envs/PEP2/lib/python3.15/site-packages/eido/conversion.py", line 47, in convert_project
    return run_filter(prj, target_format, plugin_kwargs=plugin_kwargs or dict())
  File "mambaforge/envs/PEP2/lib/python3.15/site-packages/eido/conversion.py", line 83, in run_filter
    conv_result = func(prj, **plugin_kwargs)
  File "mambaforge/envs/PEP2/lib/python3.15/site-packages/eido/conversion_plugins.py", line 57, in csv_pep_filter
    return {"samples": MultilineOutputFormatter.format(p.samples)}
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "mambaforge/envs/PEP2/lib/python3.15/site-packages/eido/output_formatters.py", line 33, in format
    sample_rows = MultilineOutputFormatter._split_sample_to_multiple_rows(
        sample, sample_attributes, attribute_with_multiple_properties
    )
  File "mambaforge/envs/PEP2/lib/python3.15/site-packages/eido/output_formatters.py", line 78, in _split_sample_to_multiple_rows
    sample_row = MultilineOutputFormatter._convert_sample_to_row(
        sample, sample_attributes, sample_index
    )
  File "mambaforge/envs/PEP2/lib/python3.15/site-packages/eido/output_formatters.py", line 119, in _convert_sample_to_row
    return ",".join(sample_row)
           ~~~~~~~~^^^^^^^^^^^^
TypeError: sequence item 7: expected str instance, float found

It looks like this is caused by the empty value being converted to nan, which is of type float, not str.

主要言語
Python
スター
5
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pepkit/eido のほかの issue

pepkit/eido の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。