Skip to content

Commit af4a6f0

Browse files
committed
Fix
- TypeError: 'ABCMeta' object is not subscriptable - AttributeError: partially initialized module 'firebase_admin._user_mgt' has no attribute 'UserMetadata' (most likely due to a circular import) - db.Reference signature
1 parent a4eace1 commit af4a6f0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

firebase_admin/_user_import.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __init__(
142142
phone_number: typing.Optional[str] = None,
143143
photo_url: typing.Optional[str] = None,
144144
disabled: typing.Optional[bool] = None,
145-
user_metadata: typing.Optional[_user_mgt.UserMetadata] = None,
145+
user_metadata: typing.Optional['_user_mgt.UserMetadata'] = None,
146146
provider_data: typing.Optional[typing.List[UserProvider]] = None,
147147
custom_claims: typing.Optional[typing.Dict[str, typing.Any]] = None,
148148
password_hash: typing.Optional[bytes] = None,
@@ -218,11 +218,11 @@ def password_salt(self, password_salt: typing.Optional[bytes]) -> None:
218218
self._password_salt = _auth_utils.validate_bytes(password_salt, 'password_salt')
219219

220220
@property
221-
def user_metadata(self) -> typing.Optional[_user_mgt.UserMetadata]:
221+
def user_metadata(self) -> typing.Optional['_user_mgt.UserMetadata']:
222222
return self._user_metadata
223223

224224
@user_metadata.setter
225-
def user_metadata(self, user_metadata: typing.Optional[_user_mgt.UserMetadata]) -> None:
225+
def user_metadata(self, user_metadata: typing.Optional['_user_mgt.UserMetadata']) -> None:
226226
created_at = user_metadata.creation_timestamp if user_metadata is not None else None
227227
last_login_at = user_metadata.last_sign_in_timestamp if user_metadata is not None else None
228228
self._created_at = _auth_utils.validate_timestamp(created_at, 'creation_timestamp')

firebase_admin/db.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,24 @@ class Reference:
160160
def __init__(
161161
self,
162162
*,
163-
client: "_Client",
164-
path: str,
163+
segments: typing.List[str],
164+
client: typing.Optional["_Client"] = None,
165165
**kwargs: typing.Any,
166166
) -> None: ...
167167
@typing.overload
168168
def __init__(
169169
self,
170170
*,
171-
client: "_Client",
172-
segments: typing.List[str],
171+
path: str,
172+
client: typing.Optional["_Client"] = None,
173173
**kwargs: typing.Any,
174174
) -> None: ...
175175
def __init__(
176176
self,
177177
*,
178-
client: "_Client",
179178
path: typing.Optional[str] = None,
180179
segments: typing.Optional[typing.List[str]] = None,
180+
client: typing.Optional["_Client"] = None,
181181
**kwargs: typing.Any,
182182
) -> None:
183183
"""Creates a new Reference using the provided parameters.

0 commit comments

Comments
 (0)