Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

oci.pagination.list_call_get_all_results fails when using identity domain client

オープン
#627 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
api

調査の方向性

oci/pagination/pagination_utils.py の list_call_get_all_results から始め、次に identity_domains.IdentityDomainsClient.list_groups を使って呼び出しを再現します。ページネーションヘルパーが使用するレスポンスデータの形状とアイデンティティドメインのレスポンスを比較し、ページネーションによって AttributeError なしですべてのグループが返されることを確認します。

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

説明

SDK

SDK version 2.123.0
Python version 3.11.4

When attempting to use oci.pagination.list_call_get_all_results with the list_groups method of oci.identity.IdentityClient, the call fails with the following error:

Traceback (most recent call last):
File "/Users/cpasternak/repos/oci_helpers/groups.py", line 48, in get_all_groups_idd
group_list=oci.pagination.list_call_get_all_results(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cpasternak/Library/Python/3.11/lib/python/site-packages/oci/pagination/pagination_utils.py", line 218, in list_call_get_all_results
else aggregated_results.extend(call_result.data.items)
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Groups' object has no attribute 'items'

CODE:
config=valid OCI config
url="https://idcs-c2ee2b3360e24cea83df0f956fb007d5.identity.oraclecloud.com:443"
identity_domain_client = oci.identity_domains.IdentityDomainsClient(config, url)
group_list=oci.pagination.list_call_get_all_results(
identity_domain_client.list_groups,
retry_strategy=oci.retry.DEFAULT_RETRY_STRATEGY
).data

It would appear that the aggregated_results.extend function is looking for .items, but with the identity domain client, it uses the terminology .resources (not .items)

主要言語
Python
スター
474
フォーク
321
平均マージ
23分
マージ済み PR(30日)
4

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

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

はじめの一歩

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

oracle/oci-python-sdk のほかの issue

oracle/oci-python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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