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,
50
50
Args:
51
51
api_key (str): API key. If None, the key is obtained from the "LABELBOX_API_KEY" environment variable.
52
52
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
54
54
Raises:
55
55
labelbox.exceptions.AuthenticationError: If no `api_key`
56
56
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):
27
27
email = Field .String ("email" , "inviteeEmail" )
28
28
29
29
def __init__ (self , client , invite_response ):
30
- #invite_response.get('inviter')
31
30
project_roles = invite_response .pop ("projectInvites" , [])
32
31
super ().__init__ (client , invite_response )
33
32
Original file line number Diff line number Diff line change 7
7
from labelbox .schema .invite import Invite , InviteLimit , ProjectRole
8
8
from labelbox .schema .user import User
9
9
from labelbox .schema .role import Role
10
- import logging
11
-
12
- logger = logging .getLogger (__name__ )
13
10
14
11
15
12
class Organization (DbObject ):
@@ -64,8 +61,8 @@ def invite_user(
64
61
65
62
Notes:
66
63
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
69
66
2. Multiple invites can be sent for the same email. This can only be resolved in the UI for now.
70
67
- Future releases of the SDK will support the ability to query and revoke invites to solve this problem (and/or checking on the backend)
71
68
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 1
1
from dataclasses import dataclass
2
+ from typing import Dict , Optional , TYPE_CHECKING
2
3
3
4
from labelbox .orm .model import Field
4
5
from labelbox .orm .db_object import DbObject
5
6
from labelbox .schema .project import Project
6
7
7
- _ROLES = None
8
+ if TYPE_CHECKING :
9
+ from labelbox import Client
8
10
11
+ _ROLES : Optional [Dict [str , "Role" ]] = None
9
12
10
- def get_roles (client ):
13
+
14
+ def get_roles (client : "Client" ) -> Dict [str , "Role" ]:
11
15
global _ROLES
12
16
if _ROLES is None :
13
17
query_str = """query GetAvailableUserRolesPyApi { roles { id name } }"""
You can’t perform that action at this time.
0 commit comments