Fix typos and wrong types in remote_config.py
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
調査の方向性
firebase_admin/remote_config.py から始め、evaluate_custom_signal_condition と _Value.as_int() を、近くにある型処理とともに読みます。Issue に照らしてフォールバック値と戻り値アノテーションを確認し、利用可能であればリポジトリの関連する remote-config テストを実行します。デフォルト値とアノテーションが回帰なしにそれぞれのフィールド型と一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
[READ] Step 1: Are you in the right place?
This is a bug in the code of this repository (firebase_admin/remote_config.py).
[REQUIRED] Step 2: Describe your environment
- Operating System version: Windows 11
- Firebase SDK version: 6.x (latest)
- Firebase Product: remote_config
- Python version: 3.11
- Pip version: 24.x
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
In firebase_admin/remote_config.py, the method evaluate_custom_signal_condition
uses {} (empty dict) as the default fallback for string and list fields:
custom_signal_operator = custom_signal_condition.get('customSignalOperator') or {}
custom_signal_key = custom_signal_condition.get('customSignalKey') or {}
target_custom_signal_values = custom_signal_condition.get('targetCustomSignalValues') or {}
These should be '' (string) and [] (list) respectively, as the fields are
not dicts. Using {} is semantically incorrect.
Also, _Value.as_int() has a wrong return type annotation -> float instead
of -> int.
Relevant Code:
# Wrong defaults — should be '' and []
custom_signal_operator = custom_signal_condition.get('customSignalOperator') or {}
custom_signal_key = custom_signal_condition.get('customSignalKey') or {}
target_custom_signal_values = custom_signal_condition.get('targetCustomSignalValues') or {}
# Wrong return type annotation — should be -> int
def as_int(self) -> float:
"""Returns the value as a number."""
- 主要言語
- Python
- スター
- 1.2k
- フォーク
- 359
- 平均マージ
- 5日 6分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-admin-python のほかの issue
-
api: database type: feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
firebase/firebase-admin-python#978 · コメント 1 件 ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) オープンapi: auth
firebase/firebase-admin-python#949 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
firebase/firebase-admin-python#945 · コメント 1 件 · リアクション 1 件 ·
-
type: feature request
firebase/firebase-admin-python#915 · コメント 5 件 · リアクション 3 件 · 担当者 3 名 ·
firebase/firebase-admin-python の issue をすべて見る
似ている issue
-
documentation help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
simonw/sqlite-utils#872 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100