Fix typos and wrong types in remote_config.py
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 75/100
Rechercherichtung
Beginne in firebase_admin/remote_config.py, indem du evaluate_custom_signal_condition und _Value.as_int() zusammen mit der Typbehandlung in der Nähe liest. Überprüfe die Fallback-Werte und die Rückgabeannotation anhand des Issues und führe anschließend, falls verfügbar, die relevanten remote-config-Tests des Repositorys aus; abgeschlossen ist die Aufgabe, wenn die Defaults und die Annotation ohne Regressionen mit ihren Feldtypen übereinstimmen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
[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."""
- Vorherrschende Sprache
- Python
- Sterne
- 1.2k
- Forks
- 359
- Ø Merge
- 5 T. 6 Min.
- Gemergte PRs (30 T.)
- 2
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus firebase/firebase-admin-python
-
api: database type: feature request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
firebase/firebase-admin-python#978 · 1 Kommentar ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) Offenapi: auth
firebase/firebase-admin-python#949 · 2 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 43/100
firebase/firebase-admin-python#945 · 1 Kommentar · 1 Reaktion ·
-
type: feature request
firebase/firebase-admin-python#915 · 5 Kommentare · 3 Reaktionen · 3 zugewiesene Personen ·
Alle Issues in firebase/firebase-admin-python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100