Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions docs/sdk/notification.md

This file was deleted.

1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ nav:
- Label Utils: sdk/label_utils.md
- Label Parsing: sdk/label_parsing.md
- LLM: sdk/llm.md
- Notification: sdk/notification.md
- Organization: sdk/organization.md
- Plugins: sdk/plugins.md
- Project: sdk/project.md
Expand Down
8 changes: 1 addition & 7 deletions src/kili/adapters/kili_api_gateway/notification/mappers.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
"""Mappers for notification API calls."""


from kili.adapters.kili_api_gateway.user.mappers import user_where_mapper
from kili.domain.notification import NotificationFilter


def map_notification_filter(filters: NotificationFilter) -> dict:
"""Build the GraphQL NotificationWhere variable to be sent in an operation."""
return {
"hasBeenSeen": filters.has_been_seen,
"id": filters.id,
"user": user_where_mapper(filters.user) if filters.user else None,
}
return {"id": filters.id}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,3 @@ def list_notifications(
return PaginatedGraphQLQuery(self.graphql_client).execute_query_from_paginated_call(
query, where, options, "Retrieving notifications", GQL_COUNT_NOTIFICATIONS
)

def count_notification(self, filters: NotificationFilter) -> int:
"""Count notifications."""
variables = {"where": map_notification_filter(filters=filters)}
return self.graphql_client.execute(GQL_COUNT_NOTIFICATIONS, variables)["data"]
4 changes: 0 additions & 4 deletions src/kili/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from kili.core.graphql.graphql_client import GraphQLClient, GraphQLClientName
from kili.entrypoints.mutations.asset import MutationsAsset
from kili.entrypoints.mutations.issue import MutationsIssue
from kili.entrypoints.mutations.notification import MutationsNotification
from kili.entrypoints.mutations.plugins import MutationsPlugins
from kili.entrypoints.mutations.project import MutationsProject
from kili.entrypoints.mutations.project_version import MutationsProjectVersion
Expand All @@ -31,7 +30,6 @@
from kili.presentation.client.internal import InternalClientMethods
from kili.presentation.client.issue import IssueClientMethods
from kili.presentation.client.label import LabelClientMethods
from kili.presentation.client.notification import NotificationClientMethods
from kili.presentation.client.organization import OrganizationClientMethods
from kili.presentation.client.project import ProjectClientMethods
from kili.presentation.client.project_workflow import ProjectWorkflowClientMethods
Expand Down Expand Up @@ -63,7 +61,6 @@ def filter(self, record) -> bool:
class Kili( # pylint: disable=too-many-ancestors,too-many-instance-attributes
MutationsAsset,
MutationsIssue,
MutationsNotification,
MutationsPlugins,
MutationsProject,
MutationsProjectVersion,
Expand All @@ -75,7 +72,6 @@ class Kili( # pylint: disable=too-many-ancestors,too-many-instance-attributes
CloudStorageClientMethods,
IssueClientMethods,
LabelClientMethods,
NotificationClientMethods,
OrganizationClientMethods,
ProjectClientMethods,
ProjectWorkflowClientMethods,
Expand Down
7 changes: 0 additions & 7 deletions src/kili/core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
]


NotificationStatus = Literal[
"FAILURE",
"PENDING",
"SUCCESS",
]


OrganizationRole = Literal[
"ADMIN",
"USER",
Expand Down
7 changes: 1 addition & 6 deletions src/kili/domain/notification.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"""Notification domain."""

from dataclasses import dataclass
from typing import TYPE_CHECKING, NewType, Optional

if TYPE_CHECKING:
from .user import UserFilter
from typing import NewType, Optional

NotificationId = NewType("NotificationId", str)

Expand All @@ -13,6 +10,4 @@
class NotificationFilter:
"""Notification filter."""

has_been_seen: Optional[bool]
id: Optional[NotificationId]
user: Optional["UserFilter"]
74 changes: 0 additions & 74 deletions src/kili/entrypoints/mutations/notification/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions src/kili/entrypoints/mutations/notification/fragments.py

This file was deleted.

41 changes: 0 additions & 41 deletions src/kili/entrypoints/mutations/notification/queries.py

This file was deleted.

145 changes: 0 additions & 145 deletions src/kili/presentation/client/notification.py

This file was deleted.

9 changes: 8 additions & 1 deletion src/kili/services/asset_import/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
)
from kili.core.helpers import T, format_result, get_mime_type, is_url
from kili.core.utils.pagination import batcher
from kili.domain.notification import NotificationFilter, NotificationId
from kili.domain.organization import OrganizationFilters
from kili.domain.project import InputType, ProjectId
from kili.domain.types import ListOrTuple
Expand Down Expand Up @@ -139,7 +140,13 @@ def verify_batch_imported(self, notification_id: str) -> None:
reraise=True,
):
with attempt:
notification = self.kili.notifications(notification_id=notification_id)[0]
notification = list(
self.kili.kili_api_gateway.list_notifications(
filters=NotificationFilter(id=NotificationId(notification_id)),
fields=("status",),
options=QueryOptions(disable_tqdm=True, first=1, skip=0),
)
)[0]
if notification["status"] == "FAILURE":
error_message = (
"Some assets were not imported. "
Expand Down
Loading
Loading