File tree Expand file tree Collapse file tree
src/kili/adapters/kili_api_gateway/asset Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""GraphQL payload data mappers for asset operations."""
22
3+ import warnings
4+
35from kili .domain .asset import AssetFilters
46
7+ MAX_PARTIAL_EXTERNAL_IDS_FILTER = 10
8+
59
610def asset_where_mapper (filters : AssetFilters ):
711 """Build the GraphQL AssetWhere variable to be sent in an operation."""
12+ if (
13+ filters .external_id_in is not None
14+ and len (filters .external_id_in ) > MAX_PARTIAL_EXTERNAL_IDS_FILTER
15+ ):
16+ warnings .warn (
17+ f"Requesting more than { MAX_PARTIAL_EXTERNAL_IDS_FILTER } partial external IDs"
18+ "in a single query is deprecated. You can use the `external_id_strictly_in`"
19+ f"field to filter by more than { MAX_PARTIAL_EXTERNAL_IDS_FILTER } external IDs. "
20+ "This limit will be enforced in next versions." ,
21+ stacklevel = 5 ,
22+ )
823 return {
924 "id" : filters .asset_id ,
1025 "project" : {
You can’t perform that action at this time.
0 commit comments