File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def __init__(self,
5050 Args:
5151 api_key (str): API key. If None, the key is obtained from the "LABELBOX_API_KEY" environment variable.
5252 endpoint (str): URL of the Labelbox server to connect to.
53- enable_experimental (bool): Indicated whether or not to use experimental features
53+ enable_experimental (bool): Indicates whether or not to use experimental features
5454 Raises:
5555 labelbox.exceptions.AuthenticationError: If no `api_key`
5656 is provided as an argument or via the environment
Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ class Invite(DbObject):
2727 email = Field .String ("email" , "inviteeEmail" )
2828
2929 def __init__ (self , client , invite_response ):
30- #invite_response.get('inviter')
3130 project_roles = invite_response .pop ("projectInvites" , [])
3231 super ().__init__ (client , invite_response )
3332
Original file line number Diff line number Diff line change 77from labelbox .schema .invite import Invite , InviteLimit , ProjectRole
88from labelbox .schema .user import User
99from labelbox .schema .role import Role
10- import logging
11-
12- logger = logging .getLogger (__name__ )
1310
1411
1512class Organization (DbObject ):
@@ -64,8 +61,8 @@ def invite_user(
6461
6562 Notes:
6663 This function is currently experimental and has a few limitations that will be resolved in future releases
67- 1. There is a really unclear foreign key error if you use an unsupported role.
68- - This means that the `Roles` object is not getting the right ids
64+ 1. If you try to add an unsupported you will get an error referring to invalid foreign keys
65+ - In this case `role.get_roles` is likely not getting the right ids
6966 2. Multiple invites can be sent for the same email. This can only be resolved in the UI for now.
7067 - Future releases of the SDK will support the ability to query and revoke invites to solve this problem (and/or checking on the backend)
7168 3. Some server side response are unclear (e.g. if the user invites themself `None` is returned which the SDK raises as a `LabelboxError` )
Original file line number Diff line number Diff line change 11from dataclasses import dataclass
2+ from typing import Dict , Optional , TYPE_CHECKING
23
34from labelbox .orm .model import Field
45from labelbox .orm .db_object import DbObject
56from labelbox .schema .project import Project
67
7- _ROLES = None
8+ if TYPE_CHECKING :
9+ from labelbox import Client
810
11+ _ROLES : Optional [Dict [str , "Role" ]] = None
912
10- def get_roles (client ):
13+
14+ def get_roles (client : "Client" ) -> Dict [str , "Role" ]:
1115 global _ROLES
1216 if _ROLES is None :
1317 query_str = """query GetAvailableUserRolesPyApi { roles { id name } }"""
You can’t perform that action at this time.
0 commit comments