Fix typos and wrong types in remote_config.py

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

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

評価

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

調査の方向性

firebase_admin/remote_config.py から始め、evaluate_custom_signal_condition と _Value.as_int() を、近くにある型処理とともに読みます。Issue に照らしてフォールバック値と戻り値アノテーションを確認し、利用可能であればリポジトリの関連する remote-config テストを実行します。デフォルト値とアノテーションが回帰なしにそれぞれのフィールド型と一致すれば完了です。

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

説明

api: remoteconfig
[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

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

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

はじめの一歩

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

firebase/firebase-admin-python のほかの issue

firebase/firebase-admin-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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