python / python/typeshed

geopandas: index type should be Any

オープン
#15,111 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

stubs: false positive
主要言語
Python
スター
5.1k
フォーク
2.1k
平均マージ
1日 19時間
マージ済み PR(30日)
82

説明

My repo currently satisfies pandas-stubs type hints. However, when I add types-geopandas, I see hundreds of new issues:

error: "Index[Any]" has no attribute "overlaps" [attr-defined]
error: "Index[Any]" has no attribute "left" [attr-defined]
error: "Index[Any]" has no attribute "right" [attr-defined]

I'm using pd.IntervalIndex, which has these attributes. However, pandas currently has no way of typing DataFrame indices (https://github.com/pandas-dev/pandas/issues/36708), so there is no way of knowing which kind of index is returned.

I think it would be more correct to use typing.Any here since it is unknown and dynamic.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

特定のファイルやテストは指定されていません。まず、DataFrame のインデックスに関する types-geopandas のアノテーションを見つけ、インデックスの種類を型付けできない pandas の現状と比較してください。完了とは、両方のスタブパッケージを使用したときに、報告されている IntervalIndex 属性エラーがもはや生成されないことを意味します。

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

評価

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

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

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