diff --git a/.github/workflows/test_installability.yml b/.github/workflows/test_installability.yml index 4f7c17fb..ef21c616 100644 --- a/.github/workflows/test_installability.yml +++ b/.github/workflows/test_installability.yml @@ -20,7 +20,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install the current SDK version from PyPI - run: pip install exabel-data-sdk --no-cache-dir + run: pip install exabel --no-cache-dir - name: Post to Slack uses: ravsamhq/notify-slack-action@2.5.0 diff --git a/README.md b/README.md index 1baff41f..468084ea 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ A Python SDK which provides easy access to Exabel APIs. ## Installation ```shell -pip install exabel-data-sdk +pip install exabel ``` -or download from [PyPI](https://pypi.org/project/exabel-data-sdk/). +or download from [PyPI](https://pypi.org/project/exabel/). The SDK requires Python 3.10 or later. @@ -18,10 +18,10 @@ For installation with support for exporting data from a various SQL based data s ```shell # Install the Exabel Python SDK with Snowflake support: -pip install exabel-data-sdk[snowflake] +pip install exabel[snowflake] # Or install multiple data sources at the same time: -pip install exabel-data-sdk[snowflake,bigquery,athena] +pip install exabel[snowflake,bigquery,athena] ``` Supported data sources are: @@ -40,7 +40,7 @@ until the token expires. [Export API Developer guide](https://help.exabel.com/docs/exporting-via-exabel-sdk) -[Examples of usage](https://github.com/Exabel/python-sdk/tree/main/exabel_data_sdk/examples). +[Examples of usage](https://github.com/Exabel/python-sdk/tree/main/exabel/examples). ## Exabel API documentation diff --git a/autoformat.sh b/autoformat.sh index 643426b4..30da3118 100755 --- a/autoformat.sh +++ b/autoformat.sh @@ -2,5 +2,5 @@ # Autoformats all Python files with isort and black. -ruff check --fix exabel_data_sdk -ruff format exabel_data_sdk +ruff check --fix exabel +ruff format exabel diff --git a/exabel_data_sdk/__init__.py b/exabel/__init__.py similarity index 100% rename from exabel_data_sdk/__init__.py rename to exabel/__init__.py diff --git a/exabel_data_sdk/client/__init__.py b/exabel/client/__init__.py similarity index 100% rename from exabel_data_sdk/client/__init__.py rename to exabel/client/__init__.py diff --git a/exabel_data_sdk/client/api/__init__.py b/exabel/client/api/__init__.py similarity index 100% rename from exabel_data_sdk/client/api/__init__.py rename to exabel/client/api/__init__.py diff --git a/exabel_data_sdk/client/api/api_client/__init__.py b/exabel/client/api/api_client/__init__.py similarity index 100% rename from exabel_data_sdk/client/api/api_client/__init__.py rename to exabel/client/api/api_client/__init__.py diff --git a/exabel_data_sdk/client/api/api_client/calendar_api_client.py b/exabel/client/api/api_client/calendar_api_client.py similarity index 81% rename from exabel_data_sdk/client/api/api_client/calendar_api_client.py rename to exabel/client/api/api_client/calendar_api_client.py index dafa59e4..4a929e88 100644 --- a/exabel_data_sdk/client/api/api_client/calendar_api_client.py +++ b/exabel/client/api/api_client/calendar_api_client.py @@ -1,9 +1,11 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.data.v1.calendar_service_pb2 import ( +from exabel.stubs.exabel.api.data.v1.calendar_service_pb2 import ( BatchCreateFiscalPeriodsRequest, BatchCreateFiscalPeriodsResponse, + CompanyCalendar, DeleteFiscalPeriodRequest, + GetCompanyCalendarRequest, ListCompaniesWithFiscalPeriodsRequest, ListCompaniesWithFiscalPeriodsResponse, ListFiscalPeriodsRequest, @@ -14,6 +16,10 @@ class CalendarApiClient(ABC): """Superclass for clients that send calendar requests to the Exabel Data API.""" + @abstractmethod + def get_company_calendar(self, request: GetCompanyCalendarRequest) -> CompanyCalendar: + """Get the fiscal calendar for a company.""" + @abstractmethod def batch_create_fiscal_periods( self, request: BatchCreateFiscalPeriodsRequest diff --git a/exabel_data_sdk/client/api/api_client/data_set_api_client.py b/exabel/client/api/api_client/data_set_api_client.py similarity index 93% rename from exabel_data_sdk/client/api/api_client/data_set_api_client.py rename to exabel/client/api/api_client/data_set_api_client.py index 0b78372b..272f3b55 100644 --- a/exabel_data_sdk/client/api/api_client/data_set_api_client.py +++ b/exabel/client/api/api_client/data_set_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateDataSetRequest, DataSet, DeleteDataSetRequest, diff --git a/exabel_data_sdk/client/api/api_client/derived_signal_api_client.py b/exabel/client/api/api_client/derived_signal_api_client.py similarity index 93% rename from exabel_data_sdk/client/api/api_client/derived_signal_api_client.py rename to exabel/client/api/api_client/derived_signal_api_client.py index a0766bcd..c338f162 100644 --- a/exabel_data_sdk/client/api/api_client/derived_signal_api_client.py +++ b/exabel/client/api/api_client/derived_signal_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( CreateDerivedSignalRequest, DeleteDerivedSignalRequest, DerivedSignal, diff --git a/exabel_data_sdk/client/api/api_client/entity_api_client.py b/exabel/client/api/api_client/entity_api_client.py similarity index 97% rename from exabel_data_sdk/client/api/api_client/entity_api_client.py rename to exabel/client/api/api_client/entity_api_client.py index bc443d92..7c89321e 100644 --- a/exabel_data_sdk/client/api/api_client/entity_api_client.py +++ b/exabel/client/api/api_client/entity_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateEntityRequest, CreateEntityTypeRequest, DeleteEntitiesRequest, diff --git a/exabel_data_sdk/client/api/api_client/exabel_api_group.py b/exabel/client/api/api_client/exabel_api_group.py similarity index 94% rename from exabel_data_sdk/client/api/api_client/exabel_api_group.py rename to exabel/client/api/api_client/exabel_api_group.py index dd5b9a5a..f4912ee9 100644 --- a/exabel_data_sdk/client/api/api_client/exabel_api_group.py +++ b/exabel/client/api/api_client/exabel_api_group.py @@ -1,6 +1,6 @@ from enum import Enum, auto -from exabel_data_sdk.client.client_config import ClientConfig +from exabel.client.client_config import ClientConfig class ExabelApiGroup(Enum): diff --git a/exabel_data_sdk/client/api/api_client/grpc/__init__.py b/exabel/client/api/api_client/grpc/__init__.py similarity index 100% rename from exabel_data_sdk/client/api/api_client/grpc/__init__.py rename to exabel/client/api/api_client/grpc/__init__.py diff --git a/exabel_data_sdk/client/api/api_client/grpc/base_grpc_client.py b/exabel/client/api/api_client/grpc/base_grpc_client.py similarity index 95% rename from exabel_data_sdk/client/api/api_client/grpc/base_grpc_client.py rename to exabel/client/api/api_client/grpc/base_grpc_client.py index 9f78ece8..45e786ab 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/base_grpc_client.py +++ b/exabel/client/api/api_client/grpc/base_grpc_client.py @@ -2,8 +2,8 @@ import grpc -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.client_config import ClientConfig +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.client_config import ClientConfig SIXTEEN_MEGABYTES_IN_BYTES = 16 * 1024 * 1024 diff --git a/exabel_data_sdk/client/api/api_client/grpc/calendar_grpc_client.py b/exabel/client/api/api_client/grpc/calendar_grpc_client.py similarity index 67% rename from exabel_data_sdk/client/api/api_client/grpc/calendar_grpc_client.py rename to exabel/client/api/api_client/grpc/calendar_grpc_client.py index 0ab9748e..f342fd9e 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/calendar_grpc_client.py +++ b/exabel/client/api/api_client/grpc/calendar_grpc_client.py @@ -1,18 +1,20 @@ -from exabel_data_sdk.client.api.api_client.calendar_api_client import CalendarApiClient -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.calendar_service_pb2 import ( +from exabel.client.api.api_client.calendar_api_client import CalendarApiClient +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.calendar_service_pb2 import ( BatchCreateFiscalPeriodsRequest, BatchCreateFiscalPeriodsResponse, + CompanyCalendar, DeleteFiscalPeriodRequest, + GetCompanyCalendarRequest, ListCompaniesWithFiscalPeriodsRequest, ListCompaniesWithFiscalPeriodsResponse, ListFiscalPeriodsRequest, ListFiscalPeriodsResponse, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.calendar_service_pb2_grpc import CalendarServiceStub +from exabel.stubs.exabel.api.data.v1.calendar_service_pb2_grpc import CalendarServiceStub class CalendarGrpcClient(CalendarApiClient, BaseGrpcClient): @@ -24,6 +26,12 @@ def __init__(self, config: ClientConfig): super().__init__(config, ExabelApiGroup.DATA_API) self.stub = CalendarServiceStub(self.channel) + @handle_grpc_error + def get_company_calendar(self, request: GetCompanyCalendarRequest) -> CompanyCalendar: + return self.stub.GetCompanyCalendar( + request, metadata=self.metadata, timeout=self.config.timeout + ) + @handle_grpc_error def batch_create_fiscal_periods( self, request: BatchCreateFiscalPeriodsRequest diff --git a/exabel_data_sdk/client/api/api_client/grpc/data_set_grpc_client.py b/exabel/client/api/api_client/grpc/data_set_grpc_client.py similarity index 73% rename from exabel_data_sdk/client/api/api_client/grpc/data_set_grpc_client.py rename to exabel/client/api/api_client/grpc/data_set_grpc_client.py index db9eff8c..456c0150 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/data_set_grpc_client.py +++ b/exabel/client/api/api_client/grpc/data_set_grpc_client.py @@ -1,9 +1,9 @@ -from exabel_data_sdk.client.api.api_client.data_set_api_client import DataSetApiClient -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.api_client.data_set_api_client import DataSetApiClient +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateDataSetRequest, DataSet, DeleteDataSetRequest, @@ -12,7 +12,7 @@ ListDataSetsResponse, UpdateDataSetRequest, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2_grpc import DataSetServiceStub +from exabel.stubs.exabel.api.data.v1.all_pb2_grpc import DataSetServiceStub class DataSetGrpcClient(DataSetApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/derived_signal_grpc_client.py b/exabel/client/api/api_client/grpc/derived_signal_grpc_client.py similarity index 71% rename from exabel_data_sdk/client/api/api_client/grpc/derived_signal_grpc_client.py rename to exabel/client/api/api_client/grpc/derived_signal_grpc_client.py index 377c7d70..efabacb2 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/derived_signal_grpc_client.py +++ b/exabel/client/api/api_client/grpc/derived_signal_grpc_client.py @@ -1,16 +1,16 @@ -from exabel_data_sdk.client.api.api_client.derived_signal_api_client import DerivedSignalApiClient -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.client.api.api_client.derived_signal_api_client import DerivedSignalApiClient +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( CreateDerivedSignalRequest, DeleteDerivedSignalRequest, DerivedSignal, GetDerivedSignalRequest, UpdateDerivedSignalRequest, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2_grpc import DerivedSignalServiceStub +from exabel.stubs.exabel.api.analytics.v1.all_pb2_grpc import DerivedSignalServiceStub class DerivedSignalGrpcClient(DerivedSignalApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/entity_grpc_client.py b/exabel/client/api/api_client/grpc/entity_grpc_client.py similarity index 85% rename from exabel_data_sdk/client/api/api_client/grpc/entity_grpc_client.py rename to exabel/client/api/api_client/grpc/entity_grpc_client.py index 9d05f53d..63805b6a 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/entity_grpc_client.py +++ b/exabel/client/api/api_client/grpc/entity_grpc_client.py @@ -1,9 +1,9 @@ -from exabel_data_sdk.client.api.api_client.entity_api_client import EntityApiClient -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.api_client.entity_api_client import EntityApiClient +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateEntityRequest, CreateEntityTypeRequest, DeleteEntitiesRequest, @@ -22,7 +22,7 @@ UpdateEntityRequest, UpdateEntityTypeRequest, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2_grpc import EntityServiceStub +from exabel.stubs.exabel.api.data.v1.all_pb2_grpc import EntityServiceStub class EntityGrpcClient(EntityApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/holiday_grpc_client.py b/exabel/client/api/api_client/grpc/holiday_grpc_client.py similarity index 74% rename from exabel_data_sdk/client/api/api_client/grpc/holiday_grpc_client.py rename to exabel/client/api/api_client/grpc/holiday_grpc_client.py index 9f088be8..8a3c75ad 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/holiday_grpc_client.py +++ b/exabel/client/api/api_client/grpc/holiday_grpc_client.py @@ -1,10 +1,10 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.holiday_api_client import HolidayApiClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.holiday_messages_pb2 import HolidaySpecification -from exabel_data_sdk.stubs.exabel.api.data.v1.holiday_service_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.holiday_api_client import HolidayApiClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.holiday_messages_pb2 import HolidaySpecification +from exabel.stubs.exabel.api.data.v1.holiday_service_pb2 import ( CreateHolidaySpecificationRequest, DeleteHolidaySpecificationRequest, GetHolidaySpecificationRequest, @@ -12,7 +12,7 @@ ListHolidaySpecificationsResponse, UpdateHolidaySpecificationRequest, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.holiday_service_pb2_grpc import HolidayServiceStub +from exabel.stubs.exabel.api.data.v1.holiday_service_pb2_grpc import HolidayServiceStub class HolidayGrpcClient(HolidayApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/kpi_grpc_client.py b/exabel/client/api/api_client/grpc/kpi_grpc_client.py similarity index 83% rename from exabel_data_sdk/client/api/api_client/grpc/kpi_grpc_client.py rename to exabel/client/api/api_client/grpc/kpi_grpc_client.py index c41a48bc..196be0f5 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/kpi_grpc_client.py +++ b/exabel/client/api/api_client/grpc/kpi_grpc_client.py @@ -1,8 +1,8 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.kpi_api_client import KpiApiClient -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.kpi_api_client import KpiApiClient +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( ListCompanyBaseModelResultsRequest, ListCompanyBaseModelResultsResponse, ListCompanyHierarchicalModelResultsRequest, @@ -16,7 +16,7 @@ ListKpiScreenResultsRequest, ListKpiScreenResultsResponse, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_service_pb2_grpc import KpiServiceStub +from exabel.stubs.exabel.api.analytics.v1.kpi_service_pb2_grpc import KpiServiceStub class KpiGrpcClient(KpiApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/library_grpc_client.py b/exabel/client/api/api_client/grpc/library_grpc_client.py similarity index 81% rename from exabel_data_sdk/client/api/api_client/grpc/library_grpc_client.py rename to exabel/client/api/api_client/grpc/library_grpc_client.py index e269fea7..b17e17dd 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/library_grpc_client.py +++ b/exabel/client/api/api_client/grpc/library_grpc_client.py @@ -1,11 +1,11 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.library_api_client import LibraryApiClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2_grpc import LibraryServiceStub -from exabel_data_sdk.stubs.exabel.api.management.v1.folder_messages_pb2 import Folder -from exabel_data_sdk.stubs.exabel.api.management.v1.library_service_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.library_api_client import LibraryApiClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.management.v1.all_pb2_grpc import LibraryServiceStub +from exabel.stubs.exabel.api.management.v1.folder_messages_pb2 import Folder +from exabel.stubs.exabel.api.management.v1.library_service_pb2 import ( CreateFolderRequest, DeleteFolderRequest, GetFolderRequest, diff --git a/exabel_data_sdk/client/api/api_client/grpc/namespace_grpc_client.py b/exabel/client/api/api_client/grpc/namespace_grpc_client.py similarity index 52% rename from exabel_data_sdk/client/api/api_client/grpc/namespace_grpc_client.py rename to exabel/client/api/api_client/grpc/namespace_grpc_client.py index bacb5473..43c207d0 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/namespace_grpc_client.py +++ b/exabel/client/api/api_client/grpc/namespace_grpc_client.py @@ -1,13 +1,13 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.namespace_api_client import NamespaceApiClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.namespace_api_client import NamespaceApiClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( ListNamespacesRequest, ListNamespacesResponse, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2_grpc import NamespaceServiceStub +from exabel.stubs.exabel.api.data.v1.all_pb2_grpc import NamespaceServiceStub class NamespaceGrpcClient(NamespaceApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/prediction_model_grpc_client.py b/exabel/client/api/api_client/grpc/prediction_model_grpc_client.py similarity index 56% rename from exabel_data_sdk/client/api/api_client/grpc/prediction_model_grpc_client.py rename to exabel/client/api/api_client/grpc/prediction_model_grpc_client.py index dd51c470..1452d322 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/prediction_model_grpc_client.py +++ b/exabel/client/api/api_client/grpc/prediction_model_grpc_client.py @@ -1,15 +1,15 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.prediction_model_api_client import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.prediction_model_api_client import ( PredictionModelApiClient, ) -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( CreatePredictionModelRunRequest, PredictionModelRun, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2_grpc import PredictionModelServiceStub +from exabel.stubs.exabel.api.analytics.v1.all_pb2_grpc import PredictionModelServiceStub class PredictionModelGrpcClient(PredictionModelApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/relationship_grpc_client.py b/exabel/client/api/api_client/grpc/relationship_grpc_client.py similarity index 85% rename from exabel_data_sdk/client/api/api_client/grpc/relationship_grpc_client.py rename to exabel/client/api/api_client/grpc/relationship_grpc_client.py index a1030a48..e7acfe95 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/relationship_grpc_client.py +++ b/exabel/client/api/api_client/grpc/relationship_grpc_client.py @@ -1,9 +1,9 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.relationship_api_client import RelationshipApiClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.relationship_api_client import RelationshipApiClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateRelationshipRequest, CreateRelationshipTypeRequest, DeleteRelationshipRequest, @@ -19,7 +19,7 @@ UpdateRelationshipRequest, UpdateRelationshipTypeRequest, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2_grpc import RelationshipServiceStub +from exabel.stubs.exabel.api.data.v1.all_pb2_grpc import RelationshipServiceStub class RelationshipGrpcClient(RelationshipApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/signal_grpc_client.py b/exabel/client/api/api_client/grpc/signal_grpc_client.py similarity index 79% rename from exabel_data_sdk/client/api/api_client/grpc/signal_grpc_client.py rename to exabel/client/api/api_client/grpc/signal_grpc_client.py index 04b92270..bd01c553 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/signal_grpc_client.py +++ b/exabel/client/api/api_client/grpc/signal_grpc_client.py @@ -1,9 +1,9 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.signal_api_client import SignalApiClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.signal_api_client import SignalApiClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateSignalRequest, DeleteSignalRequest, FilterDerivedSignalsRequest, @@ -14,7 +14,7 @@ Signal, UpdateSignalRequest, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2_grpc import SignalServiceStub +from exabel.stubs.exabel.api.data.v1.all_pb2_grpc import SignalServiceStub class SignalGrpcClient(SignalApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/tag_grpc_client.py b/exabel/client/api/api_client/grpc/tag_grpc_client.py similarity index 80% rename from exabel_data_sdk/client/api/api_client/grpc/tag_grpc_client.py rename to exabel/client/api/api_client/grpc/tag_grpc_client.py index 9dd99262..ad9e06a6 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/tag_grpc_client.py +++ b/exabel/client/api/api_client/grpc/tag_grpc_client.py @@ -1,9 +1,9 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.tag_api_client import TagApiClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.tag_api_client import TagApiClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( AddEntitiesRequest, AddEntitiesResponse, CreateTagRequest, @@ -18,7 +18,7 @@ Tag, UpdateTagRequest, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2_grpc import TagServiceStub +from exabel.stubs.exabel.api.analytics.v1.all_pb2_grpc import TagServiceStub class TagGrpcClient(TagApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/grpc/time_series_grpc_client.py b/exabel/client/api/api_client/grpc/time_series_grpc_client.py similarity index 82% rename from exabel_data_sdk/client/api/api_client/grpc/time_series_grpc_client.py rename to exabel/client/api/api_client/grpc/time_series_grpc_client.py index ed30c5d4..9aeebd24 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/time_series_grpc_client.py +++ b/exabel/client/api/api_client/grpc/time_series_grpc_client.py @@ -1,9 +1,9 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.time_series_api_client import TimeSeriesApiClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.time_series_api_client import TimeSeriesApiClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( BatchDeleteTimeSeriesPointsRequest, BatchDeleteTimeSeriesPointsResponse, CreateTimeSeriesRequest, @@ -16,7 +16,7 @@ TimeSeries, UpdateTimeSeriesRequest, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2_grpc import TimeSeriesServiceStub +from exabel.stubs.exabel.api.data.v1.all_pb2_grpc import TimeSeriesServiceStub FIVE_MINUTES_IN_SECONDS = 5 * 60 diff --git a/exabel_data_sdk/client/api/api_client/grpc/user_grpc_client.py b/exabel/client/api/api_client/grpc/user_grpc_client.py similarity index 59% rename from exabel_data_sdk/client/api/api_client/grpc/user_grpc_client.py rename to exabel/client/api/api_client/grpc/user_grpc_client.py index d951c17b..bc2d5b6d 100644 --- a/exabel_data_sdk/client/api/api_client/grpc/user_grpc_client.py +++ b/exabel/client/api/api_client/grpc/user_grpc_client.py @@ -1,15 +1,15 @@ -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient -from exabel_data_sdk.client.api.api_client.user_api_client import UserApiClient -from exabel_data_sdk.client.api.error_handler import handle_grpc_error -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import ( +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.api.api_client.grpc.base_grpc_client import BaseGrpcClient +from exabel.client.api.api_client.user_api_client import UserApiClient +from exabel.client.api.error_handler import handle_grpc_error +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.management.v1.all_pb2 import ( ListGroupsRequest, ListGroupsResponse, ListUsersRequest, ListUsersResponse, ) -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2_grpc import UserServiceStub +from exabel.stubs.exabel.api.management.v1.all_pb2_grpc import UserServiceStub class UserGrpcClient(UserApiClient, BaseGrpcClient): diff --git a/exabel_data_sdk/client/api/api_client/holiday_api_client.py b/exabel/client/api/api_client/holiday_api_client.py similarity index 88% rename from exabel_data_sdk/client/api/api_client/holiday_api_client.py rename to exabel/client/api/api_client/holiday_api_client.py index 86b29eb2..1e76b12b 100644 --- a/exabel_data_sdk/client/api/api_client/holiday_api_client.py +++ b/exabel/client/api/api_client/holiday_api_client.py @@ -1,7 +1,7 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.data.v1.holiday_messages_pb2 import HolidaySpecification -from exabel_data_sdk.stubs.exabel.api.data.v1.holiday_service_pb2 import ( +from exabel.stubs.exabel.api.data.v1.holiday_messages_pb2 import HolidaySpecification +from exabel.stubs.exabel.api.data.v1.holiday_service_pb2 import ( CreateHolidaySpecificationRequest, DeleteHolidaySpecificationRequest, GetHolidaySpecificationRequest, diff --git a/exabel_data_sdk/client/api/api_client/kpi_api_client.py b/exabel/client/api/api_client/kpi_api_client.py similarity index 96% rename from exabel_data_sdk/client/api/api_client/kpi_api_client.py rename to exabel/client/api/api_client/kpi_api_client.py index acd07665..f7056fa6 100644 --- a/exabel_data_sdk/client/api/api_client/kpi_api_client.py +++ b/exabel/client/api/api_client/kpi_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( ListCompanyBaseModelResultsRequest, ListCompanyBaseModelResultsResponse, ListCompanyHierarchicalModelResultsRequest, diff --git a/exabel_data_sdk/client/api/api_client/library_api_client.py b/exabel/client/api/api_client/library_api_client.py similarity index 96% rename from exabel_data_sdk/client/api/api_client/library_api_client.py rename to exabel/client/api/api_client/library_api_client.py index 76350098..28e29935 100644 --- a/exabel_data_sdk/client/api/api_client/library_api_client.py +++ b/exabel/client/api/api_client/library_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import ( +from exabel.stubs.exabel.api.management.v1.all_pb2 import ( CreateFolderRequest, DeleteFolderRequest, Folder, diff --git a/exabel_data_sdk/client/api/api_client/namespace_api_client.py b/exabel/client/api/api_client/namespace_api_client.py similarity index 86% rename from exabel_data_sdk/client/api/api_client/namespace_api_client.py rename to exabel/client/api/api_client/namespace_api_client.py index ae1854a8..2b6ef256 100644 --- a/exabel_data_sdk/client/api/api_client/namespace_api_client.py +++ b/exabel/client/api/api_client/namespace_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( ListNamespacesRequest, ListNamespacesResponse, ) diff --git a/exabel_data_sdk/client/api/api_client/prediction_model_api_client.py b/exabel/client/api/api_client/prediction_model_api_client.py similarity index 66% rename from exabel_data_sdk/client/api/api_client/prediction_model_api_client.py rename to exabel/client/api/api_client/prediction_model_api_client.py index 6b78a564..f45e4a4d 100644 --- a/exabel_data_sdk/client/api/api_client/prediction_model_api_client.py +++ b/exabel/client/api/api_client/prediction_model_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( CreatePredictionModelRunRequest, PredictionModelRun, ) @@ -8,7 +8,7 @@ class PredictionModelApiClient(ABC): """ - Superclass for clients that sends prediction model requests to the Exabel Analytics API. + Superclass for clients that send prediction model requests to the Exabel Analytics API. """ @abstractmethod diff --git a/exabel_data_sdk/client/api/api_client/relationship_api_client.py b/exabel/client/api/api_client/relationship_api_client.py similarity index 97% rename from exabel_data_sdk/client/api/api_client/relationship_api_client.py rename to exabel/client/api/api_client/relationship_api_client.py index fa0543ce..9341a167 100644 --- a/exabel_data_sdk/client/api/api_client/relationship_api_client.py +++ b/exabel/client/api/api_client/relationship_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateRelationshipRequest, CreateRelationshipTypeRequest, DeleteRelationshipRequest, diff --git a/exabel_data_sdk/client/api/api_client/signal_api_client.py b/exabel/client/api/api_client/signal_api_client.py similarity index 93% rename from exabel_data_sdk/client/api/api_client/signal_api_client.py rename to exabel/client/api/api_client/signal_api_client.py index 276182ac..55a062b7 100644 --- a/exabel_data_sdk/client/api/api_client/signal_api_client.py +++ b/exabel/client/api/api_client/signal_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateSignalRequest, DeleteSignalRequest, GetSignalRequest, diff --git a/exabel_data_sdk/client/api/api_client/tag_api_client.py b/exabel/client/api/api_client/tag_api_client.py similarity index 95% rename from exabel_data_sdk/client/api/api_client/tag_api_client.py rename to exabel/client/api/api_client/tag_api_client.py index 071abbdc..8073a659 100644 --- a/exabel_data_sdk/client/api/api_client/tag_api_client.py +++ b/exabel/client/api/api_client/tag_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( AddEntitiesRequest, AddEntitiesResponse, CreateTagRequest, diff --git a/exabel_data_sdk/client/api/api_client/time_series_api_client.py b/exabel/client/api/api_client/time_series_api_client.py similarity index 96% rename from exabel_data_sdk/client/api/api_client/time_series_api_client.py rename to exabel/client/api/api_client/time_series_api_client.py index 286201a5..8ae377c8 100644 --- a/exabel_data_sdk/client/api/api_client/time_series_api_client.py +++ b/exabel/client/api/api_client/time_series_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( BatchDeleteTimeSeriesPointsRequest, BatchDeleteTimeSeriesPointsResponse, CreateTimeSeriesRequest, diff --git a/exabel_data_sdk/client/api/api_client/user_api_client.py b/exabel/client/api/api_client/user_api_client.py similarity index 88% rename from exabel_data_sdk/client/api/api_client/user_api_client.py rename to exabel/client/api/api_client/user_api_client.py index a5a84c98..dc0f6970 100644 --- a/exabel_data_sdk/client/api/api_client/user_api_client.py +++ b/exabel/client/api/api_client/user_api_client.py @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import ( +from exabel.stubs.exabel.api.management.v1.all_pb2 import ( ListGroupsRequest, ListGroupsResponse, ListUsersRequest, diff --git a/exabel_data_sdk/client/api/bulk_import.py b/exabel/client/api/bulk_import.py similarity index 90% rename from exabel_data_sdk/client/api/bulk_import.py rename to exabel/client/api/bulk_import.py index 0e7705e2..328e47a2 100644 --- a/exabel_data_sdk/client/api/bulk_import.py +++ b/exabel/client/api/bulk_import.py @@ -8,24 +8,23 @@ import pandas as pd -from exabel_data_sdk.client.api.bulk_insert import BulkInsertFailedError, _get_backoff, _raise_error -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError, Violation -from exabel_data_sdk.client.api.data_classes.time_series import TimeSeries, TimeSeriesResourceName -from exabel_data_sdk.client.api.resource_creation_result import ( +from exabel.client.api.bulk_insert import BulkInsertFailedError, _get_backoff, _raise_error +from exabel.client.api.data_classes.request_error import ErrorType, RequestError, Violation +from exabel.client.api.data_classes.time_series import TimeSeries, TimeSeriesResourceName +from exabel.client.api.resource_creation_result import ( ResourceCreationResult, ResourceCreationResults, ResourceCreationStatus, ResourceT, ) -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT, MAX_THREADS_FOR_IMPORT, ) -from exabel_data_sdk.util.deprecate_arguments import deprecate_arguments -from exabel_data_sdk.util.import_ import get_batches_for_import -from exabel_data_sdk.util.logging_thread_pool_executor import LoggingThreadPoolExecutor +from exabel.util.import_ import get_batches_for_import +from exabel.util.logging_thread_pool_executor import LoggingThreadPoolExecutor logger = logging.getLogger(__name__) @@ -149,12 +148,6 @@ def _process( ) -@deprecate_arguments( - resources_batches="resources", - threads_for_import_func="threads", - threads_for_insert_func=None, - insert_func=None, -) def bulk_import( resources: Sequence[ResourceT], import_func: Callable[ @@ -164,11 +157,6 @@ def bulk_import( threads: int = DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT, retries: int = DEFAULT_NUMBER_OF_RETRIES, abort_threshold: float | None = DEFAULT_ABORT_THRESHOLD, - # Deprecated arguments - resources_batches: Sequence[Sequence[ResourceT]] | None = None, - threads_for_import_func: int | None = None, - threads_for_insert_func: int | None = None, - insert_func: Callable[[ResourceT], ResourceCreationStatus] | None = None, ) -> ResourceCreationResults[ResourceT]: """ Call the provided import function with batches of the provided resources, while catching errors diff --git a/exabel_data_sdk/client/api/bulk_insert.py b/exabel/client/api/bulk_insert.py similarity index 96% rename from exabel_data_sdk/client/api/bulk_insert.py rename to exabel/client/api/bulk_insert.py index 75b92759..7929c1b4 100644 --- a/exabel_data_sdk/client/api/bulk_insert.py +++ b/exabel/client/api/bulk_insert.py @@ -3,14 +3,14 @@ from time import sleep, time from typing import Callable, Sequence -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.api.resource_creation_result import ( +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.resource_creation_result import ( ResourceCreationResult, ResourceCreationResults, ResourceCreationStatus, ResourceT, ) -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_MAX_BACKOFF_SECONDS, DEFAULT_MIN_BACKOFF_SECONDS, diff --git a/exabel_data_sdk/client/api/calendar_api.py b/exabel/client/api/calendar_api.py similarity index 65% rename from exabel_data_sdk/client/api/calendar_api.py rename to exabel/client/api/calendar_api.py index d5f33b51..179efc05 100644 --- a/exabel_data_sdk/client/api/calendar_api.py +++ b/exabel/client/api/calendar_api.py @@ -1,15 +1,17 @@ from collections.abc import Sequence -from exabel_data_sdk.client.api.api_client.grpc.calendar_grpc_client import CalendarGrpcClient -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.calendar_messages_pb2 import FiscalPeriod, Frequency -from exabel_data_sdk.stubs.exabel.api.data.v1.calendar_service_pb2 import ( +from exabel.client.api.api_client.grpc.calendar_grpc_client import CalendarGrpcClient +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.calendar_messages_pb2 import FiscalPeriod, Frequency +from exabel.stubs.exabel.api.data.v1.calendar_service_pb2 import ( BatchCreateFiscalPeriodsRequest, DeleteFiscalPeriodRequest, + GetCompanyCalendarRequest, ListCompaniesWithFiscalPeriodsRequest, ListFiscalPeriodsRequest, ) -from exabel_data_sdk.stubs.exabel.api.time.date_pb2 import Date +from exabel.stubs.exabel.api.time.date_pb2 import Date +from exabel.stubs.exabel.api.time.time_range_pb2 import TimeRange class CalendarApi: @@ -18,6 +20,39 @@ class CalendarApi: def __init__(self, config: ClientConfig): self.client = CalendarGrpcClient(config) + def get_company_calendar( + self, + company: str, + time_range: TimeRange | None = None, + frequency: Frequency.ValueType | None = None, + include_unreported: bool = False, + ) -> Sequence[FiscalPeriod]: + """ + Get the fiscal calendar for a company. + + Args: + company: The resource name of the company. + time_range: The time range for fiscal periods. Returns all periods whose end date + falls within this range. If not provided, returns all historical periods and, + if include_unreported is True, future periods for the current fiscal year and + two fiscal years into the future. + frequency: The requested frequency. If not provided, uses the company's reporting + frequency (quarterly or semi-annual). + include_unreported: Whether to include unreported (future) fiscal periods. + If False, only periods that have been reported are returned. + + Returns: + A list of fiscal periods for the company, including labels, start/end dates, + and whether each period has been reported. + """ + request = GetCompanyCalendarRequest( + company=company, + time_range=time_range, + frequency=frequency, + include_unreported=include_unreported, + ) + return self.client.get_company_calendar(request).periods + def create_fiscal_periods( self, company: str, @@ -102,7 +137,7 @@ def list_companies_with_fiscal_periods(self) -> Sequence[str]: Returns: A list containing the resource names of all the companies for which the customer has - uploaded fiscal periods + uploaded fiscal periods. """ request = ListCompaniesWithFiscalPeriodsRequest() return self.client.list_companies_with_fiscal_periods(request).companies diff --git a/exabel_data_sdk/client/api/data_classes/__init__.py b/exabel/client/api/data_classes/__init__.py similarity index 100% rename from exabel_data_sdk/client/api/data_classes/__init__.py rename to exabel/client/api/data_classes/__init__.py diff --git a/exabel_data_sdk/client/api/data_classes/company.py b/exabel/client/api/data_classes/company.py similarity index 86% rename from exabel_data_sdk/client/api/data_classes/company.py rename to exabel/client/api/data_classes/company.py index debcb027..5b8229f5 100644 --- a/exabel_data_sdk/client/api/data_classes/company.py +++ b/exabel/client/api/data_classes/company.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import Company as ProtoCompany +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import Company as ProtoCompany @dataclass diff --git a/exabel_data_sdk/client/api/data_classes/company_kpi_mapping_results.py b/exabel/client/api/data_classes/company_kpi_mapping_results.py similarity index 80% rename from exabel_data_sdk/client/api/data_classes/company_kpi_mapping_results.py rename to exabel/client/api/data_classes/company_kpi_mapping_results.py index aa95aff0..a69364aa 100644 --- a/exabel_data_sdk/client/api/data_classes/company_kpi_mapping_results.py +++ b/exabel/client/api/data_classes/company_kpi_mapping_results.py @@ -1,13 +1,13 @@ from dataclasses import dataclass from typing import Sequence -from exabel_data_sdk.client.api.data_classes.company import Company -from exabel_data_sdk.client.api.data_classes.kpi import Kpi -from exabel_data_sdk.client.api.data_classes.kpi_mapping_result_data import KpiMappingResultData -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.client.api.data_classes.company import Company +from exabel.client.api.data_classes.kpi import Kpi +from exabel.client.api.data_classes.kpi_mapping_result_data import KpiMappingResultData +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( CompanyKpiMappingResults as ProtoCompanyKpiMappingResults, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( SingleCompanyKpiMappingResults as ProtoSingleCompanyKpiMappingResults, ) diff --git a/exabel_data_sdk/client/api/data_classes/company_kpi_model_result.py b/exabel/client/api/data_classes/company_kpi_model_result.py similarity index 84% rename from exabel_data_sdk/client/api/data_classes/company_kpi_model_result.py rename to exabel/client/api/data_classes/company_kpi_model_result.py index 6583e6c8..6e6e6965 100644 --- a/exabel_data_sdk/client/api/data_classes/company_kpi_model_result.py +++ b/exabel/client/api/data_classes/company_kpi_model_result.py @@ -1,8 +1,8 @@ from dataclasses import dataclass -from exabel_data_sdk.client.api.data_classes.kpi import Kpi -from exabel_data_sdk.client.api.data_classes.kpi_model import KpiModel -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.client.api.data_classes.kpi import Kpi +from exabel.client.api.data_classes.kpi_model import KpiModel +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( CompanyKpiModelResult as ProtoCompanyKpiModelResult, ) diff --git a/exabel_data_sdk/client/api/data_classes/company_kpi_models.py b/exabel/client/api/data_classes/company_kpi_models.py similarity index 85% rename from exabel_data_sdk/client/api/data_classes/company_kpi_models.py rename to exabel/client/api/data_classes/company_kpi_models.py index f541bd4d..b299cbcc 100644 --- a/exabel_data_sdk/client/api/data_classes/company_kpi_models.py +++ b/exabel/client/api/data_classes/company_kpi_models.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import Sequence -from exabel_data_sdk.client.api.data_classes.kpi_mapping_model import KpiMappingModel -from exabel_data_sdk.client.api.data_classes.kpi_model import KpiModel -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( +from exabel.client.api.data_classes.kpi_mapping_model import KpiMappingModel +from exabel.client.api.data_classes.kpi_model import KpiModel +from exabel.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( ListCompanyKpiModelResultsResponse, ) diff --git a/exabel_data_sdk/client/api/data_classes/data_set.py b/exabel/client/api/data_classes/data_set.py similarity index 58% rename from exabel_data_sdk/client/api/data_classes/data_set.py rename to exabel/client/api/data_classes/data_set.py index 0b703fb2..c4878cc7 100644 --- a/exabel_data_sdk/client/api/data_classes/data_set.py +++ b/exabel/client/api/data_classes/data_set.py @@ -1,53 +1,37 @@ +from dataclasses import dataclass, field from typing import Sequence -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import DataSet as ProtoDataSet +from exabel.stubs.exabel.api.data.v1.all_pb2 import DataSet as ProtoDataSet +@dataclass class DataSet: """ A data set resource in the Data API. Attributes: - name (str): The resource name of the data set, for example, - "dataSets/ns.mydata". - display_name (str): The display name of the data set. - description (str): One or more paragraphs of text description. - signals ([str]): Resource names of signals this data set contains. - read_only (bool): Whether this resource is read only. - derived_signals ([str]): Resource names of signals this data set contains. - highlighted_signals ([str]): Resource names of signals this data set contains. + name: The resource name of the data set, for example, + "dataSets/ns.mydata". + display_name: The display name of the data set. + description: One or more paragraphs of text description. + signals: Resource names of signals this data set contains. + read_only: Whether this resource is read only. + derived_signals: Resource names of derived signals for this data set. + highlighted_signals: Resource names of highlighted signals for this data set. """ - def __init__( - self, - name: str, - display_name: str, - description: str = "", - signals: Sequence[str] | None = None, - read_only: bool = False, - derived_signals: Sequence[str] | None = None, - highlighted_signals: Sequence[str] | None = None, - ): - """ - Create a data set resource in the Data API. + name: str + display_name: str + description: str = "" + signals: Sequence[str] = field(default_factory=list) + read_only: bool = False + derived_signals: Sequence[str] = field(default_factory=list) + highlighted_signals: Sequence[str] = field(default_factory=list) - Args: - name (str): The resource name of the data set, for example, - "dataSets/ns.mydata". - display_name: The display name of the data set. - description: One or more paragraphs of text description. - signals: Resource names of signals this data set contains. - read_only: Whether this resource is read only. - derived_signals: Resource names of derived signals for this data set. - highlighted_signals: Resource names of highlighted signals for this data set. - """ - self.name = name - self.display_name = display_name - self.description = description - self.read_only = read_only - self.signals = signals or [] - self.derived_signals = derived_signals or [] - self.highlighted_signals = highlighted_signals or [] + def __post_init__(self) -> None: + self.signals = self.signals or [] + self.derived_signals = self.derived_signals or [] + self.highlighted_signals = self.highlighted_signals or [] @staticmethod def from_proto(data_set: ProtoDataSet) -> "DataSet": diff --git a/exabel_data_sdk/client/api/data_classes/derived_signal.py b/exabel/client/api/data_classes/derived_signal.py similarity index 95% rename from exabel_data_sdk/client/api/data_classes/derived_signal.py rename to exabel/client/api/data_classes/derived_signal.py index 9260cb40..14fdce6c 100644 --- a/exabel_data_sdk/client/api/data_classes/derived_signal.py +++ b/exabel/client/api/data_classes/derived_signal.py @@ -2,23 +2,23 @@ from google.protobuf.wrappers_pb2 import Int32Value -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( DerivedSignal as ProtoDerivedSignal, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( DerivedSignalMetadata as ProtoDerivedSignalMetadata, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( DerivedSignalType as ProtoDerivedSignalType, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( DerivedSignalUnit as ProtoDerivedSignalUnit, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.signal_messages_pb2 import ( +from exabel.stubs.exabel.api.data.v1.signal_messages_pb2 import ( DerivedSignal as ProtoDataApiDerivedSignal, ) -from exabel_data_sdk.stubs.exabel.api.math.aggregation_pb2 import Aggregation -from exabel_data_sdk.stubs.exabel.api.math.change_pb2 import Change +from exabel.stubs.exabel.api.math.aggregation_pb2 import Aggregation +from exabel.stubs.exabel.api.math.change_pb2 import Change class DerivedSignalType(Enum): @@ -90,7 +90,7 @@ def __init__( @staticmethod def from_proto(metadata: ProtoDerivedSignalMetadata) -> "DerivedSignalMetaData": - """Create a DerivedSignalMetaData from the given protobuf DerivedSignalMetaData.""" + """Create a DerivedSignalMetaData from the given protobuf DerivedSignalMetadata.""" return DerivedSignalMetaData( unit=DerivedSignalUnit(metadata.unit), decimals=metadata.decimals.value if metadata.HasField("decimals") else None, diff --git a/exabel/client/api/data_classes/entity.py b/exabel/client/api/data_classes/entity.py new file mode 100644 index 00000000..9c9798e2 --- /dev/null +++ b/exabel/client/api/data_classes/entity.py @@ -0,0 +1,86 @@ +import re +from dataclasses import dataclass, field +from typing import Mapping + +from exabel.client.api.proto_utils import from_struct, to_struct +from exabel.stubs.exabel.api.data.v1.all_pb2 import Entity as ProtoEntity + + +@dataclass +class Entity: + r""" + An entity resource in the Data API. + + Attributes: + name: The resource name of the entity, for example + "entityTypes/entityTypeIdentifier/entities/entityIdentifier" or + "entityTypes/namespace1.entityTypeIdentifier/entities/ + namespace2.entityIdentifier". The namespaces must be empty (being + global) or one of the predetermined namespaces the customer has access + to. If namespace1 is not empty, it must be equal to namespace2. The + entity identifier must match the regex [a-zA-Z][\w-]{0,63}. + display_name: The display name of the entity. + description: One or more paragraphs of text description. + properties: The properties of this entity. + read_only: Whether this resource is read only. + """ + + name: str + display_name: str + description: str = "" + properties: Mapping[str, str | bool | int | float] = field(default_factory=dict) + read_only: bool = False + + def __post_init__(self) -> None: + self.properties = self.properties or {} + + @staticmethod + def from_proto(entity: ProtoEntity) -> "Entity": + """Create an Entity from the given protobuf Entity.""" + return Entity( + name=entity.name, + display_name=entity.display_name, + description=entity.description, + read_only=entity.read_only, + properties=from_struct(entity.properties), + ) + + def to_proto(self) -> ProtoEntity: + """Create a protobuf Entity from this Entity.""" + return ProtoEntity( + name=self.name, + display_name=self.display_name, + description=self.description, + properties=to_struct(self.properties), + ) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, Entity): + return False + return ( + self.name == other.name + and self.display_name == other.display_name + and self.description == other.description + and self.properties == other.properties + and self.read_only == other.read_only + ) + + def __repr__(self) -> str: + return ( + f"Entity(name='{self.name}', display_name='{self.display_name}', " + f"description='{self.description}', properties={self.properties}, " + f"read_only={self.read_only})" + ) + + def __lt__(self, other: object) -> bool: + if not isinstance(other, Entity): + raise ValueError(f"Cannot compare Entity to non-Entity: {other}") + return self.name < other.name + + def get_entity_type(self) -> str: + """Extracts the entity type name from the entity's resource name.""" + p = re.compile(r"(entityTypes/[a-zA-Z0-9_\-.]+)/entities/[a-zA-Z0-9_\-.]+") + m = p.match(self.name) + if m: + return m.group(1) + raise ValueError(f"Could not parse entity resource name: {self.name}") diff --git a/exabel/client/api/data_classes/entity_type.py b/exabel/client/api/data_classes/entity_type.py new file mode 100644 index 00000000..97af6a60 --- /dev/null +++ b/exabel/client/api/data_classes/entity_type.py @@ -0,0 +1,67 @@ +from dataclasses import dataclass + +from exabel.stubs.exabel.api.data.v1.all_pb2 import EntityType as ProtoEntityType + + +@dataclass +class EntityType: + r""" + An entity type resource in the Data API. + + Attributes: + name: The resource name of the entity type, for example + "entityTypes/entityTypeIdentifier" or + "entityTypes/namespace.entityTypeIdentifier". The namespace must be + empty (being global) or one of the predetermined namespaces the + customer has access to. The entity type identifier must match the + regex [a-zA-Z][\w-]{0,63}. + display_name: The display name of the entity type. + description: One or more paragraphs of text description. + read_only: Whether this resource is read only. + is_associative: Whether this entity type is associative. + """ + + name: str + display_name: str + description: str + read_only: bool = False + is_associative: bool = False + + @staticmethod + def from_proto(entity_type: ProtoEntityType) -> "EntityType": + """Create an EntityType from a protobuf EntityType.""" + return EntityType( + name=entity_type.name, + display_name=entity_type.display_name, + description=entity_type.description, + read_only=entity_type.read_only, + is_associative=entity_type.is_associative, + ) + + def to_proto(self) -> ProtoEntityType: + """Create a protobuf EntityType from an EntityType.""" + return ProtoEntityType( + name=self.name, + display_name=self.display_name, + description=self.description, + read_only=self.read_only, + is_associative=self.is_associative, + ) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, EntityType): + return False + return ( + self.name == other.name + and self.display_name == other.display_name + and self.description == other.description + and self.read_only == other.read_only + and self.is_associative == other.is_associative + ) + + def __repr__(self) -> str: + return ( + f"EntityType(name='{self.name}', display_name='{self.display_name}', " + f"description='{self.description}', read_only={self.read_only}, " + f"is_associative={self.is_associative})" + ) diff --git a/exabel_data_sdk/client/api/data_classes/fiscal_period.py b/exabel/client/api/data_classes/fiscal_period.py similarity index 94% rename from exabel_data_sdk/client/api/data_classes/fiscal_period.py rename to exabel/client/api/data_classes/fiscal_period.py index 5edff18f..abc551ff 100644 --- a/exabel_data_sdk/client/api/data_classes/fiscal_period.py +++ b/exabel/client/api/data_classes/fiscal_period.py @@ -2,7 +2,7 @@ import pandas as pd -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( FiscalPeriod as ProtoFiscalPeriod, ) diff --git a/exabel_data_sdk/client/api/data_classes/folder.py b/exabel/client/api/data_classes/folder.py similarity index 89% rename from exabel_data_sdk/client/api/data_classes/folder.py rename to exabel/client/api/data_classes/folder.py index beffd187..46cdb955 100644 --- a/exabel_data_sdk/client/api/data_classes/folder.py +++ b/exabel/client/api/data_classes/folder.py @@ -1,7 +1,7 @@ from typing import Sequence -from exabel_data_sdk.client.api.data_classes.folder_item import FolderItem -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import Folder as ProtoFolder +from exabel.client.api.data_classes.folder_item import FolderItem +from exabel.stubs.exabel.api.management.v1.all_pb2 import Folder as ProtoFolder class Folder: @@ -13,7 +13,7 @@ class Folder: display_name (str): The display name of the folder. write (bool): Whether the caller has write access to the folder. items (list): The items in the folder. - description (str) An optional description of the folder. + description (str): An optional description of the folder. """ def __init__( @@ -32,7 +32,7 @@ def __init__( display_name (str): The display name of the folder. write (bool): Whether the caller has write access to the folder. items (list): The items in the folder. - description (str) An optional description of the folder. + description (str): An optional description of the folder. """ self.name = name self.display_name = display_name diff --git a/exabel_data_sdk/client/api/data_classes/folder_accessor.py b/exabel/client/api/data_classes/folder_accessor.py similarity index 91% rename from exabel_data_sdk/client/api/data_classes/folder_accessor.py rename to exabel/client/api/data_classes/folder_accessor.py index 4523d658..3ca29b40 100644 --- a/exabel_data_sdk/client/api/data_classes/folder_accessor.py +++ b/exabel/client/api/data_classes/folder_accessor.py @@ -1,5 +1,5 @@ -from exabel_data_sdk.client.api.data_classes.group import Group -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import ( +from exabel.client.api.data_classes.group import Group +from exabel.stubs.exabel.api.management.v1.all_pb2 import ( FolderAccessor as ProtoFolderAccessor, ) diff --git a/exabel_data_sdk/client/api/data_classes/folder_item.py b/exabel/client/api/data_classes/folder_item.py similarity index 97% rename from exabel_data_sdk/client/api/data_classes/folder_item.py rename to exabel/client/api/data_classes/folder_item.py index 3b431dba..69f027a4 100644 --- a/exabel_data_sdk/client/api/data_classes/folder_item.py +++ b/exabel/client/api/data_classes/folder_item.py @@ -4,8 +4,8 @@ from dateutil import tz from google.protobuf.timestamp_pb2 import Timestamp as ProtoTimestamp -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import FolderItem as ProtoFolderItem -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import ( +from exabel.stubs.exabel.api.management.v1.all_pb2 import FolderItem as ProtoFolderItem +from exabel.stubs.exabel.api.management.v1.all_pb2 import ( FolderItemType as ProtoFolderItemType, ) diff --git a/exabel_data_sdk/client/api/data_classes/group.py b/exabel/client/api/data_classes/group.py similarity index 90% rename from exabel_data_sdk/client/api/data_classes/group.py rename to exabel/client/api/data_classes/group.py index ec48add4..bd886cdb 100644 --- a/exabel_data_sdk/client/api/data_classes/group.py +++ b/exabel/client/api/data_classes/group.py @@ -1,7 +1,7 @@ from typing import Sequence -from exabel_data_sdk.client.api.data_classes.user import User -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import Group as ProtoGroup +from exabel.client.api.data_classes.user import User +from exabel.stubs.exabel.api.management.v1.all_pb2 import Group as ProtoGroup class Group: @@ -16,7 +16,7 @@ class Group: def __init__(self, name: str, display_name: str, users: Sequence[User]): """ - Create a user. + Create a group. Args: name (str): The resource name of the group, for example "groups/123". diff --git a/exabel_data_sdk/client/api/data_classes/kpi.py b/exabel/client/api/data_classes/kpi.py similarity index 94% rename from exabel_data_sdk/client/api/data_classes/kpi.py rename to exabel/client/api/data_classes/kpi.py index 6c0d4057..4b2c165c 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi.py +++ b/exabel/client/api/data_classes/kpi.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from enum import Enum -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import Kpi as ProtoKpi +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import Kpi as ProtoKpi class KpiType(Enum): diff --git a/exabel_data_sdk/client/api/data_classes/kpi_hierarchy.py b/exabel/client/api/data_classes/kpi_hierarchy.py similarity index 87% rename from exabel_data_sdk/client/api/data_classes/kpi_hierarchy.py rename to exabel/client/api/data_classes/kpi_hierarchy.py index 94ec3012..cbbbc74f 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_hierarchy.py +++ b/exabel/client/api/data_classes/kpi_hierarchy.py @@ -1,14 +1,14 @@ from dataclasses import dataclass from typing import Sequence -from exabel_data_sdk.client.api.data_classes.kpi import Kpi -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.client.api.data_classes.kpi import Kpi +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiBreakdown as ProtoKpiBreakdown, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiBreakdownNode as ProtoKpiBreakdownNode, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiHierarchy as ProtoKpiHierarchy, ) diff --git a/exabel_data_sdk/client/api/data_classes/kpi_mapping_group_reference.py b/exabel/client/api/data_classes/kpi_mapping_group_reference.py similarity index 92% rename from exabel_data_sdk/client/api/data_classes/kpi_mapping_group_reference.py rename to exabel/client/api/data_classes/kpi_mapping_group_reference.py index e58c70c9..dd4479bf 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_mapping_group_reference.py +++ b/exabel/client/api/data_classes/kpi_mapping_group_reference.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiMappingGroupReference as ProtoKpiMappingGroupReference, ) diff --git a/exabel_data_sdk/client/api/data_classes/kpi_mapping_model.py b/exabel/client/api/data_classes/kpi_mapping_model.py similarity index 75% rename from exabel_data_sdk/client/api/data_classes/kpi_mapping_model.py rename to exabel/client/api/data_classes/kpi_mapping_model.py index 6d9fbe4b..84981f7e 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_mapping_model.py +++ b/exabel/client/api/data_classes/kpi_mapping_model.py @@ -1,10 +1,10 @@ from dataclasses import dataclass -from exabel_data_sdk.client.api.data_classes.kpi_mapping_group_reference import ( +from exabel.client.api.data_classes.kpi_mapping_group_reference import ( KpiMappingGroupReference, ) -from exabel_data_sdk.client.api.data_classes.kpi_model_data import KpiModelData -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.client.api.data_classes.kpi_model_data import KpiModelData +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiMappingModel as ProtoKpiMappingModel, ) diff --git a/exabel_data_sdk/client/api/data_classes/kpi_mapping_result_data.py b/exabel/client/api/data_classes/kpi_mapping_result_data.py similarity index 93% rename from exabel_data_sdk/client/api/data_classes/kpi_mapping_result_data.py rename to exabel/client/api/data_classes/kpi_mapping_result_data.py index 6389fd79..c637d385 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_mapping_result_data.py +++ b/exabel/client/api/data_classes/kpi_mapping_result_data.py @@ -2,14 +2,14 @@ import pandas as pd -from exabel_data_sdk.client.api.data_classes.kpi_mapping_group_reference import ( +from exabel.client.api.data_classes.kpi_mapping_group_reference import ( KpiMappingGroupReference, ) -from exabel_data_sdk.client.api.data_classes.model_quality import ModelQuality -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.client.api.data_classes.model_quality import ModelQuality +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiMappingResultData as ProtoKpiMappingResultData, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( ModelQuality as ProtoModelQuality, ) diff --git a/exabel_data_sdk/client/api/data_classes/kpi_model.py b/exabel/client/api/data_classes/kpi_model.py similarity index 75% rename from exabel_data_sdk/client/api/data_classes/kpi_model.py rename to exabel/client/api/data_classes/kpi_model.py index e29f0441..e11cfbed 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_model.py +++ b/exabel/client/api/data_classes/kpi_model.py @@ -1,9 +1,9 @@ from dataclasses import dataclass -from exabel_data_sdk.client.api.data_classes.kpi_model_data import KpiModelData -from exabel_data_sdk.client.api.data_classes.kpi_model_runs import KpiModelRuns -from exabel_data_sdk.client.api.data_classes.kpi_model_weight_groups import KpiModelWeightGroups -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import KpiModel as ProtoKpiModel +from exabel.client.api.data_classes.kpi_model_data import KpiModelData +from exabel.client.api.data_classes.kpi_model_runs import KpiModelRuns +from exabel.client.api.data_classes.kpi_model_weight_groups import KpiModelWeightGroups +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import KpiModel as ProtoKpiModel @dataclass diff --git a/exabel_data_sdk/client/api/data_classes/kpi_model_data.py b/exabel/client/api/data_classes/kpi_model_data.py similarity index 93% rename from exabel_data_sdk/client/api/data_classes/kpi_model_data.py rename to exabel/client/api/data_classes/kpi_model_data.py index d693cfdf..71060101 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_model_data.py +++ b/exabel/client/api/data_classes/kpi_model_data.py @@ -2,11 +2,11 @@ import pandas as pd -from exabel_data_sdk.client.api.data_classes.model_quality import ModelQuality -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.client.api.data_classes.model_quality import ModelQuality +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiModelData as ProtoKpiModelData, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( ModelQuality as ProtoModelQuality, ) @@ -31,7 +31,7 @@ class KpiModelData: mape_pit: The point-in-time MAPE (mean absolute percentage error). mae: The MAE (mean absolute error). mae_pit: The point-in-time MAE (mean absolute error). - error_count: Number of data points used to calcuate the MAE and MAPE. + error_count: Number of data points used to calculate the MAE and MAPE. hit_rate: The hit rate. hit_rate_count: Number of data points used to calculate the hit rate. revision_1_week: The 1 week revision. diff --git a/exabel_data_sdk/client/api/data_classes/kpi_model_run.py b/exabel/client/api/data_classes/kpi_model_run.py similarity index 95% rename from exabel_data_sdk/client/api/data_classes/kpi_model_run.py rename to exabel/client/api/data_classes/kpi_model_run.py index e0a50c9b..b8f4be84 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_model_run.py +++ b/exabel/client/api/data_classes/kpi_model_run.py @@ -4,7 +4,7 @@ from dateutil import tz from google.protobuf.timestamp_pb2 import Timestamp as ProtoTimestamp -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiModelRun as ProtoKpiModelRun, ) diff --git a/exabel_data_sdk/client/api/data_classes/kpi_model_runs.py b/exabel/client/api/data_classes/kpi_model_runs.py similarity index 87% rename from exabel_data_sdk/client/api/data_classes/kpi_model_runs.py rename to exabel/client/api/data_classes/kpi_model_runs.py index 9c4792a6..ad73da0e 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_model_runs.py +++ b/exabel/client/api/data_classes/kpi_model_runs.py @@ -1,7 +1,7 @@ from dataclasses import dataclass -from exabel_data_sdk.client.api.data_classes.kpi_model_run import KpiModelRun -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.client.api.data_classes.kpi_model_run import KpiModelRun +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiModelRuns as ProtoKpiModelRuns, ) diff --git a/exabel_data_sdk/client/api/data_classes/kpi_model_weight_groups.py b/exabel/client/api/data_classes/kpi_model_weight_groups.py similarity index 88% rename from exabel_data_sdk/client/api/data_classes/kpi_model_weight_groups.py rename to exabel/client/api/data_classes/kpi_model_weight_groups.py index 6358dbc8..77798795 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_model_weight_groups.py +++ b/exabel/client/api/data_classes/kpi_model_weight_groups.py @@ -1,23 +1,23 @@ from dataclasses import dataclass from typing import Sequence -from exabel_data_sdk.client.api.data_classes.kpi_mapping_group_reference import ( +from exabel.client.api.data_classes.kpi_mapping_group_reference import ( KpiMappingGroupReference, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiModelFeatureWeight as ProtoKpiModelFeatureWeight, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiModelWeightGroup as ProtoKpiModelWeightGroup, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiModelWeightGroups as ProtoKpiModelWeightGroups, ) @dataclass class KpiModelFeatureWeight: - """ " + """ The weight for a single feature. Attributes: @@ -41,7 +41,7 @@ def from_proto( @dataclass class KpiModelWeightGroup: - """ " + """ Represents a weight group. Attributes: diff --git a/exabel_data_sdk/client/api/data_classes/kpi_screen_results.py b/exabel/client/api/data_classes/kpi_screen_results.py similarity index 76% rename from exabel_data_sdk/client/api/data_classes/kpi_screen_results.py rename to exabel/client/api/data_classes/kpi_screen_results.py index 725fce27..bc62abc2 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_screen_results.py +++ b/exabel/client/api/data_classes/kpi_screen_results.py @@ -1,10 +1,10 @@ from dataclasses import dataclass from typing import Sequence -from exabel_data_sdk.client.api.data_classes.company import Company -from exabel_data_sdk.client.api.data_classes.company_kpi_model_result import CompanyKpiModelResult -from exabel_data_sdk.client.api.data_classes.fiscal_period import FiscalPeriod -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.client.api.data_classes.company import Company +from exabel.client.api.data_classes.company_kpi_model_result import CompanyKpiModelResult +from exabel.client.api.data_classes.fiscal_period import FiscalPeriod +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiScreenCompanyResult as ProtoKpiScreenCompanyResult, ) diff --git a/exabel_data_sdk/client/api/data_classes/kpi_source.py b/exabel/client/api/data_classes/kpi_source.py similarity index 86% rename from exabel_data_sdk/client/api/data_classes/kpi_source.py rename to exabel/client/api/data_classes/kpi_source.py index 2516d8cd..0316c373 100644 --- a/exabel_data_sdk/client/api/data_classes/kpi_source.py +++ b/exabel/client/api/data_classes/kpi_source.py @@ -1,6 +1,6 @@ from enum import Enum -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( KpiSource as ProtoKpiSource, ) diff --git a/exabel_data_sdk/client/api/data_classes/model_quality.py b/exabel/client/api/data_classes/model_quality.py similarity index 92% rename from exabel_data_sdk/client/api/data_classes/model_quality.py rename to exabel/client/api/data_classes/model_quality.py index 10b16e1d..94532e7f 100644 --- a/exabel_data_sdk/client/api/data_classes/model_quality.py +++ b/exabel/client/api/data_classes/model_quality.py @@ -1,6 +1,6 @@ from enum import Enum -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_messages_pb2 import ( ModelQuality as ProtoModelQuality, ) diff --git a/exabel_data_sdk/client/api/data_classes/model_results.py b/exabel/client/api/data_classes/model_results.py similarity index 83% rename from exabel_data_sdk/client/api/data_classes/model_results.py rename to exabel/client/api/data_classes/model_results.py index daf6bd05..72cbf3bd 100644 --- a/exabel_data_sdk/client/api/data_classes/model_results.py +++ b/exabel/client/api/data_classes/model_results.py @@ -1,10 +1,10 @@ from dataclasses import dataclass from typing import Sequence -from exabel_data_sdk.client.api.data_classes.company_kpi_model_result import CompanyKpiModelResult -from exabel_data_sdk.client.api.data_classes.fiscal_period import FiscalPeriod -from exabel_data_sdk.client.api.data_classes.kpi_hierarchy import KpiHierarchy -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( +from exabel.client.api.data_classes.company_kpi_model_result import CompanyKpiModelResult +from exabel.client.api.data_classes.fiscal_period import FiscalPeriod +from exabel.client.api.data_classes.kpi_hierarchy import KpiHierarchy +from exabel.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( ListCompanyBaseModelResultsResponse, ListCompanyHierarchicalModelResultsResponse, ) diff --git a/exabel_data_sdk/client/api/data_classes/namespace.py b/exabel/client/api/data_classes/namespace.py similarity index 90% rename from exabel_data_sdk/client/api/data_classes/namespace.py rename to exabel/client/api/data_classes/namespace.py index cf9cec2d..273e9535 100644 --- a/exabel_data_sdk/client/api/data_classes/namespace.py +++ b/exabel/client/api/data_classes/namespace.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import Namespace as ProtoNamespace +from exabel.stubs.exabel.api.data.v1.all_pb2 import Namespace as ProtoNamespace @dataclass diff --git a/exabel_data_sdk/client/api/data_classes/paging_result.py b/exabel/client/api/data_classes/paging_result.py similarity index 100% rename from exabel_data_sdk/client/api/data_classes/paging_result.py rename to exabel/client/api/data_classes/paging_result.py diff --git a/exabel_data_sdk/client/api/data_classes/prediction_model_run.py b/exabel/client/api/data_classes/prediction_model_run.py similarity index 97% rename from exabel_data_sdk/client/api/data_classes/prediction_model_run.py rename to exabel/client/api/data_classes/prediction_model_run.py index a73dcf26..f2b7b4ed 100644 --- a/exabel_data_sdk/client/api/data_classes/prediction_model_run.py +++ b/exabel/client/api/data_classes/prediction_model_run.py @@ -1,9 +1,9 @@ from enum import Enum -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( PredictionModelRun as ProtoPredictionModelRun, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.prediction_model_messages_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.prediction_model_messages_pb2 import ( ModelConfiguration as ProtoModelConfiguration, ) diff --git a/exabel/client/api/data_classes/relationship.py b/exabel/client/api/data_classes/relationship.py new file mode 100644 index 00000000..a1cefd75 --- /dev/null +++ b/exabel/client/api/data_classes/relationship.py @@ -0,0 +1,79 @@ +from dataclasses import dataclass, field +from typing import Mapping + +from exabel.client.api.proto_utils import from_struct, to_struct +from exabel.stubs.exabel.api.data.v1.all_pb2 import Relationship as ProtoRelationship + + +@dataclass +class Relationship: + """ + A relationship resource in the Data API. + + Attributes: + relationship_type: The resource name of the relationship type, for example + "relationshipTypes/namespace.relationshipTypeIdentifier". The + namespace must be empty (being global) or one of the + predetermined namespaces the customer has access to. The + relationship type identifier must match the regex + [A-Z][A-Z0-9_]{0,63}. + from_entity: The resource name of the start point of the relationship, + for example "entityTypes/ns.type1/entities/ns.entity1". + to_entity: The resource name of the end point of the relationship, + for example "entityTypes/ns.type2/entities/ns.entity2". + description: One or more paragraphs of text description. + properties: The properties of this entity. + read_only: Whether this resource is read only. + """ + + relationship_type: str + from_entity: str + to_entity: str + description: str = "" + properties: Mapping[str, str | bool | int | float] = field(default_factory=dict) + read_only: bool = False + + def __post_init__(self) -> None: + self.properties = self.properties or {} + + @staticmethod + def from_proto(relationship: ProtoRelationship) -> "Relationship": + """Create a Relationship from the given protobuf Relationship.""" + return Relationship( + relationship_type=relationship.parent, + from_entity=relationship.from_entity, + to_entity=relationship.to_entity, + description=relationship.description, + properties=from_struct(relationship.properties), + read_only=relationship.read_only, + ) + + def to_proto(self) -> ProtoRelationship: + """Create a protobuf Relationship from this Relationship.""" + return ProtoRelationship( + parent=self.relationship_type, + from_entity=self.from_entity, + to_entity=self.to_entity, + description=self.description, + properties=to_struct(self.properties), + ) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, Relationship): + return False + return ( + self.relationship_type == other.relationship_type + and self.from_entity == other.from_entity + and self.to_entity == other.to_entity + and self.description == other.description + and self.properties == other.properties + and self.read_only == other.read_only + ) + + def __repr__(self) -> str: + return ( + f"Relationship(relationship_type='{self.relationship_type}', " + f"from_entity='{self.from_entity}', to_entity='{self.to_entity}', " + f"description='{self.description}', properties={self.properties}, " + f"read_only={self.read_only})" + ) diff --git a/exabel/client/api/data_classes/relationship_type.py b/exabel/client/api/data_classes/relationship_type.py new file mode 100644 index 00000000..e07b8189 --- /dev/null +++ b/exabel/client/api/data_classes/relationship_type.py @@ -0,0 +1,73 @@ +from dataclasses import dataclass, field +from typing import Mapping + +from exabel.client.api.proto_utils import from_struct, to_struct +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( + RelationshipType as ProtoRelationshipType, +) + + +@dataclass +class RelationshipType: + """ + A relationship type resource in the Data API. + + Attributes: + name: The resource name of the relationship type, for example + "relationshipTypes/namespace.relationshipTypeIdentifier". + The namespace must be empty (being global) or one of the + predetermined namespaces the customer has access to. The + relationship type identifier must match the regex + [A-Z][A-Z0-9_]{0,63}. + description: One or more paragraphs of text description. + properties: The properties of this entity. + read_only: Whether this resource is read only. + is_ownership: Whether this relationship type is a data set ownership. + """ + + name: str + description: str = "" + properties: Mapping[str, str | bool | int | float] = field(default_factory=dict) + read_only: bool = False + is_ownership: bool = False + + def __post_init__(self) -> None: + self.properties = self.properties or {} + + @staticmethod + def from_proto(relationship_type: ProtoRelationshipType) -> "RelationshipType": + """Create a RelationshipType from the given protobuf RelationshipType.""" + return RelationshipType( + name=relationship_type.name, + description=relationship_type.description, + properties=from_struct(relationship_type.properties), + read_only=relationship_type.read_only, + is_ownership=relationship_type.is_ownership, + ) + + def to_proto(self) -> ProtoRelationshipType: + """Create a protobuf RelationshipType from this RelationshipType.""" + return ProtoRelationshipType( + name=self.name, + description=self.description, + properties=to_struct(self.properties), + is_ownership=self.is_ownership, + ) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, RelationshipType): + return False + return ( + self.name == other.name + and self.description == other.description + and self.properties == other.properties + and self.read_only == other.read_only + and self.is_ownership == other.is_ownership + ) + + def __repr__(self) -> str: + return ( + f"RelationshipType(name='{self.name}', description='{self.description}', " + f"properties={self.properties}, read_only={self.read_only}, " + f"is_ownership={self.is_ownership})" + ) diff --git a/exabel_data_sdk/client/api/data_classes/request_error.py b/exabel/client/api/data_classes/request_error.py similarity index 97% rename from exabel_data_sdk/client/api/data_classes/request_error.py rename to exabel/client/api/data_classes/request_error.py index f852e99f..e0c7f27c 100644 --- a/exabel_data_sdk/client/api/data_classes/request_error.py +++ b/exabel/client/api/data_classes/request_error.py @@ -78,7 +78,7 @@ class PreconditionFailure: @dataclass class RequestError(Exception): """ - Represents an error returned from the Exabel Api. + Represents an error returned from the Exabel API. Attributes: error_type (ErrorType): Type of error. diff --git a/exabel_data_sdk/client/api/data_classes/signal.py b/exabel/client/api/data_classes/signal.py similarity index 92% rename from exabel_data_sdk/client/api/data_classes/signal.py rename to exabel/client/api/data_classes/signal.py index 777e9c48..510e367b 100644 --- a/exabel_data_sdk/client/api/data_classes/signal.py +++ b/exabel/client/api/data_classes/signal.py @@ -1,8 +1,8 @@ from dataclasses import dataclass, field from typing import Sequence -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import Signal as ProtoSignal -from exabel_data_sdk.stubs.exabel.api.math.aggregation_pb2 import Aggregation +from exabel.stubs.exabel.api.data.v1.all_pb2 import Signal as ProtoSignal +from exabel.stubs.exabel.api.math.aggregation_pb2 import Aggregation @dataclass(frozen=True) diff --git a/exabel_data_sdk/client/api/data_classes/tag.py b/exabel/client/api/data_classes/tag.py similarity index 93% rename from exabel_data_sdk/client/api/data_classes/tag.py rename to exabel/client/api/data_classes/tag.py index 0f03ba04..b3478e53 100644 --- a/exabel_data_sdk/client/api/data_classes/tag.py +++ b/exabel/client/api/data_classes/tag.py @@ -4,8 +4,8 @@ from dateutil import tz from google.protobuf.timestamp_pb2 import Timestamp as ProtoTimestamp -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ItemMetadata as ProtoTagMetadata -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import Tag as ProtoTag +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ItemMetadata as ProtoTagMetadata +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import Tag as ProtoTag @dataclass @@ -15,7 +15,7 @@ class TagMetaData: Attributes: create_time: Time when the tag was created. - update_time: Time when the tag was updaed. + update_time: Time when the tag was updated. created_by: Resource name of the user that created the tag. updated_by: Resource name of the user that updated the tag. write_access: Whether the current user has write access to the tag. diff --git a/exabel_data_sdk/client/api/data_classes/time_series.py b/exabel/client/api/data_classes/time_series.py similarity index 96% rename from exabel_data_sdk/client/api/data_classes/time_series.py rename to exabel/client/api/data_classes/time_series.py index eb6ac4f9..4f294da0 100644 --- a/exabel_data_sdk/client/api/data_classes/time_series.py +++ b/exabel/client/api/data_classes/time_series.py @@ -8,10 +8,10 @@ import pandas as pd from dateutil import tz -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import TimeSeries as ProtoTimeSeries -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import TimeSeriesPoint -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import Unit as ProtoUnit -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import Units as ProtoUnits +from exabel.stubs.exabel.api.data.v1.all_pb2 import TimeSeries as ProtoTimeSeries +from exabel.stubs.exabel.api.data.v1.all_pb2 import TimeSeriesPoint +from exabel.stubs.exabel.api.data.v1.all_pb2 import Unit as ProtoUnit +from exabel.stubs.exabel.api.data.v1.all_pb2 import Units as ProtoUnits class Dimension(Enum): diff --git a/exabel_data_sdk/client/api/data_classes/user.py b/exabel/client/api/data_classes/user.py similarity index 94% rename from exabel_data_sdk/client/api/data_classes/user.py rename to exabel/client/api/data_classes/user.py index befb5312..263bdfd0 100644 --- a/exabel_data_sdk/client/api/data_classes/user.py +++ b/exabel/client/api/data_classes/user.py @@ -1,4 +1,4 @@ -from exabel_data_sdk.stubs.exabel.api.management.v1.all_pb2 import User as ProtoUser +from exabel.stubs.exabel.api.management.v1.all_pb2 import User as ProtoUser class User: diff --git a/exabel_data_sdk/client/api/data_set_api.py b/exabel/client/api/data_set_api.py similarity index 86% rename from exabel_data_sdk/client/api/data_set_api.py rename to exabel/client/api/data_set_api.py index 4ab8086e..a9350d3f 100644 --- a/exabel_data_sdk/client/api/data_set_api.py +++ b/exabel/client/api/data_set_api.py @@ -2,11 +2,11 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk.client.api.api_client.grpc.data_set_grpc_client import DataSetGrpcClient -from exabel_data_sdk.client.api.data_classes.data_set import DataSet -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.data_set_service_pb2 import ( +from exabel.client.api.api_client.grpc.data_set_grpc_client import DataSetGrpcClient +from exabel.client.api.data_classes.data_set import DataSet +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.data_set_service_pb2 import ( CreateDataSetRequest, DeleteDataSetRequest, GetDataSetRequest, @@ -38,7 +38,7 @@ def get_data_set(self, name: str) -> DataSet | None: Args: name: The resource name of the requested data set, for example - "dataSet/123". + "dataSets/123". """ try: response = self.client.get_data_set(GetDataSetRequest(name=name)) diff --git a/exabel_data_sdk/client/api/derived_signal_api.py b/exabel/client/api/derived_signal_api.py similarity index 85% rename from exabel_data_sdk/client/api/derived_signal_api.py rename to exabel/client/api/derived_signal_api.py index cbf5befc..c82b93a6 100644 --- a/exabel_data_sdk/client/api/derived_signal_api.py +++ b/exabel/client/api/derived_signal_api.py @@ -1,10 +1,10 @@ -from exabel_data_sdk.client.api.api_client.grpc.derived_signal_grpc_client import ( +from exabel.client.api.api_client.grpc.derived_signal_grpc_client import ( DerivedSignalGrpcClient, ) -from exabel_data_sdk.client.api.data_classes.derived_signal import DerivedSignal -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.client.api.data_classes.derived_signal import DerivedSignal +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( CreateDerivedSignalRequest, DeleteDerivedSignalRequest, GetDerivedSignalRequest, diff --git a/exabel_data_sdk/client/api/entity_api.py b/exabel/client/api/entity_api.py similarity index 91% rename from exabel_data_sdk/client/api/entity_api.py rename to exabel/client/api/entity_api.py index 41d7f438..2189398a 100644 --- a/exabel_data_sdk/client/api/entity_api.py +++ b/exabel/client/api/entity_api.py @@ -2,25 +2,25 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk.client.api.api_client.grpc.entity_grpc_client import EntityGrpcClient -from exabel_data_sdk.client.api.bulk_insert import bulk_insert -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.api.pageable_resource import PageableResourceMixin -from exabel_data_sdk.client.api.resource_creation_result import ( +from exabel.client.api.api_client.grpc.entity_grpc_client import EntityGrpcClient +from exabel.client.api.bulk_insert import bulk_insert +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.pageable_resource import PageableResourceMixin +from exabel.client.api.resource_creation_result import ( ResourceCreationResults, ResourceCreationStatus, ) -from exabel_data_sdk.client.api.search_service import SearchService -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.client.api.search_service import SearchService +from exabel.client.client_config import ClientConfig +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateEntityRequest, CreateEntityTypeRequest, DeleteEntitiesRequest, @@ -257,7 +257,7 @@ def search_for_entities(self, entity_type: str, **search_terms: str) -> Sequence Search for entities. Args: - entity_type: The resource name of the entity type which is search for, for example + entity_type: The resource name of the entity type to search for, for example "entityTypes/ns.type1" """ terms = [] diff --git a/exabel_data_sdk/client/api/error_handler.py b/exabel/client/api/error_handler.py similarity index 98% rename from exabel_data_sdk/client/api/error_handler.py rename to exabel/client/api/error_handler.py index dc017d74..62a60210 100644 --- a/exabel_data_sdk/client/api/error_handler.py +++ b/exabel/client/api/error_handler.py @@ -4,7 +4,7 @@ from google.rpc.status_pb2 import Status as StatusProto from grpc import RpcError, StatusCode -from exabel_data_sdk.client.api.data_classes.request_error import ( +from exabel.client.api.data_classes.request_error import ( ErrorType, PreconditionFailure, RequestError, diff --git a/exabel_data_sdk/client/api/export_api.py b/exabel/client/api/export_api.py similarity index 88% rename from exabel_data_sdk/client/api/export_api.py rename to exabel/client/api/export_api.py index 58171ef7..35892f25 100644 --- a/exabel_data_sdk/client/api/export_api.py +++ b/exabel/client/api/export_api.py @@ -8,12 +8,13 @@ from requests.adapters import HTTPAdapter from urllib3 import Retry -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.query.column import Column -from exabel_data_sdk.query.predicate import Predicate -from exabel_data_sdk.query.query import Query -from exabel_data_sdk.query.signals import Signals -from exabel_data_sdk.scripts.utils import conditional_progress_bar +from exabel.client.api.data_classes.derived_signal import DerivedSignal +from exabel.client.client_config import ClientConfig +from exabel.query.column import Column +from exabel.query.predicate import Predicate +from exabel.query.query import Query +from exabel.query.signals import Signals +from exabel.scripts.utils import conditional_progress_bar logger = logging.getLogger(__name__) @@ -92,9 +93,21 @@ def run_query(self, query: str | Query) -> pd.DataFrame: assert isinstance(content, pd.DataFrame) return content + @staticmethod + def _to_column(item: str | Column | DerivedSignal) -> str | Column: + """Convert a signal specification to a Column for query building.""" + if isinstance(item, DerivedSignal): + if not item.label or not item.expression: + raise ValueError( + f"DerivedSignal must have both label and expression, " + f"got label={item.label!r}, expression={item.expression!r}" + ) + return Column(name=item.label, expression=item.expression) + return item # str or Column pass through unchanged + def signal_query( self, - signal: str | Column | Sequence[str | Column], + signal: str | Column | DerivedSignal | Sequence[str | Column | DerivedSignal], bloomberg_ticker: str | Sequence[str] | None = None, *, factset_id: str | Sequence[str] | None = None, @@ -114,8 +127,8 @@ def signal_query( related to any entity. Args: - signal: the signal(s) to retrieve, as string identifiers or Column objects. - At least one signal must be requested. + signal: the signal(s) to retrieve, as string identifiers, Column objects, + or DerivedSignal objects. At least one signal must be requested. bloomberg_ticker: a Bloomberg ticker such as "AAPL US", or a list of such tickers. factset_id: a FactSet id such as "QLGSL2-R", or a list of such identifiers. resource_name: an Exabel resource name such as "entityTypes/company/entities/F_000C7F-E" @@ -195,10 +208,10 @@ def signal_query( # The columns to query for columns: list[str | Column] = list(index) - if isinstance(signal, (str, Column)): - columns.append(signal) + if isinstance(signal, (str, Column, DerivedSignal)): + columns.append(self._to_column(signal)) else: - columns.extend(signal) + columns.extend(self._to_column(s) for s in signal) # Execute the query query = Signals.query( @@ -215,7 +228,7 @@ def signal_query( def batched_signal_query( self, batch_size: int, - signal: str | Column | Sequence[str | Column], + signal: str | Column | DerivedSignal | Sequence[str | Column | DerivedSignal], *, bloomberg_ticker: Sequence[str] | None = None, factset_id: Sequence[str] | None = None, diff --git a/exabel_data_sdk/client/api/holiday_api.py b/exabel/client/api/holiday_api.py similarity index 88% rename from exabel_data_sdk/client/api/holiday_api.py rename to exabel/client/api/holiday_api.py index 0c62e6f5..cb2a1fd3 100644 --- a/exabel_data_sdk/client/api/holiday_api.py +++ b/exabel/client/api/holiday_api.py @@ -1,9 +1,9 @@ from collections.abc import Sequence -from exabel_data_sdk.client.api.api_client.grpc.holiday_grpc_client import HolidayGrpcClient -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.holiday_messages_pb2 import HolidaySpecification -from exabel_data_sdk.stubs.exabel.api.data.v1.holiday_service_pb2 import ( +from exabel.client.api.api_client.grpc.holiday_grpc_client import HolidayGrpcClient +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.holiday_messages_pb2 import HolidaySpecification +from exabel.stubs.exabel.api.data.v1.holiday_service_pb2 import ( CreateHolidaySpecificationRequest, DeleteHolidaySpecificationRequest, GetHolidaySpecificationRequest, @@ -20,11 +20,11 @@ class HolidayApi: that can be used when forecasting with the Prophet model. Example: - from exabel_data_sdk import ExabelClient - from exabel_data_sdk.stubs.exabel.api.data.v1.holiday_messages_pb2 import ( + from exabel import ExabelClient + from exabel.stubs.exabel.api.data.v1.holiday_messages_pb2 import ( Holiday, HolidaySpecification ) - from exabel_data_sdk.stubs.exabel.api.time.date_pb2 import Date + from exabel.stubs.exabel.api.time.date_pb2 import Date client = ExabelClient(api_key="YOUR_API_KEY") diff --git a/exabel_data_sdk/client/api/kpi_api.py b/exabel/client/api/kpi_api.py similarity index 88% rename from exabel_data_sdk/client/api/kpi_api.py rename to exabel/client/api/kpi_api.py index b2b611a2..025bf6da 100644 --- a/exabel_data_sdk/client/api/kpi_api.py +++ b/exabel/client/api/kpi_api.py @@ -3,26 +3,26 @@ import pandas as pd -from exabel_data_sdk.client.api.api_client.grpc.kpi_grpc_client import KpiGrpcClient -from exabel_data_sdk.client.api.data_classes.company_kpi_mapping_results import ( +from exabel.client.api.api_client.grpc.kpi_grpc_client import KpiGrpcClient +from exabel.client.api.data_classes.company_kpi_mapping_results import ( CompanyKpiMappingResults, ) -from exabel_data_sdk.client.api.data_classes.company_kpi_models import CompanyKpiModels -from exabel_data_sdk.client.api.data_classes.kpi import Kpi, KpiType -from exabel_data_sdk.client.api.data_classes.kpi_mapping_result_data import KpiMappingResultData -from exabel_data_sdk.client.api.data_classes.kpi_screen_results import KpiScreenCompanyResult -from exabel_data_sdk.client.api.data_classes.kpi_source import KpiSource -from exabel_data_sdk.client.api.data_classes.model_results import ( +from exabel.client.api.data_classes.company_kpi_models import CompanyKpiModels +from exabel.client.api.data_classes.kpi import Kpi, KpiType +from exabel.client.api.data_classes.kpi_mapping_result_data import KpiMappingResultData +from exabel.client.api.data_classes.kpi_screen_results import KpiScreenCompanyResult +from exabel.client.api.data_classes.kpi_source import KpiSource +from exabel.client.api.data_classes.model_results import ( BaseModelResults, HierarchicalModelResults, ) -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( FiscalPeriodSelector, RelativeFiscalPeriodSelector, ) -from exabel_data_sdk.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( +from exabel.stubs.exabel.api.analytics.v1.kpi_service_pb2 import ( ListCompanyBaseModelResultsRequest, ListCompanyHierarchicalModelResultsRequest, ListCompanyKpiMappingResultsRequest, @@ -30,7 +30,7 @@ ListKpiMappingResultsRequest, ListKpiScreenResultsRequest, ) -from exabel_data_sdk.stubs.exabel.api.time.date_pb2 import Date +from exabel.stubs.exabel.api.time.date_pb2 import Date logger = logging.getLogger(__name__) diff --git a/exabel_data_sdk/client/api/library_api.py b/exabel/client/api/library_api.py similarity index 92% rename from exabel_data_sdk/client/api/library_api.py rename to exabel/client/api/library_api.py index 48af9027..eae904bd 100644 --- a/exabel_data_sdk/client/api/library_api.py +++ b/exabel/client/api/library_api.py @@ -2,13 +2,13 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk.client.api.api_client.grpc.library_grpc_client import LibraryGrpcClient -from exabel_data_sdk.client.api.data_classes.folder import Folder -from exabel_data_sdk.client.api.data_classes.folder_accessor import FolderAccessor -from exabel_data_sdk.client.api.data_classes.folder_item import FolderItem, FolderItemType -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.management.v1.library_service_pb2 import ( +from exabel.client.api.api_client.grpc.library_grpc_client import LibraryGrpcClient +from exabel.client.api.data_classes.folder import Folder +from exabel.client.api.data_classes.folder_accessor import FolderAccessor +from exabel.client.api.data_classes.folder_item import FolderItem, FolderItemType +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.management.v1.library_service_pb2 import ( CreateFolderRequest, DeleteFolderRequest, GetFolderRequest, diff --git a/exabel_data_sdk/client/api/namespace_api.py b/exabel/client/api/namespace_api.py similarity index 77% rename from exabel_data_sdk/client/api/namespace_api.py rename to exabel/client/api/namespace_api.py index abf2b7e2..e756b1c5 100644 --- a/exabel_data_sdk/client/api/namespace_api.py +++ b/exabel/client/api/namespace_api.py @@ -1,11 +1,11 @@ import logging from typing import Sequence -from exabel_data_sdk.client.api.api_client.grpc.namespace_grpc_client import NamespaceGrpcClient -from exabel_data_sdk.client.api.data_classes.namespace import Namespace -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ListNamespacesRequest -from exabel_data_sdk.util.exceptions import NoWriteableNamespaceError +from exabel.client.api.api_client.grpc.namespace_grpc_client import NamespaceGrpcClient +from exabel.client.api.data_classes.namespace import Namespace +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ListNamespacesRequest +from exabel.util.exceptions import NoWriteableNamespaceError logger = logging.getLogger(__name__) diff --git a/exabel_data_sdk/client/api/pageable_resource.py b/exabel/client/api/pageable_resource.py similarity index 63% rename from exabel_data_sdk/client/api/pageable_resource.py rename to exabel/client/api/pageable_resource.py index a673a446..21e4e283 100644 --- a/exabel_data_sdk/client/api/pageable_resource.py +++ b/exabel/client/api/pageable_resource.py @@ -1,13 +1,13 @@ from typing import Callable, Iterator, TypeVar -from exabel_data_sdk.client.api.data_classes.data_set import DataSet -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.data_classes.relationship_type import RelationshipType -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.client.api.data_classes.tag import Tag +from exabel.client.api.data_classes.data_set import DataSet +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.data_classes.relationship_type import RelationshipType +from exabel.client.api.data_classes.signal import Signal +from exabel.client.api.data_classes.tag import Tag PageableResourceT = TypeVar( "PageableResourceT", diff --git a/exabel_data_sdk/client/api/prediction_model_api.py b/exabel/client/api/prediction_model_api.py similarity index 69% rename from exabel_data_sdk/client/api/prediction_model_api.py rename to exabel/client/api/prediction_model_api.py index 383ff907..8dc049e8 100644 --- a/exabel_data_sdk/client/api/prediction_model_api.py +++ b/exabel/client/api/prediction_model_api.py @@ -1,9 +1,9 @@ -from exabel_data_sdk.client.api.api_client.grpc.prediction_model_grpc_client import ( +from exabel.client.api.api_client.grpc.prediction_model_grpc_client import ( PredictionModelGrpcClient, ) -from exabel_data_sdk.client.api.data_classes.prediction_model_run import PredictionModelRun -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import CreatePredictionModelRunRequest +from exabel.client.api.data_classes.prediction_model_run import PredictionModelRun +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import CreatePredictionModelRunRequest class PredictionModelApi: diff --git a/exabel_data_sdk/client/api/proto_utils.py b/exabel/client/api/proto_utils.py similarity index 100% rename from exabel_data_sdk/client/api/proto_utils.py rename to exabel/client/api/proto_utils.py diff --git a/exabel_data_sdk/client/api/relationship_api.py b/exabel/client/api/relationship_api.py similarity index 95% rename from exabel_data_sdk/client/api/relationship_api.py rename to exabel/client/api/relationship_api.py index 8af3d442..59a2dbcc 100644 --- a/exabel_data_sdk/client/api/relationship_api.py +++ b/exabel/client/api/relationship_api.py @@ -3,26 +3,26 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk.client.api.api_client.grpc.relationship_grpc_client import ( +from exabel.client.api.api_client.grpc.relationship_grpc_client import ( RelationshipGrpcClient, ) -from exabel_data_sdk.client.api.bulk_insert import bulk_insert -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.data_classes.relationship_type import RelationshipType -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.api.pageable_resource import PageableResourceMixin -from exabel_data_sdk.client.api.resource_creation_result import ( +from exabel.client.api.bulk_insert import bulk_insert +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.data_classes.relationship_type import RelationshipType +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.pageable_resource import PageableResourceMixin +from exabel.client.api.resource_creation_result import ( ResourceCreationResults, ResourceCreationStatus, ) -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.client.client_config import ClientConfig +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateRelationshipRequest, CreateRelationshipTypeRequest, DeleteRelationshipRequest, diff --git a/exabel_data_sdk/client/api/resource_creation_result.py b/exabel/client/api/resource_creation_result.py similarity index 96% rename from exabel_data_sdk/client/api/resource_creation_result.py rename to exabel/client/api/resource_creation_result.py index 135be53a..4fa58d9f 100644 --- a/exabel_data_sdk/client/api/resource_creation_result.py +++ b/exabel/client/api/resource_creation_result.py @@ -8,11 +8,11 @@ import numpy as np import pandas as pd -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.data_classes.request_error import RequestError -from exabel_data_sdk.client.api.data_classes.time_series import TimeSeries -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.data_classes.request_error import RequestError +from exabel.client.api.data_classes.time_series import TimeSeries +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_BULK_LOAD_CHECKPOINTS, FAILURE_LOG_LIMIT, diff --git a/exabel_data_sdk/client/api/search_service.py b/exabel/client/api/search_service.py similarity index 97% rename from exabel_data_sdk/client/api/search_service.py rename to exabel/client/api/search_service.py index 1cbf8f1e..9d630da1 100644 --- a/exabel_data_sdk/client/api/search_service.py +++ b/exabel/client/api/search_service.py @@ -1,9 +1,9 @@ import itertools from typing import Mapping, Sequence, TypeVar -from exabel_data_sdk.client.api.api_client.entity_api_client import EntityApiClient -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.api_client.entity_api_client import EntityApiClient +from exabel.client.api.data_classes.entity import Entity +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( SearchEntitiesRequest, SearchEntitiesResponse, SearchTerm, diff --git a/exabel_data_sdk/client/api/signal_api.py b/exabel/client/api/signal_api.py similarity index 87% rename from exabel_data_sdk/client/api/signal_api.py rename to exabel/client/api/signal_api.py index 79799f0e..067e672d 100644 --- a/exabel_data_sdk/client/api/signal_api.py +++ b/exabel/client/api/signal_api.py @@ -2,14 +2,14 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk.client.api.api_client.grpc.signal_grpc_client import SignalGrpcClient -from exabel_data_sdk.client.api.data_classes.derived_signal import DerivedSignal -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.client.api.pageable_resource import PageableResourceMixin -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.api_client.grpc.signal_grpc_client import SignalGrpcClient +from exabel.client.api.data_classes.derived_signal import DerivedSignal +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.data_classes.signal import Signal +from exabel.client.api.pageable_resource import PageableResourceMixin +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( CreateSignalRequest, DeleteSignalRequest, FilterDerivedSignalsRequest, @@ -72,7 +72,7 @@ def get_signal(self, name: str) -> Signal | None: def create_signal(self, signal: Signal, create_library_signal: bool = False) -> Signal: """ - Create one signal and returns it. + Create one signal and return it. Args: signal: The signal to create. @@ -141,7 +141,7 @@ def filter_derived_signals(self, entity_names: list[str]) -> dict[str, list[Deri Args: entity_names: The resource names of the entities to filter on. At least one entity must be specified. A derived signal is returned only if - at least one of the entities are included in the signal. + at least one of the entities is included in the signal. Returns: Dictionary mapping data set resource names to DerivedSignals collections. diff --git a/exabel_data_sdk/client/api/tag_api.py b/exabel/client/api/tag_api.py similarity index 89% rename from exabel_data_sdk/client/api/tag_api.py rename to exabel/client/api/tag_api.py index a916d769..db4a4c2c 100644 --- a/exabel_data_sdk/client/api/tag_api.py +++ b/exabel/client/api/tag_api.py @@ -1,12 +1,12 @@ from typing import Iterator -from exabel_data_sdk.client.api.api_client.grpc.tag_grpc_client import TagGrpcClient -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.api.data_classes.tag import Tag -from exabel_data_sdk.client.api.pageable_resource import PageableResourceMixin -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.analytics.v1.all_pb2 import ( +from exabel.client.api.api_client.grpc.tag_grpc_client import TagGrpcClient +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.data_classes.tag import Tag +from exabel.client.api.pageable_resource import PageableResourceMixin +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.analytics.v1.all_pb2 import ( AddEntitiesRequest, CreateTagRequest, DeleteTagRequest, @@ -76,7 +76,7 @@ def delete_tag(self, name: str) -> None: def list_tags(self, page_size: int = 1000, page_token: str | None = None) -> PagingResult[Tag]: """ - List tags accesible to the user. + List tags accessible to the user. Args: page_size: The maximum number of results to return. Defaults to 1000, which is also diff --git a/exabel_data_sdk/client/api/time_series_api.py b/exabel/client/api/time_series_api.py similarity index 95% rename from exabel_data_sdk/client/api/time_series_api.py rename to exabel/client/api/time_series_api.py index 7f9d2f82..4c8bb08b 100644 --- a/exabel_data_sdk/client/api/time_series_api.py +++ b/exabel/client/api/time_series_api.py @@ -8,25 +8,25 @@ from google.rpc.code_pb2 import Code as CodeProto from grpc import StatusCode -from exabel_data_sdk.client.api.api_client.grpc.time_series_grpc_client import TimeSeriesGrpcClient -from exabel_data_sdk.client.api.bulk_import import bulk_import -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.api.data_classes.time_series import TimeSeries -from exabel_data_sdk.client.api.error_handler import grpc_status_to_error_type -from exabel_data_sdk.client.api.pageable_resource import PageableResourceMixin -from exabel_data_sdk.client.api.resource_creation_result import ( +from exabel.client.api.api_client.grpc.time_series_grpc_client import TimeSeriesGrpcClient +from exabel.client.api.bulk_import import bulk_import +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.data_classes.time_series import TimeSeries +from exabel.client.api.error_handler import grpc_status_to_error_type +from exabel.client.api.pageable_resource import PageableResourceMixin +from exabel.client.api.resource_creation_result import ( ResourceCreationResult, ResourceCreationResults, ResourceCreationStatus, ) -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.client.client_config import ClientConfig +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( BatchDeleteTimeSeriesPointsRequest, CreateTimeSeriesRequest, DefaultKnownTime, @@ -39,8 +39,8 @@ UpdateOptions, UpdateTimeSeriesRequest, ) -from exabel_data_sdk.stubs.exabel.api.time.time_range_pb2 import TimeRange -from exabel_data_sdk.util.deprecate_arguments import deprecate_arguments +from exabel.stubs.exabel.api.time.time_range_pb2 import TimeRange +from exabel.util.deprecate_arguments import deprecate_arguments class TimeSeriesApi(PageableResourceMixin): @@ -58,7 +58,7 @@ def get_signal_time_series( Get the resource names of all time series for one signal. Args: - signal: The signal to get time series for, for example "signal/ns.signal1". + signal: The signal to get time series for, for example "signals/ns.signal1". page_size: The maximum number of results to return. Defaults to 1000, which is also the maximum size of this field. page_token: The page token to resume the results from. @@ -186,7 +186,7 @@ def create_time_series( "signals/ns3.signal/entityTypes/ns1.type/entities/ns2.entity". The namespaces must be empty (being global) or one of the predetermined namespaces the customer has access to. If ns2 is not empty, it must be - equals to ns3, and if ns1 is not empty, all three namespaces must be equal. + equal to ns3, and if ns1 is not empty, all three namespaces must be equal. series: The time series data create_tag: Deprecated. default_known_time: @@ -227,7 +227,7 @@ def upsert_time_series( "signals/ns3.signal/entityTypes/ns1.type/entities/ns2.entity". The namespaces must be empty (being global) or one of the predetermined namespaces the customer has access to. If ns2 is not empty, it must be - equals to ns3, and if ns1 is not empty, all three namespaces must be equal. + equal to ns3, and if ns1 is not empty, all three namespaces must be equal. series: The time series data create_tag: Deprecated. default_known_time: @@ -469,8 +469,6 @@ def bulk_upsert_time_series( should_optimise: bool | None = None, retries: int = DEFAULT_NUMBER_OF_RETRIES, abort_threshold: float | None = DEFAULT_ABORT_THRESHOLD, - # Deprecated arguments - threads_for_import: int = 4, ) -> ResourceCreationResults[pd.Series]: """Import the provided time series in batches. diff --git a/exabel_data_sdk/client/api/user_api.py b/exabel/client/api/user_api.py similarity index 66% rename from exabel_data_sdk/client/api/user_api.py rename to exabel/client/api/user_api.py index 64c11caa..66566440 100644 --- a/exabel_data_sdk/client/api/user_api.py +++ b/exabel/client/api/user_api.py @@ -1,10 +1,10 @@ from typing import Sequence -from exabel_data_sdk.client.api.api_client.grpc.user_grpc_client import UserGrpcClient -from exabel_data_sdk.client.api.data_classes.group import Group -from exabel_data_sdk.client.api.data_classes.user import User -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.management.v1.user_service_pb2 import ( +from exabel.client.api.api_client.grpc.user_grpc_client import UserGrpcClient +from exabel.client.api.data_classes.group import Group +from exabel.client.api.data_classes.user import User +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.management.v1.user_service_pb2 import ( ListGroupsRequest, ListUsersRequest, ) diff --git a/exabel_data_sdk/client/client_config.py b/exabel/client/client_config.py similarity index 100% rename from exabel_data_sdk/client/client_config.py rename to exabel/client/client_config.py diff --git a/exabel_data_sdk/client/exabel_client.py b/exabel/client/exabel_client.py similarity index 79% rename from exabel_data_sdk/client/exabel_client.py rename to exabel/client/exabel_client.py index f5c2be36..1761c6a7 100644 --- a/exabel_data_sdk/client/exabel_client.py +++ b/exabel/client/exabel_client.py @@ -1,21 +1,21 @@ from typing import Sequence -from exabel_data_sdk.client.api.calendar_api import CalendarApi -from exabel_data_sdk.client.api.data_set_api import DataSetApi -from exabel_data_sdk.client.api.derived_signal_api import DerivedSignalApi -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.api.export_api import ExportApi -from exabel_data_sdk.client.api.holiday_api import HolidayApi -from exabel_data_sdk.client.api.kpi_api import KpiApi -from exabel_data_sdk.client.api.library_api import LibraryApi -from exabel_data_sdk.client.api.namespace_api import NamespaceApi -from exabel_data_sdk.client.api.prediction_model_api import PredictionModelApi -from exabel_data_sdk.client.api.relationship_api import RelationshipApi -from exabel_data_sdk.client.api.signal_api import SignalApi -from exabel_data_sdk.client.api.tag_api import TagApi -from exabel_data_sdk.client.api.time_series_api import TimeSeriesApi -from exabel_data_sdk.client.api.user_api import UserApi -from exabel_data_sdk.client.client_config import ClientConfig +from exabel.client.api.calendar_api import CalendarApi +from exabel.client.api.data_set_api import DataSetApi +from exabel.client.api.derived_signal_api import DerivedSignalApi +from exabel.client.api.entity_api import EntityApi +from exabel.client.api.export_api import ExportApi +from exabel.client.api.holiday_api import HolidayApi +from exabel.client.api.kpi_api import KpiApi +from exabel.client.api.library_api import LibraryApi +from exabel.client.api.namespace_api import NamespaceApi +from exabel.client.api.prediction_model_api import PredictionModelApi +from exabel.client.api.relationship_api import RelationshipApi +from exabel.client.api.signal_api import SignalApi +from exabel.client.api.tag_api import TagApi +from exabel.client.api.time_series_api import TimeSeriesApi +from exabel.client.api.user_api import UserApi +from exabel.client.client_config import ClientConfig class ExabelClient: @@ -61,7 +61,7 @@ def __init__( export_api_port: Override default Exabel Export API port. timeout: Override default timeout in seconds to use for API requests (only affects gRPC APIs). - retries: Override default number of retrie for requests (only affects Export + retries: Override default number of retries for requests (only affects Export API). root_certificates: Additional allowed root certificates for verifying TLS connection (only affects gRPC APIs). diff --git a/exabel_data_sdk/examples/__init__.py b/exabel/examples/__init__.py similarity index 100% rename from exabel_data_sdk/examples/__init__.py rename to exabel/examples/__init__.py diff --git a/exabel_data_sdk/examples/create_time_series_example.py b/exabel/examples/create_time_series_example.py similarity index 90% rename from exabel_data_sdk/examples/create_time_series_example.py rename to exabel/examples/create_time_series_example.py index 0c13b993..a9c6be4b 100644 --- a/exabel_data_sdk/examples/create_time_series_example.py +++ b/exabel/examples/create_time_series_example.py @@ -1,11 +1,11 @@ import pandas as pd from dateutil import tz -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.data_classes.relationship_type import RelationshipType -from exabel_data_sdk.client.api.data_classes.signal import Signal +from exabel import ExabelClient +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.data_classes.relationship_type import RelationshipType +from exabel.client.api.data_classes.signal import Signal def create_time_series() -> None: diff --git a/exabel_data_sdk/examples/get_company_example.py b/exabel/examples/get_company_example.py similarity index 98% rename from exabel_data_sdk/examples/get_company_example.py rename to exabel/examples/get_company_example.py index b2325b4e..e8ff6677 100644 --- a/exabel_data_sdk/examples/get_company_example.py +++ b/exabel/examples/get_company_example.py @@ -1,4 +1,4 @@ -from exabel_data_sdk import ExabelClient +from exabel import ExabelClient def get_company() -> None: diff --git a/exabel_data_sdk/query/__init__.py b/exabel/query/__init__.py similarity index 100% rename from exabel_data_sdk/query/__init__.py rename to exabel/query/__init__.py diff --git a/exabel_data_sdk/query/column.py b/exabel/query/column.py similarity index 93% rename from exabel_data_sdk/query/column.py rename to exabel/query/column.py index a5ec4da7..35ee175d 100644 --- a/exabel_data_sdk/query/column.py +++ b/exabel/query/column.py @@ -1,7 +1,7 @@ from dataclasses import dataclass -from exabel_data_sdk.query.literal import Literal, escape -from exabel_data_sdk.query.predicate import Comparison, InPredicate +from exabel.query.literal import Literal, escape +from exabel.query.predicate import Comparison, InPredicate @dataclass diff --git a/exabel_data_sdk/query/dashboard.py b/exabel/query/dashboard.py similarity index 90% rename from exabel_data_sdk/query/dashboard.py rename to exabel/query/dashboard.py index 8349ac5e..2018aeaa 100644 --- a/exabel_data_sdk/query/dashboard.py +++ b/exabel/query/dashboard.py @@ -1,8 +1,8 @@ from typing import Sequence -from exabel_data_sdk.query.column import Column -from exabel_data_sdk.query.query import Query -from exabel_data_sdk.query.table import Table +from exabel.query.column import Column +from exabel.query.query import Query +from exabel.query.table import Table class Dashboard: diff --git a/exabel_data_sdk/query/literal.py b/exabel/query/literal.py similarity index 100% rename from exabel_data_sdk/query/literal.py rename to exabel/query/literal.py diff --git a/exabel_data_sdk/query/predicate.py b/exabel/query/predicate.py similarity index 95% rename from exabel_data_sdk/query/predicate.py rename to exabel/query/predicate.py index 453035ba..695cd9d7 100644 --- a/exabel_data_sdk/query/predicate.py +++ b/exabel/query/predicate.py @@ -2,7 +2,7 @@ from dataclasses import dataclass from typing import Sequence -from exabel_data_sdk.query.literal import Literal, to_sql +from exabel.query.literal import Literal, to_sql class Predicate(ABC): diff --git a/exabel_data_sdk/query/query.py b/exabel/query/query.py similarity index 81% rename from exabel_data_sdk/query/query.py rename to exabel/query/query.py index 2089d8a6..c8f17285 100644 --- a/exabel_data_sdk/query/query.py +++ b/exabel/query/query.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import Sequence -from exabel_data_sdk.query.column import Column -from exabel_data_sdk.query.predicate import Predicate -from exabel_data_sdk.query.table import Table +from exabel.query.column import Column +from exabel.query.predicate import Predicate +from exabel.query.table import Table @dataclass diff --git a/exabel_data_sdk/query/signals.py b/exabel/query/signals.py similarity index 93% rename from exabel_data_sdk/query/signals.py rename to exabel/query/signals.py index 39bf78ee..06e0c31d 100644 --- a/exabel_data_sdk/query/signals.py +++ b/exabel/query/signals.py @@ -2,10 +2,10 @@ import pandas as pd -from exabel_data_sdk.query.column import Column -from exabel_data_sdk.query.predicate import FunctionPredicate, Predicate -from exabel_data_sdk.query.query import Query -from exabel_data_sdk.query.table import Table +from exabel.query.column import Column +from exabel.query.predicate import FunctionPredicate, Predicate +from exabel.query.query import Query +from exabel.query.table import Table class Signals: diff --git a/exabel_data_sdk/query/table.py b/exabel/query/table.py similarity index 100% rename from exabel_data_sdk/query/table.py rename to exabel/query/table.py diff --git a/exabel_data_sdk/scripts/__init__.py b/exabel/scripts/__init__.py similarity index 100% rename from exabel_data_sdk/scripts/__init__.py rename to exabel/scripts/__init__.py diff --git a/exabel_data_sdk/scripts/actions.py b/exabel/scripts/actions.py similarity index 96% rename from exabel_data_sdk/scripts/actions.py rename to exabel/scripts/actions.py index d8040b89..ed0b3a12 100644 --- a/exabel_data_sdk/scripts/actions.py +++ b/exabel/scripts/actions.py @@ -2,7 +2,7 @@ import warnings from typing import Sequence -from exabel_data_sdk.util.warnings import ExabelDeprecationWarning +from exabel.util.warnings import ExabelDeprecationWarning class DeprecatedArgumentAction(argparse.Action): diff --git a/exabel_data_sdk/scripts/base_script.py b/exabel/scripts/base_script.py similarity index 97% rename from exabel_data_sdk/scripts/base_script.py rename to exabel/scripts/base_script.py index bf0a8a0c..659e307d 100644 --- a/exabel_data_sdk/scripts/base_script.py +++ b/exabel/scripts/base_script.py @@ -4,8 +4,8 @@ import urllib.parse from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.command_line_script import CommandLineScript +from exabel import ExabelClient +from exabel.scripts.command_line_script import CommandLineScript class BaseScript(CommandLineScript, abc.ABC): diff --git a/exabel_data_sdk/scripts/check_company_identifiers_in_csv.py b/exabel/scripts/check_company_identifiers_in_csv.py similarity index 95% rename from exabel_data_sdk/scripts/check_company_identifiers_in_csv.py rename to exabel/scripts/check_company_identifiers_in_csv.py index dea19662..6159b93a 100644 --- a/exabel_data_sdk/scripts/check_company_identifiers_in_csv.py +++ b/exabel/scripts/check_company_identifiers_in_csv.py @@ -4,10 +4,10 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.search_service import COMPANY_SEARCH_TERM_FIELDS -from exabel_data_sdk.scripts.csv_script import CsvScript -from exabel_data_sdk.util.resource_name_normalization import ( +from exabel import ExabelClient +from exabel.client.api.search_service import COMPANY_SEARCH_TERM_FIELDS +from exabel.scripts.csv_script import CsvScript +from exabel.util.resource_name_normalization import ( EntityResourceNames, to_entity_resource_names, ) diff --git a/exabel_data_sdk/scripts/command_line_script.py b/exabel/scripts/command_line_script.py similarity index 92% rename from exabel_data_sdk/scripts/command_line_script.py rename to exabel/scripts/command_line_script.py index 545f26c5..85db044a 100644 --- a/exabel_data_sdk/scripts/command_line_script.py +++ b/exabel/scripts/command_line_script.py @@ -13,7 +13,7 @@ def __init__(self, argv: Sequence[str], description: str): self.parser = argparse.ArgumentParser(description=description) def parse_arguments(self) -> argparse.Namespace: - """Parse arguments input""" + """Parse arguments input.""" return self.parser.parse_args(self.argv[1:]) def setup_logging( @@ -22,7 +22,7 @@ def setup_logging( level: int = logging.INFO, stream: TextIO = sys.stdout, ) -> None: - """Setup logging""" + """Set up logging.""" logging.basicConfig(format=format, level=level, stream=stream) logging.captureWarnings(True) diff --git a/exabel_data_sdk/scripts/create_data_set.py b/exabel/scripts/create_data_set.py similarity index 90% rename from exabel_data_sdk/scripts/create_data_set.py rename to exabel/scripts/create_data_set.py index ab262cc9..c8fbb240 100644 --- a/exabel_data_sdk/scripts/create_data_set.py +++ b/exabel/scripts/create_data_set.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.data_set import DataSet, print_data_set -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.data_set import DataSet, print_data_set +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class CreateDataSet(BaseScript): diff --git a/exabel_data_sdk/scripts/create_derived_signal.py b/exabel/scripts/create_derived_signal.py similarity index 93% rename from exabel_data_sdk/scripts/create_derived_signal.py rename to exabel/scripts/create_derived_signal.py index f1b41b37..c7575624 100644 --- a/exabel_data_sdk/scripts/create_derived_signal.py +++ b/exabel/scripts/create_derived_signal.py @@ -2,13 +2,13 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.derived_signal import ( +from exabel import ExabelClient +from exabel.client.api.data_classes.derived_signal import ( DerivedSignal, DerivedSignalMetaData, DerivedSignalUnit, ) -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel.scripts.base_script import BaseScript class CreateDerivedSignal(BaseScript): diff --git a/exabel_data_sdk/scripts/create_entity.py b/exabel/scripts/create_entity.py similarity index 87% rename from exabel_data_sdk/scripts/create_entity.py rename to exabel/scripts/create_entity.py index a772a4a8..b3ad1d36 100644 --- a/exabel_data_sdk/scripts/create_entity.py +++ b/exabel/scripts/create_entity.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.entity import Entity +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class CreateEntity(BaseScript): diff --git a/exabel_data_sdk/scripts/create_entity_mapping_from_csv.py b/exabel/scripts/create_entity_mapping_from_csv.py similarity index 98% rename from exabel_data_sdk/scripts/create_entity_mapping_from_csv.py rename to exabel/scripts/create_entity_mapping_from_csv.py index 77db1a37..ceaa1cd9 100644 --- a/exabel_data_sdk/scripts/create_entity_mapping_from_csv.py +++ b/exabel/scripts/create_entity_mapping_from_csv.py @@ -4,9 +4,9 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript -from exabel_data_sdk.services.csv_reader import CsvReader +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript +from exabel.services.csv_reader import CsvReader class CreateEntityMappingFromCsv(BaseScript): diff --git a/exabel_data_sdk/scripts/create_entity_type.py b/exabel/scripts/create_entity_type.py similarity index 89% rename from exabel_data_sdk/scripts/create_entity_type.py rename to exabel/scripts/create_entity_type.py index b8fd42b1..26213690 100644 --- a/exabel_data_sdk/scripts/create_entity_type.py +++ b/exabel/scripts/create_entity_type.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class CreateEntityType(BaseScript): diff --git a/exabel_data_sdk/scripts/create_folder.py b/exabel/scripts/create_folder.py similarity index 83% rename from exabel_data_sdk/scripts/create_folder.py rename to exabel/scripts/create_folder.py index f43159cc..463d6da0 100644 --- a/exabel_data_sdk/scripts/create_folder.py +++ b/exabel/scripts/create_folder.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.folder import Folder -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.folder import Folder +from exabel.scripts.base_script import BaseScript class CreateFolder(BaseScript): diff --git a/exabel_data_sdk/scripts/create_prediction_model_run.py b/exabel/scripts/create_prediction_model_run.py similarity index 84% rename from exabel_data_sdk/scripts/create_prediction_model_run.py rename to exabel/scripts/create_prediction_model_run.py index 10325d84..e91bdf5c 100644 --- a/exabel_data_sdk/scripts/create_prediction_model_run.py +++ b/exabel/scripts/create_prediction_model_run.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.prediction_model_run import PredictionModelRun -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.prediction_model_run import PredictionModelRun +from exabel.scripts.base_script import BaseScript class CreatePredictionModelRun(BaseScript): diff --git a/exabel_data_sdk/scripts/create_relationship.py b/exabel/scripts/create_relationship.py similarity index 88% rename from exabel_data_sdk/scripts/create_relationship.py rename to exabel/scripts/create_relationship.py index 3e955754..bb5b629a 100644 --- a/exabel_data_sdk/scripts/create_relationship.py +++ b/exabel/scripts/create_relationship.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.relationship import Relationship +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class CreateRelationship(BaseScript): diff --git a/exabel_data_sdk/scripts/create_relationship_type.py b/exabel/scripts/create_relationship_type.py similarity index 89% rename from exabel_data_sdk/scripts/create_relationship_type.py rename to exabel/scripts/create_relationship_type.py index 087f9e8f..6de911de 100644 --- a/exabel_data_sdk/scripts/create_relationship_type.py +++ b/exabel/scripts/create_relationship_type.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.relationship_type import RelationshipType -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.relationship_type import RelationshipType +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class CreateRelationshipType(BaseScript): diff --git a/exabel_data_sdk/scripts/create_signal.py b/exabel/scripts/create_signal.py similarity index 88% rename from exabel_data_sdk/scripts/create_signal.py rename to exabel/scripts/create_signal.py index 9d703dab..f0f7f947 100644 --- a/exabel_data_sdk/scripts/create_signal.py +++ b/exabel/scripts/create_signal.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.signal import Signal +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class CreateSignal(BaseScript): diff --git a/exabel_data_sdk/scripts/csv_script.py b/exabel/scripts/csv_script.py similarity index 92% rename from exabel_data_sdk/scripts/csv_script.py rename to exabel/scripts/csv_script.py index c908ff22..767f6ee8 100644 --- a/exabel_data_sdk/scripts/csv_script.py +++ b/exabel/scripts/csv_script.py @@ -5,9 +5,9 @@ import pandas as pd -from exabel_data_sdk.scripts.actions import DeprecatedArgumentAction -from exabel_data_sdk.scripts.base_script import BaseScript -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.scripts.actions import DeprecatedArgumentAction +from exabel.scripts.base_script import BaseScript +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS, @@ -18,7 +18,7 @@ class CsvScript(BaseScript): """ - Base class for scripts that process a CSV files with data to be loaded into the Exabel API. + Base class for scripts that process a CSV file with data to be loaded into the Exabel API. The first row of the CSV file should be a header row with column names. Each script will provide additional command line arguments that specify which columns to use. diff --git a/exabel_data_sdk/scripts/csv_script_with_entity_mapping.py b/exabel/scripts/csv_script_with_entity_mapping.py similarity index 96% rename from exabel_data_sdk/scripts/csv_script_with_entity_mapping.py rename to exabel/scripts/csv_script_with_entity_mapping.py index e4a2a477..cd9a9120 100644 --- a/exabel_data_sdk/scripts/csv_script_with_entity_mapping.py +++ b/exabel/scripts/csv_script_with_entity_mapping.py @@ -1,6 +1,6 @@ from typing import Sequence -from exabel_data_sdk.scripts.csv_script import CsvScript +from exabel.scripts.csv_script import CsvScript class CsvScriptWithEntityMapping(CsvScript): diff --git a/exabel_data_sdk/scripts/delete_data_set.py b/exabel/scripts/delete_data_set.py similarity index 84% rename from exabel_data_sdk/scripts/delete_data_set.py rename to exabel/scripts/delete_data_set.py index b9d27d4c..31bed90d 100644 --- a/exabel_data_sdk/scripts/delete_data_set.py +++ b/exabel/scripts/delete_data_set.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class DeleteDataSet(BaseScript): diff --git a/exabel_data_sdk/scripts/delete_entities.py b/exabel/scripts/delete_entities.py similarity index 90% rename from exabel_data_sdk/scripts/delete_entities.py rename to exabel/scripts/delete_entities.py index 767bdeee..aea447b4 100644 --- a/exabel_data_sdk/scripts/delete_entities.py +++ b/exabel/scripts/delete_entities.py @@ -6,11 +6,11 @@ from tqdm import tqdm -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.request_error import RequestError -from exabel_data_sdk.scripts.list_entities import ListEntities -from exabel_data_sdk.scripts.utils import ( +from exabel import ExabelClient +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.request_error import RequestError +from exabel.scripts.list_entities import ListEntities +from exabel.scripts.utils import ( ERROR, MAX_WORKERS, PAGE_SIZE, diff --git a/exabel_data_sdk/scripts/delete_entity.py b/exabel/scripts/delete_entity.py similarity index 93% rename from exabel_data_sdk/scripts/delete_entity.py rename to exabel/scripts/delete_entity.py index fb1b7f2d..614a0021 100644 --- a/exabel_data_sdk/scripts/delete_entity.py +++ b/exabel/scripts/delete_entity.py @@ -2,8 +2,8 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class DeleteEntity(BaseScript): diff --git a/exabel_data_sdk/scripts/delete_entity_type.py b/exabel/scripts/delete_entity_type.py similarity index 84% rename from exabel_data_sdk/scripts/delete_entity_type.py rename to exabel/scripts/delete_entity_type.py index 6f18d71b..8aace37a 100644 --- a/exabel_data_sdk/scripts/delete_entity_type.py +++ b/exabel/scripts/delete_entity_type.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class DeleteEntityType(BaseScript): diff --git a/exabel_data_sdk/scripts/delete_folder.py b/exabel/scripts/delete_folder.py similarity index 89% rename from exabel_data_sdk/scripts/delete_folder.py rename to exabel/scripts/delete_folder.py index d8a7ec52..ca70a6f4 100644 --- a/exabel_data_sdk/scripts/delete_folder.py +++ b/exabel/scripts/delete_folder.py @@ -2,8 +2,8 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class DeleteFolder(BaseScript): diff --git a/exabel_data_sdk/scripts/delete_relationship.py b/exabel/scripts/delete_relationship.py similarity index 90% rename from exabel_data_sdk/scripts/delete_relationship.py rename to exabel/scripts/delete_relationship.py index b471e51b..9bba229b 100644 --- a/exabel_data_sdk/scripts/delete_relationship.py +++ b/exabel/scripts/delete_relationship.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class DeleteRelationship(BaseScript): diff --git a/exabel_data_sdk/scripts/delete_relationship_type.py b/exabel/scripts/delete_relationship_type.py similarity index 86% rename from exabel_data_sdk/scripts/delete_relationship_type.py rename to exabel/scripts/delete_relationship_type.py index 029a59aa..bd81be82 100644 --- a/exabel_data_sdk/scripts/delete_relationship_type.py +++ b/exabel/scripts/delete_relationship_type.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class DeleteRelationshipType(BaseScript): diff --git a/exabel_data_sdk/scripts/delete_signal.py b/exabel/scripts/delete_signal.py similarity index 83% rename from exabel_data_sdk/scripts/delete_signal.py rename to exabel/scripts/delete_signal.py index 42720149..c64af143 100644 --- a/exabel_data_sdk/scripts/delete_signal.py +++ b/exabel/scripts/delete_signal.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class DeleteSignal(BaseScript): diff --git a/exabel_data_sdk/scripts/delete_time_series.py b/exabel/scripts/delete_time_series.py similarity index 93% rename from exabel_data_sdk/scripts/delete_time_series.py rename to exabel/scripts/delete_time_series.py index 975501b5..ed3b62fe 100644 --- a/exabel_data_sdk/scripts/delete_time_series.py +++ b/exabel/scripts/delete_time_series.py @@ -6,10 +6,10 @@ from tqdm import tqdm -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.request_error import RequestError -from exabel_data_sdk.scripts.list_time_series import ListTimeSeries -from exabel_data_sdk.scripts.utils import ( +from exabel import ExabelClient +from exabel.client.api.data_classes.request_error import RequestError +from exabel.scripts.list_time_series import ListTimeSeries +from exabel.scripts.utils import ( ERROR, MAX_WORKERS, PAGE_SIZE, diff --git a/exabel_data_sdk/scripts/delete_time_series_point.py b/exabel/scripts/delete_time_series_point.py similarity index 91% rename from exabel_data_sdk/scripts/delete_time_series_point.py rename to exabel/scripts/delete_time_series_point.py index b6c43e75..e3431846 100644 --- a/exabel_data_sdk/scripts/delete_time_series_point.py +++ b/exabel/scripts/delete_time_series_point.py @@ -4,9 +4,9 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class DeleteTimeSeriesPoint(BaseScript): diff --git a/exabel_data_sdk/scripts/delete_time_series_points.py b/exabel/scripts/delete_time_series_points.py similarity index 93% rename from exabel_data_sdk/scripts/delete_time_series_points.py rename to exabel/scripts/delete_time_series_points.py index cfa1d03f..e6813cd3 100644 --- a/exabel_data_sdk/scripts/delete_time_series_points.py +++ b/exabel/scripts/delete_time_series_points.py @@ -4,9 +4,9 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.list_time_series import ListTimeSeries -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel import ExabelClient +from exabel.scripts.list_time_series import ListTimeSeries +from exabel.services.csv_loading_constants import ( DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS, ) @@ -14,7 +14,7 @@ class DeleteTimeSeriesPoints(ListTimeSeries): """ - Deletes all time series data points for a specifc date and known time. + Deletes all time series data points for a specific date and known time. The script fetches all time series for a given signal, entity type or entity, or a combination of these. """ diff --git a/exabel_data_sdk/scripts/delete_time_series_points_from_file.py b/exabel/scripts/delete_time_series_points_from_file.py similarity index 89% rename from exabel_data_sdk/scripts/delete_time_series_points_from_file.py rename to exabel/scripts/delete_time_series_points_from_file.py index 3894a9a9..7e0de529 100644 --- a/exabel_data_sdk/scripts/delete_time_series_points_from_file.py +++ b/exabel/scripts/delete_time_series_points_from_file.py @@ -2,13 +2,13 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.actions import CaseInsensitiveArgumentAction -from exabel_data_sdk.scripts.csv_script_with_entity_mapping import CsvScriptWithEntityMapping -from exabel_data_sdk.services.csv_loading_constants import DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_time_series_loader import FileTimeSeriesLoader +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.actions import CaseInsensitiveArgumentAction +from exabel.scripts.csv_script_with_entity_mapping import CsvScriptWithEntityMapping +from exabel.services.csv_loading_constants import DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_time_series_loader import FileTimeSeriesLoader class DeleteTimeSeriesPointsFromFile(CsvScriptWithEntityMapping): diff --git a/exabel_data_sdk/scripts/export_data.py b/exabel/scripts/export_data.py similarity index 93% rename from exabel_data_sdk/scripts/export_data.py rename to exabel/scripts/export_data.py index b54fa17c..ad44a8cf 100644 --- a/exabel_data_sdk/scripts/export_data.py +++ b/exabel/scripts/export_data.py @@ -2,8 +2,8 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class ExportData(BaseScript): diff --git a/exabel_data_sdk/scripts/export_signals.py b/exabel/scripts/export_signals.py similarity index 94% rename from exabel_data_sdk/scripts/export_signals.py rename to exabel/scripts/export_signals.py index ea0b29cf..05a14d38 100644 --- a/exabel_data_sdk/scripts/export_signals.py +++ b/exabel/scripts/export_signals.py @@ -7,9 +7,9 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript -from exabel_data_sdk.scripts.file_utils import ( +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript +from exabel.scripts.file_utils import ( supported_formats_message, to_file, validate_file_extension, @@ -99,7 +99,7 @@ def run_script(self, client: ExabelClient, args: argparse.Namespace) -> None: print("In total", len(entities), "entities") signals = args.signal print("Downloading signal(s):", ", ".join(signals)) - logging.getLogger("exabel_data_sdk.client.api.export_api").setLevel(logging.WARNING) + logging.getLogger("exabel.client.api.export_api").setLevel(logging.WARNING) data = client.export_api.batched_signal_query( batch_size=args.batch_size, signal=signals, diff --git a/exabel_data_sdk/scripts/file_utils.py b/exabel/scripts/file_utils.py similarity index 100% rename from exabel_data_sdk/scripts/file_utils.py rename to exabel/scripts/file_utils.py diff --git a/exabel_data_sdk/scripts/get_data_set.py b/exabel/scripts/get_data_set.py similarity index 78% rename from exabel_data_sdk/scripts/get_data_set.py rename to exabel/scripts/get_data_set.py index 995924a3..6647f6c0 100644 --- a/exabel_data_sdk/scripts/get_data_set.py +++ b/exabel/scripts/get_data_set.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.data_set import print_data_set -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.data_set import print_data_set +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class GetDataSet(BaseScript): diff --git a/exabel_data_sdk/scripts/get_entity.py b/exabel/scripts/get_entity.py similarity index 84% rename from exabel_data_sdk/scripts/get_entity.py rename to exabel/scripts/get_entity.py index d6a5da58..bfe4fa5e 100644 --- a/exabel_data_sdk/scripts/get_entity.py +++ b/exabel/scripts/get_entity.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class GetEntity(BaseScript): diff --git a/exabel_data_sdk/scripts/get_entity_type.py b/exabel/scripts/get_entity_type.py similarity index 83% rename from exabel_data_sdk/scripts/get_entity_type.py rename to exabel/scripts/get_entity_type.py index d6627e66..d720d5ae 100644 --- a/exabel_data_sdk/scripts/get_entity_type.py +++ b/exabel/scripts/get_entity_type.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class GetEntityType(BaseScript): diff --git a/exabel_data_sdk/scripts/get_folder.py b/exabel/scripts/get_folder.py similarity index 89% rename from exabel_data_sdk/scripts/get_folder.py rename to exabel/scripts/get_folder.py index 1f08f0b3..9102de37 100644 --- a/exabel_data_sdk/scripts/get_folder.py +++ b/exabel/scripts/get_folder.py @@ -2,8 +2,8 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class GetFolder(BaseScript): diff --git a/exabel_data_sdk/scripts/get_relationship.py b/exabel/scripts/get_relationship.py similarity index 88% rename from exabel_data_sdk/scripts/get_relationship.py rename to exabel/scripts/get_relationship.py index 6a7317cc..6feab35f 100644 --- a/exabel_data_sdk/scripts/get_relationship.py +++ b/exabel/scripts/get_relationship.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.request_error import RequestError -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.request_error import RequestError +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class GetRelationship(BaseScript): diff --git a/exabel_data_sdk/scripts/get_relationship_type.py b/exabel/scripts/get_relationship_type.py similarity index 85% rename from exabel_data_sdk/scripts/get_relationship_type.py rename to exabel/scripts/get_relationship_type.py index d76d0388..fb6a5640 100644 --- a/exabel_data_sdk/scripts/get_relationship_type.py +++ b/exabel/scripts/get_relationship_type.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class GetRelationshipType(BaseScript): diff --git a/exabel_data_sdk/scripts/get_signal.py b/exabel/scripts/get_signal.py similarity index 83% rename from exabel_data_sdk/scripts/get_signal.py rename to exabel/scripts/get_signal.py index 348bb495..f7826693 100644 --- a/exabel_data_sdk/scripts/get_signal.py +++ b/exabel/scripts/get_signal.py @@ -3,9 +3,9 @@ from pprint import pprint from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class GetSignal(BaseScript): diff --git a/exabel_data_sdk/scripts/get_time_series.py b/exabel/scripts/get_time_series.py similarity index 91% rename from exabel_data_sdk/scripts/get_time_series.py rename to exabel/scripts/get_time_series.py index ecd3c3d3..6b1a9305 100644 --- a/exabel_data_sdk/scripts/get_time_series.py +++ b/exabel/scripts/get_time_series.py @@ -4,10 +4,10 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.time_series import TimeSeries -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.time_series import TimeSeries +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class GetTimeSeries(BaseScript): diff --git a/exabel_data_sdk/scripts/list_data_sets.py b/exabel/scripts/list_data_sets.py similarity index 73% rename from exabel_data_sdk/scripts/list_data_sets.py rename to exabel/scripts/list_data_sets.py index f2fe0375..5dbd1aca 100644 --- a/exabel_data_sdk/scripts/list_data_sets.py +++ b/exabel/scripts/list_data_sets.py @@ -1,9 +1,9 @@ import argparse import sys -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.data_set import print_data_set -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.data_set import print_data_set +from exabel.scripts.base_script import BaseScript class ListDataSets(BaseScript): diff --git a/exabel_data_sdk/scripts/list_entities.py b/exabel/scripts/list_entities.py similarity index 90% rename from exabel_data_sdk/scripts/list_entities.py rename to exabel/scripts/list_entities.py index 83ef3f0f..e0679e4b 100644 --- a/exabel_data_sdk/scripts/list_entities.py +++ b/exabel/scripts/list_entities.py @@ -3,11 +3,11 @@ from math import ceil from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript -from exabel_data_sdk.scripts.utils import PAGE_SIZE, conditional_progress_bar +from exabel import ExabelClient +from exabel.client.api.data_classes.entity import Entity +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript +from exabel.scripts.utils import PAGE_SIZE, conditional_progress_bar class ListEntities(BaseScript): diff --git a/exabel_data_sdk/scripts/list_entity_types.py b/exabel/scripts/list_entity_types.py similarity index 83% rename from exabel_data_sdk/scripts/list_entity_types.py rename to exabel/scripts/list_entity_types.py index 177de4f5..7a120655 100644 --- a/exabel_data_sdk/scripts/list_entity_types.py +++ b/exabel/scripts/list_entity_types.py @@ -1,8 +1,8 @@ import argparse import sys -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class ListEntityTypes(BaseScript): diff --git a/exabel_data_sdk/scripts/list_folder_accessors.py b/exabel/scripts/list_folder_accessors.py similarity index 87% rename from exabel_data_sdk/scripts/list_folder_accessors.py rename to exabel/scripts/list_folder_accessors.py index beb5bec2..0f0b4c08 100644 --- a/exabel_data_sdk/scripts/list_folder_accessors.py +++ b/exabel/scripts/list_folder_accessors.py @@ -2,13 +2,13 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class ListFolderAccessors(BaseScript): """ - List folder accessors + List folder accessors. """ def __init__(self, argv: Sequence[str], description: str): diff --git a/exabel_data_sdk/scripts/list_folders.py b/exabel/scripts/list_folders.py similarity index 82% rename from exabel_data_sdk/scripts/list_folders.py rename to exabel/scripts/list_folders.py index 10984c61..724943b3 100644 --- a/exabel_data_sdk/scripts/list_folders.py +++ b/exabel/scripts/list_folders.py @@ -1,8 +1,8 @@ import argparse import sys -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class ListFolders(BaseScript): diff --git a/exabel_data_sdk/scripts/list_groups.py b/exabel/scripts/list_groups.py similarity index 78% rename from exabel_data_sdk/scripts/list_groups.py rename to exabel/scripts/list_groups.py index ddfac19e..62f42e4b 100644 --- a/exabel_data_sdk/scripts/list_groups.py +++ b/exabel/scripts/list_groups.py @@ -1,8 +1,8 @@ import argparse import sys -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class ListGroups(BaseScript): diff --git a/exabel_data_sdk/scripts/list_items.py b/exabel/scripts/list_items.py similarity index 84% rename from exabel_data_sdk/scripts/list_items.py rename to exabel/scripts/list_items.py index f03ff544..3346611b 100644 --- a/exabel_data_sdk/scripts/list_items.py +++ b/exabel/scripts/list_items.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.folder_item import FolderItemType -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.folder_item import FolderItemType +from exabel.scripts.base_script import BaseScript class ListItems(BaseScript): diff --git a/exabel_data_sdk/scripts/list_relationship_types.py b/exabel/scripts/list_relationship_types.py similarity index 79% rename from exabel_data_sdk/scripts/list_relationship_types.py rename to exabel/scripts/list_relationship_types.py index 9ed1df31..0754efb7 100644 --- a/exabel_data_sdk/scripts/list_relationship_types.py +++ b/exabel/scripts/list_relationship_types.py @@ -1,10 +1,10 @@ import argparse import sys -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.relationship_type import RelationshipType -from exabel_data_sdk.scripts.base_script import BaseScript -from exabel_data_sdk.scripts.utils import PAGE_SIZE +from exabel import ExabelClient +from exabel.client.api.data_classes.relationship_type import RelationshipType +from exabel.scripts.base_script import BaseScript +from exabel.scripts.utils import PAGE_SIZE class ListRelationshipTypes(BaseScript): diff --git a/exabel_data_sdk/scripts/list_relationships.py b/exabel/scripts/list_relationships.py similarity index 92% rename from exabel_data_sdk/scripts/list_relationships.py rename to exabel/scripts/list_relationships.py index c90d8a14..f4974e55 100644 --- a/exabel_data_sdk/scripts/list_relationships.py +++ b/exabel/scripts/list_relationships.py @@ -2,10 +2,10 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.request_error import RequestError -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.request_error import RequestError +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class ListRelationships(BaseScript): diff --git a/exabel_data_sdk/scripts/list_signals.py b/exabel/scripts/list_signals.py similarity index 93% rename from exabel_data_sdk/scripts/list_signals.py rename to exabel/scripts/list_signals.py index 84e31038..7b50b3df 100644 --- a/exabel_data_sdk/scripts/list_signals.py +++ b/exabel/scripts/list_signals.py @@ -4,8 +4,8 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class ListSignals(BaseScript): diff --git a/exabel_data_sdk/scripts/list_time_series.py b/exabel/scripts/list_time_series.py similarity index 94% rename from exabel_data_sdk/scripts/list_time_series.py rename to exabel/scripts/list_time_series.py index 617efb97..6ce0892d 100644 --- a/exabel_data_sdk/scripts/list_time_series.py +++ b/exabel/scripts/list_time_series.py @@ -4,12 +4,12 @@ from math import ceil from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript -from exabel_data_sdk.scripts.utils import MAX_WORKERS, PAGE_SIZE, conditional_progress_bar +from exabel import ExabelClient +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript +from exabel.scripts.utils import MAX_WORKERS, PAGE_SIZE, conditional_progress_bar class ListTimeSeries(BaseScript): diff --git a/exabel_data_sdk/scripts/list_users.py b/exabel/scripts/list_users.py similarity index 77% rename from exabel_data_sdk/scripts/list_users.py rename to exabel/scripts/list_users.py index 17b5d6e1..2c53f6de 100644 --- a/exabel_data_sdk/scripts/list_users.py +++ b/exabel/scripts/list_users.py @@ -1,8 +1,8 @@ import argparse import sys -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class ListUsers(BaseScript): diff --git a/exabel_data_sdk/scripts/load_entities_from_csv.py b/exabel/scripts/load_entities_from_csv.py similarity index 85% rename from exabel_data_sdk/scripts/load_entities_from_csv.py rename to exabel/scripts/load_entities_from_csv.py index 03e6ac2f..f763ede2 100644 --- a/exabel_data_sdk/scripts/load_entities_from_csv.py +++ b/exabel/scripts/load_entities_from_csv.py @@ -2,14 +2,14 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.actions import CaseInsensitiveArgumentAction, DeprecatedArgumentAction -from exabel_data_sdk.scripts.csv_script import CsvScript -from exabel_data_sdk.services.csv_entity_loader import CsvEntityLoader -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.util.exceptions import ParsePropertyColumnsError -from exabel_data_sdk.util.parse_property_columns import parse_property_columns +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.actions import CaseInsensitiveArgumentAction +from exabel.scripts.csv_script import CsvScript +from exabel.services.csv_entity_loader import CsvEntityLoader +from exabel.services.file_loading_exception import FileLoadingException +from exabel.util.exceptions import ParsePropertyColumnsError +from exabel.util.parse_property_columns import parse_property_columns class LoadEntitiesFromCsv(CsvScript): @@ -52,8 +52,7 @@ def __init__(self, argv: Sequence[str], description: str): "If not specified, defaults to the same value as the name_column argument." ), ) - entity_group = self.parser.add_mutually_exclusive_group() - entity_group.add_argument( + self.parser.add_argument( "--entity-column", type=str, action=CaseInsensitiveArgumentAction, @@ -63,14 +62,6 @@ def __init__(self, argv: Sequence[str], description: str): "Supports case-insensitive column names." ), ) - entity_group.add_argument( - "--name-column", - dest="entity_column", - type=str, - help=argparse.SUPPRESS, - action=DeprecatedArgumentAction, - case_insensitive=True, - ) self.parser.add_argument( "--display-name-column", required=False, diff --git a/exabel_data_sdk/scripts/load_relationships_from_csv.py b/exabel/scripts/load_relationships_from_csv.py similarity index 86% rename from exabel_data_sdk/scripts/load_relationships_from_csv.py rename to exabel/scripts/load_relationships_from_csv.py index e6b877d5..476c74f1 100644 --- a/exabel_data_sdk/scripts/load_relationships_from_csv.py +++ b/exabel/scripts/load_relationships_from_csv.py @@ -2,14 +2,14 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.search_service import COMPANY_SEARCH_TERM_FIELDS -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.actions import CaseInsensitiveArgumentAction, DeprecatedArgumentAction -from exabel_data_sdk.scripts.csv_script_with_entity_mapping import CsvScriptWithEntityMapping -from exabel_data_sdk.services.csv_relationship_loader import CsvRelationshipLoader -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.util.parse_property_columns import parse_property_columns +from exabel import ExabelClient +from exabel.client.api.search_service import COMPANY_SEARCH_TERM_FIELDS +from exabel.scripts import utils +from exabel.scripts.actions import CaseInsensitiveArgumentAction +from exabel.scripts.csv_script_with_entity_mapping import CsvScriptWithEntityMapping +from exabel.services.csv_relationship_loader import CsvRelationshipLoader +from exabel.services.file_loading_exception import FileLoadingException +from exabel.util.parse_property_columns import parse_property_columns class LoadRelationshipsFromCsv(CsvScriptWithEntityMapping): @@ -91,8 +91,7 @@ def __init__(self, argv: Sequence[str], description: str): "order to look up entities by an identifier." ), ) - from_entity_group = self.parser.add_mutually_exclusive_group() - from_entity_group.add_argument( + self.parser.add_argument( "--from-entity-column", type=str, action=CaseInsensitiveArgumentAction, @@ -102,14 +101,6 @@ def __init__(self, argv: Sequence[str], description: str): "Supports case-insensitive column names." ), ) - from_entity_group.add_argument( - "--entity-from-column", - dest="from_entity_column", - type=str, - help=argparse.SUPPRESS, - action=DeprecatedArgumentAction, - case_insensitive=True, - ) self.parser.add_argument( "--to-entity-type", type=str, @@ -130,8 +121,7 @@ def __init__(self, argv: Sequence[str], description: str): "entities by an identifier." ), ) - to_entity_group = self.parser.add_mutually_exclusive_group() - to_entity_group.add_argument( + self.parser.add_argument( "--to-entity-column", type=str, action=CaseInsensitiveArgumentAction, @@ -141,14 +131,6 @@ def __init__(self, argv: Sequence[str], description: str): "Supports case-insensitive column names." ), ) - to_entity_group.add_argument( - "--entity-to-column", - dest="to_entity_column", - type=str, - help=argparse.SUPPRESS, - action=DeprecatedArgumentAction, - case_insensitive=True, - ) self.parser.add_argument( "--description-column", required=False, diff --git a/exabel_data_sdk/scripts/load_signals_from_csv.py b/exabel/scripts/load_signals_from_csv.py similarity index 93% rename from exabel_data_sdk/scripts/load_signals_from_csv.py rename to exabel/scripts/load_signals_from_csv.py index a8802065..c4f2529b 100644 --- a/exabel_data_sdk/scripts/load_signals_from_csv.py +++ b/exabel/scripts/load_signals_from_csv.py @@ -5,9 +5,9 @@ import pandas as pd from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.signal import Signal +from exabel.scripts.base_script import BaseScript class LoadSignalsFromCsv(BaseScript): diff --git a/exabel/scripts/load_time_series_from_csv.py b/exabel/scripts/load_time_series_from_csv.py new file mode 100644 index 00000000..69a72388 --- /dev/null +++ b/exabel/scripts/load_time_series_from_csv.py @@ -0,0 +1,10 @@ +""" +This file is here to keep backwards compatibility with the old name of the time series import script. +""" + +import sys + +from exabel.scripts.load_time_series_from_file import LoadTimeSeriesFromFile + +if __name__ == "__main__": + LoadTimeSeriesFromFile(sys.argv).run() diff --git a/exabel_data_sdk/scripts/load_time_series_from_file.py b/exabel/scripts/load_time_series_from_file.py similarity index 94% rename from exabel_data_sdk/scripts/load_time_series_from_file.py rename to exabel/scripts/load_time_series_from_file.py index 9a69e676..5a5c8e9f 100644 --- a/exabel_data_sdk/scripts/load_time_series_from_file.py +++ b/exabel/scripts/load_time_series_from_file.py @@ -2,12 +2,12 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.actions import CaseInsensitiveArgumentAction -from exabel_data_sdk.scripts.csv_script_with_entity_mapping import CsvScriptWithEntityMapping -from exabel_data_sdk.services.csv_loading_constants import DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_time_series_loader import FileTimeSeriesLoader +from exabel import ExabelClient +from exabel.scripts.actions import CaseInsensitiveArgumentAction +from exabel.scripts.csv_script_with_entity_mapping import CsvScriptWithEntityMapping +from exabel.services.csv_loading_constants import DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_time_series_loader import FileTimeSeriesLoader class LoadTimeSeriesFromFile(CsvScriptWithEntityMapping): diff --git a/exabel_data_sdk/scripts/load_time_series_metadata_from_file.py b/exabel/scripts/load_time_series_metadata_from_file.py similarity index 90% rename from exabel_data_sdk/scripts/load_time_series_metadata_from_file.py rename to exabel/scripts/load_time_series_metadata_from_file.py index 0902a691..bd3cf4a7 100644 --- a/exabel_data_sdk/scripts/load_time_series_metadata_from_file.py +++ b/exabel/scripts/load_time_series_metadata_from_file.py @@ -2,13 +2,13 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.actions import CaseInsensitiveArgumentAction -from exabel_data_sdk.scripts.csv_script_with_entity_mapping import CsvScriptWithEntityMapping -from exabel_data_sdk.services.csv_loading_constants import DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_time_series_loader import FileTimeSeriesLoader +from exabel import ExabelClient +from exabel.scripts import utils +from exabel.scripts.actions import CaseInsensitiveArgumentAction +from exabel.scripts.csv_script_with_entity_mapping import CsvScriptWithEntityMapping +from exabel.services.csv_loading_constants import DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_time_series_loader import FileTimeSeriesLoader class LoadTimeSeriesMetaDataFromFile(CsvScriptWithEntityMapping): diff --git a/exabel_data_sdk/scripts/move_items.py b/exabel/scripts/move_items.py similarity index 89% rename from exabel_data_sdk/scripts/move_items.py rename to exabel/scripts/move_items.py index c8d34f03..d3ab23db 100644 --- a/exabel_data_sdk/scripts/move_items.py +++ b/exabel/scripts/move_items.py @@ -2,13 +2,13 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class MoveItems(BaseScript): """ - Move items to a folder + Move items to a folder. """ def __init__(self, argv: Sequence[str], description: str): diff --git a/exabel_data_sdk/scripts/search_entities.py b/exabel/scripts/search_entities.py similarity index 96% rename from exabel_data_sdk/scripts/search_entities.py rename to exabel/scripts/search_entities.py index b68cbc78..0b63f033 100644 --- a/exabel_data_sdk/scripts/search_entities.py +++ b/exabel/scripts/search_entities.py @@ -2,8 +2,8 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class SearchEntities(BaseScript): diff --git a/exabel_data_sdk/scripts/share_folder.py b/exabel/scripts/share_folder.py similarity index 92% rename from exabel_data_sdk/scripts/share_folder.py rename to exabel/scripts/share_folder.py index 0cbbb887..aa463c50 100644 --- a/exabel_data_sdk/scripts/share_folder.py +++ b/exabel/scripts/share_folder.py @@ -2,8 +2,8 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class ShareFolder(BaseScript): diff --git a/exabel_data_sdk/scripts/sql/__init__.py b/exabel/scripts/sql/__init__.py similarity index 100% rename from exabel_data_sdk/scripts/sql/__init__.py rename to exabel/scripts/sql/__init__.py diff --git a/exabel_data_sdk/scripts/sql/read_athena.py b/exabel/scripts/sql/read_athena.py similarity index 92% rename from exabel_data_sdk/scripts/sql/read_athena.py rename to exabel/scripts/sql/read_athena.py index ef410fa4..d29593ae 100644 --- a/exabel_data_sdk/scripts/sql/read_athena.py +++ b/exabel/scripts/sql/read_athena.py @@ -1,8 +1,8 @@ import sys from typing import Sequence -from exabel_data_sdk.scripts.sql.sql_script import SqlScript -from exabel_data_sdk.services.sql.athena_reader_configuration import AthenaReaderConfiguration +from exabel.scripts.sql.sql_script import SqlScript +from exabel.services.sql.athena_reader_configuration import AthenaReaderConfiguration class ReadAthena(SqlScript): diff --git a/exabel_data_sdk/scripts/sql/read_bigquery.py b/exabel/scripts/sql/read_bigquery.py similarity index 92% rename from exabel_data_sdk/scripts/sql/read_bigquery.py rename to exabel/scripts/sql/read_bigquery.py index 51109c64..765e570b 100644 --- a/exabel_data_sdk/scripts/sql/read_bigquery.py +++ b/exabel/scripts/sql/read_bigquery.py @@ -1,8 +1,8 @@ import sys from typing import Sequence -from exabel_data_sdk.scripts.sql.sql_script import SqlScript -from exabel_data_sdk.services.sql.bigquery_reader_configuration import BigQueryReaderConfiguration +from exabel.scripts.sql.sql_script import SqlScript +from exabel.services.sql.bigquery_reader_configuration import BigQueryReaderConfiguration class ReadBigQuery(SqlScript): diff --git a/exabel_data_sdk/scripts/sql/read_snowflake.py b/exabel/scripts/sql/read_snowflake.py similarity index 92% rename from exabel_data_sdk/scripts/sql/read_snowflake.py rename to exabel/scripts/sql/read_snowflake.py index e00b21c9..5bb0561a 100644 --- a/exabel_data_sdk/scripts/sql/read_snowflake.py +++ b/exabel/scripts/sql/read_snowflake.py @@ -3,9 +3,9 @@ from os import path from typing import Sequence -from exabel_data_sdk.scripts.sql.sql_script import SqlScript -from exabel_data_sdk.services.sql.snowflake_reader import SnowflakeReader -from exabel_data_sdk.services.sql.snowflake_reader_configuration import SnowflakeReaderConfiguration +from exabel.scripts.sql.sql_script import SqlScript +from exabel.services.sql.snowflake_reader import SnowflakeReader +from exabel.services.sql.snowflake_reader_configuration import SnowflakeReaderConfiguration class ReadSnowflake(SqlScript): @@ -60,7 +60,7 @@ def __init__(self, argv: Sequence[str]): def read_key(self, file: str, passphrase: str | None) -> bytes: """Read the key from given file. Use the provided passphrase to decrypt the file. - If not passphrase is provided, promt the user to enter one. Provide an empty + If no passphrase is provided, prompt the user to enter one. Provide an empty string as passphrase for unencrypted keys.""" from cryptography.hazmat.primitives import serialization diff --git a/exabel_data_sdk/scripts/sql/sql_script.py b/exabel/scripts/sql/sql_script.py similarity index 86% rename from exabel_data_sdk/scripts/sql/sql_script.py rename to exabel/scripts/sql/sql_script.py index 449d83d1..152e63eb 100644 --- a/exabel_data_sdk/scripts/sql/sql_script.py +++ b/exabel/scripts/sql/sql_script.py @@ -1,9 +1,9 @@ import abc from typing import Sequence -from exabel_data_sdk.scripts.command_line_script import CommandLineScript -from exabel_data_sdk.services.sql.sql_reader_configuration import SqlReaderConfiguration -from exabel_data_sdk.services.sql.sqlalchemy_reader import SQLAlchemyReader +from exabel.scripts.command_line_script import CommandLineScript +from exabel.services.sql.sql_reader_configuration import SqlReaderConfiguration +from exabel.services.sql.sqlalchemy_reader import SQLAlchemyReader class SqlScript(CommandLineScript, abc.ABC): diff --git a/exabel_data_sdk/scripts/unshare_folder.py b/exabel/scripts/unshare_folder.py similarity index 90% rename from exabel_data_sdk/scripts/unshare_folder.py rename to exabel/scripts/unshare_folder.py index b43387c9..d23a0197 100644 --- a/exabel_data_sdk/scripts/unshare_folder.py +++ b/exabel/scripts/unshare_folder.py @@ -2,8 +2,8 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.scripts.base_script import BaseScript class UnshareFolder(BaseScript): diff --git a/exabel_data_sdk/scripts/update_data_set.py b/exabel/scripts/update_data_set.py similarity index 94% rename from exabel_data_sdk/scripts/update_data_set.py rename to exabel/scripts/update_data_set.py index 188e1a77..c31c9167 100644 --- a/exabel_data_sdk/scripts/update_data_set.py +++ b/exabel/scripts/update_data_set.py @@ -4,10 +4,10 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.data_set import DataSet, print_data_set -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.data_set import DataSet, print_data_set +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class UpdateDataSet(BaseScript): diff --git a/exabel_data_sdk/scripts/update_entity_type.py b/exabel/scripts/update_entity_type.py similarity index 91% rename from exabel_data_sdk/scripts/update_entity_type.py rename to exabel/scripts/update_entity_type.py index d145558c..b6c3c71c 100644 --- a/exabel_data_sdk/scripts/update_entity_type.py +++ b/exabel/scripts/update_entity_type.py @@ -4,10 +4,10 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class UpdateEntityType(BaseScript): diff --git a/exabel_data_sdk/scripts/update_folder.py b/exabel/scripts/update_folder.py similarity index 87% rename from exabel_data_sdk/scripts/update_folder.py rename to exabel/scripts/update_folder.py index d8f77577..5fb58fbb 100644 --- a/exabel_data_sdk/scripts/update_folder.py +++ b/exabel/scripts/update_folder.py @@ -2,9 +2,9 @@ import sys from typing import Sequence -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.folder import Folder -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.folder import Folder +from exabel.scripts.base_script import BaseScript class UpdateFolder(BaseScript): diff --git a/exabel_data_sdk/scripts/update_relationship_type.py b/exabel/scripts/update_relationship_type.py similarity index 91% rename from exabel_data_sdk/scripts/update_relationship_type.py rename to exabel/scripts/update_relationship_type.py index 97f58892..9d3578f4 100644 --- a/exabel_data_sdk/scripts/update_relationship_type.py +++ b/exabel/scripts/update_relationship_type.py @@ -4,10 +4,10 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.relationship_type import RelationshipType -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.relationship_type import RelationshipType +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class UpdateRelationshipType(BaseScript): diff --git a/exabel_data_sdk/scripts/upsert_time_series_unit.py b/exabel/scripts/upsert_time_series_unit.py similarity index 86% rename from exabel_data_sdk/scripts/upsert_time_series_unit.py rename to exabel/scripts/upsert_time_series_unit.py index d870422c..ed7ca16e 100644 --- a/exabel_data_sdk/scripts/upsert_time_series_unit.py +++ b/exabel/scripts/upsert_time_series_unit.py @@ -4,12 +4,12 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.request_error import RequestError -from exabel_data_sdk.client.api.data_classes.time_series import Dimension, TimeSeries, Unit, Units -from exabel_data_sdk.client.api.resource_creation_result import ResourceCreationStatus -from exabel_data_sdk.scripts import utils -from exabel_data_sdk.scripts.base_script import BaseScript +from exabel import ExabelClient +from exabel.client.api.data_classes.request_error import RequestError +from exabel.client.api.data_classes.time_series import Dimension, TimeSeries, Unit, Units +from exabel.client.api.resource_creation_result import ResourceCreationStatus +from exabel.scripts import utils +from exabel.scripts.base_script import BaseScript class UpsertTimeSeriesUnit(BaseScript): diff --git a/exabel_data_sdk/scripts/utils.py b/exabel/scripts/utils.py similarity index 97% rename from exabel_data_sdk/scripts/utils.py rename to exabel/scripts/utils.py index b3ea6807..42eb5a23 100644 --- a/exabel_data_sdk/scripts/utils.py +++ b/exabel/scripts/utils.py @@ -109,7 +109,7 @@ def time_series_resource_name(argument: str) -> str: def read_signals_from_file(file_name: str) -> Sequence[str]: """ - Reads a list of signal resource name from a file which has one per line. + Reads a list of signal resource names from a file which has one per line. """ signals = [] with open(file_name, "r", encoding="utf-8") as signals_file: diff --git a/exabel_data_sdk/services/__init__.py b/exabel/services/__init__.py similarity index 100% rename from exabel_data_sdk/services/__init__.py rename to exabel/services/__init__.py diff --git a/exabel_data_sdk/services/csv_entity_loader.py b/exabel/services/csv_entity_loader.py similarity index 91% rename from exabel_data_sdk/services/csv_entity_loader.py rename to exabel/services/csv_entity_loader.py index ad06ae45..d2619bb9 100644 --- a/exabel_data_sdk/services/csv_entity_loader.py +++ b/exabel/services/csv_entity_loader.py @@ -4,22 +4,21 @@ from pandas import DataFrame, Index from pandas.core.arrays import ExtensionArray -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.bulk_insert import BulkInsertFailedError -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel import ExabelClient +from exabel.client.api.bulk_insert import BulkInsertFailedError +from exabel.client.api.data_classes.entity import Entity +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS, ) -from exabel_data_sdk.services.csv_reader import CsvReader -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_loading_result import FileLoadingResult -from exabel_data_sdk.util.case_insensitive_column import get_case_insensitive_column -from exabel_data_sdk.util.deprecate_arguments import deprecate_arguments -from exabel_data_sdk.util.exceptions import TypeConversionError -from exabel_data_sdk.util.resource_name_normalization import normalize_resource_name -from exabel_data_sdk.util.type_converter import type_converter +from exabel.services.csv_reader import CsvReader +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_loading_result import FileLoadingResult +from exabel.util.case_insensitive_column import get_case_insensitive_column +from exabel.util.exceptions import TypeConversionError +from exabel.util.resource_name_normalization import normalize_resource_name +from exabel.util.type_converter import type_converter logger = logging.getLogger(__name__) @@ -32,7 +31,6 @@ class CsvEntityLoader: def __init__(self, client: ExabelClient): self._client = client - @deprecate_arguments(name_column="entity_column", namespace=None) def load_entities( self, *, @@ -52,9 +50,6 @@ def load_entities( batch_size: int | None = None, return_results: bool = True, total_rows: int | None = None, - # Deprecated arguments - name_column: str | None = None, - namespace: str | None = None, ) -> FileLoadingResult: """ Load a CSV file and upload the entities specified therein to the Exabel Data API. diff --git a/exabel_data_sdk/services/csv_exception.py b/exabel/services/csv_exception.py similarity index 66% rename from exabel_data_sdk/services/csv_exception.py rename to exabel/services/csv_exception.py index 46d7e8b4..cac8a59d 100644 --- a/exabel_data_sdk/services/csv_exception.py +++ b/exabel/services/csv_exception.py @@ -1,5 +1,5 @@ """This file aliases an import for backwards compatibility after an exception object was renamed.""" -from exabel_data_sdk.services.file_loading_exception import ( # noqa: F401 +from exabel.services.file_loading_exception import ( # noqa: F401 FileLoadingException as CsvLoadingException, ) diff --git a/exabel_data_sdk/services/csv_loading_constants.py b/exabel/services/csv_loading_constants.py similarity index 100% rename from exabel_data_sdk/services/csv_loading_constants.py rename to exabel/services/csv_loading_constants.py diff --git a/exabel_data_sdk/services/csv_loading_result.py b/exabel/services/csv_loading_result.py similarity index 72% rename from exabel_data_sdk/services/csv_loading_result.py rename to exabel/services/csv_loading_result.py index 1594cbd1..ef83ea5e 100644 --- a/exabel_data_sdk/services/csv_loading_result.py +++ b/exabel/services/csv_loading_result.py @@ -1,5 +1,5 @@ """This file aliases an import for backwards compatibility after the result object was renamed.""" -from exabel_data_sdk.services.file_loading_result import ( +from exabel.services.file_loading_result import ( FileLoadingResult as CsvLoadingResult, # noqa: F401 ) diff --git a/exabel_data_sdk/services/csv_reader.py b/exabel/services/csv_reader.py similarity index 100% rename from exabel_data_sdk/services/csv_reader.py rename to exabel/services/csv_reader.py diff --git a/exabel_data_sdk/services/csv_relationship_loader.py b/exabel/services/csv_relationship_loader.py similarity index 94% rename from exabel_data_sdk/services/csv_relationship_loader.py rename to exabel/services/csv_relationship_loader.py index 08a9a2b3..58d97c13 100644 --- a/exabel_data_sdk/services/csv_relationship_loader.py +++ b/exabel/services/csv_relationship_loader.py @@ -3,29 +3,28 @@ from itertools import chain from typing import Mapping, Sequence -from pandas import DataFrame +import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.bulk_insert import BulkInsertFailedError -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.search_service import ( +from exabel import ExabelClient +from exabel.client.api.bulk_insert import BulkInsertFailedError +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.search_service import ( COMPANY_SEARCH_TERM_FIELDS, SECURITY_SEARCH_TERM_FIELDS, ) -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS, ) -from exabel_data_sdk.services.csv_reader import CsvReader -from exabel_data_sdk.services.entity_mapping_file_reader import EntityMappingFileReader -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_loading_result import FileLoadingResult -from exabel_data_sdk.util.case_insensitive_column import get_case_insensitive_column -from exabel_data_sdk.util.deprecate_arguments import deprecate_arguments -from exabel_data_sdk.util.exceptions import TypeConversionError -from exabel_data_sdk.util.resource_name_normalization import to_entity_resource_names -from exabel_data_sdk.util.type_converter import type_converter +from exabel.services.csv_reader import CsvReader +from exabel.services.entity_mapping_file_reader import EntityMappingFileReader +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_loading_result import FileLoadingResult +from exabel.util.case_insensitive_column import get_case_insensitive_column +from exabel.util.exceptions import TypeConversionError +from exabel.util.resource_name_normalization import to_entity_resource_names +from exabel.util.type_converter import type_converter logger = logging.getLogger(__name__) @@ -278,9 +277,6 @@ class CsvRelationshipLoader: def __init__(self, client: ExabelClient): self._client = client - @deprecate_arguments( - entity_from_column="from_entity_column", entity_to_column="to_entity_column" - ) def load_relationships( self, *, @@ -305,10 +301,6 @@ def load_relationships( batch_size: int | None = None, return_results: bool = True, total_rows: int | None = None, - # Deprecated arguments: - entity_from_column: str | None = None, - entity_to_column: str | None = None, - namespace: str | None = None, ) -> FileLoadingResult: """ Load a CSV file and upload the relationships specified therein to the Exabel Data API. @@ -387,7 +379,7 @@ def load_relationships( keep_default_na=False, chunksize=batch_size, ) - if isinstance(relationships_dfs, DataFrame): + if isinstance(relationships_dfs, pd.DataFrame): relationships_dfs = iter((relationships_dfs,)) else: logger.info("Processing file in chunks of %d rows.", batch_size) @@ -428,7 +420,7 @@ def load_relationships( def _load_relationships( self, - data_frame: DataFrame, + data_frame: pd.DataFrame, entity_mapping: Mapping[str, Mapping[str, str]] | None, relationship_type_name: str, config: RelationshipLoaderColumnConfiguration, @@ -547,7 +539,7 @@ def get_relationship_type_name(self, relationship_type: str, namespace: str) -> raise FileLoadingException( f"Did not find relationship type {relationship_type_name}, " "please create it by running:\n" - "python -m exabel_data_sdk.scripts.create_relationship_type " + "python -m exabel.scripts.create_relationship_type " f"--name={relationship_type_name} [args]" ) diff --git a/exabel_data_sdk/services/csv_time_series_loader.py b/exabel/services/csv_time_series_loader.py similarity index 84% rename from exabel_data_sdk/services/csv_time_series_loader.py rename to exabel/services/csv_time_series_loader.py index 6da37d4b..e642bc52 100644 --- a/exabel_data_sdk/services/csv_time_series_loader.py +++ b/exabel/services/csv_time_series_loader.py @@ -1,23 +1,21 @@ -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel import ExabelClient +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT, ) -from exabel_data_sdk.services.file_loading_result import FileLoadingResult -from exabel_data_sdk.services.file_time_series_loader import FileTimeSeriesLoader -from exabel_data_sdk.util.deprecate_arguments import deprecate_arguments +from exabel.services.file_loading_result import FileLoadingResult +from exabel.services.file_time_series_loader import FileTimeSeriesLoader class CsvTimeSeriesLoader: """ - Processes CSV file with time series and uploads the time series to the Exabel Data API. + Processes a CSV file with time series and uploads the time series to the Exabel Data API. """ def __init__(self, client: ExabelClient): self._client = client - @deprecate_arguments(namespace=None, create_tag=None) def load_time_series( self, *, @@ -36,12 +34,9 @@ def load_time_series( abort_threshold: float | None = DEFAULT_ABORT_THRESHOLD, skip_validation: bool = False, case_sensitive_signals: bool = False, - # Deprecated arguments - create_tag: bool | None = None, - namespace: str | None = None, ) -> FileLoadingResult: """ - Load a CSV file and upload the time series to the Exabel Data API + Load a CSV file and upload the time series to the Exabel Data API. Args: filename: the location of the CSV file @@ -61,7 +56,7 @@ def load_time_series( setting does not match what is found in the file threads: the number of parallel upload threads to run dry_run: if True, the file is processed, but no time series are actually uploaded - error_on_any_failure: if True, an exception is raised if any time series failed to be + error_on_any_failure: if True, an exception is raised if any time series failed to be created retries: the maximum number of retries to make for each failed request abort_threshold: the threshold for the proportion of failed requests that will cause the diff --git a/exabel_data_sdk/services/csv_writer.py b/exabel/services/csv_writer.py similarity index 91% rename from exabel_data_sdk/services/csv_writer.py rename to exabel/services/csv_writer.py index 8a78d618..2487fe80 100644 --- a/exabel_data_sdk/services/csv_writer.py +++ b/exabel/services/csv_writer.py @@ -4,7 +4,7 @@ import pandas as pd -from exabel_data_sdk.services.file_writer import FileWriter, FileWritingResult +from exabel.services.file_writer import FileWriter, FileWritingResult logger = logging.getLogger(__name__) diff --git a/exabel_data_sdk/services/entity_mapping_file_reader.py b/exabel/services/entity_mapping_file_reader.py similarity index 97% rename from exabel_data_sdk/services/entity_mapping_file_reader.py rename to exabel/services/entity_mapping_file_reader.py index 3bd20193..af705451 100644 --- a/exabel_data_sdk/services/entity_mapping_file_reader.py +++ b/exabel/services/entity_mapping_file_reader.py @@ -3,7 +3,7 @@ import pandas as pd -from exabel_data_sdk.services.file_loading_exception import FileLoadingException +from exabel.services.file_loading_exception import FileLoadingException class EntityMappingFileReader: diff --git a/exabel_data_sdk/services/excel_writer.py b/exabel/services/excel_writer.py similarity index 85% rename from exabel_data_sdk/services/excel_writer.py rename to exabel/services/excel_writer.py index e0fcae52..9e021455 100644 --- a/exabel_data_sdk/services/excel_writer.py +++ b/exabel/services/excel_writer.py @@ -2,7 +2,7 @@ import pandas as pd -from exabel_data_sdk.services.file_writer import FileWriter, FileWritingResult +from exabel.services.file_writer import FileWriter, FileWritingResult class ExcelWriter(FileWriter): diff --git a/exabel_data_sdk/services/feather_reader.py b/exabel/services/feather_reader.py similarity index 90% rename from exabel_data_sdk/services/feather_reader.py rename to exabel/services/feather_reader.py index cf185476..3b958bc1 100644 --- a/exabel_data_sdk/services/feather_reader.py +++ b/exabel/services/feather_reader.py @@ -3,7 +3,7 @@ import numpy as np import pandas as pd -from exabel_data_sdk.util.handle_missing_imports import handle_missing_imports +from exabel.util.handle_missing_imports import handle_missing_imports with handle_missing_imports(): import pyarrow as pa @@ -33,7 +33,7 @@ def read_file_in_batches( @staticmethod def read_file(filename: str, string_columns: Iterable[int]) -> pd.DataFrame: """ - Read the Feather file and return a pandas DataFrame + Read the Feather file and return a pandas DataFrame. Args: filename: the location of the Feather file diff --git a/exabel_data_sdk/services/feather_writer.py b/exabel/services/feather_writer.py similarity index 90% rename from exabel_data_sdk/services/feather_writer.py rename to exabel/services/feather_writer.py index 5f72419e..9f7df219 100644 --- a/exabel_data_sdk/services/feather_writer.py +++ b/exabel/services/feather_writer.py @@ -4,7 +4,7 @@ import pandas as pd -from exabel_data_sdk.services.file_writer import FileWriter, FileWritingResult +from exabel.services.file_writer import FileWriter, FileWritingResult logger = logging.getLogger(__name__) diff --git a/exabel_data_sdk/services/file_constants.py b/exabel/services/file_constants.py similarity index 100% rename from exabel_data_sdk/services/file_constants.py rename to exabel/services/file_constants.py diff --git a/exabel_data_sdk/services/file_loading_exception.py b/exabel/services/file_loading_exception.py similarity index 75% rename from exabel_data_sdk/services/file_loading_exception.py rename to exabel/services/file_loading_exception.py index 563846d8..ad956735 100644 --- a/exabel_data_sdk/services/file_loading_exception.py +++ b/exabel/services/file_loading_exception.py @@ -1,7 +1,7 @@ from typing import Generic, Sequence -from exabel_data_sdk.client.api.resource_creation_result import ResourceCreationResult -from exabel_data_sdk.services.file_loading_result import ResourceT +from exabel.client.api.resource_creation_result import ResourceCreationResult +from exabel.services.file_loading_result import ResourceT class FileLoadingException(Generic[ResourceT], Exception): diff --git a/exabel_data_sdk/services/file_loading_result.py b/exabel/services/file_loading_result.py similarity index 89% rename from exabel_data_sdk/services/file_loading_result.py rename to exabel/services/file_loading_result.py index a7f89542..d447e6c6 100644 --- a/exabel_data_sdk/services/file_loading_result.py +++ b/exabel/services/file_loading_result.py @@ -5,9 +5,9 @@ import pandas as pd -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.resource_creation_result import ResourceCreationResults +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.resource_creation_result import ResourceCreationResults ResourceT = TypeVar("ResourceT", Entity, Relationship, pd.Series) @@ -34,10 +34,10 @@ class FileLoadingResult(Generic[ResourceT]): Contains a summary of the results of uploading data from a data file. Attributes: - results: the individual uploading results for all the resources; `None` if uploading was - aborted or it was a dry run - warnings: a list of warnings - aborted: whether uploading was aborted + results: the individual uploading results for all the resources; `None` if uploading + was aborted or it was a dry run + warnings: a sequence of warnings + aborted: whether uploading was aborted processed_rows: the number of rows processed """ @@ -50,7 +50,7 @@ def __init__( processed_rows: int | None = None, ): self.results: ResourceCreationResults[ResourceT] | None = results - self.warnings = warnings or [] + self.warnings = warnings or () self.aborted = aborted self.processed_rows = processed_rows diff --git a/exabel_data_sdk/services/file_time_series_loader.py b/exabel/services/file_time_series_loader.py similarity index 97% rename from exabel_data_sdk/services/file_time_series_loader.py rename to exabel/services/file_time_series_loader.py index aa0c1985..b5fa84f0 100644 --- a/exabel_data_sdk/services/file_time_series_loader.py +++ b/exabel/services/file_time_series_loader.py @@ -4,29 +4,29 @@ from google.protobuf.duration_pb2 import Duration from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.bulk_insert import BulkInsertFailedError -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.client.api.resource_creation_result import ResourceCreationResults -from exabel_data_sdk.client.api.search_service import ( +from exabel import ExabelClient +from exabel.client.api.bulk_insert import BulkInsertFailedError +from exabel.client.api.data_classes.signal import Signal +from exabel.client.api.resource_creation_result import ResourceCreationResults +from exabel.client.api.search_service import ( COMPANY_SEARCH_TERM_FIELDS, SECURITY_SEARCH_TERM_FIELDS, ) -from exabel_data_sdk.services.csv_loading_constants import ( +from exabel.services.csv_loading_constants import ( DEFAULT_ABORT_THRESHOLD, DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS, DEFAULT_NUMBER_OF_THREADS_FOR_IMPORT, ) -from exabel_data_sdk.services.entity_mapping_file_reader import EntityMappingFileReader -from exabel_data_sdk.services.file_constants import GLOBAL_ENTITY_NAME -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_loading_result import ( +from exabel.services.entity_mapping_file_reader import EntityMappingFileReader +from exabel.services.file_constants import GLOBAL_ENTITY_NAME +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_loading_result import ( EntityMappingResult, FileLoadingResult, TimeSeriesFileLoadingResult, ) -from exabel_data_sdk.services.file_time_series_parser import ( +from exabel.services.file_time_series_parser import ( EMPTY_HEADER_PATTERN, EntitiesInColumns, MetaDataSignalNamesInRows, @@ -36,9 +36,8 @@ SignalNamesInRows, TimeSeriesFileParser, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.time_series_messages_pb2 import DefaultKnownTime -from exabel_data_sdk.util.deprecate_arguments import deprecate_arguments -from exabel_data_sdk.util.resource_name_normalization import validate_signal_name +from exabel.stubs.exabel.api.data.v1.time_series_messages_pb2 import DefaultKnownTime +from exabel.util.resource_name_normalization import validate_signal_name logger = logging.getLogger(__name__) @@ -54,7 +53,6 @@ def __init__(self, client: ExabelClient): self._client = client self._time_series_parser: type[ParsedTimeSeriesFile] | None = None - @deprecate_arguments(namespace=None, create_tag=None) def load_time_series( self, *, @@ -82,12 +80,9 @@ def load_time_series( return_results: bool = True, processed_rows: int = 0, total_rows: int | None = None, - # Deprecated arguments - create_tag: bool | None = None, - namespace: str | None = None, ) -> Sequence[TimeSeriesFileLoadingResult]: """ - Load a file and upload the time series to the Exabel Data API + Load a file and upload the time series to the Exabel Data API. If the file has multiple sheets, time series from all the sheets are loaded. @@ -595,7 +590,7 @@ def load_time_series_metadata( total_rows: int | None = None, ) -> Sequence[TimeSeriesFileLoadingResult]: """ - Load a file and upload the time series metadata to the Exabel Data API + Load a file and upload the time series metadata to the Exabel Data API. If the file has multiple sheets, time series from all the sheets are loaded. diff --git a/exabel_data_sdk/services/file_time_series_parser.py b/exabel/services/file_time_series_parser.py similarity index 98% rename from exabel_data_sdk/services/file_time_series_parser.py rename to exabel/services/file_time_series_parser.py index 1cc5d020..ad3d3dc5 100644 --- a/exabel_data_sdk/services/file_time_series_parser.py +++ b/exabel/services/file_time_series_parser.py @@ -19,18 +19,18 @@ from dateutil import tz from pandas.core.dtypes.common import is_numeric_dtype -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.api.data_classes.time_series import Dimension, TimeSeries, Unit, Units -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.api.resource_creation_result import ( +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.data_classes.time_series import Dimension, TimeSeries, Unit, Units +from exabel.client.api.entity_api import EntityApi +from exabel.client.api.resource_creation_result import ( ResourceCreationResult, ResourceCreationStatus, ) -from exabel_data_sdk.services import file_constants -from exabel_data_sdk.services.csv_reader import CsvReader -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.util.handle_missing_imports import handle_missing_imports -from exabel_data_sdk.util.resource_name_normalization import ( +from exabel.services import file_constants +from exabel.services.csv_reader import CsvReader +from exabel.services.file_loading_exception import FileLoadingException +from exabel.util.handle_missing_imports import handle_missing_imports +from exabel.util.resource_name_normalization import ( EntityResourceNames, to_entity_resource_names, validate_signal_name, @@ -90,7 +90,7 @@ def from_file( return (TimeSeriesFileParser(filename, None, s, None) for s in workbook.sheetnames) if Path(filename).suffix.lower() in file_constants.FEATHER_EXTENSIONS: if batch_size is not None: - from exabel_data_sdk.services.feather_reader import FeatherReader + from exabel.services.feather_reader import FeatherReader logger.info( "Reading in batches from Feather file. Batch size will be set to the " @@ -164,7 +164,7 @@ def parse_file( engine="openpyxl", ) elif extension in file_constants.FEATHER_EXTENSIONS: - from exabel_data_sdk.services.feather_reader import FeatherReader + from exabel.services.feather_reader import FeatherReader df = FeatherReader.read_file(self.filename, string_columns=[0]) else: diff --git a/exabel_data_sdk/services/file_writer.py b/exabel/services/file_writer.py similarity index 100% rename from exabel_data_sdk/services/file_writer.py rename to exabel/services/file_writer.py diff --git a/exabel_data_sdk/services/file_writer_provider.py b/exabel/services/file_writer_provider.py similarity index 73% rename from exabel_data_sdk/services/file_writer_provider.py rename to exabel/services/file_writer_provider.py index b24e1075..e41b3440 100644 --- a/exabel_data_sdk/services/file_writer_provider.py +++ b/exabel/services/file_writer_provider.py @@ -1,14 +1,14 @@ from pathlib import Path -from exabel_data_sdk.services.csv_writer import CsvWriter -from exabel_data_sdk.services.excel_writer import ExcelWriter -from exabel_data_sdk.services.feather_writer import FeatherWriter -from exabel_data_sdk.services.file_constants import ( +from exabel.services.csv_writer import CsvWriter +from exabel.services.excel_writer import ExcelWriter +from exabel.services.feather_writer import FeatherWriter +from exabel.services.file_constants import ( EXCEL_EXTENSIONS, FEATHER_EXTENSIONS, FULL_CSV_EXTENSIONS, ) -from exabel_data_sdk.services.file_writer import FileWriter +from exabel.services.file_writer import FileWriter class FileWriterProvider: diff --git a/exabel_data_sdk/services/sql/__init__.py b/exabel/services/sql/__init__.py similarity index 100% rename from exabel_data_sdk/services/sql/__init__.py rename to exabel/services/sql/__init__.py diff --git a/exabel_data_sdk/services/sql/athena_reader_configuration.py b/exabel/services/sql/athena_reader_configuration.py similarity index 98% rename from exabel_data_sdk/services/sql/athena_reader_configuration.py rename to exabel/services/sql/athena_reader_configuration.py index da2fbe68..65317938 100644 --- a/exabel_data_sdk/services/sql/athena_reader_configuration.py +++ b/exabel/services/sql/athena_reader_configuration.py @@ -3,7 +3,7 @@ from dataclasses import dataclass from typing import MutableMapping, NewType -from exabel_data_sdk.services.sql.sql_reader_configuration import ( +from exabel.services.sql.sql_reader_configuration import ( ConnectionString, SqlReaderConfiguration, ) diff --git a/exabel_data_sdk/services/sql/bigquery_reader_configuration.py b/exabel/services/sql/bigquery_reader_configuration.py similarity index 92% rename from exabel_data_sdk/services/sql/bigquery_reader_configuration.py rename to exabel/services/sql/bigquery_reader_configuration.py index 7c28d65e..61a1eeca 100644 --- a/exabel_data_sdk/services/sql/bigquery_reader_configuration.py +++ b/exabel/services/sql/bigquery_reader_configuration.py @@ -4,13 +4,13 @@ from dataclasses import dataclass from typing import MutableMapping, NewType -from exabel_data_sdk.services.sql.exceptions import InvalidServiceAccountCredentialsError -from exabel_data_sdk.services.sql.sql_reader_configuration import ( +from exabel.services.sql.exceptions import InvalidServiceAccountCredentialsError +from exabel.services.sql.sql_reader_configuration import ( ConnectionString, EngineArgs, SqlReaderConfiguration, ) -from exabel_data_sdk.util.handle_missing_imports import handle_missing_imports +from exabel.util.handle_missing_imports import handle_missing_imports with handle_missing_imports(): from google.cloud.bigquery import Client as BigQueryClient diff --git a/exabel_data_sdk/services/sql/exceptions.py b/exabel/services/sql/exceptions.py similarity index 100% rename from exabel_data_sdk/services/sql/exceptions.py rename to exabel/services/sql/exceptions.py diff --git a/exabel_data_sdk/services/sql/snowflake_reader.py b/exabel/services/sql/snowflake_reader.py similarity index 94% rename from exabel_data_sdk/services/sql/snowflake_reader.py rename to exabel/services/sql/snowflake_reader.py index 80e74190..e3fcc4f8 100644 --- a/exabel_data_sdk/services/sql/snowflake_reader.py +++ b/exabel/services/sql/snowflake_reader.py @@ -3,8 +3,8 @@ import pandas as pd -from exabel_data_sdk.services.sql.sql_reader import BatchSize, Query, SqlReader -from exabel_data_sdk.util.handle_missing_imports import handle_missing_imports +from exabel.services.sql.sql_reader import BatchSize, Query, SqlReader +from exabel.util.handle_missing_imports import handle_missing_imports with handle_missing_imports(): from snowflake.connector import connect diff --git a/exabel_data_sdk/services/sql/snowflake_reader_configuration.py b/exabel/services/sql/snowflake_reader_configuration.py similarity index 93% rename from exabel_data_sdk/services/sql/snowflake_reader_configuration.py rename to exabel/services/sql/snowflake_reader_configuration.py index f2f7065e..62475110 100644 --- a/exabel_data_sdk/services/sql/snowflake_reader_configuration.py +++ b/exabel/services/sql/snowflake_reader_configuration.py @@ -2,12 +2,12 @@ from dataclasses import asdict, dataclass from typing import NewType -from exabel_data_sdk.services.sql.sql_reader_configuration import ( +from exabel.services.sql.sql_reader_configuration import ( ConnectionString, EngineArgs, SqlReaderConfiguration, ) -from exabel_data_sdk.util.handle_missing_imports import handle_missing_imports +from exabel.util.handle_missing_imports import handle_missing_imports with handle_missing_imports(): from snowflake.sqlalchemy import URL diff --git a/exabel_data_sdk/services/sql/sql_reader.py b/exabel/services/sql/sql_reader.py similarity index 93% rename from exabel_data_sdk/services/sql/sql_reader.py rename to exabel/services/sql/sql_reader.py index 0579cd53..32f8b6d7 100644 --- a/exabel_data_sdk/services/sql/sql_reader.py +++ b/exabel/services/sql/sql_reader.py @@ -4,8 +4,8 @@ import pandas as pd -from exabel_data_sdk.services.file_writer import FileWritingResult -from exabel_data_sdk.services.file_writer_provider import FileWriterProvider +from exabel.services.file_writer import FileWritingResult +from exabel.services.file_writer_provider import FileWriterProvider logger = logging.getLogger(__name__) diff --git a/exabel_data_sdk/services/sql/sql_reader_configuration.py b/exabel/services/sql/sql_reader_configuration.py similarity index 100% rename from exabel_data_sdk/services/sql/sql_reader_configuration.py rename to exabel/services/sql/sql_reader_configuration.py diff --git a/exabel_data_sdk/services/sql/sqlalchemy_reader.py b/exabel/services/sql/sqlalchemy_reader.py similarity index 88% rename from exabel_data_sdk/services/sql/sqlalchemy_reader.py rename to exabel/services/sql/sqlalchemy_reader.py index 19ebf181..11a57f9b 100644 --- a/exabel_data_sdk/services/sql/sqlalchemy_reader.py +++ b/exabel/services/sql/sqlalchemy_reader.py @@ -4,9 +4,9 @@ import pandas as pd -from exabel_data_sdk.services.sql.sql_reader import BatchSize, Query, SqlReader -from exabel_data_sdk.services.sql.sql_reader_configuration import ConnectionString -from exabel_data_sdk.util.handle_missing_imports import handle_missing_imports +from exabel.services.sql.sql_reader import BatchSize, Query, SqlReader +from exabel.services.sql.sql_reader_configuration import ConnectionString +from exabel.util.handle_missing_imports import handle_missing_imports with handle_missing_imports(): from sqlalchemy import create_engine diff --git a/exabel_data_sdk/stubs/__init__.py b/exabel/stubs/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/__init__.py rename to exabel/stubs/__init__.py diff --git a/exabel/stubs/__init__.pyi b/exabel/stubs/__init__.pyi new file mode 100644 index 00000000..bd1d94f9 --- /dev/null +++ b/exabel/stubs/__init__.pyi @@ -0,0 +1,2 @@ +from . import exabel +from . import protoc_gen_openapiv2 diff --git a/exabel_data_sdk/stubs/exabel/__init__.py b/exabel/stubs/exabel/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/__init__.py rename to exabel/stubs/exabel/__init__.py diff --git a/exabel/stubs/exabel/__init__.pyi b/exabel/stubs/exabel/__init__.pyi new file mode 100644 index 00000000..4dc7607e --- /dev/null +++ b/exabel/stubs/exabel/__init__.pyi @@ -0,0 +1 @@ +from . import api diff --git a/exabel_data_sdk/stubs/exabel/api/__init__.py b/exabel/stubs/exabel/api/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/__init__.py rename to exabel/stubs/exabel/api/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/__init__.pyi b/exabel/stubs/exabel/api/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/__init__.pyi rename to exabel/stubs/exabel/api/__init__.pyi diff --git a/exabel_data_sdk/stubs/exabel/api/all_pb2.py b/exabel/stubs/exabel/api/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/all_pb2.py rename to exabel/stubs/exabel/api/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/all_pb2_grpc.py b/exabel/stubs/exabel/api/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/all_pb2_grpc.py rename to exabel/stubs/exabel/api/all_pb2_grpc.py diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/__init__.py b/exabel/stubs/exabel/api/analytics/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/analytics/__init__.py rename to exabel/stubs/exabel/api/analytics/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/__init__.pyi b/exabel/stubs/exabel/api/analytics/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/analytics/__init__.pyi rename to exabel/stubs/exabel/api/analytics/__init__.pyi diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/all_pb2.py b/exabel/stubs/exabel/api/analytics/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/analytics/all_pb2.py rename to exabel/stubs/exabel/api/analytics/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/all_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/analytics/all_pb2_grpc.py rename to exabel/stubs/exabel/api/analytics/all_pb2_grpc.py diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/__init__.py b/exabel/stubs/exabel/api/analytics/v1/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/__init__.py rename to exabel/stubs/exabel/api/analytics/v1/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/__init__.pyi b/exabel/stubs/exabel/api/analytics/v1/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/__init__.pyi rename to exabel/stubs/exabel/api/analytics/v1/__init__.pyi diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/all_pb2.py b/exabel/stubs/exabel/api/analytics/v1/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/all_pb2.py rename to exabel/stubs/exabel/api/analytics/v1/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/all_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/all_pb2_grpc.py rename to exabel/stubs/exabel/api/analytics/v1/all_pb2_grpc.py diff --git a/exabel/stubs/exabel/api/analytics/v1/common_messages_pb2.py b/exabel/stubs/exabel/api/analytics/v1/common_messages_pb2.py new file mode 100644 index 00000000..27a0adbf --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/common_messages_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/common_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/common_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-exabel/api/analytics/v1/common_messages.proto\x12\x17\x65xabel.api.analytics.v1\"+\n\tEntitySet\x12\x10\n\x08\x65ntities\x18\x01 \x03(\t\x12\x0c\n\x04tags\x18\x02 \x03(\tBT\n\x1b\x63om.exabel.api.analytics.v1B\x16\x45ntitySetMessagesProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.common_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\026EntitySetMessagesProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_ENTITYSET']._serialized_start=74 + _globals['_ENTITYSET']._serialized_end=117 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/common_messages_pb2.pyi similarity index 74% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2.pyi rename to exabel/stubs/exabel/api/analytics/v1/common_messages_pb2.pyi index 3f6888d9..7322271b 100644 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2.pyi +++ b/exabel/stubs/exabel/api/analytics/v1/common_messages_pb2.pyi @@ -2,21 +2,24 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2025 Exabel AS. All rights reserved.""" + import builtins import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class EntitySet(google.protobuf.message.Message): """Defines a set of entities by a combination of individual entities and/or tags.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENTITIES_FIELD_NUMBER: builtins.int TAGS_FIELD_NUMBER: builtins.int - @property def entities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Individual entity resource names (e.g., "entityTypes/company/entities/F_000C7F-E").""" @@ -25,9 +28,12 @@ class EntitySet(google.protobuf.message.Message): def tags(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Tag resource names (e.g., "tags/123").""" - def __init__(self, *, entities: collections.abc.Iterable[builtins.str] | None=..., tags: collections.abc.Iterable[builtins.str] | None=...) -> None: - ... + def __init__( + self, + *, + entities: collections.abc.Iterable[builtins.str] | None = ..., + tags: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entities", b"entities", "tags", b"tags"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entities', b'entities', 'tags', b'tags']) -> None: - ... -global___EntitySet = EntitySet \ No newline at end of file +global___EntitySet = EntitySet diff --git a/exabel/stubs/exabel/api/analytics/v1/common_messages_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/common_messages_pb2_grpc.py new file mode 100644 index 00000000..8c0252b9 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/common_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/common_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.py b/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.py new file mode 100644 index 00000000..fe196b80 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/derived_signal_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/derived_signal_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ...data.v1 import common_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_common__messages__pb2 +from ...math import aggregation_pb2 as exabel_dot_api_dot_math_dot_aggregation__pb2 +from ...math import change_pb2 as exabel_dot_api_dot_math_dot_change__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n5exabel/api/analytics/v1/derived_signal_messages.proto\x12\x17\x65xabel.api.analytics.v1\x1a(exabel/api/data/v1/common_messages.proto\x1a!exabel/api/math/aggregation.proto\x1a\x1c\x65xabel/api/math/change.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\xe1\x02\n\rDerivedSignal\x12\x41\n\x04name\x18\x01 \x01(\tB3\x92\x41-J\x14\"derivedSignals/123\"\xca>\x14\xfa\x02\x11\x64\x65rivedSignalName\xe0\x41\x05\x12;\n\x05label\x18\x02 \x01(\tB,\x92\x41)J\x11\"close_price_ma7\"\x8a\x01\x13^[a-zA-Z_]\\w{0,99}$\x12:\n\nexpression\x18\x03 \x01(\tB&\x92\x41#J!\"close_price().moving_average(7)\"\x12<\n\x0b\x64\x65scription\x18\x04 \x01(\tB\'\x92\x41$J\"\"Close price 7 day moving average\"\x12\x14\n\x0c\x64isplay_name\x18\x06 \x01(\t\x12@\n\x08metadata\x18\x05 \x01(\x0b\x32..exabel.api.analytics.v1.DerivedSignalMetadata\"\xd6\x02\n\x15\x44\x65rivedSignalMetadata\x12-\n\x08\x64\x65\x63imals\x18\x01 \x01(\x0b\x32\x1b.google.protobuf.Int32Value\x12\x38\n\x04unit\x18\x02 \x01(\x0e\x32*.exabel.api.analytics.v1.DerivedSignalUnit\x12=\n\x04type\x18\x03 \x01(\x0e\x32*.exabel.api.analytics.v1.DerivedSignalTypeB\x03\xe0\x41\x03\x12\x39\n\x13\x64ownsampling_method\x18\x04 \x01(\x0e\x32\x1c.exabel.api.math.Aggregation\x12\'\n\x06\x63hange\x18\x05 \x01(\x0e\x32\x17.exabel.api.math.Change\x12\x31\n\nentity_set\x18\x06 \x01(\x0b\x32\x1d.exabel.api.data.v1.EntitySet*a\n\x11\x44\x65rivedSignalUnit\x12\x1f\n\x1b\x44\x45RIVED_SIGNAL_UNIT_INVALID\x10\x00\x12\n\n\x06NUMBER\x10\x01\x12\t\n\x05RATIO\x10\x02\x12\x14\n\x10RATIO_DIFFERENCE\x10\x03*\x9a\x01\n\x11\x44\x65rivedSignalType\x12\x1f\n\x1b\x44\x45RIVED_SIGNAL_TYPE_INVALID\x10\x00\x12\x12\n\x0e\x44\x45RIVED_SIGNAL\x10\x01\x12\x18\n\x14\x46ILE_UPLOADED_SIGNAL\x10\x02\x12 \n\x1c\x46ILE_UPLOADED_COMPANY_SIGNAL\x10\x03\x12\x14\n\x10PERSISTED_SIGNAL\x10\x04\x42X\n\x1b\x63om.exabel.api.analytics.v1B\x1a\x44\x65rivedSignalMessagesProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.derived_signal_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\032DerivedSignalMessagesProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_DERIVEDSIGNAL'].fields_by_name['name']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['name']._serialized_options = b'\222A-J\024\"derivedSignals/123\"\312>\024\372\002\021derivedSignalName\340A\005' + _globals['_DERIVEDSIGNAL'].fields_by_name['label']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['label']._serialized_options = b'\222A)J\021\"close_price_ma7\"\212\001\023^[a-zA-Z_]\\w{0,99}$' + _globals['_DERIVEDSIGNAL'].fields_by_name['expression']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['expression']._serialized_options = b'\222A#J!\"close_price().moving_average(7)\"' + _globals['_DERIVEDSIGNAL'].fields_by_name['description']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['description']._serialized_options = b'\222A$J\"\"Close price 7 day moving average\"' + _globals['_DERIVEDSIGNALMETADATA'].fields_by_name['type']._loaded_options = None + _globals['_DERIVEDSIGNALMETADATA'].fields_by_name['type']._serialized_options = b'\340A\003' + _globals['_DERIVEDSIGNALUNIT']._serialized_start=1003 + _globals['_DERIVEDSIGNALUNIT']._serialized_end=1100 + _globals['_DERIVEDSIGNALTYPE']._serialized_start=1103 + _globals['_DERIVEDSIGNALTYPE']._serialized_end=1257 + _globals['_DERIVEDSIGNAL']._serialized_start=303 + _globals['_DERIVEDSIGNAL']._serialized_end=656 + _globals['_DERIVEDSIGNALMETADATA']._serialized_start=659 + _globals['_DERIVEDSIGNALMETADATA']._serialized_end=1001 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.pyi new file mode 100644 index 00000000..cf224b08 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.pyi @@ -0,0 +1,205 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2022-2024 Exabel AS. All rights reserved.""" + +import builtins +from ...data.v1 import common_messages_pb2 +from ...math import aggregation_pb2 +from ...math import change_pb2 +import google.protobuf.descriptor +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import google.protobuf.wrappers_pb2 +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _DerivedSignalUnit: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _DerivedSignalUnitEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DerivedSignalUnit.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DERIVED_SIGNAL_UNIT_INVALID: _DerivedSignalUnit.ValueType # 0 + """Signal unit was not specified.""" + NUMBER: _DerivedSignalUnit.ValueType # 1 + """Signal represents normal floating point numbers. This is the default value.""" + RATIO: _DerivedSignalUnit.ValueType # 2 + """Signal represents a ratio, typically with values in the interval [0, 1]. Values will be + displayed as a percentage. + """ + RATIO_DIFFERENCE: _DerivedSignalUnit.ValueType # 3 + """Signal represents a difference in a ratio. Values will be displayed as percentage points.""" + +class DerivedSignalUnit(_DerivedSignalUnit, metaclass=_DerivedSignalUnitEnumTypeWrapper): + """Unit of the signal.""" + +DERIVED_SIGNAL_UNIT_INVALID: DerivedSignalUnit.ValueType # 0 +"""Signal unit was not specified.""" +NUMBER: DerivedSignalUnit.ValueType # 1 +"""Signal represents normal floating point numbers. This is the default value.""" +RATIO: DerivedSignalUnit.ValueType # 2 +"""Signal represents a ratio, typically with values in the interval [0, 1]. Values will be +displayed as a percentage. +""" +RATIO_DIFFERENCE: DerivedSignalUnit.ValueType # 3 +"""Signal represents a difference in a ratio. Values will be displayed as percentage points.""" +global___DerivedSignalUnit = DerivedSignalUnit + +class _DerivedSignalType: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _DerivedSignalTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DerivedSignalType.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DERIVED_SIGNAL_TYPE_INVALID: _DerivedSignalType.ValueType # 0 + """Signal type was not specified.""" + DERIVED_SIGNAL: _DerivedSignalType.ValueType # 1 + """Signal is a derived signal, with an editable label and expression. This is the default value.""" + FILE_UPLOADED_SIGNAL: _DerivedSignalType.ValueType # 2 + """Signal uploaded through the legacy File Uploader. The expression refers to a raw signal and + cannot be modified. + """ + FILE_UPLOADED_COMPANY_SIGNAL: _DerivedSignalType.ValueType # 3 + """Signal uploaded through the legacy File Uploader. The expression refers to a raw signal and + cannot be modified. + """ + PERSISTED_SIGNAL: _DerivedSignalType.ValueType # 4 + """A persisted signal that is evaluated and cached daily. + The expression refers to a raw signal and cannot be modified. + """ + +class DerivedSignalType(_DerivedSignalType, metaclass=_DerivedSignalTypeEnumTypeWrapper): + """Type of the signal. Not relevant for external use.""" + +DERIVED_SIGNAL_TYPE_INVALID: DerivedSignalType.ValueType # 0 +"""Signal type was not specified.""" +DERIVED_SIGNAL: DerivedSignalType.ValueType # 1 +"""Signal is a derived signal, with an editable label and expression. This is the default value.""" +FILE_UPLOADED_SIGNAL: DerivedSignalType.ValueType # 2 +"""Signal uploaded through the legacy File Uploader. The expression refers to a raw signal and +cannot be modified. +""" +FILE_UPLOADED_COMPANY_SIGNAL: DerivedSignalType.ValueType # 3 +"""Signal uploaded through the legacy File Uploader. The expression refers to a raw signal and +cannot be modified. +""" +PERSISTED_SIGNAL: DerivedSignalType.ValueType # 4 +"""A persisted signal that is evaluated and cached daily. +The expression refers to a raw signal and cannot be modified. +""" +global___DerivedSignalType = DerivedSignalType + +@typing.final +class DerivedSignal(google.protobuf.message.Message): + """A derived signal. + + As opposed to raw signals which represents time series on entities, a derived signal + represents a calculation through a DSL expression. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + LABEL_FIELD_NUMBER: builtins.int + EXPRESSION_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the derived signal, e.g. `derivedSignals/123`. In the "Create derived + signal" method, this is ignored and may be left empty. + """ + label: builtins.str + """Label of the derived signal. This appears in the Library when browsing for derived signals, + and when a derived signal is used in any Exabel feature (e.g. chart, dashboard). It can also + be used to reference this derived signal in a second derived signal. + + This is required when creating a derived signal. Must be a valid Python identifier between + 1-100 characters, match the regex `^[a-zA-Z_]\\w{0,99}$`, and cannot be a Python keyword. + """ + expression: builtins.str + """A DSL expression describing the signal transformations to apply. For more information, see the + DSL reference. + """ + description: builtins.str + """Appears in the Exabel Library, when browsing for derived signals.""" + display_name: builtins.str + """The human readable name of the signal.""" + @property + def metadata(self) -> global___DerivedSignalMetadata: + """Additional metadata to control formatting (decimals and units).""" + + def __init__( + self, + *, + name: builtins.str | None = ..., + label: builtins.str | None = ..., + expression: builtins.str | None = ..., + description: builtins.str | None = ..., + display_name: builtins.str | None = ..., + metadata: global___DerivedSignalMetadata | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["metadata", b"metadata"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "display_name", b"display_name", "expression", b"expression", "label", b"label", "metadata", b"metadata", "name", b"name"]) -> None: ... + +global___DerivedSignal = DerivedSignal + +@typing.final +class DerivedSignalMetadata(google.protobuf.message.Message): + """Additional metadata to control formatting (decimals and units). + + Note: this is only used today when a signal is added to a dashboard table. This will be phased + out in favour of providing formatting controls in the Exabel features (charts, dashboards, etc.) + where signals are used. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + DECIMALS_FIELD_NUMBER: builtins.int + UNIT_FIELD_NUMBER: builtins.int + TYPE_FIELD_NUMBER: builtins.int + DOWNSAMPLING_METHOD_FIELD_NUMBER: builtins.int + CHANGE_FIELD_NUMBER: builtins.int + ENTITY_SET_FIELD_NUMBER: builtins.int + unit: global___DerivedSignalUnit.ValueType + """Unit of the signal.""" + type: global___DerivedSignalType.ValueType + """Type of the signal. Not relevant for external use.""" + downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType + """The default downsampling method to use when this signal is re-sampled into larger intervals. + When two or more values in an interval needs to be aggregated into a single value, specifies + how they are combined. + """ + change: exabel.api.math.change_pb2.Change.ValueType + """The method used to calculate changes in this signal.""" + @property + def decimals(self) -> google.protobuf.wrappers_pb2.Int32Value: + """Number of decimals to use when displaying numeric values.""" + + @property + def entity_set(self) -> exabel.api.data.v1.common_messages_pb2.EntitySet: + """The set of entities that this signal is valid for.""" + + def __init__( + self, + *, + decimals: google.protobuf.wrappers_pb2.Int32Value | None = ..., + unit: global___DerivedSignalUnit.ValueType | None = ..., + type: global___DerivedSignalType.ValueType | None = ..., + downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType | None = ..., + change: exabel.api.math.change_pb2.Change.ValueType | None = ..., + entity_set: exabel.api.data.v1.common_messages_pb2.EntitySet | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["decimals", b"decimals", "entity_set", b"entity_set"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["change", b"change", "decimals", b"decimals", "downsampling_method", b"downsampling_method", "entity_set", b"entity_set", "type", b"type", "unit", b"unit"]) -> None: ... + +global___DerivedSignalMetadata = DerivedSignalMetadata diff --git a/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2_grpc.py new file mode 100644 index 00000000..5a5a5888 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/derived_signal_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.py b/exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.py new file mode 100644 index 00000000..5fee74fe --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/derived_signal_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/derived_signal_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import derived_signal_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n4exabel/api/analytics/v1/derived_signal_service.proto\x12\x17\x65xabel.api.analytics.v1\x1a\x35\x65xabel/api/analytics/v1/derived_signal_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"F\n\x17GetDerivedSignalRequest\x12+\n\x04name\x18\x01 \x01(\tB\x1d\x92\x41\x17\xca>\x14\xfa\x02\x11\x64\x65rivedSignalName\xe0\x41\x02\"i\n\x1a\x43reateDerivedSignalRequest\x12;\n\x06signal\x18\x01 \x01(\x0b\x32&.exabel.api.analytics.v1.DerivedSignalB\x03\xe0\x41\x02\x12\x0e\n\x06\x66older\x18\x02 \x01(\t\"\x8a\x01\n\x1aUpdateDerivedSignalRequest\x12;\n\x06signal\x18\x01 \x01(\x0b\x32&.exabel.api.analytics.v1.DerivedSignalB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"I\n\x1a\x44\x65leteDerivedSignalRequest\x12+\n\x04name\x18\x01 \x01(\tB\x1d\x92\x41\x17\xca>\x14\xfa\x02\x11\x64\x65rivedSignalName\xe0\x41\x02\x32\xdb\x05\n\x14\x44\x65rivedSignalService\x12\xa8\x01\n\x10GetDerivedSignal\x12\x30.exabel.api.analytics.v1.GetDerivedSignalRequest\x1a&.exabel.api.analytics.v1.DerivedSignal\":\x92\x41\x14\x12\x12Get derived signal\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/{name=derivedSignals/*}\x12\xb0\x01\n\x13\x43reateDerivedSignal\x12\x33.exabel.api.analytics.v1.CreateDerivedSignalRequest\x1a&.exabel.api.analytics.v1.DerivedSignal\"<\x92\x41\x17\x12\x15\x43reate derived signal\x82\xd3\xe4\x93\x02\x1c\"\x12/v1/derivedSignals:\x06signal\x12\xc0\x01\n\x13UpdateDerivedSignal\x12\x33.exabel.api.analytics.v1.UpdateDerivedSignalRequest\x1a&.exabel.api.analytics.v1.DerivedSignal\"L\x92\x41\x17\x12\x15Update derived signal\x82\xd3\xe4\x93\x02,2\"/v1/{signal.name=derivedSignals/*}:\x06signal\x12\xa1\x01\n\x13\x44\x65leteDerivedSignal\x12\x33.exabel.api.analytics.v1.DeleteDerivedSignalRequest\x1a\x16.google.protobuf.Empty\"=\x92\x41\x17\x12\x15\x44\x65lete derived signal\x82\xd3\xe4\x93\x02\x1d*\x1b/v1/{name=derivedSignals/*}BW\n\x1b\x63om.exabel.api.analytics.v1B\x19\x44\x65rivedSignalServiceProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.derived_signal_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\031DerivedSignalServiceProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_GETDERIVEDSIGNALREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETDERIVEDSIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\222A\027\312>\024\372\002\021derivedSignalName\340A\002' + _globals['_CREATEDERIVEDSIGNALREQUEST'].fields_by_name['signal']._loaded_options = None + _globals['_CREATEDERIVEDSIGNALREQUEST'].fields_by_name['signal']._serialized_options = b'\340A\002' + _globals['_UPDATEDERIVEDSIGNALREQUEST'].fields_by_name['signal']._loaded_options = None + _globals['_UPDATEDERIVEDSIGNALREQUEST'].fields_by_name['signal']._serialized_options = b'\340A\002' + _globals['_DELETEDERIVEDSIGNALREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETEDERIVEDSIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\222A\027\312>\024\372\002\021derivedSignalName\340A\002' + _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['GetDerivedSignal']._loaded_options = None + _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['GetDerivedSignal']._serialized_options = b'\222A\024\022\022Get derived signal\202\323\344\223\002\035\022\033/v1/{name=derivedSignals/*}' + _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['CreateDerivedSignal']._loaded_options = None + _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['CreateDerivedSignal']._serialized_options = b'\222A\027\022\025Create derived signal\202\323\344\223\002\034\"\022/v1/derivedSignals:\006signal' + _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['UpdateDerivedSignal']._loaded_options = None + _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['UpdateDerivedSignal']._serialized_options = b'\222A\027\022\025Update derived signal\202\323\344\223\002,2\"/v1/{signal.name=derivedSignals/*}:\006signal' + _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['DeleteDerivedSignal']._loaded_options = None + _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['DeleteDerivedSignal']._serialized_options = b'\222A\027\022\025Delete derived signal\202\323\344\223\002\035*\033/v1/{name=derivedSignals/*}' + _globals['_GETDERIVEDSIGNALREQUEST']._serialized_start=310 + _globals['_GETDERIVEDSIGNALREQUEST']._serialized_end=380 + _globals['_CREATEDERIVEDSIGNALREQUEST']._serialized_start=382 + _globals['_CREATEDERIVEDSIGNALREQUEST']._serialized_end=487 + _globals['_UPDATEDERIVEDSIGNALREQUEST']._serialized_start=490 + _globals['_UPDATEDERIVEDSIGNALREQUEST']._serialized_end=628 + _globals['_DELETEDERIVEDSIGNALREQUEST']._serialized_start=630 + _globals['_DELETEDERIVEDSIGNALREQUEST']._serialized_end=703 + _globals['_DERIVEDSIGNALSERVICE']._serialized_start=706 + _globals['_DERIVEDSIGNALSERVICE']._serialized_end=1437 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.pyi similarity index 57% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.pyi rename to exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.pyi index 2162b5df..a01810c7 100644 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.pyi +++ b/exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.pyi @@ -2,59 +2,71 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2022 Exabel AS. All rights reserved.""" + import builtins -from ..... import exabel +from . import derived_signal_messages_pb2 import google.protobuf.descriptor import google.protobuf.field_mask_pb2 import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class GetDerivedSignalRequest(google.protobuf.message.Message): """Request to GetDerivedSignal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The derived signal resource name.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """The derived signal resource name.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetDerivedSignalRequest = GetDerivedSignalRequest @typing.final class CreateDerivedSignalRequest(google.protobuf.message.Message): """Request to CreateDerivedSignal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SIGNAL_FIELD_NUMBER: builtins.int FOLDER_FIELD_NUMBER: builtins.int folder: builtins.str - 'Resource name of the Library folder to create the signal in, e.g. `folders/123`. If not\n specified, the signal will be created in an “Analytics API” folder that is shared with the\n customer user group.\n ' - + """Resource name of the Library folder to create the signal in, e.g. `folders/123`. If not + specified, the signal will be created in an “Analytics API” folder that is shared with the + customer user group. + """ @property def signal(self) -> exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal: """A derived signal.""" - def __init__(self, *, signal: exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal | None=..., folder: builtins.str | None=...) -> None: - ... + def __init__( + self, + *, + signal: exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal | None = ..., + folder: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["signal", b"signal"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["folder", b"folder", "signal", b"signal"]) -> None: ... - def HasField(self, field_name: typing.Literal['signal', b'signal']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['folder', b'folder', 'signal', b'signal']) -> None: - ... global___CreateDerivedSignalRequest = CreateDerivedSignalRequest @typing.final class UpdateDerivedSignalRequest(google.protobuf.message.Message): """Request to UpdateDerivedSignal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SIGNAL_FIELD_NUMBER: builtins.int UPDATE_MASK_FIELD_NUMBER: builtins.int - @property def signal(self) -> exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal: """A derived signal.""" @@ -67,27 +79,31 @@ class UpdateDerivedSignalRequest(google.protobuf.message.Message): For REST requests, this is a comma-separated string. """ - def __init__(self, *, signal: exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['signal', b'signal', 'update_mask', b'update_mask']) -> builtins.bool: - ... + def __init__( + self, + *, + signal: exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["signal", b"signal", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["signal", b"signal", "update_mask", b"update_mask"]) -> None: ... - def ClearField(self, field_name: typing.Literal['signal', b'signal', 'update_mask', b'update_mask']) -> None: - ... global___UpdateDerivedSignalRequest = UpdateDerivedSignalRequest @typing.final class DeleteDerivedSignalRequest(google.protobuf.message.Message): """Request to DeleteDerivedSignal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The derived signal resource name.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... -global___DeleteDerivedSignalRequest = DeleteDerivedSignalRequest \ No newline at end of file + """The derived signal resource name.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... + +global___DeleteDerivedSignalRequest = DeleteDerivedSignalRequest diff --git a/exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2_grpc.py new file mode 100644 index 00000000..25f40417 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/derived_signal_service_pb2_grpc.py @@ -0,0 +1,273 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import derived_signal_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2 +from . import derived_signal_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/derived_signal_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class DerivedSignalServiceStub(object): + """Service to manage derived signals. + + A derived signal is a DSL expression with a unique label. The label must be unique to the + customer. + + Derived signals are stored in Library folders and shared across users through folder sharing. + + Requests to the DerivedSignalService are executed in the context of the customer's service + account (SA). The SA is a special user that is a member of the customer user group, giving + it access to all folders that are shared with this user group, but not to private folders. + Hence, only derived signals that are in folders shared to the SA, via the customer user group, + will be accessible via the DerivedSignalService. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GetDerivedSignal = channel.unary_unary( + '/exabel.api.analytics.v1.DerivedSignalService/GetDerivedSignal', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.GetDerivedSignalRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, + _registered_method=True) + self.CreateDerivedSignal = channel.unary_unary( + '/exabel.api.analytics.v1.DerivedSignalService/CreateDerivedSignal', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.CreateDerivedSignalRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, + _registered_method=True) + self.UpdateDerivedSignal = channel.unary_unary( + '/exabel.api.analytics.v1.DerivedSignalService/UpdateDerivedSignal', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.UpdateDerivedSignalRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, + _registered_method=True) + self.DeleteDerivedSignal = channel.unary_unary( + '/exabel.api.analytics.v1.DerivedSignalService/DeleteDerivedSignal', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.DeleteDerivedSignalRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + + +class DerivedSignalServiceServicer(object): + """Service to manage derived signals. + + A derived signal is a DSL expression with a unique label. The label must be unique to the + customer. + + Derived signals are stored in Library folders and shared across users through folder sharing. + + Requests to the DerivedSignalService are executed in the context of the customer's service + account (SA). The SA is a special user that is a member of the customer user group, giving + it access to all folders that are shared with this user group, but not to private folders. + Hence, only derived signals that are in folders shared to the SA, via the customer user group, + will be accessible via the DerivedSignalService. + """ + + def GetDerivedSignal(self, request, context): + """Gets a derived signal. + + The derived signal must be in a folder that is shared to your service account (which is always + in your main customer user group). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateDerivedSignal(self, request, context): + """Creates a derived signal. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateDerivedSignal(self, request, context): + """Updates a derived signal. + + Note that this method will update all fields unless `update_mask` is set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteDerivedSignal(self, request, context): + """Deletes a derived signal. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_DerivedSignalServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GetDerivedSignal': grpc.unary_unary_rpc_method_handler( + servicer.GetDerivedSignal, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.GetDerivedSignalRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.SerializeToString, + ), + 'CreateDerivedSignal': grpc.unary_unary_rpc_method_handler( + servicer.CreateDerivedSignal, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.CreateDerivedSignalRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.SerializeToString, + ), + 'UpdateDerivedSignal': grpc.unary_unary_rpc_method_handler( + servicer.UpdateDerivedSignal, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.UpdateDerivedSignalRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.SerializeToString, + ), + 'DeleteDerivedSignal': grpc.unary_unary_rpc_method_handler( + servicer.DeleteDerivedSignal, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.DeleteDerivedSignalRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.analytics.v1.DerivedSignalService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.analytics.v1.DerivedSignalService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class DerivedSignalService(object): + """Service to manage derived signals. + + A derived signal is a DSL expression with a unique label. The label must be unique to the + customer. + + Derived signals are stored in Library folders and shared across users through folder sharing. + + Requests to the DerivedSignalService are executed in the context of the customer's service + account (SA). The SA is a special user that is a member of the customer user group, giving + it access to all folders that are shared with this user group, but not to private folders. + Hence, only derived signals that are in folders shared to the SA, via the customer user group, + will be accessible via the DerivedSignalService. + """ + + @staticmethod + def GetDerivedSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.DerivedSignalService/GetDerivedSignal', + exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.GetDerivedSignalRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateDerivedSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.DerivedSignalService/CreateDerivedSignal', + exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.CreateDerivedSignalRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateDerivedSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.DerivedSignalService/UpdateDerivedSignal', + exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.UpdateDerivedSignalRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteDerivedSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.DerivedSignalService/DeleteDerivedSignal', + exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.DeleteDerivedSignalRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2.py b/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2.py new file mode 100644 index 00000000..d50866cf --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/item_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/item_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+exabel/api/analytics/v1/item_messages.proto\x12\x17\x65xabel.api.analytics.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xdd\x01\n\x0cItemMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x17\n\ncreated_by\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nupdated_by\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x0cwrite_access\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x42\x0f\n\r_write_accessBO\n\x1b\x63om.exabel.api.analytics.v1B\x11ItemMessagesProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.item_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\021ItemMessagesProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_ITEMMETADATA'].fields_by_name['create_time']._loaded_options = None + _globals['_ITEMMETADATA'].fields_by_name['create_time']._serialized_options = b'\340A\003' + _globals['_ITEMMETADATA'].fields_by_name['update_time']._loaded_options = None + _globals['_ITEMMETADATA'].fields_by_name['update_time']._serialized_options = b'\340A\003' + _globals['_ITEMMETADATA'].fields_by_name['created_by']._loaded_options = None + _globals['_ITEMMETADATA'].fields_by_name['created_by']._serialized_options = b'\340A\003' + _globals['_ITEMMETADATA'].fields_by_name['updated_by']._loaded_options = None + _globals['_ITEMMETADATA'].fields_by_name['updated_by']._serialized_options = b'\340A\003' + _globals['_ITEMMETADATA'].fields_by_name['write_access']._loaded_options = None + _globals['_ITEMMETADATA'].fields_by_name['write_access']._serialized_options = b'\340A\003' + _globals['_ITEMMETADATA']._serialized_start=139 + _globals['_ITEMMETADATA']._serialized_end=360 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2.pyi new file mode 100644 index 00000000..2f220741 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2.pyi @@ -0,0 +1,54 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" + +import builtins +import google.protobuf.descriptor +import google.protobuf.message +import google.protobuf.timestamp_pb2 +import typing + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class ItemMetadata(google.protobuf.message.Message): + """Metadata about an item.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + CREATE_TIME_FIELD_NUMBER: builtins.int + UPDATE_TIME_FIELD_NUMBER: builtins.int + CREATED_BY_FIELD_NUMBER: builtins.int + UPDATED_BY_FIELD_NUMBER: builtins.int + WRITE_ACCESS_FIELD_NUMBER: builtins.int + created_by: builtins.str + """Resource name of the user who created the item.""" + updated_by: builtins.str + """Resource name of the user who last updated the item.""" + write_access: builtins.bool + """Whether the API caller has write access to the item. + May not always be populated. + """ + @property + def create_time(self) -> google.protobuf.timestamp_pb2.Timestamp: + """When the item was created.""" + + @property + def update_time(self) -> google.protobuf.timestamp_pb2.Timestamp: + """When the item was last updated.""" + + def __init__( + self, + *, + create_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + update_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + created_by: builtins.str | None = ..., + updated_by: builtins.str | None = ..., + write_access: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_write_access", b"_write_access", "create_time", b"create_time", "update_time", b"update_time", "write_access", b"write_access"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_write_access", b"_write_access", "create_time", b"create_time", "created_by", b"created_by", "update_time", b"update_time", "updated_by", b"updated_by", "write_access", b"write_access"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_write_access", b"_write_access"]) -> typing.Literal["write_access"] | None: ... + +global___ItemMetadata = ItemMetadata diff --git a/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2_grpc.py new file mode 100644 index 00000000..a663dae8 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/item_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/item_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.py b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.py new file mode 100644 index 00000000..7f4c4805 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/kpi_mapping_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/kpi_mapping_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import common_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_common__messages__pb2 +from . import derived_signal_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2 +from . import kpi_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__messages__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2exabel/api/analytics/v1/kpi_mapping_messages.proto\x12\x17\x65xabel.api.analytics.v1\x1a-exabel/api/analytics/v1/common_messages.proto\x1a\x35\x65xabel/api/analytics/v1/derived_signal_messages.proto\x1a*exabel/api/analytics/v1/kpi_messages.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\xa4\x04\n\x0fKpiMappingGroup\x12I\n\x04name\x18\x01 \x01(\tB;\x92\x41\x35J\x1a\"kpiMappings/123/groups/4\"\xca>\x16\xfa\x02\x13kpiMappingGroupName\xe0\x41\x05\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12)\n\x03kpi\x18\x03 \x01(\x0b\x32\x1c.exabel.api.analytics.v1.Kpi\x12<\n\x0cproxy_signal\x18\x04 \x01(\x0b\x32&.exabel.api.analytics.v1.DerivedSignal\x12?\n\x04type\x18\x05 \x01(\x0e\x32,.exabel.api.analytics.v1.KpiMappingGroupTypeB\x03\xe0\x41\x05\x12\x36\n\nentity_set\x18\x06 \x01(\x0b\x32\".exabel.api.analytics.v1.EntitySet\x12\x46\n\x15proxy_resample_method\x18\x07 \x01(\x0e\x32\'.exabel.api.analytics.v1.ResampleMethod\x12H\n\x13\x66orecasting_options\x18\x08 \x01(\x0b\x32+.exabel.api.analytics.v1.ForecastingOptions\x12<\n\rmodel_options\x18\t \x01(\x0b\x32%.exabel.api.analytics.v1.ModelOptions\"\xcf\x01\n\x12\x46orecastingOptions\x12`\n\nmodel_type\x18\x01 \x01(\tBL\x92\x41I\xf2\x02\x04\x61uto\xf2\x02\x07prophet\xf2\x02\x06sarima\xf2\x02\x05theta\xf2\x02\x15unobserved_components\xf2\x02\x0cholt_winters\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x18\n\x10\x63ountry_holidays\x18\x03 \x01(\t\x12\x10\n\x08holidays\x18\x04 \x01(\t\"\xa0\x02\n\x0cModelOptions\x12\xca\x01\n\nmodel_type\x18\x01 \x01(\tB\xb5\x01\x92\x41\xb1\x01\xf2\x02\x0e\x61rd_regression\xf2\x02\x0b\x65lastic_net\xf2\x02\x0e\x65lastic_net_cv\xf2\x02\x10huber_regression\xf2\x02\x11linear_regression\xf2\x02\x10ratio_prediction\xf2\x02\x13ratio_prediction_ml\xf2\x02\x07sarimax\xf2\x02\x0cspread_model\xf2\x02\x15unobserved_components\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x16\n\x0eyear_over_year\x18\x03 \x01(\x08*]\n\x13KpiMappingGroupType\x12&\n\"KPI_MAPPING_GROUP_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42ULK\x10\x01\x12\x14\n\x10\x43OMPANY_SPECIFIC\x10\x02*\xad\x01\n\x0eResampleMethod\x12\x1f\n\x1bRESAMPLE_METHOD_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNO_RESAMPLE\x10\x01\x12\x11\n\rRESAMPLE_MEAN\x10\x02\x12\x10\n\x0cRESAMPLE_SUM\x10\x03\x12\x13\n\x0fRESAMPLE_MEDIAN\x10\x04\x12\x1c\n\x18RESAMPLE_MEAN_TIMES_DAYS\x10\x05\x12\x11\n\rRESAMPLE_LAST\x10\x06\x42Z\n\x1b\x63om.exabel.api.analytics.v1B\x1cKpiMappingGroupMessagesProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.kpi_mapping_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\034KpiMappingGroupMessagesProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_KPIMAPPINGGROUP'].fields_by_name['name']._loaded_options = None + _globals['_KPIMAPPINGGROUP'].fields_by_name['name']._serialized_options = b'\222A5J\032\"kpiMappings/123/groups/4\"\312>\026\372\002\023kpiMappingGroupName\340A\005' + _globals['_KPIMAPPINGGROUP'].fields_by_name['type']._loaded_options = None + _globals['_KPIMAPPINGGROUP'].fields_by_name['type']._serialized_options = b'\340A\005' + _globals['_FORECASTINGOPTIONS'].fields_by_name['model_type']._loaded_options = None + _globals['_FORECASTINGOPTIONS'].fields_by_name['model_type']._serialized_options = b'\222AI\362\002\004auto\362\002\007prophet\362\002\006sarima\362\002\005theta\362\002\025unobserved_components\362\002\014holt_winters' + _globals['_MODELOPTIONS'].fields_by_name['model_type']._loaded_options = None + _globals['_MODELOPTIONS'].fields_by_name['model_type']._serialized_options = b'\222A\261\001\362\002\016ard_regression\362\002\013elastic_net\362\002\016elastic_net_cv\362\002\020huber_regression\362\002\021linear_regression\362\002\020ratio_prediction\362\002\023ratio_prediction_ml\362\002\007sarimax\362\002\014spread_model\362\002\025unobserved_components' + _globals['_KPIMAPPINGGROUPTYPE']._serialized_start=1388 + _globals['_KPIMAPPINGGROUPTYPE']._serialized_end=1481 + _globals['_RESAMPLEMETHOD']._serialized_start=1484 + _globals['_RESAMPLEMETHOD']._serialized_end=1657 + _globals['_KPIMAPPINGGROUP']._serialized_start=337 + _globals['_KPIMAPPINGGROUP']._serialized_end=885 + _globals['_FORECASTINGOPTIONS']._serialized_start=888 + _globals['_FORECASTINGOPTIONS']._serialized_end=1095 + _globals['_MODELOPTIONS']._serialized_start=1098 + _globals['_MODELOPTIONS']._serialized_end=1386 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.pyi new file mode 100644 index 00000000..8dc9d792 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.pyi @@ -0,0 +1,236 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2025 Exabel AS. All rights reserved.""" + +import builtins +from . import common_messages_pb2 +from . import derived_signal_messages_pb2 +from . import kpi_messages_pb2 +import google.protobuf.descriptor +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import google.protobuf.struct_pb2 +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _KpiMappingGroupType: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _KpiMappingGroupTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_KpiMappingGroupType.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + KPI_MAPPING_GROUP_TYPE_UNSPECIFIED: _KpiMappingGroupType.ValueType # 0 + """Unspecified.""" + BULK: _KpiMappingGroupType.ValueType # 1 + """Bulk mapping groups.""" + COMPANY_SPECIFIC: _KpiMappingGroupType.ValueType # 2 + """Company specific mapping groups.""" + +class KpiMappingGroupType(_KpiMappingGroupType, metaclass=_KpiMappingGroupTypeEnumTypeWrapper): + """Specifies KPI mapping group types.""" + +KPI_MAPPING_GROUP_TYPE_UNSPECIFIED: KpiMappingGroupType.ValueType # 0 +"""Unspecified.""" +BULK: KpiMappingGroupType.ValueType # 1 +"""Bulk mapping groups.""" +COMPANY_SPECIFIC: KpiMappingGroupType.ValueType # 2 +"""Company specific mapping groups.""" +global___KpiMappingGroupType = KpiMappingGroupType + +class _ResampleMethod: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ResampleMethodEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ResampleMethod.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + RESAMPLE_METHOD_UNSPECIFIED: _ResampleMethod.ValueType # 0 + """Unspecified.""" + NO_RESAMPLE: _ResampleMethod.ValueType # 1 + """No resampling.""" + RESAMPLE_MEAN: _ResampleMethod.ValueType # 2 + """Mean.""" + RESAMPLE_SUM: _ResampleMethod.ValueType # 3 + """Sum.""" + RESAMPLE_MEDIAN: _ResampleMethod.ValueType # 4 + """Median.""" + RESAMPLE_MEAN_TIMES_DAYS: _ResampleMethod.ValueType # 5 + """Mean times days.""" + RESAMPLE_LAST: _ResampleMethod.ValueType # 6 + """Last.""" + +class ResampleMethod(_ResampleMethod, metaclass=_ResampleMethodEnumTypeWrapper): + """Specifies how to resample a signal.""" + +RESAMPLE_METHOD_UNSPECIFIED: ResampleMethod.ValueType # 0 +"""Unspecified.""" +NO_RESAMPLE: ResampleMethod.ValueType # 1 +"""No resampling.""" +RESAMPLE_MEAN: ResampleMethod.ValueType # 2 +"""Mean.""" +RESAMPLE_SUM: ResampleMethod.ValueType # 3 +"""Sum.""" +RESAMPLE_MEDIAN: ResampleMethod.ValueType # 4 +"""Median.""" +RESAMPLE_MEAN_TIMES_DAYS: ResampleMethod.ValueType # 5 +"""Mean times days.""" +RESAMPLE_LAST: ResampleMethod.ValueType # 6 +"""Last.""" +global___ResampleMethod = ResampleMethod + +@typing.final +class KpiMappingGroup(google.protobuf.message.Message): + """A KPI mapping group.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + KPI_FIELD_NUMBER: builtins.int + PROXY_SIGNAL_FIELD_NUMBER: builtins.int + TYPE_FIELD_NUMBER: builtins.int + ENTITY_SET_FIELD_NUMBER: builtins.int + PROXY_RESAMPLE_METHOD_FIELD_NUMBER: builtins.int + FORECASTING_OPTIONS_FIELD_NUMBER: builtins.int + MODEL_OPTIONS_FIELD_NUMBER: builtins.int + name: builtins.str + """Resource name. E.g "kpiMappings/123/groups/4".""" + display_name: builtins.str + """Display name.""" + type: global___KpiMappingGroupType.ValueType + """Type of KPI mapping group.""" + proxy_resample_method: global___ResampleMethod.ValueType + """Specifies how to resample the proxy signal.""" + @property + def kpi(self) -> exabel.api.analytics.v1.kpi_messages_pb2.Kpi: + """The KPI for the group.""" + + @property + def proxy_signal(self) -> exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal: + """Proxy signal.""" + + @property + def entity_set(self) -> exabel.api.analytics.v1.common_messages_pb2.EntitySet: + """The entities for which this group defines KPI mappings. + All the entities must be companies. + """ + + @property + def forecasting_options(self) -> global___ForecastingOptions: + """Specifies how proxy signal forecasting should be performed.""" + + @property + def model_options(self) -> global___ModelOptions: + """Configuration for the single-predictor models that are built for this group.""" + + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + kpi: exabel.api.analytics.v1.kpi_messages_pb2.Kpi | None = ..., + proxy_signal: exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal | None = ..., + type: global___KpiMappingGroupType.ValueType | None = ..., + entity_set: exabel.api.analytics.v1.common_messages_pb2.EntitySet | None = ..., + proxy_resample_method: global___ResampleMethod.ValueType | None = ..., + forecasting_options: global___ForecastingOptions | None = ..., + model_options: global___ModelOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["entity_set", b"entity_set", "forecasting_options", b"forecasting_options", "kpi", b"kpi", "model_options", b"model_options", "proxy_signal", b"proxy_signal"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["display_name", b"display_name", "entity_set", b"entity_set", "forecasting_options", b"forecasting_options", "kpi", b"kpi", "model_options", b"model_options", "name", b"name", "proxy_resample_method", b"proxy_resample_method", "proxy_signal", b"proxy_signal", "type", b"type"]) -> None: ... + +global___KpiMappingGroup = KpiMappingGroup + +@typing.final +class ForecastingOptions(google.protobuf.message.Message): + """Forecasting options for Prophet and other forecasting models.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + MODEL_TYPE_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + COUNTRY_HOLIDAYS_FIELD_NUMBER: builtins.int + HOLIDAYS_FIELD_NUMBER: builtins.int + model_type: builtins.str + """Forecasting model type. + + Supported values: `auto`, `prophet`, `sarima`, `theta`, `unobserved_components`, `holt_winters`. + + Default: `auto`. + + For information about forecasting, see https://doc.exabel.com/dsl/modelling/forecasting.html + """ + country_holidays: builtins.str + """Country code for standard country holidays (e.g., 'US', 'UK'). + Only used when model_type='prophet'. + """ + holidays: builtins.str + """Resource name of the holiday specification to use for Prophet forecasting. + Only used when model_type='prophet'. + Example: "holidaySpecifications/123" + """ + @property + def parameters(self) -> google.protobuf.struct_pb2.Struct: + """Model-specific parameters passed to the forecasting function.""" + + def __init__( + self, + *, + model_type: builtins.str | None = ..., + parameters: google.protobuf.struct_pb2.Struct | None = ..., + country_holidays: builtins.str | None = ..., + holidays: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["parameters", b"parameters"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["country_holidays", b"country_holidays", "holidays", b"holidays", "model_type", b"model_type", "parameters", b"parameters"]) -> None: ... + +global___ForecastingOptions = ForecastingOptions + +@typing.final +class ModelOptions(google.protobuf.message.Message): + """Options for the KPI prediction models.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + MODEL_TYPE_FIELD_NUMBER: builtins.int + PARAMETERS_FIELD_NUMBER: builtins.int + YEAR_OVER_YEAR_FIELD_NUMBER: builtins.int + model_type: builtins.str + """The type of the model. + + Supported values: `ard_regression`, `elastic_net`, `elastic_net_cv`, `huber_regression`, + `linear_regression`, `ratio_prediction`, `ratio_prediction_ml`, `sarimax`, `spread_model`, + and `unobserved_components`. + + Default: `sarimax` is used for ratio KPIs and `ratio_prediction` for other KPIs. + + For information about model types, see https://doc.exabel.com/dsl/modelling/models.html + """ + year_over_year: builtins.bool + """Whether to apply year-over-year transformation. + When enabled, both predictors and targets are transformed to year-over-year changes during training, + and predictions are transformed back to absolute values during inference. + """ + @property + def parameters(self) -> google.protobuf.struct_pb2.Struct: + """Model-specific parameters. Only takes effect if `model_type` is set.""" + + def __init__( + self, + *, + model_type: builtins.str | None = ..., + parameters: google.protobuf.struct_pb2.Struct | None = ..., + year_over_year: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["parameters", b"parameters"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["model_type", b"model_type", "parameters", b"parameters", "year_over_year", b"year_over_year"]) -> None: ... + +global___ModelOptions = ModelOptions diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2_grpc.py new file mode 100644 index 00000000..cf5a5a68 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/kpi_mapping_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.py b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.py new file mode 100644 index 00000000..b0beb456 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/kpi_mapping_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/kpi_mapping_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import kpi_mapping_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1exabel/api/analytics/v1/kpi_mapping_service.proto\x12\x17\x65xabel.api.analytics.v1\x1a\x32\x65xabel/api/analytics/v1/kpi_mapping_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x94\x01\n\x1c\x43reateKpiMappingGroupRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0ekpiMappingName\xe0\x41\x02\x12H\n\x11kpi_mapping_group\x18\x02 \x01(\x0b\x32(.exabel.api.analytics.v1.KpiMappingGroupB\x03\xe0\x41\x02\"J\n\x19GetKpiMappingGroupRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\x92\x41\x19\xca>\x16\xfa\x02\x13kpiMappingGroupName\xe0\x41\x02\"\xcd\x01\n\x1bListKpiMappingGroupsRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0ekpiMappingName\xe0\x41\x02\x12:\n\x04type\x18\x02 \x01(\x0e\x32,.exabel.api.analytics.v1.KpiMappingGroupType\x12\x11\n\tcompanies\x18\x03 \x03(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x0c\n\x04skip\x18\x06 \x01(\x05\"\x85\x01\n\x1cListKpiMappingGroupsResponse\x12\x38\n\x06groups\x18\x01 \x03(\x0b\x32(.exabel.api.analytics.v1.KpiMappingGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\x99\x01\n\x1cUpdateKpiMappingGroupRequest\x12H\n\x11kpi_mapping_group\x18\x01 \x01(\x0b\x32(.exabel.api.analytics.v1.KpiMappingGroupB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\xd8\x06\n\x11KpiMappingService\x12\xd3\x01\n\x15\x43reateKpiMappingGroup\x12\x35.exabel.api.analytics.v1.CreateKpiMappingGroupRequest\x1a(.exabel.api.analytics.v1.KpiMappingGroup\"Y\x92\x41\x1a\x12\x18\x43reate KPI mapping group\x82\xd3\xe4\x93\x02\x36\"!/v1/{parent=kpiMappings/*}/groups:\x11kpi_mapping_group\x12\xb7\x01\n\x12GetKpiMappingGroup\x12\x32.exabel.api.analytics.v1.GetKpiMappingGroupRequest\x1a(.exabel.api.analytics.v1.KpiMappingGroup\"C\x92\x41\x17\x12\x15Get KPI mapping group\x82\xd3\xe4\x93\x02#\x12!/v1/{name=kpiMappings/*/groups/*}\x12\xca\x01\n\x14ListKpiMappingGroups\x12\x34.exabel.api.analytics.v1.ListKpiMappingGroupsRequest\x1a\x35.exabel.api.analytics.v1.ListKpiMappingGroupsResponse\"E\x92\x41\x19\x12\x17List KPI mapping groups\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=kpiMappings/*}/groups\x12\xe5\x01\n\x15UpdateKpiMappingGroup\x12\x35.exabel.api.analytics.v1.UpdateKpiMappingGroupRequest\x1a(.exabel.api.analytics.v1.KpiMappingGroup\"k\x92\x41\x1a\x12\x18Update KPI mapping group\x82\xd3\xe4\x93\x02H23/v1/{kpi_mapping_group.name=kpiMappings/*/groups/*}:\x11kpi_mapping_groupBY\n\x1b\x63om.exabel.api.analytics.v1B\x1bKpiMappingGroupServiceProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.kpi_mapping_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\033KpiMappingGroupServiceProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_CREATEKPIMAPPINGGROUPREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_CREATEKPIMAPPINGGROUPREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\024\312>\021\372\002\016kpiMappingName\340A\002' + _globals['_CREATEKPIMAPPINGGROUPREQUEST'].fields_by_name['kpi_mapping_group']._loaded_options = None + _globals['_CREATEKPIMAPPINGGROUPREQUEST'].fields_by_name['kpi_mapping_group']._serialized_options = b'\340A\002' + _globals['_GETKPIMAPPINGGROUPREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETKPIMAPPINGGROUPREQUEST'].fields_by_name['name']._serialized_options = b'\222A\031\312>\026\372\002\023kpiMappingGroupName\340A\002' + _globals['_LISTKPIMAPPINGGROUPSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTKPIMAPPINGGROUPSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\024\312>\021\372\002\016kpiMappingName\340A\002' + _globals['_UPDATEKPIMAPPINGGROUPREQUEST'].fields_by_name['kpi_mapping_group']._loaded_options = None + _globals['_UPDATEKPIMAPPINGGROUPREQUEST'].fields_by_name['kpi_mapping_group']._serialized_options = b'\340A\002' + _globals['_KPIMAPPINGSERVICE'].methods_by_name['CreateKpiMappingGroup']._loaded_options = None + _globals['_KPIMAPPINGSERVICE'].methods_by_name['CreateKpiMappingGroup']._serialized_options = b'\222A\032\022\030Create KPI mapping group\202\323\344\223\0026\"!/v1/{parent=kpiMappings/*}/groups:\021kpi_mapping_group' + _globals['_KPIMAPPINGSERVICE'].methods_by_name['GetKpiMappingGroup']._loaded_options = None + _globals['_KPIMAPPINGSERVICE'].methods_by_name['GetKpiMappingGroup']._serialized_options = b'\222A\027\022\025Get KPI mapping group\202\323\344\223\002#\022!/v1/{name=kpiMappings/*/groups/*}' + _globals['_KPIMAPPINGSERVICE'].methods_by_name['ListKpiMappingGroups']._loaded_options = None + _globals['_KPIMAPPINGSERVICE'].methods_by_name['ListKpiMappingGroups']._serialized_options = b'\222A\031\022\027List KPI mapping groups\202\323\344\223\002#\022!/v1/{parent=kpiMappings/*}/groups' + _globals['_KPIMAPPINGSERVICE'].methods_by_name['UpdateKpiMappingGroup']._loaded_options = None + _globals['_KPIMAPPINGSERVICE'].methods_by_name['UpdateKpiMappingGroup']._serialized_options = b'\222A\032\022\030Update KPI mapping group\202\323\344\223\002H23/v1/{kpi_mapping_group.name=kpiMappings/*/groups/*}:\021kpi_mapping_group' + _globals['_CREATEKPIMAPPINGGROUPREQUEST']._serialized_start=276 + _globals['_CREATEKPIMAPPINGGROUPREQUEST']._serialized_end=424 + _globals['_GETKPIMAPPINGGROUPREQUEST']._serialized_start=426 + _globals['_GETKPIMAPPINGGROUPREQUEST']._serialized_end=500 + _globals['_LISTKPIMAPPINGGROUPSREQUEST']._serialized_start=503 + _globals['_LISTKPIMAPPINGGROUPSREQUEST']._serialized_end=708 + _globals['_LISTKPIMAPPINGGROUPSRESPONSE']._serialized_start=711 + _globals['_LISTKPIMAPPINGGROUPSRESPONSE']._serialized_end=844 + _globals['_UPDATEKPIMAPPINGGROUPREQUEST']._serialized_start=847 + _globals['_UPDATEKPIMAPPINGGROUPREQUEST']._serialized_end=1000 + _globals['_KPIMAPPINGSERVICE']._serialized_start=1003 + _globals['_KPIMAPPINGSERVICE']._serialized_end=1859 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.pyi similarity index 55% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.pyi rename to exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.pyi index 3a5935e6..2b821717 100644 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.pyi +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.pyi @@ -2,58 +2,68 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2025 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import kpi_mapping_messages_pb2 import google.protobuf.descriptor import google.protobuf.field_mask_pb2 import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class CreateKpiMappingGroupRequest(google.protobuf.message.Message): """Request message to CreateKpiMappingGroup.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int KPI_MAPPING_GROUP_FIELD_NUMBER: builtins.int parent: builtins.str - 'Resource name of the Kpi mapping which the group should be added to.' - + """Resource name of the Kpi mapping which the group should be added to.""" @property def kpi_mapping_group(self) -> exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup: """KpiMappingGroup to create. The name field in the Kpi mapping group is ignored and may be left empty.""" - def __init__(self, *, parent: builtins.str | None=..., kpi_mapping_group: exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['kpi_mapping_group', b'kpi_mapping_group']) -> builtins.bool: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + kpi_mapping_group: exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kpi_mapping_group", b"kpi_mapping_group"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kpi_mapping_group", b"kpi_mapping_group", "parent", b"parent"]) -> None: ... - def ClearField(self, field_name: typing.Literal['kpi_mapping_group', b'kpi_mapping_group', 'parent', b'parent']) -> None: - ... global___CreateKpiMappingGroupRequest = CreateKpiMappingGroupRequest @typing.final class GetKpiMappingGroupRequest(google.protobuf.message.Message): """Request message to GetKpiMappingGroup.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'Resource name of Kpi mapping group to retrieve.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """Resource name of Kpi mapping group to retrieve.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetKpiMappingGroupRequest = GetKpiMappingGroupRequest @typing.final class ListKpiMappingGroupsRequest(google.protobuf.message.Message): """Request message to ListKpiMappingGroups.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int TYPE_FIELD_NUMBER: builtins.int COMPANIES_FIELD_NUMBER: builtins.int @@ -61,16 +71,18 @@ class ListKpiMappingGroupsRequest(google.protobuf.message.Message): PAGE_TOKEN_FIELD_NUMBER: builtins.int SKIP_FIELD_NUMBER: builtins.int parent: builtins.str - 'Resource name of Kpi mapping to list groups for.' + """Resource name of Kpi mapping to list groups for.""" type: exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroupType.ValueType - 'KPI mapping group types to list.' + """KPI mapping group types to list.""" page_size: builtins.int - 'The page size. Default is 100 and max is 1000.' + """The page size. Default is 100 and max is 1000.""" page_token: builtins.str - 'A page token, received from the previous call to list Kpi mapping groups.' + """A page token, received from the previous call to list Kpi mapping groups.""" skip: builtins.int - 'Number of KPI mapping groups to skip relative to page_token. Negative value is allowed.\n Skipping past end of list will return no groups.\n Skipping past start of list will return groups from start of list.\n ' - + """Number of KPI mapping groups to skip relative to page_token. Negative value is allowed. + Skipping past end of list will return no groups. + Skipping past start of list will return groups from start of list. + """ @property def companies(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Companies to retrieve groups for. If no companies are specified, results for all companies are @@ -78,43 +90,58 @@ class ListKpiMappingGroupsRequest(google.protobuf.message.Message): Example: `"entityTypes/company/entities/F_67890-E"`. """ - def __init__(self, *, parent: builtins.str | None=..., type: exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroupType.ValueType | None=..., companies: collections.abc.Iterable[builtins.str] | None=..., page_size: builtins.int | None=..., page_token: builtins.str | None=..., skip: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + type: exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroupType.ValueType | None = ..., + companies: collections.abc.Iterable[builtins.str] | None = ..., + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + skip: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["companies", b"companies", "page_size", b"page_size", "page_token", b"page_token", "parent", b"parent", "skip", b"skip", "type", b"type"]) -> None: ... - def ClearField(self, field_name: typing.Literal['companies', b'companies', 'page_size', b'page_size', 'page_token', b'page_token', 'parent', b'parent', 'skip', b'skip', 'type', b'type']) -> None: - ... global___ListKpiMappingGroupsRequest = ListKpiMappingGroupsRequest @typing.final class ListKpiMappingGroupsResponse(google.protobuf.message.Message): """Response message to ListKpiMappingGroups.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + GROUPS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the token is empty.\n ' + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the token is empty. + """ total_size: builtins.int - 'Total number of KPI mapping groups for this request.' - + """Total number of KPI mapping groups for this request.""" @property def groups(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup]: """List of KPI mappings groups.""" - def __init__(self, *, groups: collections.abc.Iterable[exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + groups: collections.abc.Iterable[exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["groups", b"groups", "next_page_token", b"next_page_token", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['groups', b'groups', 'next_page_token', b'next_page_token', 'total_size', b'total_size']) -> None: - ... global___ListKpiMappingGroupsResponse = ListKpiMappingGroupsResponse @typing.final class UpdateKpiMappingGroupRequest(google.protobuf.message.Message): """Request message to UpdateKpiMappingGroup.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + KPI_MAPPING_GROUP_FIELD_NUMBER: builtins.int UPDATE_MASK_FIELD_NUMBER: builtins.int - @property def kpi_mapping_group(self) -> exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup: """KpiMappingGroup to update.""" @@ -127,12 +154,13 @@ class UpdateKpiMappingGroupRequest(google.protobuf.message.Message): For REST requests, this is a comma-separated string. """ - def __init__(self, *, kpi_mapping_group: exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['kpi_mapping_group', b'kpi_mapping_group', 'update_mask', b'update_mask']) -> builtins.bool: - ... + def __init__( + self, + *, + kpi_mapping_group: exabel.api.analytics.v1.kpi_mapping_messages_pb2.KpiMappingGroup | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kpi_mapping_group", b"kpi_mapping_group", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kpi_mapping_group", b"kpi_mapping_group", "update_mask", b"update_mask"]) -> None: ... - def ClearField(self, field_name: typing.Literal['kpi_mapping_group', b'kpi_mapping_group', 'update_mask', b'update_mask']) -> None: - ... -global___UpdateKpiMappingGroupRequest = UpdateKpiMappingGroupRequest \ No newline at end of file +global___UpdateKpiMappingGroupRequest = UpdateKpiMappingGroupRequest diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2_grpc.py new file mode 100644 index 00000000..8c8c7cff --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2_grpc.py @@ -0,0 +1,234 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import kpi_mapping_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2 +from . import kpi_mapping_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/kpi_mapping_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class KpiMappingServiceStub(object): + """Service for managing KPI mapping groups. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateKpiMappingGroup = channel.unary_unary( + '/exabel.api.analytics.v1.KpiMappingService/CreateKpiMappingGroup', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.CreateKpiMappingGroupRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, + _registered_method=True) + self.GetKpiMappingGroup = channel.unary_unary( + '/exabel.api.analytics.v1.KpiMappingService/GetKpiMappingGroup', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.GetKpiMappingGroupRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, + _registered_method=True) + self.ListKpiMappingGroups = channel.unary_unary( + '/exabel.api.analytics.v1.KpiMappingService/ListKpiMappingGroups', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsResponse.FromString, + _registered_method=True) + self.UpdateKpiMappingGroup = channel.unary_unary( + '/exabel.api.analytics.v1.KpiMappingService/UpdateKpiMappingGroup', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.UpdateKpiMappingGroupRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, + _registered_method=True) + + +class KpiMappingServiceServicer(object): + """Service for managing KPI mapping groups. + """ + + def CreateKpiMappingGroup(self, request, context): + """Create a KPI mapping group. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetKpiMappingGroup(self, request, context): + """Retrieve a KPI mapping group. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListKpiMappingGroups(self, request, context): + """List KPI mapping groups for a KPI mapping. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateKpiMappingGroup(self, request, context): + """Update a KPI mapping group. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_KpiMappingServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'CreateKpiMappingGroup': grpc.unary_unary_rpc_method_handler( + servicer.CreateKpiMappingGroup, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.CreateKpiMappingGroupRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.SerializeToString, + ), + 'GetKpiMappingGroup': grpc.unary_unary_rpc_method_handler( + servicer.GetKpiMappingGroup, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.GetKpiMappingGroupRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.SerializeToString, + ), + 'ListKpiMappingGroups': grpc.unary_unary_rpc_method_handler( + servicer.ListKpiMappingGroups, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsResponse.SerializeToString, + ), + 'UpdateKpiMappingGroup': grpc.unary_unary_rpc_method_handler( + servicer.UpdateKpiMappingGroup, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.UpdateKpiMappingGroupRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.analytics.v1.KpiMappingService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.analytics.v1.KpiMappingService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class KpiMappingService(object): + """Service for managing KPI mapping groups. + """ + + @staticmethod + def CreateKpiMappingGroup(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiMappingService/CreateKpiMappingGroup', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.CreateKpiMappingGroupRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetKpiMappingGroup(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiMappingService/GetKpiMappingGroup', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.GetKpiMappingGroupRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListKpiMappingGroups(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiMappingService/ListKpiMappingGroups', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateKpiMappingGroup(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiMappingService/UpdateKpiMappingGroup', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.UpdateKpiMappingGroupRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2.py b/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2.py new file mode 100644 index 00000000..8a912a73 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/kpi_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/kpi_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ...time import date_pb2 as exabel_dot_api_dot_time_dot_date__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/analytics/v1/kpi_messages.proto\x12\x17\x65xabel.api.analytics.v1\x1a\x1a\x65xabel/api/time/date.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9a\x01\n\x18\x43ompanyKpiMappingResults\x12\x30\n\x06\x65ntity\x18\x01 \x01(\x0b\x32 .exabel.api.analytics.v1.Company\x12L\n\x0bkpi_results\x18\x02 \x03(\x0b\x32\x37.exabel.api.analytics.v1.SingleCompanyKpiMappingResults\"G\n\x07\x43ompany\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x18\n\x10\x62loomberg_ticker\x18\x03 \x01(\t\"\x88\x01\n\x1eSingleCompanyKpiMappingResults\x12)\n\x03kpi\x18\x01 \x01(\x0b\x32\x1c.exabel.api.analytics.v1.Kpi\x12;\n\x04\x64\x61ta\x18\x02 \x03(\x0b\x32-.exabel.api.analytics.v1.KpiMappingResultData\"\x87\x01\n\x03Kpi\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x12\n\x05value\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x11\n\x04\x66req\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08is_ratio\x18\x05 \x01(\x08H\x02\x88\x01\x01\x42\x08\n\x06_valueB\x07\n\x05_freqB\x0b\n\t_is_ratio\"\x8b\x07\n\x14KpiMappingResultData\x12\x41\n\x06source\x18\x01 \x01(\x0b\x32\x31.exabel.api.analytics.v1.KpiMappingGroupReference\x12\x17\n\nmodel_mape\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x16\n\tmodel_mae\x18\x03 \x01(\x01H\x01\x88\x01\x01\x12\x1b\n\x0emodel_hit_rate\x18\x04 \x01(\x01H\x02\x88\x01\x01\x12<\n\rmodel_quality\x18\x0f \x01(\x0e\x32%.exabel.api.analytics.v1.ModelQuality\x12.\n\x0flast_value_date\x18\x05 \x01(\x0b\x32\x15.exabel.api.time.Date\x12\"\n\x15number_of_data_points\x18\x06 \x01(\x05H\x03\x88\x01\x01\x12#\n\x16period_over_period_mae\x18\x07 \x01(\x01H\x04\x88\x01\x01\x12\x1f\n\x12year_over_year_mae\x18\x08 \x01(\x01H\x05\x88\x01\x01\x12!\n\x14\x61\x62solute_correlation\x18\t \x01(\x01H\x06\x88\x01\x01\x12+\n\x1eperiod_over_period_correlation\x18\n \x01(\x01H\x07\x88\x01\x01\x12\'\n\x1ayear_over_year_correlation\x18\x0b \x01(\x01H\x08\x88\x01\x01\x12\x1d\n\x10\x61\x62solute_p_value\x18\x0c \x01(\x01H\t\x88\x01\x01\x12\'\n\x1aperiod_over_period_p_value\x18\r \x01(\x01H\n\x88\x01\x01\x12#\n\x16year_over_year_p_value\x18\x0e \x01(\x01H\x0b\x88\x01\x01\x42\r\n\x0b_model_mapeB\x0c\n\n_model_maeB\x11\n\x0f_model_hit_rateB\x18\n\x16_number_of_data_pointsB\x19\n\x17_period_over_period_maeB\x15\n\x13_year_over_year_maeB\x17\n\x15_absolute_correlationB!\n\x1f_period_over_period_correlationB\x1d\n\x1b_year_over_year_correlationB\x13\n\x11_absolute_p_valueB\x1d\n\x1b_period_over_period_p_valueB\x19\n\x17_year_over_year_p_value\"[\n\x18KpiMappingGroupReference\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1b\n\x13vendor_display_name\x18\x03 \x01(\t\"\xcb\x01\n\x15\x43ompanyKpiModelResult\x12)\n\x03kpi\x18\x01 \x01(\x0b\x32\x1c.exabel.api.analytics.v1.Kpi\x12\x30\n\x05model\x18\x02 \x01(\x0b\x32!.exabel.api.analytics.v1.KpiModel\x12!\n\x19\x61\x63\x63\x65ssible_mappings_count\x18\x03 \x01(\x05\x12\x1c\n\x14total_mappings_count\x18\x04 \x01(\x05\x12\x14\n\x0cmodels_count\x18\x05 \x01(\x05\"\xc6\x02\n\x08KpiModel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x05\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x33\n\x04\x64\x61ta\x18\x04 \x01(\x0b\x32%.exabel.api.analytics.v1.KpiModelData\x12>\n\x07weights\x18\x05 \x01(\x0b\x32-.exabel.api.analytics.v1.KpiModelWeightGroups\x12\x39\n\nmodel_runs\x18\x06 \x01(\x0b\x32%.exabel.api.analytics.v1.KpiModelRuns\x12Z\n\x1dhierarchical_model_kpi_source\x18\x07 \x01(\x0b\x32\x33.exabel.api.analytics.v1.HierarchicalModelKpiSource\"\xed\x01\n\x1aHierarchicalModelKpiSource\x12`\n\x04type\x18\x01 \x01(\x0e\x32R.exabel.api.analytics.v1.HierarchicalModelKpiSource.HierarchicalModelKpiSourceType\x12\r\n\x05model\x18\x02 \x01(\t\"^\n\x1eHierarchicalModelKpiSourceType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\t\n\x05MODEL\x10\x01\x12\r\n\tCONSENSUS\x10\x02\x12\x11\n\rFREE_VARIABLE\x10\x03\"\xc2\x01\n\x0cKpiModelRuns\x12\x39\n\x0binitial_run\x18\x01 \x01(\x0b\x32$.exabel.api.analytics.v1.KpiModelRun\x12\x37\n\tdaily_run\x18\x02 \x01(\x0b\x32$.exabel.api.analytics.v1.KpiModelRun\x12>\n\x10pit_backtest_run\x18\x03 \x01(\x0b\x32$.exabel.api.analytics.v1.KpiModelRun\"\xbc\x01\n\x0bKpiModelRun\x12.\n\ncreated_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nstarted_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x66inished_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\x05\x65rror\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_error\"\x93\x01\n\x0fKpiMappingModel\x12\x41\n\x06source\x18\x01 \x01(\x0b\x32\x31.exabel.api.analytics.v1.KpiMappingGroupReference\x12=\n\x0ekpi_model_data\x18\x02 \x01(\x0b\x32%.exabel.api.analytics.v1.KpiModelData\"\x8a\x07\n\x0cKpiModelData\x12\x17\n\nprediction\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x1f\n\x12prediction_yoy_rel\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x1f\n\x12prediction_yoy_abs\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x16\n\tconsensus\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x1e\n\x11\x63onsensus_yoy_rel\x18\x05 \x01(\x01H\x04\x88\x01\x01\x12\x1e\n\x11\x63onsensus_yoy_abs\x18\x06 \x01(\x01H\x05\x88\x01\x01\x12\x16\n\tdelta_abs\x18\x07 \x01(\x01H\x06\x88\x01\x01\x12\x16\n\tdelta_rel\x18\x08 \x01(\x01H\x07\x88\x01\x01\x12\x1b\n\x0e\x64\x65lta_by_error\x18\t \x01(\x01H\x08\x88\x01\x01\x12<\n\rmodel_quality\x18\n \x01(\x0e\x32%.exabel.api.analytics.v1.ModelQuality\x12\x11\n\x04mape\x18\x0b \x01(\x01H\t\x88\x01\x01\x12\x15\n\x08mape_pit\x18\x0c \x01(\x01H\n\x88\x01\x01\x12\x10\n\x03mae\x18\r \x01(\x01H\x0b\x88\x01\x01\x12\x14\n\x07mae_pit\x18\x0e \x01(\x01H\x0c\x88\x01\x01\x12\x18\n\x0b\x65rror_count\x18\x13 \x01(\x05H\r\x88\x01\x01\x12\x15\n\x08hit_rate\x18\x0f \x01(\x01H\x0e\x88\x01\x01\x12\x1b\n\x0ehit_rate_count\x18\x14 \x01(\x05H\x0f\x88\x01\x01\x12\x1c\n\x0frevision_1_week\x18\x10 \x01(\x01H\x10\x88\x01\x01\x12\x1d\n\x10revision_1_month\x18\x11 \x01(\x01H\x11\x88\x01\x01\x12\'\n\x04\x64\x61te\x18\x12 \x01(\x0b\x32\x15.exabel.api.time.DateB\x02\x18\x01\x12\r\n\x05\x65rror\x18\x64 \x01(\tB\r\n\x0b_predictionB\x15\n\x13_prediction_yoy_relB\x15\n\x13_prediction_yoy_absB\x0c\n\n_consensusB\x14\n\x12_consensus_yoy_relB\x14\n\x12_consensus_yoy_absB\x0c\n\n_delta_absB\x0c\n\n_delta_relB\x11\n\x0f_delta_by_errorB\x07\n\x05_mapeB\x0b\n\t_mape_pitB\x06\n\x04_maeB\n\n\x08_mae_pitB\x0e\n\x0c_error_countB\x0b\n\t_hit_rateB\x11\n\x0f_hit_rate_countB\x12\n\x10_revision_1_weekB\x13\n\x11_revision_1_month\"t\n\x14KpiModelWeightGroups\x12\x43\n\rweight_groups\x18\x01 \x03(\x0b\x32,.exabel.api.analytics.v1.KpiModelWeightGroup\x12\x17\n\x0fis_coefficients\x18\x02 \x01(\x08\"\xb6\x01\n\x13KpiModelWeightGroup\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12@\n\x05group\x18\x02 \x01(\x0b\x32\x31.exabel.api.analytics.v1.KpiMappingGroupReference\x12G\n\x0f\x66\x65\x61ture_weights\x18\x03 \x03(\x0b\x32..exabel.api.analytics.v1.KpiModelFeatureWeight\"M\n\x15KpiModelFeatureWeight\x12\x13\n\x06weight\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\tB\t\n\x07_weight\"\x81\x01\n\x0c\x46iscalPeriod\x12\'\n\x08\x65nd_date\x18\x01 \x01(\x0b\x32\x15.exabel.api.time.Date\x12\x12\n\x05label\x18\x02 \x01(\tH\x00\x88\x01\x01\x12*\n\x0breport_date\x18\x03 \x01(\x0b\x32\x15.exabel.api.time.DateB\x08\n\x06_label\"\xa1\x01\n\x14\x46iscalPeriodSelector\x12P\n\x11relative_selector\x18\x01 \x01(\x0e\x32\x35.exabel.api.analytics.v1.RelativeFiscalPeriodSelector\x12)\n\nperiod_end\x18\x02 \x01(\x0b\x32\x15.exabel.api.time.Date\x12\x0c\n\x04\x66req\x18\x03 \x01(\t\"d\n\x0cKpiHierarchy\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x66req\x18\x02 \x01(\t\x12\x38\n\tbreakdown\x18\x03 \x01(\x0b\x32%.exabel.api.analytics.v1.KpiBreakdown\"G\n\x0cKpiBreakdown\x12\x37\n\x04kpis\x18\x01 \x03(\x0b\x32).exabel.api.analytics.v1.KpiBreakdownNode\"\x99\x01\n\x10KpiBreakdownNode\x12+\n\x03kpi\x18\x01 \x01(\x0b\x32\x1c.exabel.api.analytics.v1.KpiH\x00\x12\x10\n\x06header\x18\x02 \x01(\tH\x00\x12;\n\x08\x63hildren\x18\x03 \x03(\x0b\x32).exabel.api.analytics.v1.KpiBreakdownNodeB\t\n\x07\x63ontent\"\xca\x01\n\x16KpiScreenCompanyResult\x12\x31\n\x07\x63ompany\x18\x01 \x01(\x0b\x32 .exabel.api.analytics.v1.Company\x12<\n\rfiscal_period\x18\x02 \x01(\x0b\x32%.exabel.api.analytics.v1.FiscalPeriod\x12?\n\x07results\x18\x03 \x03(\x0b\x32..exabel.api.analytics.v1.CompanyKpiModelResult*x\n\tKpiSource\x12\x1a\n\x16KPI_SOURCE_UNSPECIFIED\x10\x00\x12\x1c\n\x18KPI_SOURCE_VISIBLE_ALPHA\x10\x01\x12\x16\n\x12KPI_SOURCE_FACTSET\x10\x02\x12\x19\n\x15KPI_SOURCE_CUSTOM_KPI\x10\x03*\x93\x01\n\x0cModelQuality\x12\x1d\n\x19MODEL_QUALITY_UNSPECIFIED\x10\x00\x12\x15\n\x11MODEL_QUALITY_LOW\x10\n\x12\x18\n\x14MODEL_QUALITY_MEDIUM\x10\x14\x12\x16\n\x12MODEL_QUALITY_HIGH\x10\x1e\x12\x1b\n\x17MODEL_QUALITY_VERY_HIGH\x10(*t\n\x1cRelativeFiscalPeriodSelector\x12/\n+RELATIVE_FISCAL_PERIOD_SELECTOR_UNSPECIFIED\x10\x00\x12\x0c\n\x08PREVIOUS\x10\x01\x12\x0b\n\x07\x43URRENT\x10\x02\x12\x08\n\x04NEXT\x10\x03\x42N\n\x1b\x63om.exabel.api.analytics.v1B\x10KpiMessagesProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.kpi_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\020KpiMessagesProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_KPIMODELDATA'].fields_by_name['date']._loaded_options = None + _globals['_KPIMODELDATA'].fields_by_name['date']._serialized_options = b'\030\001' + _globals['_KPISOURCE']._serialized_start=5078 + _globals['_KPISOURCE']._serialized_end=5198 + _globals['_MODELQUALITY']._serialized_start=5201 + _globals['_MODELQUALITY']._serialized_end=5348 + _globals['_RELATIVEFISCALPERIODSELECTOR']._serialized_start=5350 + _globals['_RELATIVEFISCALPERIODSELECTOR']._serialized_end=5466 + _globals['_COMPANYKPIMAPPINGRESULTS']._serialized_start=133 + _globals['_COMPANYKPIMAPPINGRESULTS']._serialized_end=287 + _globals['_COMPANY']._serialized_start=289 + _globals['_COMPANY']._serialized_end=360 + _globals['_SINGLECOMPANYKPIMAPPINGRESULTS']._serialized_start=363 + _globals['_SINGLECOMPANYKPIMAPPINGRESULTS']._serialized_end=499 + _globals['_KPI']._serialized_start=502 + _globals['_KPI']._serialized_end=637 + _globals['_KPIMAPPINGRESULTDATA']._serialized_start=640 + _globals['_KPIMAPPINGRESULTDATA']._serialized_end=1547 + _globals['_KPIMAPPINGGROUPREFERENCE']._serialized_start=1549 + _globals['_KPIMAPPINGGROUPREFERENCE']._serialized_end=1640 + _globals['_COMPANYKPIMODELRESULT']._serialized_start=1643 + _globals['_COMPANYKPIMODELRESULT']._serialized_end=1846 + _globals['_KPIMODEL']._serialized_start=1849 + _globals['_KPIMODEL']._serialized_end=2175 + _globals['_HIERARCHICALMODELKPISOURCE']._serialized_start=2178 + _globals['_HIERARCHICALMODELKPISOURCE']._serialized_end=2415 + _globals['_HIERARCHICALMODELKPISOURCE_HIERARCHICALMODELKPISOURCETYPE']._serialized_start=2321 + _globals['_HIERARCHICALMODELKPISOURCE_HIERARCHICALMODELKPISOURCETYPE']._serialized_end=2415 + _globals['_KPIMODELRUNS']._serialized_start=2418 + _globals['_KPIMODELRUNS']._serialized_end=2612 + _globals['_KPIMODELRUN']._serialized_start=2615 + _globals['_KPIMODELRUN']._serialized_end=2803 + _globals['_KPIMAPPINGMODEL']._serialized_start=2806 + _globals['_KPIMAPPINGMODEL']._serialized_end=2953 + _globals['_KPIMODELDATA']._serialized_start=2956 + _globals['_KPIMODELDATA']._serialized_end=3862 + _globals['_KPIMODELWEIGHTGROUPS']._serialized_start=3864 + _globals['_KPIMODELWEIGHTGROUPS']._serialized_end=3980 + _globals['_KPIMODELWEIGHTGROUP']._serialized_start=3983 + _globals['_KPIMODELWEIGHTGROUP']._serialized_end=4165 + _globals['_KPIMODELFEATUREWEIGHT']._serialized_start=4167 + _globals['_KPIMODELFEATUREWEIGHT']._serialized_end=4244 + _globals['_FISCALPERIOD']._serialized_start=4247 + _globals['_FISCALPERIOD']._serialized_end=4376 + _globals['_FISCALPERIODSELECTOR']._serialized_start=4379 + _globals['_FISCALPERIODSELECTOR']._serialized_end=4540 + _globals['_KPIHIERARCHY']._serialized_start=4542 + _globals['_KPIHIERARCHY']._serialized_end=4642 + _globals['_KPIBREAKDOWN']._serialized_start=4644 + _globals['_KPIBREAKDOWN']._serialized_end=4715 + _globals['_KPIBREAKDOWNNODE']._serialized_start=4718 + _globals['_KPIBREAKDOWNNODE']._serialized_end=4871 + _globals['_KPISCREENCOMPANYRESULT']._serialized_start=4874 + _globals['_KPISCREENCOMPANYRESULT']._serialized_end=5076 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2.pyi new file mode 100644 index 00000000..12b65132 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2.pyi @@ -0,0 +1,1078 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2025 Exabel AS. All rights reserved.""" + +import builtins +import collections.abc +from ...time import date_pb2 +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import google.protobuf.timestamp_pb2 +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _KpiSource: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _KpiSourceEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_KpiSource.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + KPI_SOURCE_UNSPECIFIED: _KpiSource.ValueType # 0 + """Unspecified.""" + KPI_SOURCE_VISIBLE_ALPHA: _KpiSource.ValueType # 1 + """Visible Alpha.""" + KPI_SOURCE_FACTSET: _KpiSource.ValueType # 2 + """FactSet.""" + KPI_SOURCE_CUSTOM_KPI: _KpiSource.ValueType # 3 + """Custom KPI.""" + +class KpiSource(_KpiSource, metaclass=_KpiSourceEnumTypeWrapper): + """KPI source.""" + +KPI_SOURCE_UNSPECIFIED: KpiSource.ValueType # 0 +"""Unspecified.""" +KPI_SOURCE_VISIBLE_ALPHA: KpiSource.ValueType # 1 +"""Visible Alpha.""" +KPI_SOURCE_FACTSET: KpiSource.ValueType # 2 +"""FactSet.""" +KPI_SOURCE_CUSTOM_KPI: KpiSource.ValueType # 3 +"""Custom KPI.""" +global___KpiSource = KpiSource + +class _ModelQuality: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ModelQualityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ModelQuality.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + MODEL_QUALITY_UNSPECIFIED: _ModelQuality.ValueType # 0 + """Unspecified.""" + MODEL_QUALITY_LOW: _ModelQuality.ValueType # 10 + """Low quality.""" + MODEL_QUALITY_MEDIUM: _ModelQuality.ValueType # 20 + """Medium quality.""" + MODEL_QUALITY_HIGH: _ModelQuality.ValueType # 30 + """High quality.""" + MODEL_QUALITY_VERY_HIGH: _ModelQuality.ValueType # 40 + """Very high quality.""" + +class ModelQuality(_ModelQuality, metaclass=_ModelQualityEnumTypeWrapper): + """Model quality.""" + +MODEL_QUALITY_UNSPECIFIED: ModelQuality.ValueType # 0 +"""Unspecified.""" +MODEL_QUALITY_LOW: ModelQuality.ValueType # 10 +"""Low quality.""" +MODEL_QUALITY_MEDIUM: ModelQuality.ValueType # 20 +"""Medium quality.""" +MODEL_QUALITY_HIGH: ModelQuality.ValueType # 30 +"""High quality.""" +MODEL_QUALITY_VERY_HIGH: ModelQuality.ValueType # 40 +"""Very high quality.""" +global___ModelQuality = ModelQuality + +class _RelativeFiscalPeriodSelector: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _RelativeFiscalPeriodSelectorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_RelativeFiscalPeriodSelector.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + RELATIVE_FISCAL_PERIOD_SELECTOR_UNSPECIFIED: _RelativeFiscalPeriodSelector.ValueType # 0 + """Unspecified.""" + PREVIOUS: _RelativeFiscalPeriodSelector.ValueType # 1 + """Last reported fiscal period.""" + CURRENT: _RelativeFiscalPeriodSelector.ValueType # 2 + """Current unreported fiscal period.""" + NEXT: _RelativeFiscalPeriodSelector.ValueType # 3 + """Next unreported fiscal period.""" + +class RelativeFiscalPeriodSelector(_RelativeFiscalPeriodSelector, metaclass=_RelativeFiscalPeriodSelectorEnumTypeWrapper): + """Selector for a relative fiscal period.""" + +RELATIVE_FISCAL_PERIOD_SELECTOR_UNSPECIFIED: RelativeFiscalPeriodSelector.ValueType # 0 +"""Unspecified.""" +PREVIOUS: RelativeFiscalPeriodSelector.ValueType # 1 +"""Last reported fiscal period.""" +CURRENT: RelativeFiscalPeriodSelector.ValueType # 2 +"""Current unreported fiscal period.""" +NEXT: RelativeFiscalPeriodSelector.ValueType # 3 +"""Next unreported fiscal period.""" +global___RelativeFiscalPeriodSelector = RelativeFiscalPeriodSelector + +@typing.final +class CompanyKpiMappingResults(google.protobuf.message.Message): + """KPI mapping results for a single company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ENTITY_FIELD_NUMBER: builtins.int + KPI_RESULTS_FIELD_NUMBER: builtins.int + @property + def entity(self) -> global___Company: + """The company these results apply to.""" + + @property + def kpi_results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SingleCompanyKpiMappingResults]: + """The results for each KPI.""" + + def __init__( + self, + *, + entity: global___Company | None = ..., + kpi_results: collections.abc.Iterable[global___SingleCompanyKpiMappingResults] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["entity", b"entity"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["entity", b"entity", "kpi_results", b"kpi_results"]) -> None: ... + +global___CompanyKpiMappingResults = CompanyKpiMappingResults + +@typing.final +class Company(google.protobuf.message.Message): + """A company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + BLOOMBERG_TICKER_FIELD_NUMBER: builtins.int + name: builtins.str + """The resource name of the company.""" + display_name: builtins.str + """The display name of the company.""" + bloomberg_ticker: builtins.str + """The bloomberg ticker of the company.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + bloomberg_ticker: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["bloomberg_ticker", b"bloomberg_ticker", "display_name", b"display_name", "name", b"name"]) -> None: ... + +global___Company = Company + +@typing.final +class SingleCompanyKpiMappingResults(google.protobuf.message.Message): + """KPI mapping results for a single company KPI.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KPI_FIELD_NUMBER: builtins.int + DATA_FIELD_NUMBER: builtins.int + @property + def kpi(self) -> global___Kpi: + """The KPI.""" + + @property + def data(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiMappingResultData]: + """The KPI mapping results for this KPI.""" + + def __init__( + self, + *, + kpi: global___Kpi | None = ..., + data: collections.abc.Iterable[global___KpiMappingResultData] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kpi", b"kpi"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["data", b"data", "kpi", b"kpi"]) -> None: ... + +global___SingleCompanyKpiMappingResults = SingleCompanyKpiMappingResults + +@typing.final +class Kpi(google.protobuf.message.Message): + """A KPI.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TYPE_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + FREQ_FIELD_NUMBER: builtins.int + IS_RATIO_FIELD_NUMBER: builtins.int + type: builtins.str + """The type of the KPI. A KPI is one of the following types: + - `FACTSET_ESTIMATES`: FactSet actuals/estimates. + - `FACTSET_FUNDAMENTALS`: FactSet fundamentals. + - `FACTSET_SEGMENTS`: FactSet segments. + - `VISIBLE_ALPHA_STANDARD_KPI`: Visible Alpha standard KPI. + - `CUSTOM_KPI`: Custom KPI. + """ + value: builtins.str + """A value which is dependent on the type: + - `FACTSET_ESTIMATES`: Reporting number, e.g. `SALES`. + - `FACTSET_FUNDAMENTALS`: Reporting number, e.g. `SALES`. + - `FACTSET_SEGMENTS`: Factset segment resource name, e.g. `entityTypes/geo_segment/entities/factset.segment_123`. + - `VISIBLE_ALPHA_STANDARD_KPI`: Line item parameter id. For example, the "Total revenue" parameter has a parameter id of `190`. + - `CUSTOM_KPI`: Custom KPI id. For example, `1234`. + """ + display_name: builtins.str + """The display name of the KPI.""" + freq: builtins.str + """A textual representation of the KPI frequency. Either `FQ`, `FS` or `FY`.""" + is_ratio: builtins.bool + """Whether this KPI is a ratio or not.""" + def __init__( + self, + *, + type: builtins.str | None = ..., + value: builtins.str | None = ..., + display_name: builtins.str | None = ..., + freq: builtins.str | None = ..., + is_ratio: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_freq", b"_freq", "_is_ratio", b"_is_ratio", "_value", b"_value", "freq", b"freq", "is_ratio", b"is_ratio", "value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_freq", b"_freq", "_is_ratio", b"_is_ratio", "_value", b"_value", "display_name", b"display_name", "freq", b"freq", "is_ratio", b"is_ratio", "type", b"type", "value", b"value"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_freq", b"_freq"]) -> typing.Literal["freq"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_is_ratio", b"_is_ratio"]) -> typing.Literal["is_ratio"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_value", b"_value"]) -> typing.Literal["value"] | None: ... + +global___Kpi = Kpi + +@typing.final +class KpiMappingResultData(google.protobuf.message.Message): + """Data for a KPI mapping result.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + SOURCE_FIELD_NUMBER: builtins.int + MODEL_MAPE_FIELD_NUMBER: builtins.int + MODEL_MAE_FIELD_NUMBER: builtins.int + MODEL_HIT_RATE_FIELD_NUMBER: builtins.int + MODEL_QUALITY_FIELD_NUMBER: builtins.int + LAST_VALUE_DATE_FIELD_NUMBER: builtins.int + NUMBER_OF_DATA_POINTS_FIELD_NUMBER: builtins.int + PERIOD_OVER_PERIOD_MAE_FIELD_NUMBER: builtins.int + YEAR_OVER_YEAR_MAE_FIELD_NUMBER: builtins.int + ABSOLUTE_CORRELATION_FIELD_NUMBER: builtins.int + PERIOD_OVER_PERIOD_CORRELATION_FIELD_NUMBER: builtins.int + YEAR_OVER_YEAR_CORRELATION_FIELD_NUMBER: builtins.int + ABSOLUTE_P_VALUE_FIELD_NUMBER: builtins.int + PERIOD_OVER_PERIOD_P_VALUE_FIELD_NUMBER: builtins.int + YEAR_OVER_YEAR_P_VALUE_FIELD_NUMBER: builtins.int + model_mape: builtins.float + """Mean absolute percentage error for a model built using this proxy.""" + model_mae: builtins.float + """Mean absolute error for a model built using this proxy.""" + model_hit_rate: builtins.float + """Hit rate for a model built using this proxy.""" + model_quality: global___ModelQuality.ValueType + """Model quality for a model built using this proxy.""" + number_of_data_points: builtins.int + """Number of data points (after resampling). + This is the number of data points where both the KPI and the proxy have data. + """ + period_over_period_mae: builtins.float + """Period-over-period mean absolute error.""" + year_over_year_mae: builtins.float + """Year-over-year mean absolute error.""" + absolute_correlation: builtins.float + """Absolute correlation.""" + period_over_period_correlation: builtins.float + """Period-over-period correlation.""" + year_over_year_correlation: builtins.float + """Year-over-year correlation.""" + absolute_p_value: builtins.float + """Absolute P-value.""" + period_over_period_p_value: builtins.float + """Period-over-period P-value.""" + year_over_year_p_value: builtins.float + """Year-over-year P-value.""" + @property + def source(self) -> global___KpiMappingGroupReference: + """The KPI mapping group from which this result originates""" + + @property + def last_value_date(self) -> exabel.api.time.date_pb2.Date: + """The date of the last observed proxy value.""" + + def __init__( + self, + *, + source: global___KpiMappingGroupReference | None = ..., + model_mape: builtins.float | None = ..., + model_mae: builtins.float | None = ..., + model_hit_rate: builtins.float | None = ..., + model_quality: global___ModelQuality.ValueType | None = ..., + last_value_date: exabel.api.time.date_pb2.Date | None = ..., + number_of_data_points: builtins.int | None = ..., + period_over_period_mae: builtins.float | None = ..., + year_over_year_mae: builtins.float | None = ..., + absolute_correlation: builtins.float | None = ..., + period_over_period_correlation: builtins.float | None = ..., + year_over_year_correlation: builtins.float | None = ..., + absolute_p_value: builtins.float | None = ..., + period_over_period_p_value: builtins.float | None = ..., + year_over_year_p_value: builtins.float | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_absolute_correlation", b"_absolute_correlation", "_absolute_p_value", b"_absolute_p_value", "_model_hit_rate", b"_model_hit_rate", "_model_mae", b"_model_mae", "_model_mape", b"_model_mape", "_number_of_data_points", b"_number_of_data_points", "_period_over_period_correlation", b"_period_over_period_correlation", "_period_over_period_mae", b"_period_over_period_mae", "_period_over_period_p_value", b"_period_over_period_p_value", "_year_over_year_correlation", b"_year_over_year_correlation", "_year_over_year_mae", b"_year_over_year_mae", "_year_over_year_p_value", b"_year_over_year_p_value", "absolute_correlation", b"absolute_correlation", "absolute_p_value", b"absolute_p_value", "last_value_date", b"last_value_date", "model_hit_rate", b"model_hit_rate", "model_mae", b"model_mae", "model_mape", b"model_mape", "number_of_data_points", b"number_of_data_points", "period_over_period_correlation", b"period_over_period_correlation", "period_over_period_mae", b"period_over_period_mae", "period_over_period_p_value", b"period_over_period_p_value", "source", b"source", "year_over_year_correlation", b"year_over_year_correlation", "year_over_year_mae", b"year_over_year_mae", "year_over_year_p_value", b"year_over_year_p_value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_absolute_correlation", b"_absolute_correlation", "_absolute_p_value", b"_absolute_p_value", "_model_hit_rate", b"_model_hit_rate", "_model_mae", b"_model_mae", "_model_mape", b"_model_mape", "_number_of_data_points", b"_number_of_data_points", "_period_over_period_correlation", b"_period_over_period_correlation", "_period_over_period_mae", b"_period_over_period_mae", "_period_over_period_p_value", b"_period_over_period_p_value", "_year_over_year_correlation", b"_year_over_year_correlation", "_year_over_year_mae", b"_year_over_year_mae", "_year_over_year_p_value", b"_year_over_year_p_value", "absolute_correlation", b"absolute_correlation", "absolute_p_value", b"absolute_p_value", "last_value_date", b"last_value_date", "model_hit_rate", b"model_hit_rate", "model_mae", b"model_mae", "model_mape", b"model_mape", "model_quality", b"model_quality", "number_of_data_points", b"number_of_data_points", "period_over_period_correlation", b"period_over_period_correlation", "period_over_period_mae", b"period_over_period_mae", "period_over_period_p_value", b"period_over_period_p_value", "source", b"source", "year_over_year_correlation", b"year_over_year_correlation", "year_over_year_mae", b"year_over_year_mae", "year_over_year_p_value", b"year_over_year_p_value"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_absolute_correlation", b"_absolute_correlation"]) -> typing.Literal["absolute_correlation"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_absolute_p_value", b"_absolute_p_value"]) -> typing.Literal["absolute_p_value"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_model_hit_rate", b"_model_hit_rate"]) -> typing.Literal["model_hit_rate"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_model_mae", b"_model_mae"]) -> typing.Literal["model_mae"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_model_mape", b"_model_mape"]) -> typing.Literal["model_mape"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_number_of_data_points", b"_number_of_data_points"]) -> typing.Literal["number_of_data_points"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_period_over_period_correlation", b"_period_over_period_correlation"]) -> typing.Literal["period_over_period_correlation"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_period_over_period_mae", b"_period_over_period_mae"]) -> typing.Literal["period_over_period_mae"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_period_over_period_p_value", b"_period_over_period_p_value"]) -> typing.Literal["period_over_period_p_value"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_year_over_year_correlation", b"_year_over_year_correlation"]) -> typing.Literal["year_over_year_correlation"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_year_over_year_mae", b"_year_over_year_mae"]) -> typing.Literal["year_over_year_mae"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_year_over_year_p_value", b"_year_over_year_p_value"]) -> typing.Literal["year_over_year_p_value"] | None: ... + +global___KpiMappingResultData = KpiMappingResultData + +@typing.final +class KpiMappingGroupReference(google.protobuf.message.Message): + """KPI mapping group minimal set of fields.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + VENDOR_DISPLAY_NAME_FIELD_NUMBER: builtins.int + name: builtins.str + """Resource name.""" + display_name: builtins.str + """Display name.""" + vendor_display_name: builtins.str + """Vendor display name.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + vendor_display_name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["display_name", b"display_name", "name", b"name", "vendor_display_name", b"vendor_display_name"]) -> None: ... + +global___KpiMappingGroupReference = KpiMappingGroupReference + +@typing.final +class CompanyKpiModelResult(google.protobuf.message.Message): + """Result for a single company KPI.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KPI_FIELD_NUMBER: builtins.int + MODEL_FIELD_NUMBER: builtins.int + ACCESSIBLE_MAPPINGS_COUNT_FIELD_NUMBER: builtins.int + TOTAL_MAPPINGS_COUNT_FIELD_NUMBER: builtins.int + MODELS_COUNT_FIELD_NUMBER: builtins.int + accessible_mappings_count: builtins.int + """Number of KPI mappings for this company KPI that the current user has access to.""" + total_mappings_count: builtins.int + """Total number of KPI mappings for this company KPI, including both accessible + KPI mappings and public KPI mappings. + """ + models_count: builtins.int + """Number of models for this company KPI.""" + @property + def kpi(self) -> global___Kpi: + """KPI.""" + + @property + def model(self) -> global___KpiModel: + """KPI model.""" + + def __init__( + self, + *, + kpi: global___Kpi | None = ..., + model: global___KpiModel | None = ..., + accessible_mappings_count: builtins.int | None = ..., + total_mappings_count: builtins.int | None = ..., + models_count: builtins.int | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kpi", b"kpi", "model", b"model"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["accessible_mappings_count", b"accessible_mappings_count", "kpi", b"kpi", "model", b"model", "models_count", b"models_count", "total_mappings_count", b"total_mappings_count"]) -> None: ... + +global___CompanyKpiModelResult = CompanyKpiModelResult + +@typing.final +class KpiModel(google.protobuf.message.Message): + """A KPI model.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + ID_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + DATA_FIELD_NUMBER: builtins.int + WEIGHTS_FIELD_NUMBER: builtins.int + MODEL_RUNS_FIELD_NUMBER: builtins.int + HIERARCHICAL_MODEL_KPI_SOURCE_FIELD_NUMBER: builtins.int + name: builtins.str + """Resource name.""" + id: builtins.int + """Integer id.""" + display_name: builtins.str + """Display name.""" + @property + def data(self) -> global___KpiModelData: + """Model data.""" + + @property + def weights(self) -> global___KpiModelWeightGroups: + """Model weights.""" + + @property + def model_runs(self) -> global___KpiModelRuns: + """Model runs.""" + + @property + def hierarchical_model_kpi_source(self) -> global___HierarchicalModelKpiSource: + """Hierarchical model KPI source data. + This field specifies what was used as input for the KPI in the hierarchical model. + The field is only set for hierarchical models. + """ + + def __init__( + self, + *, + name: builtins.str | None = ..., + id: builtins.int | None = ..., + display_name: builtins.str | None = ..., + data: global___KpiModelData | None = ..., + weights: global___KpiModelWeightGroups | None = ..., + model_runs: global___KpiModelRuns | None = ..., + hierarchical_model_kpi_source: global___HierarchicalModelKpiSource | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["data", b"data", "hierarchical_model_kpi_source", b"hierarchical_model_kpi_source", "model_runs", b"model_runs", "weights", b"weights"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["data", b"data", "display_name", b"display_name", "hierarchical_model_kpi_source", b"hierarchical_model_kpi_source", "id", b"id", "model_runs", b"model_runs", "name", b"name", "weights", b"weights"]) -> None: ... + +global___KpiModel = KpiModel + +@typing.final +class HierarchicalModelKpiSource(google.protobuf.message.Message): + """Hierarchical model KPI source data.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _HierarchicalModelKpiSourceType: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _HierarchicalModelKpiSourceTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + UNSPECIFIED: HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType # 0 + """Unspecified.""" + MODEL: HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType # 1 + """Model.""" + CONSENSUS: HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType # 2 + """Consensus.""" + FREE_VARIABLE: HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType # 3 + """Free variable.""" + + class HierarchicalModelKpiSourceType(_HierarchicalModelKpiSourceType, metaclass=_HierarchicalModelKpiSourceTypeEnumTypeWrapper): + """Hierarchical model KPI source types.""" + + UNSPECIFIED: HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType # 0 + """Unspecified.""" + MODEL: HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType # 1 + """Model.""" + CONSENSUS: HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType # 2 + """Consensus.""" + FREE_VARIABLE: HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType # 3 + """Free variable.""" + + TYPE_FIELD_NUMBER: builtins.int + MODEL_FIELD_NUMBER: builtins.int + type: global___HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType + """The type of the hierarchical model KPI source.""" + model: builtins.str + """Optional model resource name. + Only set if the type is MODEL. + """ + def __init__( + self, + *, + type: global___HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType | None = ..., + model: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["model", b"model", "type", b"type"]) -> None: ... + +global___HierarchicalModelKpiSource = HierarchicalModelKpiSource + +@typing.final +class KpiModelRuns(google.protobuf.message.Message): + """Information about the runs for this model.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + INITIAL_RUN_FIELD_NUMBER: builtins.int + DAILY_RUN_FIELD_NUMBER: builtins.int + PIT_BACKTEST_RUN_FIELD_NUMBER: builtins.int + @property + def initial_run(self) -> global___KpiModelRun: + """Initial run. + The initial run performs backtesting and the initial prediction. + It runs when the model is first created. + """ + + @property + def daily_run(self) -> global___KpiModelRun: + """Latest daily run. + The daily run updates the model prediction based on the latest available data. + """ + + @property + def pit_backtest_run(self) -> global___KpiModelRun: + """Point-in-time backtest run. + This run performs point-in-time backtesting of the model. + The point-in-time backtests can be used to estimate the model error based on when we are in a quarter. + It runs when the model is first created. + """ + + def __init__( + self, + *, + initial_run: global___KpiModelRun | None = ..., + daily_run: global___KpiModelRun | None = ..., + pit_backtest_run: global___KpiModelRun | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["daily_run", b"daily_run", "initial_run", b"initial_run", "pit_backtest_run", b"pit_backtest_run"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["daily_run", b"daily_run", "initial_run", b"initial_run", "pit_backtest_run", b"pit_backtest_run"]) -> None: ... + +global___KpiModelRuns = KpiModelRuns + +@typing.final +class KpiModelRun(google.protobuf.message.Message): + """Information about a single KPI model run.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + CREATED_AT_FIELD_NUMBER: builtins.int + STARTED_AT_FIELD_NUMBER: builtins.int + FINISHED_AT_FIELD_NUMBER: builtins.int + ERROR_FIELD_NUMBER: builtins.int + error: builtins.str + """An optional error message if the run failed.""" + @property + def created_at(self) -> google.protobuf.timestamp_pb2.Timestamp: + """The time the run was created.""" + + @property + def started_at(self) -> google.protobuf.timestamp_pb2.Timestamp: + """The time the run was started.""" + + @property + def finished_at(self) -> google.protobuf.timestamp_pb2.Timestamp: + """The time the run finished.""" + + def __init__( + self, + *, + created_at: google.protobuf.timestamp_pb2.Timestamp | None = ..., + started_at: google.protobuf.timestamp_pb2.Timestamp | None = ..., + finished_at: google.protobuf.timestamp_pb2.Timestamp | None = ..., + error: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_error", b"_error", "created_at", b"created_at", "error", b"error", "finished_at", b"finished_at", "started_at", b"started_at"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_error", b"_error", "created_at", b"created_at", "error", b"error", "finished_at", b"finished_at", "started_at", b"started_at"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_error", b"_error"]) -> typing.Literal["error"] | None: ... + +global___KpiModelRun = KpiModelRun + +@typing.final +class KpiMappingModel(google.protobuf.message.Message): + """Single-predictor KPI mapping model.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + SOURCE_FIELD_NUMBER: builtins.int + KPI_MODEL_DATA_FIELD_NUMBER: builtins.int + @property + def source(self) -> global___KpiMappingGroupReference: + """The KPI mapping group from which the model originates""" + + @property + def kpi_model_data(self) -> global___KpiModelData: + """Model data.""" + + def __init__( + self, + *, + source: global___KpiMappingGroupReference | None = ..., + kpi_model_data: global___KpiModelData | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kpi_model_data", b"kpi_model_data", "source", b"source"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kpi_model_data", b"kpi_model_data", "source", b"source"]) -> None: ... + +global___KpiMappingModel = KpiMappingModel + +@typing.final +class KpiModelData(google.protobuf.message.Message): + """Data for a KPI model.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PREDICTION_FIELD_NUMBER: builtins.int + PREDICTION_YOY_REL_FIELD_NUMBER: builtins.int + PREDICTION_YOY_ABS_FIELD_NUMBER: builtins.int + CONSENSUS_FIELD_NUMBER: builtins.int + CONSENSUS_YOY_REL_FIELD_NUMBER: builtins.int + CONSENSUS_YOY_ABS_FIELD_NUMBER: builtins.int + DELTA_ABS_FIELD_NUMBER: builtins.int + DELTA_REL_FIELD_NUMBER: builtins.int + DELTA_BY_ERROR_FIELD_NUMBER: builtins.int + MODEL_QUALITY_FIELD_NUMBER: builtins.int + MAPE_FIELD_NUMBER: builtins.int + MAPE_PIT_FIELD_NUMBER: builtins.int + MAE_FIELD_NUMBER: builtins.int + MAE_PIT_FIELD_NUMBER: builtins.int + ERROR_COUNT_FIELD_NUMBER: builtins.int + HIT_RATE_FIELD_NUMBER: builtins.int + HIT_RATE_COUNT_FIELD_NUMBER: builtins.int + REVISION_1_WEEK_FIELD_NUMBER: builtins.int + REVISION_1_MONTH_FIELD_NUMBER: builtins.int + DATE_FIELD_NUMBER: builtins.int + ERROR_FIELD_NUMBER: builtins.int + prediction: builtins.float + """Absolute prediction.""" + prediction_yoy_rel: builtins.float + """Year-over-year prediction relative change. + This is the absolute prediction compared to the observed value for the + same period one year ago. + """ + prediction_yoy_abs: builtins.float + """Year-over-year prediction absolute change. + This is the absolute prediction compared to the observed value for the + same period one year ago. + """ + consensus: builtins.float + """Consensus. + Only available for Visible Alpha KPIs for users with a subscription with export allowed. + """ + consensus_yoy_rel: builtins.float + """Year-over-year consensus relative change. + This is the consensus compared to the observed value for the + same period one year ago. + """ + consensus_yoy_abs: builtins.float + """Year-over-year consensus absolute change. + This is the consensus compared to the observed value for the + same period one year ago. + """ + delta_abs: builtins.float + """Absolute difference between the prediction and the consensus. + This is calculated as prediction - consensus. + Only available for Visible Alpha KPIs for users with a subscription with export allowed. + """ + delta_rel: builtins.float + """Relative difference between the prediction and the consensus. + This is calculated as (prediction / consensus) - 1. + Only available for Visible Alpha KPIs for users with a subscription with export allowed. + """ + delta_by_error: builtins.float + """The delta divided by the error. + For ratio KPIs this is absolute delta / mae (using PiT mae if available). + For non-ratio KPIs this is relative delta / mape (using PiT mape if available). + Only available for Visible Alpha KPIs for users with a subscription with export allowed. + """ + model_quality: global___ModelQuality.ValueType + """Model quality.""" + mape: builtins.float + """Mean absolute percentage error.""" + mape_pit: builtins.float + """Point-in-time mean absolute percentage error.""" + mae: builtins.float + """Mean absolute error.""" + mae_pit: builtins.float + """Point-in-time mean absolute error.""" + error_count: builtins.int + """The number of data points used to calculate the MAPE and MAE metrics. + Note that his may be different from the number of data points available, as we + may choose to only use the most recent data points. + """ + hit_rate: builtins.float + """Hit rate.""" + hit_rate_count: builtins.int + """The number of data points included in the hit rate calculation. + If the difference between the consensus and prediction is below a certain threshold, + a data point may not be included in the calculation. + """ + revision_1_week: builtins.float + """Revision to the predicted value compared to the prediction from 1 week ago. + If the KPI is a ratio, this is just the difference between the current prediction and the + prediction from 1 week ago, otherwise this is the relative change. + For Exabel Models and custom models, a backtest may be used to get the historical prediction. + """ + revision_1_month: builtins.float + """Revision to the predicted value compared to the prediction from 1 month ago. + If the KPI is a ratio, this is just the difference between the current prediction and the + prediction from 1 month ago, otherwise this is the relative change. + For Exabel Models and custom models, a backtest may be used to get the historical prediction. + """ + error: builtins.str + """An error message in case the model training or backtesting failed.""" + @property + def date(self) -> exabel.api.time.date_pb2.Date: + """The fiscal period end date for which the prediction has been made.""" + + def __init__( + self, + *, + prediction: builtins.float | None = ..., + prediction_yoy_rel: builtins.float | None = ..., + prediction_yoy_abs: builtins.float | None = ..., + consensus: builtins.float | None = ..., + consensus_yoy_rel: builtins.float | None = ..., + consensus_yoy_abs: builtins.float | None = ..., + delta_abs: builtins.float | None = ..., + delta_rel: builtins.float | None = ..., + delta_by_error: builtins.float | None = ..., + model_quality: global___ModelQuality.ValueType | None = ..., + mape: builtins.float | None = ..., + mape_pit: builtins.float | None = ..., + mae: builtins.float | None = ..., + mae_pit: builtins.float | None = ..., + error_count: builtins.int | None = ..., + hit_rate: builtins.float | None = ..., + hit_rate_count: builtins.int | None = ..., + revision_1_week: builtins.float | None = ..., + revision_1_month: builtins.float | None = ..., + date: exabel.api.time.date_pb2.Date | None = ..., + error: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_consensus", b"_consensus", "_consensus_yoy_abs", b"_consensus_yoy_abs", "_consensus_yoy_rel", b"_consensus_yoy_rel", "_delta_abs", b"_delta_abs", "_delta_by_error", b"_delta_by_error", "_delta_rel", b"_delta_rel", "_error_count", b"_error_count", "_hit_rate", b"_hit_rate", "_hit_rate_count", b"_hit_rate_count", "_mae", b"_mae", "_mae_pit", b"_mae_pit", "_mape", b"_mape", "_mape_pit", b"_mape_pit", "_prediction", b"_prediction", "_prediction_yoy_abs", b"_prediction_yoy_abs", "_prediction_yoy_rel", b"_prediction_yoy_rel", "_revision_1_month", b"_revision_1_month", "_revision_1_week", b"_revision_1_week", "consensus", b"consensus", "consensus_yoy_abs", b"consensus_yoy_abs", "consensus_yoy_rel", b"consensus_yoy_rel", "date", b"date", "delta_abs", b"delta_abs", "delta_by_error", b"delta_by_error", "delta_rel", b"delta_rel", "error_count", b"error_count", "hit_rate", b"hit_rate", "hit_rate_count", b"hit_rate_count", "mae", b"mae", "mae_pit", b"mae_pit", "mape", b"mape", "mape_pit", b"mape_pit", "prediction", b"prediction", "prediction_yoy_abs", b"prediction_yoy_abs", "prediction_yoy_rel", b"prediction_yoy_rel", "revision_1_month", b"revision_1_month", "revision_1_week", b"revision_1_week"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_consensus", b"_consensus", "_consensus_yoy_abs", b"_consensus_yoy_abs", "_consensus_yoy_rel", b"_consensus_yoy_rel", "_delta_abs", b"_delta_abs", "_delta_by_error", b"_delta_by_error", "_delta_rel", b"_delta_rel", "_error_count", b"_error_count", "_hit_rate", b"_hit_rate", "_hit_rate_count", b"_hit_rate_count", "_mae", b"_mae", "_mae_pit", b"_mae_pit", "_mape", b"_mape", "_mape_pit", b"_mape_pit", "_prediction", b"_prediction", "_prediction_yoy_abs", b"_prediction_yoy_abs", "_prediction_yoy_rel", b"_prediction_yoy_rel", "_revision_1_month", b"_revision_1_month", "_revision_1_week", b"_revision_1_week", "consensus", b"consensus", "consensus_yoy_abs", b"consensus_yoy_abs", "consensus_yoy_rel", b"consensus_yoy_rel", "date", b"date", "delta_abs", b"delta_abs", "delta_by_error", b"delta_by_error", "delta_rel", b"delta_rel", "error", b"error", "error_count", b"error_count", "hit_rate", b"hit_rate", "hit_rate_count", b"hit_rate_count", "mae", b"mae", "mae_pit", b"mae_pit", "mape", b"mape", "mape_pit", b"mape_pit", "model_quality", b"model_quality", "prediction", b"prediction", "prediction_yoy_abs", b"prediction_yoy_abs", "prediction_yoy_rel", b"prediction_yoy_rel", "revision_1_month", b"revision_1_month", "revision_1_week", b"revision_1_week"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_consensus", b"_consensus"]) -> typing.Literal["consensus"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_consensus_yoy_abs", b"_consensus_yoy_abs"]) -> typing.Literal["consensus_yoy_abs"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_consensus_yoy_rel", b"_consensus_yoy_rel"]) -> typing.Literal["consensus_yoy_rel"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_delta_abs", b"_delta_abs"]) -> typing.Literal["delta_abs"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_delta_by_error", b"_delta_by_error"]) -> typing.Literal["delta_by_error"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_delta_rel", b"_delta_rel"]) -> typing.Literal["delta_rel"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_error_count", b"_error_count"]) -> typing.Literal["error_count"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_hit_rate", b"_hit_rate"]) -> typing.Literal["hit_rate"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_hit_rate_count", b"_hit_rate_count"]) -> typing.Literal["hit_rate_count"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_mae", b"_mae"]) -> typing.Literal["mae"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_mae_pit", b"_mae_pit"]) -> typing.Literal["mae_pit"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_mape", b"_mape"]) -> typing.Literal["mape"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_mape_pit", b"_mape_pit"]) -> typing.Literal["mape_pit"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_prediction", b"_prediction"]) -> typing.Literal["prediction"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_prediction_yoy_abs", b"_prediction_yoy_abs"]) -> typing.Literal["prediction_yoy_abs"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_prediction_yoy_rel", b"_prediction_yoy_rel"]) -> typing.Literal["prediction_yoy_rel"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_revision_1_month", b"_revision_1_month"]) -> typing.Literal["revision_1_month"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing.Literal["_revision_1_week", b"_revision_1_week"]) -> typing.Literal["revision_1_week"] | None: ... + +global___KpiModelData = KpiModelData + +@typing.final +class KpiModelWeightGroups(google.protobuf.message.Message): + """KPI model weight groups.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + WEIGHT_GROUPS_FIELD_NUMBER: builtins.int + IS_COEFFICIENTS_FIELD_NUMBER: builtins.int + is_coefficients: builtins.bool + """Whether the weights are coefficients that should be formatted as decimal numbers. + If false, the weights are normalized weights that add up to 1. + """ + @property + def weight_groups(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiModelWeightGroup]: + """Weights for all predictors in the model.""" + + def __init__( + self, + *, + weight_groups: collections.abc.Iterable[global___KpiModelWeightGroup] | None = ..., + is_coefficients: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["is_coefficients", b"is_coefficients", "weight_groups", b"weight_groups"]) -> None: ... + +global___KpiModelWeightGroups = KpiModelWeightGroups + +@typing.final +class KpiModelWeightGroup(google.protobuf.message.Message): + """Weight for a group of related KPI model input features.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + DISPLAY_NAME_FIELD_NUMBER: builtins.int + GROUP_FIELD_NUMBER: builtins.int + FEATURE_WEIGHTS_FIELD_NUMBER: builtins.int + display_name: builtins.str + """Display name of the model input feature/predictor. + For ratio prediction models, this is either 'Baseline' (representing the predictor built by forecasting + the KPI time series) or it is the display name of the KPI mapping group from which the predictor originates. + For other model types, display names include 'Seasonality' and 'Reported KPI (lagged)'. + """ + @property + def group(self) -> global___KpiMappingGroupReference: + """The KPI mapping group from which the predictor originates. + Only set when the predictor originates from a KPI mapping group. + """ + + @property + def feature_weights(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiModelFeatureWeight]: + """The individual feature weights.""" + + def __init__( + self, + *, + display_name: builtins.str | None = ..., + group: global___KpiMappingGroupReference | None = ..., + feature_weights: collections.abc.Iterable[global___KpiModelFeatureWeight] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["group", b"group"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["display_name", b"display_name", "feature_weights", b"feature_weights", "group", b"group"]) -> None: ... + +global___KpiModelWeightGroup = KpiModelWeightGroup + +@typing.final +class KpiModelFeatureWeight(google.protobuf.message.Message): + """Weight for a single KPI model input feature.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + WEIGHT_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + weight: builtins.float + """The weight of the input feature.""" + display_name: builtins.str + """Display name of the feature. + If there is only a single feature weight, this is identical to the `KpiModelWeightGroup.display_name`. + If there are multiple feature weights, this is the display name of the feature. For example, + for seasonality, the individual feature weights may include 'Q1', 'Q2', 'Q3', 'Q4' (for the quarter features). + """ + def __init__( + self, + *, + weight: builtins.float | None = ..., + display_name: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_weight", b"_weight", "weight", b"weight"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_weight", b"_weight", "display_name", b"display_name", "weight", b"weight"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_weight", b"_weight"]) -> typing.Literal["weight"] | None: ... + +global___KpiModelFeatureWeight = KpiModelFeatureWeight + +@typing.final +class FiscalPeriod(google.protobuf.message.Message): + """Represents a fiscal period.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + END_DATE_FIELD_NUMBER: builtins.int + LABEL_FIELD_NUMBER: builtins.int + REPORT_DATE_FIELD_NUMBER: builtins.int + label: builtins.str + """The fiscal period label. Examples: 1Q-2003, 2H-1997, FY-2029.""" + @property + def end_date(self) -> exabel.api.time.date_pb2.Date: + """The last date of the fiscal period.""" + + @property + def report_date(self) -> exabel.api.time.date_pb2.Date: + """The report date of the fiscal period.""" + + def __init__( + self, + *, + end_date: exabel.api.time.date_pb2.Date | None = ..., + label: builtins.str | None = ..., + report_date: exabel.api.time.date_pb2.Date | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_label", b"_label", "end_date", b"end_date", "label", b"label", "report_date", b"report_date"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_label", b"_label", "end_date", b"end_date", "label", b"label", "report_date", b"report_date"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_label", b"_label"]) -> typing.Literal["label"] | None: ... + +global___FiscalPeriod = FiscalPeriod + +@typing.final +class FiscalPeriodSelector(google.protobuf.message.Message): + """Selector for a fiscal period.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + RELATIVE_SELECTOR_FIELD_NUMBER: builtins.int + PERIOD_END_FIELD_NUMBER: builtins.int + FREQ_FIELD_NUMBER: builtins.int + relative_selector: global___RelativeFiscalPeriodSelector.ValueType + """Relative fiscal period.""" + freq: builtins.str + """Fiscal period frequency. + Allowed values are empty, "FQ", "FS" and "FY". + Must be set to either "FQ", "FS" or "FY" if `period_end` is specified. + If empty, frequency is determined based on KPI counts. The frequency + with the most number of KPIs with mappings for the user is used. + """ + @property + def period_end(self) -> exabel.api.time.date_pb2.Date: + """Specific fiscal period end.""" + + def __init__( + self, + *, + relative_selector: global___RelativeFiscalPeriodSelector.ValueType | None = ..., + period_end: exabel.api.time.date_pb2.Date | None = ..., + freq: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["period_end", b"period_end"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["freq", b"freq", "period_end", b"period_end", "relative_selector", b"relative_selector"]) -> None: ... + +global___FiscalPeriodSelector = FiscalPeriodSelector + +@typing.final +class KpiHierarchy(google.protobuf.message.Message): + """Represents a hierarchy of KPIs for a specific company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + FREQ_FIELD_NUMBER: builtins.int + BREAKDOWN_FIELD_NUMBER: builtins.int + name: builtins.str + """The resource name of the KPI hierarchy, e.g., "kpiHierarchies/135".""" + freq: builtins.str + """The frequency of the KPIs in this hierarchy.""" + @property + def breakdown(self) -> global___KpiBreakdown: + """A breakdown of the KPIs.""" + + def __init__( + self, + *, + name: builtins.str | None = ..., + freq: builtins.str | None = ..., + breakdown: global___KpiBreakdown | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["breakdown", b"breakdown"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["breakdown", b"breakdown", "freq", b"freq", "name", b"name"]) -> None: ... + +global___KpiHierarchy = KpiHierarchy + +@typing.final +class KpiBreakdown(google.protobuf.message.Message): + """A breakdown of the KPIs.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KPIS_FIELD_NUMBER: builtins.int + @property + def kpis(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiBreakdownNode]: + """The top-level nodes in the breakdown, each of which represents a KPI.""" + + def __init__( + self, + *, + kpis: collections.abc.Iterable[global___KpiBreakdownNode] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["kpis", b"kpis"]) -> None: ... + +global___KpiBreakdown = KpiBreakdown + +@typing.final +class KpiBreakdownNode(google.protobuf.message.Message): + """A node in the tree representing the breakdown of a KPI.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KPI_FIELD_NUMBER: builtins.int + HEADER_FIELD_NUMBER: builtins.int + CHILDREN_FIELD_NUMBER: builtins.int + header: builtins.str + """The string representing this node, when the node represents a grouping of KPIs and not a + single one. + """ + @property + def kpi(self) -> global___Kpi: + """The KPI represented by this node. + Only StructuredKpi is supported, and only the KPI type and the value should be set. + """ + + @property + def children(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiBreakdownNode]: + """The children of this node.""" + + def __init__( + self, + *, + kpi: global___Kpi | None = ..., + header: builtins.str | None = ..., + children: collections.abc.Iterable[global___KpiBreakdownNode] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["content", b"content", "header", b"header", "kpi", b"kpi"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["children", b"children", "content", b"content", "header", b"header", "kpi", b"kpi"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["content", b"content"]) -> typing.Literal["kpi", "header"] | None: ... + +global___KpiBreakdownNode = KpiBreakdownNode + +@typing.final +class KpiScreenCompanyResult(google.protobuf.message.Message): + """KPI screen results for a single company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + COMPANY_FIELD_NUMBER: builtins.int + FISCAL_PERIOD_FIELD_NUMBER: builtins.int + RESULTS_FIELD_NUMBER: builtins.int + @property + def company(self) -> global___Company: + """The company.""" + + @property + def fiscal_period(self) -> global___FiscalPeriod: + """The fiscal period for this result.""" + + @property + def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CompanyKpiModelResult]: + """KPI model results for this company.""" + + def __init__( + self, + *, + company: global___Company | None = ..., + fiscal_period: global___FiscalPeriod | None = ..., + results: collections.abc.Iterable[global___CompanyKpiModelResult] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["company", b"company", "fiscal_period", b"fiscal_period"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["company", b"company", "fiscal_period", b"fiscal_period", "results", b"results"]) -> None: ... + +global___KpiScreenCompanyResult = KpiScreenCompanyResult diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2_grpc.py new file mode 100644 index 00000000..2e19b9a7 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/kpi_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_service_pb2.py b/exabel/stubs/exabel/api/analytics/v1/kpi_service_pb2.py new file mode 100644 index 00000000..823edc37 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_service_pb2.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/kpi_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/kpi_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import kpi_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/analytics/v1/kpi_service.proto\x12\x17\x65xabel.api.analytics.v1\x1a*exabel/api/analytics/v1/kpi_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x9e\x01\n\x1cListKpiMappingResultsRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0ekpiMappingName\xe0\x41\x02\x12>\n\tpage_size\x18\x02 \x01(\x05\x42+\x92\x41(2&Maximum number of companies to return.\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x90\x01\n\x1dListKpiMappingResultsResponse\x12\x42\n\x07results\x18\x01 \x03(\x0b\x32\x31.exabel.api.analytics.v1.CompanyKpiMappingResults\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xc8\x01\n\"ListCompanyBaseModelResultsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x63ompanyName\xe0\x41\x02\x12=\n\x06period\x18\x02 \x01(\x0b\x32-.exabel.api.analytics.v1.FiscalPeriodSelector\x12:\n\nkpi_source\x18\x03 \x01(\x0e\x32\".exabel.api.analytics.v1.KpiSourceB\x02\x18\x01\"\x9d\x01\n#ListCompanyBaseModelResultsResponse\x12?\n\x07results\x18\x01 \x03(\x0b\x32..exabel.api.analytics.v1.CompanyKpiModelResult\x12\x35\n\x06period\x18\x02 \x01(\x0b\x32%.exabel.api.analytics.v1.FiscalPeriod\"\xd0\x01\n*ListCompanyHierarchicalModelResultsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x63ompanyName\xe0\x41\x02\x12=\n\x06period\x18\x02 \x01(\x0b\x32-.exabel.api.analytics.v1.FiscalPeriodSelector\x12:\n\nkpi_source\x18\x03 \x01(\x0e\x32\".exabel.api.analytics.v1.KpiSourceB\x02\x18\x01\"\xe3\x01\n+ListCompanyHierarchicalModelResultsResponse\x12?\n\x07results\x18\x01 \x03(\x0b\x32..exabel.api.analytics.v1.CompanyKpiModelResult\x12<\n\rkpi_hierarchy\x18\x02 \x01(\x0b\x32%.exabel.api.analytics.v1.KpiHierarchy\x12\x35\n\x06period\x18\x03 \x01(\x0b\x32%.exabel.api.analytics.v1.FiscalPeriod\"~\n#ListCompanyKpiMappingResultsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x63ompanyName\xe0\x41\x02\x12.\n\x03kpi\x18\x02 \x01(\x0b\x32\x1c.exabel.api.analytics.v1.KpiB\x03\xe0\x41\x02\"f\n$ListCompanyKpiMappingResultsResponse\x12>\n\x07results\x18\x01 \x03(\x0b\x32-.exabel.api.analytics.v1.KpiMappingResultData\"|\n!ListCompanyKpiModelResultsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x63ompanyName\xe0\x41\x02\x12.\n\x03kpi\x18\x02 \x01(\x0b\x32\x1c.exabel.api.analytics.v1.KpiB\x03\xe0\x41\x02\"\x9c\x02\n\"ListCompanyKpiModelResultsResponse\x12\x37\n\x0c\x65xabel_model\x18\x01 \x01(\x0b\x32!.exabel.api.analytics.v1.KpiModel\x12=\n\x12hierarchical_model\x18\x02 \x01(\x0b\x32!.exabel.api.analytics.v1.KpiModel\x12\x38\n\rcustom_models\x18\x03 \x03(\x0b\x32!.exabel.api.analytics.v1.KpiModel\x12\x44\n\x12kpi_mapping_models\x18\x04 \x03(\x0b\x32(.exabel.api.analytics.v1.KpiMappingModel\"\x9a\x01\n\x1bListKpiScreenResultsRequest\x12\'\n\x04name\x18\x01 \x01(\tB\x19\x92\x41\x13\xca>\x10\xfa\x02\rkpiScreenName\xe0\x41\x02\x12>\n\tpage_size\x18\x02 \x01(\x05\x42+\x92\x41(2&Maximum number of companies to return.\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x8d\x01\n\x1cListKpiScreenResultsResponse\x12@\n\x07results\x18\x01 \x03(\x0b\x32/.exabel.api.analytics.v1.KpiScreenCompanyResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x32\xe5\x0b\n\nKpiService\x12\xcf\x01\n\x15ListKpiMappingResults\x12\x35.exabel.api.analytics.v1.ListKpiMappingResultsRequest\x1a\x36.exabel.api.analytics.v1.ListKpiMappingResultsResponse\"G\x92\x41\x1a\x12\x18List KPI mapping results\x82\xd3\xe4\x93\x02$\x12\"/v1/{parent=kpiMappings/*}/results\x12\x82\x02\n\x1bListCompanyBaseModelResults\x12;.exabel.api.analytics.v1.ListCompanyBaseModelResultsRequest\x1a<.exabel.api.analytics.v1.ListCompanyBaseModelResultsResponse\"h\x92\x41!\x12\x1fList company base model results\x82\xd3\xe4\x93\x02>\x12\021\372\002\016kpiMappingName\340A\002' + _globals['_LISTKPIMAPPINGRESULTSREQUEST'].fields_by_name['page_size']._loaded_options = None + _globals['_LISTKPIMAPPINGRESULTSREQUEST'].fields_by_name['page_size']._serialized_options = b'\222A(2&Maximum number of companies to return.' + _globals['_LISTCOMPANYBASEMODELRESULTSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTCOMPANYBASEMODELRESULTSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\021\312>\016\372\002\013companyName\340A\002' + _globals['_LISTCOMPANYBASEMODELRESULTSREQUEST'].fields_by_name['kpi_source']._loaded_options = None + _globals['_LISTCOMPANYBASEMODELRESULTSREQUEST'].fields_by_name['kpi_source']._serialized_options = b'\030\001' + _globals['_LISTCOMPANYHIERARCHICALMODELRESULTSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTCOMPANYHIERARCHICALMODELRESULTSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\021\312>\016\372\002\013companyName\340A\002' + _globals['_LISTCOMPANYHIERARCHICALMODELRESULTSREQUEST'].fields_by_name['kpi_source']._loaded_options = None + _globals['_LISTCOMPANYHIERARCHICALMODELRESULTSREQUEST'].fields_by_name['kpi_source']._serialized_options = b'\030\001' + _globals['_LISTCOMPANYKPIMAPPINGRESULTSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTCOMPANYKPIMAPPINGRESULTSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\021\312>\016\372\002\013companyName\340A\002' + _globals['_LISTCOMPANYKPIMAPPINGRESULTSREQUEST'].fields_by_name['kpi']._loaded_options = None + _globals['_LISTCOMPANYKPIMAPPINGRESULTSREQUEST'].fields_by_name['kpi']._serialized_options = b'\340A\002' + _globals['_LISTCOMPANYKPIMODELRESULTSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTCOMPANYKPIMODELRESULTSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\021\312>\016\372\002\013companyName\340A\002' + _globals['_LISTCOMPANYKPIMODELRESULTSREQUEST'].fields_by_name['kpi']._loaded_options = None + _globals['_LISTCOMPANYKPIMODELRESULTSREQUEST'].fields_by_name['kpi']._serialized_options = b'\340A\002' + _globals['_LISTKPISCREENRESULTSREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_LISTKPISCREENRESULTSREQUEST'].fields_by_name['name']._serialized_options = b'\222A\023\312>\020\372\002\rkpiScreenName\340A\002' + _globals['_LISTKPISCREENRESULTSREQUEST'].fields_by_name['page_size']._loaded_options = None + _globals['_LISTKPISCREENRESULTSREQUEST'].fields_by_name['page_size']._serialized_options = b'\222A(2&Maximum number of companies to return.' + _globals['_KPISERVICE'].methods_by_name['ListKpiMappingResults']._loaded_options = None + _globals['_KPISERVICE'].methods_by_name['ListKpiMappingResults']._serialized_options = b'\222A\032\022\030List KPI mapping results\202\323\344\223\002$\022\"/v1/{parent=kpiMappings/*}/results' + _globals['_KPISERVICE'].methods_by_name['ListCompanyBaseModelResults']._loaded_options = None + _globals['_KPISERVICE'].methods_by_name['ListCompanyBaseModelResults']._serialized_options = b'\222A!\022\037List company base model results\202\323\344\223\002>\022 None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token", "parent", b"parent"]) -> None: ... - def __init__(self, *, parent: builtins.str | None=..., page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token', 'parent', b'parent']) -> None: - ... global___ListKpiMappingResultsRequest = ListKpiMappingResultsRequest @typing.final class ListKpiMappingResultsResponse(google.protobuf.message.Message): """Response from ListKpiMappingResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + RESULTS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent list query.\n The end of the list is reached when the token is empty.\n ' + """Token for the next page of results, which can be sent to a subsequent list query. + The end of the list is reached when the token is empty. + """ total_size: builtins.int - 'Total number of rows, irrespective of paging.' - + """Total number of rows, irrespective of paging.""" @property def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiMappingResults]: """List of results, one for each company.""" - def __init__(self, *, results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiMappingResults] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiMappingResults] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["next_page_token", b"next_page_token", "results", b"results", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['next_page_token', b'next_page_token', 'results', b'results', 'total_size', b'total_size']) -> None: - ... global___ListKpiMappingResultsResponse = ListKpiMappingResultsResponse @typing.final class ListCompanyBaseModelResultsRequest(google.protobuf.message.Message): """Request to ListCompanyBaseModelResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int PERIOD_FIELD_NUMBER: builtins.int KPI_SOURCE_FIELD_NUMBER: builtins.int parent: builtins.str - 'Resource name of the company get results for.' + """Resource name of the company get results for.""" kpi_source: exabel.api.analytics.v1.kpi_messages_pb2.KpiSource.ValueType - 'This field is no longer in use.' - + """This field is no longer in use.""" @property def period(self) -> exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriodSelector: """The fiscal period and frequency to get results for. @@ -75,23 +95,26 @@ class ListCompanyBaseModelResultsRequest(google.protobuf.message.Message): mappings for the user is used. """ - def __init__(self, *, parent: builtins.str | None=..., period: exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriodSelector | None=..., kpi_source: exabel.api.analytics.v1.kpi_messages_pb2.KpiSource.ValueType | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['period', b'period']) -> builtins.bool: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + period: exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriodSelector | None = ..., + kpi_source: exabel.api.analytics.v1.kpi_messages_pb2.KpiSource.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["period", b"period"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kpi_source", b"kpi_source", "parent", b"parent", "period", b"period"]) -> None: ... - def ClearField(self, field_name: typing.Literal['kpi_source', b'kpi_source', 'parent', b'parent', 'period', b'period']) -> None: - ... global___ListCompanyBaseModelResultsRequest = ListCompanyBaseModelResultsRequest @typing.final class ListCompanyBaseModelResultsResponse(google.protobuf.message.Message): """Response from ListCompanyBaseModelResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + RESULTS_FIELD_NUMBER: builtins.int PERIOD_FIELD_NUMBER: builtins.int - @property def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiModelResult]: """List of results.""" @@ -100,28 +123,30 @@ class ListCompanyBaseModelResultsResponse(google.protobuf.message.Message): def period(self) -> exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriod: """Fiscal period representing the period the results are for.""" - def __init__(self, *, results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiModelResult] | None=..., period: exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriod | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['period', b'period']) -> builtins.bool: - ... + def __init__( + self, + *, + results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiModelResult] | None = ..., + period: exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriod | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["period", b"period"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["period", b"period", "results", b"results"]) -> None: ... - def ClearField(self, field_name: typing.Literal['period', b'period', 'results', b'results']) -> None: - ... global___ListCompanyBaseModelResultsResponse = ListCompanyBaseModelResultsResponse @typing.final class ListCompanyHierarchicalModelResultsRequest(google.protobuf.message.Message): """Request to ListCompanyHierarchicalModelResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int PERIOD_FIELD_NUMBER: builtins.int KPI_SOURCE_FIELD_NUMBER: builtins.int parent: builtins.str - 'Resource name of the company get results for.' + """Resource name of the company get results for.""" kpi_source: exabel.api.analytics.v1.kpi_messages_pb2.KpiSource.ValueType - 'This field is no longer in use.' - + """This field is no longer in use.""" @property def period(self) -> exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriodSelector: """The fiscal period and frequency to get results for. @@ -130,24 +155,27 @@ class ListCompanyHierarchicalModelResultsRequest(google.protobuf.message.Message mappings for the user is used. """ - def __init__(self, *, parent: builtins.str | None=..., period: exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriodSelector | None=..., kpi_source: exabel.api.analytics.v1.kpi_messages_pb2.KpiSource.ValueType | None=...) -> None: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + period: exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriodSelector | None = ..., + kpi_source: exabel.api.analytics.v1.kpi_messages_pb2.KpiSource.ValueType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["period", b"period"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kpi_source", b"kpi_source", "parent", b"parent", "period", b"period"]) -> None: ... - def HasField(self, field_name: typing.Literal['period', b'period']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['kpi_source', b'kpi_source', 'parent', b'parent', 'period', b'period']) -> None: - ... global___ListCompanyHierarchicalModelResultsRequest = ListCompanyHierarchicalModelResultsRequest @typing.final class ListCompanyHierarchicalModelResultsResponse(google.protobuf.message.Message): """Response from ListCompanyHierarchicalModelResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + RESULTS_FIELD_NUMBER: builtins.int KPI_HIERARCHY_FIELD_NUMBER: builtins.int PERIOD_FIELD_NUMBER: builtins.int - @property def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiModelResult]: """List of results.""" @@ -160,92 +188,102 @@ class ListCompanyHierarchicalModelResultsResponse(google.protobuf.message.Messag def period(self) -> exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriod: """Fiscal period representing the period the results are for.""" - def __init__(self, *, results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiModelResult] | None=..., kpi_hierarchy: exabel.api.analytics.v1.kpi_messages_pb2.KpiHierarchy | None=..., period: exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriod | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['kpi_hierarchy', b'kpi_hierarchy', 'period', b'period']) -> builtins.bool: - ... + def __init__( + self, + *, + results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.CompanyKpiModelResult] | None = ..., + kpi_hierarchy: exabel.api.analytics.v1.kpi_messages_pb2.KpiHierarchy | None = ..., + period: exabel.api.analytics.v1.kpi_messages_pb2.FiscalPeriod | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kpi_hierarchy", b"kpi_hierarchy", "period", b"period"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kpi_hierarchy", b"kpi_hierarchy", "period", b"period", "results", b"results"]) -> None: ... - def ClearField(self, field_name: typing.Literal['kpi_hierarchy', b'kpi_hierarchy', 'period', b'period', 'results', b'results']) -> None: - ... global___ListCompanyHierarchicalModelResultsResponse = ListCompanyHierarchicalModelResultsResponse @typing.final class ListCompanyKpiMappingResultsRequest(google.protobuf.message.Message): """Request to ListCompanyKpiMappingResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int KPI_FIELD_NUMBER: builtins.int parent: builtins.str - 'Resource name of the company to get KPI mapping results for.' - + """Resource name of the company to get KPI mapping results for.""" @property def kpi(self) -> exabel.api.analytics.v1.kpi_messages_pb2.Kpi: """KPI to get KPI mapping results for. The fields `type`, `value` and `freq` must be specified. """ - def __init__(self, *, parent: builtins.str | None=..., kpi: exabel.api.analytics.v1.kpi_messages_pb2.Kpi | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['kpi', b'kpi']) -> builtins.bool: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + kpi: exabel.api.analytics.v1.kpi_messages_pb2.Kpi | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kpi", b"kpi"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kpi", b"kpi", "parent", b"parent"]) -> None: ... - def ClearField(self, field_name: typing.Literal['kpi', b'kpi', 'parent', b'parent']) -> None: - ... global___ListCompanyKpiMappingResultsRequest = ListCompanyKpiMappingResultsRequest @typing.final class ListCompanyKpiMappingResultsResponse(google.protobuf.message.Message): """Response from ListCompanyKpiMappingResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - RESULTS_FIELD_NUMBER: builtins.int + RESULTS_FIELD_NUMBER: builtins.int @property def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.analytics.v1.kpi_messages_pb2.KpiMappingResultData]: """KPI mapping results.""" - def __init__(self, *, results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.KpiMappingResultData] | None=...) -> None: - ... + def __init__( + self, + *, + results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.KpiMappingResultData] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["results", b"results"]) -> None: ... - def ClearField(self, field_name: typing.Literal['results', b'results']) -> None: - ... global___ListCompanyKpiMappingResultsResponse = ListCompanyKpiMappingResultsResponse @typing.final class ListCompanyKpiModelResultsRequest(google.protobuf.message.Message): """Request to ListCompanyKpiModelResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int KPI_FIELD_NUMBER: builtins.int parent: builtins.str - 'Resource name of the company to get model results for.' - + """Resource name of the company to get model results for.""" @property def kpi(self) -> exabel.api.analytics.v1.kpi_messages_pb2.Kpi: """KPI to get model results for. The fields `type`, `value` and `freq` must be specified. """ - def __init__(self, *, parent: builtins.str | None=..., kpi: exabel.api.analytics.v1.kpi_messages_pb2.Kpi | None=...) -> None: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + kpi: exabel.api.analytics.v1.kpi_messages_pb2.Kpi | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["kpi", b"kpi"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["kpi", b"kpi", "parent", b"parent"]) -> None: ... - def HasField(self, field_name: typing.Literal['kpi', b'kpi']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['kpi', b'kpi', 'parent', b'parent']) -> None: - ... global___ListCompanyKpiModelResultsRequest = ListCompanyKpiModelResultsRequest @typing.final class ListCompanyKpiModelResultsResponse(google.protobuf.message.Message): """Response from ListCompanyKpiModelResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + EXABEL_MODEL_FIELD_NUMBER: builtins.int HIERARCHICAL_MODEL_FIELD_NUMBER: builtins.int CUSTOM_MODELS_FIELD_NUMBER: builtins.int KPI_MAPPING_MODELS_FIELD_NUMBER: builtins.int - @property def exabel_model(self) -> exabel.api.analytics.v1.kpi_messages_pb2.KpiModel: """Exabel model.""" @@ -262,56 +300,73 @@ class ListCompanyKpiModelResultsResponse(google.protobuf.message.Message): def kpi_mapping_models(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.analytics.v1.kpi_messages_pb2.KpiMappingModel]: """Single-predictor KPI mapping models.""" - def __init__(self, *, exabel_model: exabel.api.analytics.v1.kpi_messages_pb2.KpiModel | None=..., hierarchical_model: exabel.api.analytics.v1.kpi_messages_pb2.KpiModel | None=..., custom_models: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.KpiModel] | None=..., kpi_mapping_models: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.KpiMappingModel] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['exabel_model', b'exabel_model', 'hierarchical_model', b'hierarchical_model']) -> builtins.bool: - ... + def __init__( + self, + *, + exabel_model: exabel.api.analytics.v1.kpi_messages_pb2.KpiModel | None = ..., + hierarchical_model: exabel.api.analytics.v1.kpi_messages_pb2.KpiModel | None = ..., + custom_models: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.KpiModel] | None = ..., + kpi_mapping_models: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.KpiMappingModel] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["exabel_model", b"exabel_model", "hierarchical_model", b"hierarchical_model"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["custom_models", b"custom_models", "exabel_model", b"exabel_model", "hierarchical_model", b"hierarchical_model", "kpi_mapping_models", b"kpi_mapping_models"]) -> None: ... - def ClearField(self, field_name: typing.Literal['custom_models', b'custom_models', 'exabel_model', b'exabel_model', 'hierarchical_model', b'hierarchical_model', 'kpi_mapping_models', b'kpi_mapping_models']) -> None: - ... global___ListCompanyKpiModelResultsResponse = ListCompanyKpiModelResultsResponse @typing.final class ListKpiScreenResultsRequest(google.protobuf.message.Message): """Request to ListKpiScreenResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int name: builtins.str - 'Resource name of the KPI screen, e.g. `kpiScreens/123`.' + """Resource name of the KPI screen, e.g. `kpiScreens/123`.""" page_size: builtins.int - 'Maximum number of companies to return. Defaults to 20, and the maximum allowed value is 100.' + """Maximum number of companies to return. Defaults to 20, and the maximum allowed value is 100.""" page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the same\n query parameters.\n ' - - def __init__(self, *, name: builtins.str | None=..., page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... + """Token for a specific page of results, as returned from a previous list request with the same + query parameters. + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name", "page_size", b"page_size", "page_token", b"page_token"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name', 'page_size', b'page_size', 'page_token', b'page_token']) -> None: - ... global___ListKpiScreenResultsRequest = ListKpiScreenResultsRequest @typing.final class ListKpiScreenResultsResponse(google.protobuf.message.Message): """Response from ListKpiScreenResults.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + RESULTS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent list query.\n The end of the list is reached when the token is empty.\n ' + """Token for the next page of results, which can be sent to a subsequent list query. + The end of the list is reached when the token is empty. + """ total_size: builtins.int - 'Total number of rows, irrespective of paging.' - + """Total number of rows, irrespective of paging.""" @property def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.analytics.v1.kpi_messages_pb2.KpiScreenCompanyResult]: """List of results, one for each company.""" - def __init__(self, *, results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.KpiScreenCompanyResult] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + results: collections.abc.Iterable[exabel.api.analytics.v1.kpi_messages_pb2.KpiScreenCompanyResult] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["next_page_token", b"next_page_token", "results", b"results", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['next_page_token', b'next_page_token', 'results', b'results', 'total_size', b'total_size']) -> None: - ... -global___ListKpiScreenResultsResponse = ListKpiScreenResultsResponse \ No newline at end of file +global___ListKpiScreenResultsResponse = ListKpiScreenResultsResponse diff --git a/exabel/stubs/exabel/api/analytics/v1/kpi_service_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/kpi_service_pb2_grpc.py new file mode 100644 index 00000000..9dad575c --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/kpi_service_pb2_grpc.py @@ -0,0 +1,356 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import kpi_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/kpi_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class KpiServiceStub(object): + """Service to retrieve KPI results. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListKpiMappingResults = channel.unary_unary( + '/exabel.api.analytics.v1.KpiService/ListKpiMappingResults', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsResponse.FromString, + _registered_method=True) + self.ListCompanyBaseModelResults = channel.unary_unary( + '/exabel.api.analytics.v1.KpiService/ListCompanyBaseModelResults', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsResponse.FromString, + _registered_method=True) + self.ListCompanyHierarchicalModelResults = channel.unary_unary( + '/exabel.api.analytics.v1.KpiService/ListCompanyHierarchicalModelResults', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsResponse.FromString, + _registered_method=True) + self.ListCompanyKpiMappingResults = channel.unary_unary( + '/exabel.api.analytics.v1.KpiService/ListCompanyKpiMappingResults', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsResponse.FromString, + _registered_method=True) + self.ListCompanyKpiModelResults = channel.unary_unary( + '/exabel.api.analytics.v1.KpiService/ListCompanyKpiModelResults', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsResponse.FromString, + _registered_method=True) + self.ListKpiScreenResults = channel.unary_unary( + '/exabel.api.analytics.v1.KpiService/ListKpiScreenResults', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsResponse.FromString, + _registered_method=True) + + +class KpiServiceServicer(object): + """Service to retrieve KPI results. + """ + + def ListKpiMappingResults(self, request, context): + """List KPI mapping results for a single KPI mapping collection. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListCompanyBaseModelResults(self, request, context): + """List base model results for a company. + + Returns results for all modeled KPIs for the given company. This is provided as a list of KPIs, + with the latest model predictions and metadata for each KPI. + + Base models work by modeling each KPI independently, using the vendor alternative data + available to your customer/user, and combining the best signals for that KPI. + + The default "Exabel Model" that you see for all KPIs is a base model. If you have trained a + custom model and set that as your primary model for the KPI, you may see that returned instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListCompanyHierarchicalModelResults(self, request, context): + """List hierarchical model results for a company. + + Returns results for all modeled KPIs for the given company. This is provided as a list of KPIs, + with the latest model predictions and metadata for each KPI. + + Hierarchical models build on top of the base models by harmonizing their predictions with + knowledge of each company's financial model, e.g. Total revenue = Segment A + Segment B + ... + This produces more accurate predictions that are coherent across all segments. Note that + consensus may be used for KPIs for which you have no alternative data; this is denoted in the + metadata. Hierarchical models are only available for some companies - contact + support@exabel.com with requests. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListCompanyKpiMappingResults(self, request, context): + """List KPI mapping results for a single company KPI. + + Returns the statistical test results of all KPI mappings for a given company KPI. This is + provided as a list of KPI mappings, each with the model backtest MAPE/MAE, correlation scores, + MAEs, and p-values. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListCompanyKpiModelResults(self, request, context): + """List model results for a single company KPI. + + Returns all models for a given company KPI. This includes: all single-predictor models derived + from each individual KPI mapping; the Exabel model that is an automatic ensemble of the best + single-predictor models; any custom models you train; and the hierarchical model (if available) + that harmonizes model predictions across a company's KPIs as the final modeling layer. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListKpiScreenResults(self, request, context): + """List KPI screen results. + + Returns results from a saved KPI screen. This is provided as a list of companies and their KPIs + that meet the screen criteria, with the latest model predictions and metadata for each KPI. + + As KPI screens are private to each user, you should authenticate with a user-level access + token, rather than the customer-level API key (which will not have access to individual users' + KPI screens). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_KpiServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListKpiMappingResults': grpc.unary_unary_rpc_method_handler( + servicer.ListKpiMappingResults, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsResponse.SerializeToString, + ), + 'ListCompanyBaseModelResults': grpc.unary_unary_rpc_method_handler( + servicer.ListCompanyBaseModelResults, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsResponse.SerializeToString, + ), + 'ListCompanyHierarchicalModelResults': grpc.unary_unary_rpc_method_handler( + servicer.ListCompanyHierarchicalModelResults, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsResponse.SerializeToString, + ), + 'ListCompanyKpiMappingResults': grpc.unary_unary_rpc_method_handler( + servicer.ListCompanyKpiMappingResults, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsResponse.SerializeToString, + ), + 'ListCompanyKpiModelResults': grpc.unary_unary_rpc_method_handler( + servicer.ListCompanyKpiModelResults, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsResponse.SerializeToString, + ), + 'ListKpiScreenResults': grpc.unary_unary_rpc_method_handler( + servicer.ListKpiScreenResults, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.analytics.v1.KpiService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.analytics.v1.KpiService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class KpiService(object): + """Service to retrieve KPI results. + """ + + @staticmethod + def ListKpiMappingResults(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiService/ListKpiMappingResults', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListCompanyBaseModelResults(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiService/ListCompanyBaseModelResults', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListCompanyHierarchicalModelResults(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiService/ListCompanyHierarchicalModelResults', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListCompanyKpiMappingResults(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiService/ListCompanyKpiMappingResults', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListCompanyKpiModelResults(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiService/ListCompanyKpiModelResults', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListKpiScreenResults(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.KpiService/ListKpiScreenResults', + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.py b/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.py new file mode 100644 index 00000000..895969f7 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/prediction_model_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/prediction_model_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7exabel/api/analytics/v1/prediction_model_messages.proto\x12\x17\x65xabel.api.analytics.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x96\x02\n\x12PredictionModelRun\x12\x33\n\x04name\x18\x01 \x01(\tB%\x92\x41\x1fJ\x1d\"predictionModels/123/runs/3\"\xe0\x41\x03\x12\x34\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x1f\x92\x41\x1cJ\x1a\"Initiated by API request\"\x12\x42\n\rconfiguration\x18\x03 \x01(\x0e\x32+.exabel.api.analytics.v1.ModelConfiguration\x12!\n\x14\x63onfiguration_source\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\rauto_activate\x18\x05 \x01(\x08\x42\x17\n\x15_configuration_source*e\n\x12ModelConfiguration\x12%\n!MODEL_CONFIGURATION_NOT_SPECIFIED\x10\x00\x12\n\n\x06LATEST\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x10\n\x0cSPECIFIC_RUN\x10\x03\x42Z\n\x1b\x63om.exabel.api.analytics.v1B\x1cPredictionModelMessagesProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.prediction_model_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\034PredictionModelMessagesProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_PREDICTIONMODELRUN'].fields_by_name['name']._loaded_options = None + _globals['_PREDICTIONMODELRUN'].fields_by_name['name']._serialized_options = b'\222A\037J\035\"predictionModels/123/runs/3\"\340A\003' + _globals['_PREDICTIONMODELRUN'].fields_by_name['description']._loaded_options = None + _globals['_PREDICTIONMODELRUN'].fields_by_name['description']._serialized_options = b'\222A\034J\032\"Initiated by API request\"' + _globals['_MODELCONFIGURATION']._serialized_start=446 + _globals['_MODELCONFIGURATION']._serialized_end=547 + _globals['_PREDICTIONMODELRUN']._serialized_start=166 + _globals['_PREDICTIONMODELRUN']._serialized_end=444 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.pyi new file mode 100644 index 00000000..978ba2b2 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.pyi @@ -0,0 +1,92 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2022 Exabel AS. All rights reserved.""" + +import builtins +import google.protobuf.descriptor +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _ModelConfiguration: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ModelConfigurationEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ModelConfiguration.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + MODEL_CONFIGURATION_NOT_SPECIFIED: _ModelConfiguration.ValueType # 0 + """Not specified - defaults to use the latest configuration.""" + LATEST: _ModelConfiguration.ValueType # 1 + """Latest configuration.""" + ACTIVE: _ModelConfiguration.ValueType # 2 + """Configuration of the active run. A specific run may be activated from the prediction model user interface.""" + SPECIFIC_RUN: _ModelConfiguration.ValueType # 3 + """Configuration of a specific run. The run number must be specified as well.""" + +class ModelConfiguration(_ModelConfiguration, metaclass=_ModelConfigurationEnumTypeWrapper): + """Specifies which model configuration to use. If not specified, the latest model configuration is used. + Note that the current signal library is always loaded. + """ + +MODEL_CONFIGURATION_NOT_SPECIFIED: ModelConfiguration.ValueType # 0 +"""Not specified - defaults to use the latest configuration.""" +LATEST: ModelConfiguration.ValueType # 1 +"""Latest configuration.""" +ACTIVE: ModelConfiguration.ValueType # 2 +"""Configuration of the active run. A specific run may be activated from the prediction model user interface.""" +SPECIFIC_RUN: ModelConfiguration.ValueType # 3 +"""Configuration of a specific run. The run number must be specified as well.""" +global___ModelConfiguration = ModelConfiguration + +@typing.final +class PredictionModelRun(google.protobuf.message.Message): + """A prediction model run.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + CONFIGURATION_FIELD_NUMBER: builtins.int + CONFIGURATION_SOURCE_FIELD_NUMBER: builtins.int + AUTO_ACTIVATE_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the run, e.g. `predictionModels/123/runs/3`.""" + description: builtins.str + """You may use this to record some notes about the run. This is shown in the prediction model + interface when viewing all runs, and when viewing the results of a single run. + """ + configuration: global___ModelConfiguration.ValueType + """Which model configuration to use. If not specified, the latest model configuration is used. + Note that the current signal library is always loaded. + """ + configuration_source: builtins.int + """Prediction model run number from which model configuration should be retrieved, e.g. `1`. + Only relevant when `configuration` is set to `ModelConfiguration.SPECIFIC_RUN`. + """ + auto_activate: builtins.bool + """Whether to automatically set this run as active once it completes. + The run will not be activated if it fails for any of the entities in the model. + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + description: builtins.str | None = ..., + configuration: global___ModelConfiguration.ValueType | None = ..., + configuration_source: builtins.int | None = ..., + auto_activate: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_configuration_source", b"_configuration_source", "configuration_source", b"configuration_source"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_configuration_source", b"_configuration_source", "auto_activate", b"auto_activate", "configuration", b"configuration", "configuration_source", b"configuration_source", "description", b"description", "name", b"name"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_configuration_source", b"_configuration_source"]) -> typing.Literal["configuration_source"] | None: ... + +global___PredictionModelRun = PredictionModelRun diff --git a/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2_grpc.py new file mode 100644 index 00000000..639e047a --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/prediction_model_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.py b/exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.py new file mode 100644 index 00000000..5bcecf67 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/prediction_model_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/prediction_model_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import prediction_model_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n6exabel/api/analytics/v1/prediction_model_service.proto\x12\x17\x65xabel.api.analytics.v1\x1a\x37\x65xabel/api/analytics/v1/prediction_model_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x91\x01\n\x1f\x43reatePredictionModelRunRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\x92\x41\x19\xca>\x16\xfa\x02\x13predictionModelName\xe0\x41\x02\x12=\n\x03run\x18\x02 \x01(\x0b\x32+.exabel.api.analytics.v1.PredictionModelRunB\x03\xe0\x41\x02\x32\xe8\x01\n\x16PredictionModelService\x12\xcd\x01\n\x18\x43reatePredictionModelRun\x12\x38.exabel.api.analytics.v1.CreatePredictionModelRunRequest\x1a+.exabel.api.analytics.v1.PredictionModelRun\"J\x92\x41\x16\x12\x14Run prediction model\x82\xd3\xe4\x93\x02+\"$/v1/{parent=predictionModels/*}/runs:\x03runBY\n\x1b\x63om.exabel.api.analytics.v1B\x1bPredictionModelServiceProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.prediction_model_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\033PredictionModelServiceProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_CREATEPREDICTIONMODELRUNREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_CREATEPREDICTIONMODELRUNREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\031\312>\026\372\002\023predictionModelName\340A\002' + _globals['_CREATEPREDICTIONMODELRUNREQUEST'].fields_by_name['run']._loaded_options = None + _globals['_CREATEPREDICTIONMODELRUNREQUEST'].fields_by_name['run']._serialized_options = b'\340A\002' + _globals['_PREDICTIONMODELSERVICE'].methods_by_name['CreatePredictionModelRun']._loaded_options = None + _globals['_PREDICTIONMODELSERVICE'].methods_by_name['CreatePredictionModelRun']._serialized_options = b'\222A\026\022\024Run prediction model\202\323\344\223\002+\"$/v1/{parent=predictionModels/*}/runs:\003run' + _globals['_CREATEPREDICTIONMODELRUNREQUEST']._serialized_start=252 + _globals['_CREATEPREDICTIONMODELRUNREQUEST']._serialized_end=397 + _globals['_PREDICTIONMODELSERVICE']._serialized_start=400 + _globals['_PREDICTIONMODELSERVICE']._serialized_end=632 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.pyi similarity index 57% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.pyi rename to exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.pyi index a8554bcc..d8a97b59 100644 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.pyi +++ b/exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.pyi @@ -2,32 +2,39 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins -from ..... import exabel +from . import prediction_model_messages_pb2 import google.protobuf.descriptor import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class CreatePredictionModelRunRequest(google.protobuf.message.Message): """Request to CreatePredictionModelRun.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int RUN_FIELD_NUMBER: builtins.int parent: builtins.str - 'Resource name of the prediction model for which the run should be created.\n Example: `predictionModels/123`.\n ' - + """Resource name of the prediction model for which the run should be created. + Example: `predictionModels/123`. + """ @property def run(self) -> exabel.api.analytics.v1.prediction_model_messages_pb2.PredictionModelRun: """The model run.""" - def __init__(self, *, parent: builtins.str | None=..., run: exabel.api.analytics.v1.prediction_model_messages_pb2.PredictionModelRun | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['run', b'run']) -> builtins.bool: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + run: exabel.api.analytics.v1.prediction_model_messages_pb2.PredictionModelRun | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["run", b"run"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["parent", b"parent", "run", b"run"]) -> None: ... - def ClearField(self, field_name: typing.Literal['parent', b'parent', 'run', b'run']) -> None: - ... -global___CreatePredictionModelRunRequest = CreatePredictionModelRunRequest \ No newline at end of file +global___CreatePredictionModelRunRequest = CreatePredictionModelRunRequest diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2_grpc.py similarity index 50% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2_grpc.py rename to exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2_grpc.py index e0566a5f..1fe467ab 100644 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2_grpc.py +++ b/exabel/stubs/exabel/api/analytics/v1/prediction_model_service_pb2_grpc.py @@ -1,18 +1,30 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import warnings -from .....exabel.api.analytics.v1 import prediction_model_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2 -from .....exabel.api.analytics.v1 import prediction_model_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__service__pb2 -GRPC_GENERATED_VERSION = '1.71.2' + +from . import prediction_model_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2 +from . import prediction_model_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__service__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False + try: from grpc._utilities import first_version_is_lower _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) except ImportError: _version_not_supported = True + if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/prediction_model_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/prediction_model_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + class PredictionModelServiceStub(object): """Service to manage prediction models. @@ -32,7 +44,12 @@ def __init__(self, channel): Args: channel: A grpc.Channel. """ - self.CreatePredictionModelRun = channel.unary_unary('/exabel.api.analytics.v1.PredictionModelService/CreatePredictionModelRun', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__service__pb2.CreatePredictionModelRunRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2.PredictionModelRun.FromString, _registered_method=True) + self.CreatePredictionModelRun = channel.unary_unary( + '/exabel.api.analytics.v1.PredictionModelService/CreatePredictionModelRun', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__service__pb2.CreatePredictionModelRunRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2.PredictionModelRun.FromString, + _registered_method=True) + class PredictionModelServiceServicer(object): """Service to manage prediction models. @@ -53,12 +70,22 @@ def CreatePredictionModelRun(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def add_PredictionModelServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'CreatePredictionModelRun': grpc.unary_unary_rpc_method_handler(servicer.CreatePredictionModelRun, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__service__pb2.CreatePredictionModelRunRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2.PredictionModelRun.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.analytics.v1.PredictionModelService', rpc_method_handlers) + rpc_method_handlers = { + 'CreatePredictionModelRun': grpc.unary_unary_rpc_method_handler( + servicer.CreatePredictionModelRun, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__service__pb2.CreatePredictionModelRunRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2.PredictionModelRun.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.analytics.v1.PredictionModelService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) server.add_registered_method_handlers('exabel.api.analytics.v1.PredictionModelService', rpc_method_handlers) + + # This class is part of an EXPERIMENTAL API. class PredictionModelService(object): """Service to manage prediction models. @@ -72,5 +99,28 @@ class PredictionModelService(object): """ @staticmethod - def CreatePredictionModelRun(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.PredictionModelService/CreatePredictionModelRun', exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__service__pb2.CreatePredictionModelRunRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2.PredictionModelRun.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file + def CreatePredictionModelRun(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.PredictionModelService/CreatePredictionModelRun', + exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__service__pb2.CreatePredictionModelRunRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2.PredictionModelRun.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/analytics/v1/service_pb2.py b/exabel/stubs/exabel/api/analytics/v1/service_pb2.py new file mode 100644 index 00000000..f842d3bd --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/service_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%exabel/api/analytics/v1/service.proto\x12\x17\x65xabel.api.analytics.v1\x1a.protoc_gen_openapiv2/options/annotations.protoB\xa9\x03\n\x1b\x63om.exabel.api.analytics.v1B\x0cServiceProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1\x92\x41\xdb\x02\x12T\n\x14\x45xabel Analytics API\"5\n\x06\x45xabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x05\x31.0.0\x1a\x18\x61nalytics.api.exabel.com*\x01\x02\x32\x10\x61pplication/json:\x10\x61pplication/jsonZR\n#\n\x07\x41PI key\x12\x18\x08\x02\x12\x07\x41PI key\x1a\tx-api-key \x02\n+\n\x06\x42\x65\x61rer\x12!\x08\x02\x12\x0c\x41\x63\x63\x65ss token\x1a\rauthorization \x02\x62\r\n\x0b\n\x07\x41PI key\x12\x00\x62\x0c\n\n\n\x06\x42\x65\x61rer\x12\x00rQ\n#More about the Exabel Analytics API\x12*https://help.exabel.com/docs/analytics-apib\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\014ServiceProtoP\001Z\033exabel.com/api/analytics/v1\222A\333\002\022T\n\024Exabel Analytics API\"5\n\006Exabel\022\027https://www.exabel.com/\032\022support@exabel.com2\0051.0.0\032\030analytics.api.exabel.com*\001\0022\020application/json:\020application/jsonZR\n#\n\007API key\022\030\010\002\022\007API key\032\tx-api-key \002\n+\n\006Bearer\022!\010\002\022\014Access token\032\rauthorization \002b\r\n\013\n\007API key\022\000b\014\n\n\n\006Bearer\022\000rQ\n#More about the Exabel Analytics API\022*https://help.exabel.com/docs/analytics-api' +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/service_pb2.pyi similarity index 74% rename from exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2.pyi rename to exabel/stubs/exabel/api/analytics/v1/service_pb2.pyi index b5115531..c98e324e 100644 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2.pyi +++ b/exabel/stubs/exabel/api/analytics/v1/service_pb2.pyi @@ -2,5 +2,7 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2022 Exabel AS. All rights reserved.""" + import google.protobuf.descriptor -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor \ No newline at end of file + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/exabel/stubs/exabel/api/analytics/v1/service_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/service_pb2_grpc.py new file mode 100644 index 00000000..51d8d89f --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/service_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2.py b/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2.py new file mode 100644 index 00000000..0d454dee --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/tag_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/tag_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import item_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_item__messages__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/analytics/v1/tag_messages.proto\x12\x17\x65xabel.api.analytics.v1\x1a+exabel/api/analytics/v1/item_messages.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\xc5\x01\n\x03Tag\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12#\n\x0c\x64isplay_name\x18\x02 \x01(\tB\r\x92\x41\nJ\x08\"My tag\"\x12.\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x19\x92\x41\x16J\x14\"My tag description\"\x12\x18\n\x0b\x65ntity_type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12<\n\x08metadata\x18\x05 \x01(\x0b\x32%.exabel.api.analytics.v1.ItemMetadataB\x03\xe0\x41\x03\x42N\n\x1b\x63om.exabel.api.analytics.v1B\x10TagMessagesProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.tag_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\020TagMessagesProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_TAG'].fields_by_name['name']._loaded_options = None + _globals['_TAG'].fields_by_name['name']._serialized_options = b'\340A\003' + _globals['_TAG'].fields_by_name['display_name']._loaded_options = None + _globals['_TAG'].fields_by_name['display_name']._serialized_options = b'\222A\nJ\010\"My tag\"' + _globals['_TAG'].fields_by_name['description']._loaded_options = None + _globals['_TAG'].fields_by_name['description']._serialized_options = b'\222A\026J\024\"My tag description\"' + _globals['_TAG'].fields_by_name['entity_type']._loaded_options = None + _globals['_TAG'].fields_by_name['entity_type']._serialized_options = b'\340A\003' + _globals['_TAG'].fields_by_name['metadata']._loaded_options = None + _globals['_TAG'].fields_by_name['metadata']._serialized_options = b'\340A\003' + _globals['_TAG']._serialized_start=198 + _globals['_TAG']._serialized_end=395 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2.pyi new file mode 100644 index 00000000..e123414c --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2.pyi @@ -0,0 +1,56 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +""" + +import builtins +from . import item_messages_pb2 +import google.protobuf.descriptor +import google.protobuf.message +import typing +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class Tag(google.protobuf.message.Message): + """Represents a tag.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + ENTITY_TYPE_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the tag, e.g. `tags/user:806f697b-e9fa-4443-9f92-ba46e5b60930`.""" + display_name: builtins.str + """Display name of the tag. This is shown wherever the tag is used in the Exabel app.""" + description: builtins.str + """You may use this to provide more information about the tag. This is shown in the Library when + browsing for tags. + """ + entity_type: builtins.str + """Resource name of the tag's entity type. + + Tags can only contain entities of one entity type. For new tags, this is set once the first + entity is added. + """ + @property + def metadata(self) -> exabel.api.analytics.v1.item_messages_pb2.ItemMetadata: + """Metadata about the tag.""" + + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + description: builtins.str | None = ..., + entity_type: builtins.str | None = ..., + metadata: exabel.api.analytics.v1.item_messages_pb2.ItemMetadata | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["metadata", b"metadata"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "display_name", b"display_name", "entity_type", b"entity_type", "metadata", b"metadata", "name", b"name"]) -> None: ... + +global___Tag = Tag diff --git a/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2_grpc.py new file mode 100644 index 00000000..d4e5954d --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/tag_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/tag_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/analytics/v1/tag_service_pb2.py b/exabel/stubs/exabel/api/analytics/v1/tag_service_pb2.py new file mode 100644 index 00000000..2f54da9d --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/tag_service_pb2.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/analytics/v1/tag_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/analytics/v1/tag_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import tag_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/analytics/v1/tag_service.proto\x12\x17\x65xabel.api.analytics.v1\x1a*exabel/api/analytics/v1/tag_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"R\n\x10\x43reateTagRequest\x12.\n\x03tag\x18\x01 \x01(\x0b\x32\x1c.exabel.api.analytics.v1.TagB\x03\xe0\x41\x02\x12\x0e\n\x06\x66older\x18\x02 \x01(\t\"2\n\rGetTagRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92\x41\r\xca>\n\xfa\x02\x07tagName\xe0\x41\x02\"s\n\x10UpdateTagRequest\x12.\n\x03tag\x18\x01 \x01(\x0b\x32\x1c.exabel.api.analytics.v1.TagB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"5\n\x10\x44\x65leteTagRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92\x41\r\xca>\n\xfa\x02\x07tagName\xe0\x41\x02\"`\n\x0fListTagsRequest\x12\x39\n\tpage_size\x18\x01 \x01(\x05\x42&\x92\x41#2!Maximum number of tags to return.\x12\x12\n\npage_token\x18\x02 \x01(\t\"k\n\x10ListTagsResponse\x12*\n\x04tags\x18\x01 \x03(\x0b\x32\x1c.exabel.api.analytics.v1.Tag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"M\n\x12\x41\x64\x64\x45ntitiesRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92\x41\r\xca>\n\xfa\x02\x07tagName\xe0\x41\x02\x12\x14\n\x0c\x65ntity_names\x18\x02 \x03(\t\"\x15\n\x13\x41\x64\x64\x45ntitiesResponse\"P\n\x15RemoveEntitiesRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92\x41\r\xca>\n\xfa\x02\x07tagName\xe0\x41\x02\x12\x14\n\x0c\x65ntity_names\x18\x02 \x03(\t\"\x18\n\x16RemoveEntitiesResponse\"\x90\x01\n\x16ListTagEntitiesRequest\x12#\n\x06parent\x18\x01 \x01(\tB\x13\x92\x41\r\xca>\n\xfa\x02\x07tagName\xe0\x41\x02\x12=\n\tpage_size\x18\x02 \x01(\x05\x42*\x92\x41\'2%Maximum number of entities to return.\x12\x12\n\npage_token\x18\x03 \x01(\t\"\\\n\x17ListTagEntitiesResponse\x12\x14\n\x0c\x65ntity_names\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\x32\xa5\t\n\nTagService\x12z\n\tCreateTag\x12).exabel.api.analytics.v1.CreateTagRequest\x1a\x1c.exabel.api.analytics.v1.Tag\"$\x92\x41\x0c\x12\nCreate tag\x82\xd3\xe4\x93\x02\x0f\"\x08/v1/tags:\x03tag\x12u\n\x06GetTag\x12&.exabel.api.analytics.v1.GetTagRequest\x1a\x1c.exabel.api.analytics.v1.Tag\"%\x92\x41\t\x12\x07Get tag\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/{name=tags/*}\x12\x87\x01\n\tUpdateTag\x12).exabel.api.analytics.v1.UpdateTagRequest\x1a\x1c.exabel.api.analytics.v1.Tag\"1\x92\x41\x0c\x12\nUpdate tag\x82\xd3\xe4\x93\x02\x1c\x32\x15/v1/{tag.name=tags/*}:\x03tag\x12x\n\tDeleteTag\x12).exabel.api.analytics.v1.DeleteTagRequest\x1a\x16.google.protobuf.Empty\"(\x92\x41\x0c\x12\nDelete tag\x82\xd3\xe4\x93\x02\x13*\x11/v1/{name=tags/*}\x12\x7f\n\x08ListTags\x12(.exabel.api.analytics.v1.ListTagsRequest\x1a).exabel.api.analytics.v1.ListTagsResponse\"\x1e\x92\x41\x0b\x12\tList tags\x82\xd3\xe4\x93\x02\n\x12\x08/v1/tags\x12\xaa\x01\n\x0b\x41\x64\x64\x45ntities\x12+.exabel.api.analytics.v1.AddEntitiesRequest\x1a,.exabel.api.analytics.v1.AddEntitiesResponse\"@\x92\x41\x15\x12\x13\x41\x64\x64 entities to tag\x82\xd3\xe4\x93\x02\"\"\x1d/v1/{name=tags/*}:addEntities:\x01*\x12\xbb\x01\n\x0eRemoveEntities\x12..exabel.api.analytics.v1.RemoveEntitiesRequest\x1a/.exabel.api.analytics.v1.RemoveEntitiesResponse\"H\x92\x41\x1a\x12\x18Remove entities from tag\x82\xd3\xe4\x93\x02%\" /v1/{name=tags/*}:removeEntities:\x01*\x12\xb3\x01\n\x0fListTagEntities\x12/.exabel.api.analytics.v1.ListTagEntitiesRequest\x1a\x30.exabel.api.analytics.v1.ListTagEntitiesResponse\"=\x92\x41\x16\x12\x14List entities in tag\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{parent=tags/*}/entitiesBM\n\x1b\x63om.exabel.api.analytics.v1B\x0fTagServiceProtoP\x01Z\x1b\x65xabel.com/api/analytics/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.tag_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\033com.exabel.api.analytics.v1B\017TagServiceProtoP\001Z\033exabel.com/api/analytics/v1' + _globals['_CREATETAGREQUEST'].fields_by_name['tag']._loaded_options = None + _globals['_CREATETAGREQUEST'].fields_by_name['tag']._serialized_options = b'\340A\002' + _globals['_GETTAGREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETTAGREQUEST'].fields_by_name['name']._serialized_options = b'\222A\r\312>\n\372\002\007tagName\340A\002' + _globals['_UPDATETAGREQUEST'].fields_by_name['tag']._loaded_options = None + _globals['_UPDATETAGREQUEST'].fields_by_name['tag']._serialized_options = b'\340A\002' + _globals['_DELETETAGREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETETAGREQUEST'].fields_by_name['name']._serialized_options = b'\222A\r\312>\n\372\002\007tagName\340A\002' + _globals['_LISTTAGSREQUEST'].fields_by_name['page_size']._loaded_options = None + _globals['_LISTTAGSREQUEST'].fields_by_name['page_size']._serialized_options = b'\222A#2!Maximum number of tags to return.' + _globals['_ADDENTITIESREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_ADDENTITIESREQUEST'].fields_by_name['name']._serialized_options = b'\222A\r\312>\n\372\002\007tagName\340A\002' + _globals['_REMOVEENTITIESREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_REMOVEENTITIESREQUEST'].fields_by_name['name']._serialized_options = b'\222A\r\312>\n\372\002\007tagName\340A\002' + _globals['_LISTTAGENTITIESREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTTAGENTITIESREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\r\312>\n\372\002\007tagName\340A\002' + _globals['_LISTTAGENTITIESREQUEST'].fields_by_name['page_size']._loaded_options = None + _globals['_LISTTAGENTITIESREQUEST'].fields_by_name['page_size']._serialized_options = b'\222A\'2%Maximum number of entities to return.' + _globals['_TAGSERVICE'].methods_by_name['CreateTag']._loaded_options = None + _globals['_TAGSERVICE'].methods_by_name['CreateTag']._serialized_options = b'\222A\014\022\nCreate tag\202\323\344\223\002\017\"\010/v1/tags:\003tag' + _globals['_TAGSERVICE'].methods_by_name['GetTag']._loaded_options = None + _globals['_TAGSERVICE'].methods_by_name['GetTag']._serialized_options = b'\222A\t\022\007Get tag\202\323\344\223\002\023\022\021/v1/{name=tags/*}' + _globals['_TAGSERVICE'].methods_by_name['UpdateTag']._loaded_options = None + _globals['_TAGSERVICE'].methods_by_name['UpdateTag']._serialized_options = b'\222A\014\022\nUpdate tag\202\323\344\223\002\0342\025/v1/{tag.name=tags/*}:\003tag' + _globals['_TAGSERVICE'].methods_by_name['DeleteTag']._loaded_options = None + _globals['_TAGSERVICE'].methods_by_name['DeleteTag']._serialized_options = b'\222A\014\022\nDelete tag\202\323\344\223\002\023*\021/v1/{name=tags/*}' + _globals['_TAGSERVICE'].methods_by_name['ListTags']._loaded_options = None + _globals['_TAGSERVICE'].methods_by_name['ListTags']._serialized_options = b'\222A\013\022\tList tags\202\323\344\223\002\n\022\010/v1/tags' + _globals['_TAGSERVICE'].methods_by_name['AddEntities']._loaded_options = None + _globals['_TAGSERVICE'].methods_by_name['AddEntities']._serialized_options = b'\222A\025\022\023Add entities to tag\202\323\344\223\002\"\"\035/v1/{name=tags/*}:addEntities:\001*' + _globals['_TAGSERVICE'].methods_by_name['RemoveEntities']._loaded_options = None + _globals['_TAGSERVICE'].methods_by_name['RemoveEntities']._serialized_options = b'\222A\032\022\030Remove entities from tag\202\323\344\223\002%\" /v1/{name=tags/*}:removeEntities:\001*' + _globals['_TAGSERVICE'].methods_by_name['ListTagEntities']._loaded_options = None + _globals['_TAGSERVICE'].methods_by_name['ListTagEntities']._serialized_options = b'\222A\026\022\024List entities in tag\202\323\344\223\002\036\022\034/v1/{parent=tags/*}/entities' + _globals['_CREATETAGREQUEST']._serialized_start=288 + _globals['_CREATETAGREQUEST']._serialized_end=370 + _globals['_GETTAGREQUEST']._serialized_start=372 + _globals['_GETTAGREQUEST']._serialized_end=422 + _globals['_UPDATETAGREQUEST']._serialized_start=424 + _globals['_UPDATETAGREQUEST']._serialized_end=539 + _globals['_DELETETAGREQUEST']._serialized_start=541 + _globals['_DELETETAGREQUEST']._serialized_end=594 + _globals['_LISTTAGSREQUEST']._serialized_start=596 + _globals['_LISTTAGSREQUEST']._serialized_end=692 + _globals['_LISTTAGSRESPONSE']._serialized_start=694 + _globals['_LISTTAGSRESPONSE']._serialized_end=801 + _globals['_ADDENTITIESREQUEST']._serialized_start=803 + _globals['_ADDENTITIESREQUEST']._serialized_end=880 + _globals['_ADDENTITIESRESPONSE']._serialized_start=882 + _globals['_ADDENTITIESRESPONSE']._serialized_end=903 + _globals['_REMOVEENTITIESREQUEST']._serialized_start=905 + _globals['_REMOVEENTITIESREQUEST']._serialized_end=985 + _globals['_REMOVEENTITIESRESPONSE']._serialized_start=987 + _globals['_REMOVEENTITIESRESPONSE']._serialized_end=1011 + _globals['_LISTTAGENTITIESREQUEST']._serialized_start=1014 + _globals['_LISTTAGENTITIESREQUEST']._serialized_end=1158 + _globals['_LISTTAGENTITIESRESPONSE']._serialized_start=1160 + _globals['_LISTTAGENTITIESRESPONSE']._serialized_end=1252 + _globals['_TAGSERVICE']._serialized_start=1255 + _globals['_TAGSERVICE']._serialized_end=2444 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2.pyi b/exabel/stubs/exabel/api/analytics/v1/tag_service_pb2.pyi similarity index 53% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2.pyi rename to exabel/stubs/exabel/api/analytics/v1/tag_service_pb2.pyi index fb652c72..d12a3b6e 100644 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2.pyi +++ b/exabel/stubs/exabel/api/analytics/v1/tag_service_pb2.pyi @@ -2,61 +2,75 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import tag_messages_pb2 import google.protobuf.descriptor import google.protobuf.field_mask_pb2 import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class CreateTagRequest(google.protobuf.message.Message): """Request to CreateTag.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TAG_FIELD_NUMBER: builtins.int FOLDER_FIELD_NUMBER: builtins.int folder: builtins.str - 'Resource name of the Library folder to create the signal in, e.g. `folders/123`. If not\n specified, the signal will be created in an “Analytics API” folder that is shared with the\n customer user group.\n ' - + """Resource name of the Library folder to create the signal in, e.g. `folders/123`. If not + specified, the signal will be created in an “Analytics API” folder that is shared with the + customer user group. + """ @property def tag(self) -> exabel.api.analytics.v1.tag_messages_pb2.Tag: """A tag""" - def __init__(self, *, tag: exabel.api.analytics.v1.tag_messages_pb2.Tag | None=..., folder: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['tag', b'tag']) -> builtins.bool: - ... + def __init__( + self, + *, + tag: exabel.api.analytics.v1.tag_messages_pb2.Tag | None = ..., + folder: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["tag", b"tag"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["folder", b"folder", "tag", b"tag"]) -> None: ... - def ClearField(self, field_name: typing.Literal['folder', b'folder', 'tag', b'tag']) -> None: - ... global___CreateTagRequest = CreateTagRequest @typing.final class GetTagRequest(google.protobuf.message.Message): """Request to GetTag.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'Resource name of the requested tag\n Example: `tags/user:abc123`.\n ' + """Resource name of the requested tag + Example: `tags/user:abc123`. + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetTagRequest = GetTagRequest @typing.final class UpdateTagRequest(google.protobuf.message.Message): """Request to UpdateTag.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TAG_FIELD_NUMBER: builtins.int UPDATE_MASK_FIELD_NUMBER: builtins.int - @property def tag(self) -> exabel.api.analytics.v1.tag_messages_pb2.Tag: """A tag.""" @@ -69,172 +83,223 @@ class UpdateTagRequest(google.protobuf.message.Message): For REST requests, this is a comma-separated string. """ - def __init__(self, *, tag: exabel.api.analytics.v1.tag_messages_pb2.Tag | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['tag', b'tag', 'update_mask', b'update_mask']) -> builtins.bool: - ... + def __init__( + self, + *, + tag: exabel.api.analytics.v1.tag_messages_pb2.Tag | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["tag", b"tag", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["tag", b"tag", "update_mask", b"update_mask"]) -> None: ... - def ClearField(self, field_name: typing.Literal['tag', b'tag', 'update_mask', b'update_mask']) -> None: - ... global___UpdateTagRequest = UpdateTagRequest @typing.final class DeleteTagRequest(google.protobuf.message.Message): """Request to DeleteTag.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The tag resource name.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """The tag resource name.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___DeleteTagRequest = DeleteTagRequest @typing.final class ListTagsRequest(google.protobuf.message.Message): """Request to list tags.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int page_size: builtins.int - 'Maximum number of tags to return. Default is 20 and max is 1000.' + """Maximum number of tags to return. Default is 20 and max is 1000.""" page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the same\n query parameters.\n ' + """Token for a specific page of results, as returned from a previous list request with the same + query parameters. + """ + def __init__( + self, + *, + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token"]) -> None: ... - def __init__(self, *, page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token']) -> None: - ... global___ListTagsRequest = ListTagsRequest @typing.final class ListTagsResponse(google.protobuf.message.Message): """Response to list tags.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TAGS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the token is empty.\n ' + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the token is empty. + """ total_size: builtins.int - 'Total number of results, irrespective of paging.' - + """Total number of results, irrespective of paging.""" @property def tags(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.analytics.v1.tag_messages_pb2.Tag]: """The tags in the requested page.""" - def __init__(self, *, tags: collections.abc.Iterable[exabel.api.analytics.v1.tag_messages_pb2.Tag] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + tags: collections.abc.Iterable[exabel.api.analytics.v1.tag_messages_pb2.Tag] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["next_page_token", b"next_page_token", "tags", b"tags", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['next_page_token', b'next_page_token', 'tags', b'tags', 'total_size', b'total_size']) -> None: - ... global___ListTagsResponse = ListTagsResponse @typing.final class AddEntitiesRequest(google.protobuf.message.Message): """Request to add entities to tag.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int ENTITY_NAMES_FIELD_NUMBER: builtins.int name: builtins.str - 'Resource name of the tag to add entities to\n Example: `tags/user:abc123`.\n ' - + """Resource name of the tag to add entities to + Example: `tags/user:abc123`. + """ @property def entity_names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """List of entity resource names to add to tag. You may find these resource names with the EntityService. """ - def __init__(self, *, name: builtins.str | None=..., entity_names: collections.abc.Iterable[builtins.str] | None=...) -> None: - ... + def __init__( + self, + *, + name: builtins.str | None = ..., + entity_names: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entity_names", b"entity_names", "name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entity_names', b'entity_names', 'name', b'name']) -> None: - ... global___AddEntitiesRequest = AddEntitiesRequest @typing.final class AddEntitiesResponse(google.protobuf.message.Message): """Response to add entities to a tag""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... + def __init__( + self, + ) -> None: ... + global___AddEntitiesResponse = AddEntitiesResponse @typing.final class RemoveEntitiesRequest(google.protobuf.message.Message): """Request to remove entities from a tag.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int ENTITY_NAMES_FIELD_NUMBER: builtins.int name: builtins.str - 'Resource name of the tag to remove entities from\n Example: `tags/user:abc123`.\n ' - + """Resource name of the tag to remove entities from + Example: `tags/user:abc123`. + """ @property def entity_names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """List of entity resource names to remove from tag.""" - def __init__(self, *, name: builtins.str | None=..., entity_names: collections.abc.Iterable[builtins.str] | None=...) -> None: - ... + def __init__( + self, + *, + name: builtins.str | None = ..., + entity_names: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entity_names", b"entity_names", "name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entity_names', b'entity_names', 'name', b'name']) -> None: - ... global___RemoveEntitiesRequest = RemoveEntitiesRequest @typing.final class RemoveEntitiesResponse(google.protobuf.message.Message): """Response to remove entities from a tag""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... + def __init__( + self, + ) -> None: ... + global___RemoveEntitiesResponse = RemoveEntitiesResponse @typing.final class ListTagEntitiesRequest(google.protobuf.message.Message): """Request to list entities in a tag.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int parent: builtins.str - 'The parent tag to list entities for\n Example: `tags/user:abc123`.\n ' + """The parent tag to list entities for + Example: `tags/user:abc123`. + """ page_size: builtins.int - 'Maximum number of entities to return. Default is 20 and max is 1000.' + """Maximum number of entities to return. Default is 20 and max is 1000.""" page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the same\n query parameters.\n ' - - def __init__(self, *, parent: builtins.str | None=..., page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... + """Token for a specific page of results, as returned from a previous list request with the same + query parameters. + """ + def __init__( + self, + *, + parent: builtins.str | None = ..., + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token", "parent", b"parent"]) -> None: ... - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token', 'parent', b'parent']) -> None: - ... global___ListTagEntitiesRequest = ListTagEntitiesRequest @typing.final class ListTagEntitiesResponse(google.protobuf.message.Message): """Response to list entities in a tag.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENTITY_NAMES_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the token is empty.\n ' + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the token is empty. + """ total_size: builtins.int - 'Total number of results, irrespective of paging.' - + """Total number of results, irrespective of paging.""" @property def entity_names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """List of entity resource names.""" - def __init__(self, *, entity_names: collections.abc.Iterable[builtins.str] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + entity_names: collections.abc.Iterable[builtins.str] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entity_names", b"entity_names", "next_page_token", b"next_page_token", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entity_names', b'entity_names', 'next_page_token', b'next_page_token', 'total_size', b'total_size']) -> None: - ... -global___ListTagEntitiesResponse = ListTagEntitiesResponse \ No newline at end of file +global___ListTagEntitiesResponse = ListTagEntitiesResponse diff --git a/exabel/stubs/exabel/api/analytics/v1/tag_service_pb2_grpc.py b/exabel/stubs/exabel/api/analytics/v1/tag_service_pb2_grpc.py new file mode 100644 index 00000000..f79bc509 --- /dev/null +++ b/exabel/stubs/exabel/api/analytics/v1/tag_service_pb2_grpc.py @@ -0,0 +1,436 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import tag_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2 +from . import tag_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/analytics/v1/tag_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class TagServiceStub(object): + """Service for managing tags. See the User Guide for more information about tags: + https://help.exabel.com/docs/tags-screens + + Requests to the TagService are executed in the context of the customer's service account (SA). + The SA is a special user that is a member of the customer user group, giving it access to all + folders that are shared with this user group, but not to private folders. + Hence, only tags that are in folders shared to the SA, via the customer user group, + will be accessible via the TagService. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateTag = channel.unary_unary( + '/exabel.api.analytics.v1.TagService/CreateTag', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.CreateTagRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, + _registered_method=True) + self.GetTag = channel.unary_unary( + '/exabel.api.analytics.v1.TagService/GetTag', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.GetTagRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, + _registered_method=True) + self.UpdateTag = channel.unary_unary( + '/exabel.api.analytics.v1.TagService/UpdateTag', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.UpdateTagRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, + _registered_method=True) + self.DeleteTag = channel.unary_unary( + '/exabel.api.analytics.v1.TagService/DeleteTag', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.DeleteTagRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.ListTags = channel.unary_unary( + '/exabel.api.analytics.v1.TagService/ListTags', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsResponse.FromString, + _registered_method=True) + self.AddEntities = channel.unary_unary( + '/exabel.api.analytics.v1.TagService/AddEntities', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesResponse.FromString, + _registered_method=True) + self.RemoveEntities = channel.unary_unary( + '/exabel.api.analytics.v1.TagService/RemoveEntities', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesResponse.FromString, + _registered_method=True) + self.ListTagEntities = channel.unary_unary( + '/exabel.api.analytics.v1.TagService/ListTagEntities', + request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesResponse.FromString, + _registered_method=True) + + +class TagServiceServicer(object): + """Service for managing tags. See the User Guide for more information about tags: + https://help.exabel.com/docs/tags-screens + + Requests to the TagService are executed in the context of the customer's service account (SA). + The SA is a special user that is a member of the customer user group, giving it access to all + folders that are shared with this user group, but not to private folders. + Hence, only tags that are in folders shared to the SA, via the customer user group, + will be accessible via the TagService. + """ + + def CreateTag(self, request, context): + """Create a tag. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetTag(self, request, context): + """Get a tag. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateTag(self, request, context): + """Update a tag. + + Note that this method will update all fields unless `update_mask` is set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteTag(self, request, context): + """Delete a tag. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListTags(self, request, context): + """List all tags accessible by the user. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def AddEntities(self, request, context): + """Add entities to a tag. Entities that exist in the tag already will be ignored + + Entities that exist in the tag already will be ignored. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RemoveEntities(self, request, context): + """Remove a set of entities from tag. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListTagEntities(self, request, context): + """List all entities in a tag. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_TagServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'CreateTag': grpc.unary_unary_rpc_method_handler( + servicer.CreateTag, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.CreateTagRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.SerializeToString, + ), + 'GetTag': grpc.unary_unary_rpc_method_handler( + servicer.GetTag, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.GetTagRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.SerializeToString, + ), + 'UpdateTag': grpc.unary_unary_rpc_method_handler( + servicer.UpdateTag, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.UpdateTagRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.SerializeToString, + ), + 'DeleteTag': grpc.unary_unary_rpc_method_handler( + servicer.DeleteTag, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.DeleteTagRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'ListTags': grpc.unary_unary_rpc_method_handler( + servicer.ListTags, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsResponse.SerializeToString, + ), + 'AddEntities': grpc.unary_unary_rpc_method_handler( + servicer.AddEntities, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesResponse.SerializeToString, + ), + 'RemoveEntities': grpc.unary_unary_rpc_method_handler( + servicer.RemoveEntities, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesResponse.SerializeToString, + ), + 'ListTagEntities': grpc.unary_unary_rpc_method_handler( + servicer.ListTagEntities, + request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesRequest.FromString, + response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.analytics.v1.TagService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.analytics.v1.TagService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class TagService(object): + """Service for managing tags. See the User Guide for more information about tags: + https://help.exabel.com/docs/tags-screens + + Requests to the TagService are executed in the context of the customer's service account (SA). + The SA is a special user that is a member of the customer user group, giving it access to all + folders that are shared with this user group, but not to private folders. + Hence, only tags that are in folders shared to the SA, via the customer user group, + will be accessible via the TagService. + """ + + @staticmethod + def CreateTag(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.TagService/CreateTag', + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.CreateTagRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetTag(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.TagService/GetTag', + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.GetTagRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateTag(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.TagService/UpdateTag', + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.UpdateTagRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteTag(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.TagService/DeleteTag', + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.DeleteTagRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListTags(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.TagService/ListTags', + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def AddEntities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.TagService/AddEntities', + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def RemoveEntities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.TagService/RemoveEntities', + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListTagEntities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.analytics.v1.TagService/ListTagEntities', + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesRequest.SerializeToString, + exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel_data_sdk/stubs/exabel/api/data/__init__.py b/exabel/stubs/exabel/api/data/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/data/__init__.py rename to exabel/stubs/exabel/api/data/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/data/__init__.pyi b/exabel/stubs/exabel/api/data/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/data/__init__.pyi rename to exabel/stubs/exabel/api/data/__init__.pyi diff --git a/exabel_data_sdk/stubs/exabel/api/data/all_pb2.py b/exabel/stubs/exabel/api/data/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/data/all_pb2.py rename to exabel/stubs/exabel/api/data/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/data/all_pb2_grpc.py b/exabel/stubs/exabel/api/data/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/data/all_pb2_grpc.py rename to exabel/stubs/exabel/api/data/all_pb2_grpc.py diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/__init__.py b/exabel/stubs/exabel/api/data/v1/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/data/v1/__init__.py rename to exabel/stubs/exabel/api/data/v1/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/__init__.pyi b/exabel/stubs/exabel/api/data/v1/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/data/v1/__init__.pyi rename to exabel/stubs/exabel/api/data/v1/__init__.pyi diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/all_pb2.py b/exabel/stubs/exabel/api/data/v1/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/data/v1/all_pb2.py rename to exabel/stubs/exabel/api/data/v1/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/all_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/data/v1/all_pb2_grpc.py rename to exabel/stubs/exabel/api/data/v1/all_pb2_grpc.py diff --git a/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2.py new file mode 100644 index 00000000..b094c514 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/calendar_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/calendar_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ...time import date_pb2 as exabel_dot_api_dot_time_dot_date__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/data/v1/calendar_messages.proto\x12\x12\x65xabel.api.data.v1\x1a\x1a\x65xabel/api/time/date.proto\x1a\x1fgoogle/api/field_behavior.proto\"\xc7\x01\n\x0c\x46iscalPeriod\x12\x30\n\tfrequency\x18\x01 \x01(\x0e\x32\x1d.exabel.api.data.v1.Frequency\x12.\n\nstart_date\x18\x03 \x01(\x0b\x32\x15.exabel.api.time.DateB\x03\xe0\x41\x03\x12\'\n\x08\x65nd_date\x18\x02 \x01(\x0b\x32\x15.exabel.api.time.Date\x12\x12\n\x05label\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bis_reported\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03*Q\n\tFrequency\x12\x19\n\x15\x46REQUENCY_UNSPECIFIED\x10\x00\x12\r\n\tQUARTERLY\x10\x01\x12\x0e\n\nSEMIANNUAL\x10\x02\x12\n\n\x06\x41NNUAL\x10\x03\x42I\n\x16\x63om.exabel.api.data.v1B\x15\x43\x61lendarMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.calendar_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\025CalendarMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_FISCALPERIOD'].fields_by_name['start_date']._loaded_options = None + _globals['_FISCALPERIOD'].fields_by_name['start_date']._serialized_options = b'\340A\003' + _globals['_FISCALPERIOD'].fields_by_name['label']._loaded_options = None + _globals['_FISCALPERIOD'].fields_by_name['label']._serialized_options = b'\340A\003' + _globals['_FISCALPERIOD'].fields_by_name['is_reported']._loaded_options = None + _globals['_FISCALPERIOD'].fields_by_name['is_reported']._serialized_options = b'\340A\003' + _globals['_FREQUENCY']._serialized_start=329 + _globals['_FREQUENCY']._serialized_end=410 + _globals['_FISCALPERIOD']._serialized_start=128 + _globals['_FISCALPERIOD']._serialized_end=327 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2.pyi new file mode 100644 index 00000000..7d102eb6 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2.pyi @@ -0,0 +1,87 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2025 Exabel AS. All rights reserved.""" + +import builtins +from ...time import date_pb2 +import google.protobuf.descriptor +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _Frequency: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _FrequencyEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Frequency.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + FREQUENCY_UNSPECIFIED: _Frequency.ValueType # 0 + """The frequency of the fiscal period is unspecified.""" + QUARTERLY: _Frequency.ValueType # 1 + """The fiscal period is quarterly.""" + SEMIANNUAL: _Frequency.ValueType # 2 + """The fiscal period is semi-annual.""" + ANNUAL: _Frequency.ValueType # 3 + """The fiscal periods is annual.""" + +class Frequency(_Frequency, metaclass=_FrequencyEnumTypeWrapper): + """The frequency of a fiscal period.""" + +FREQUENCY_UNSPECIFIED: Frequency.ValueType # 0 +"""The frequency of the fiscal period is unspecified.""" +QUARTERLY: Frequency.ValueType # 1 +"""The fiscal period is quarterly.""" +SEMIANNUAL: Frequency.ValueType # 2 +"""The fiscal period is semi-annual.""" +ANNUAL: Frequency.ValueType # 3 +"""The fiscal periods is annual.""" +global___Frequency = Frequency + +@typing.final +class FiscalPeriod(google.protobuf.message.Message): + """A fiscal period of a company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + FREQUENCY_FIELD_NUMBER: builtins.int + START_DATE_FIELD_NUMBER: builtins.int + END_DATE_FIELD_NUMBER: builtins.int + LABEL_FIELD_NUMBER: builtins.int + IS_REPORTED_FIELD_NUMBER: builtins.int + frequency: global___Frequency.ValueType + """The frequency of the fiscal period.""" + label: builtins.str + """The period label (e.g., "4Q-2025", "2H-2025", "FY-2025").""" + is_reported: builtins.bool + """Whether the period has been reported (earnings released).""" + @property + def start_date(self) -> exabel.api.time.date_pb2.Date: + """The first date of the fiscal period.""" + + @property + def end_date(self) -> exabel.api.time.date_pb2.Date: + """The last date in the fiscal period.""" + + def __init__( + self, + *, + frequency: global___Frequency.ValueType | None = ..., + start_date: exabel.api.time.date_pb2.Date | None = ..., + end_date: exabel.api.time.date_pb2.Date | None = ..., + label: builtins.str | None = ..., + is_reported: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["end_date", b"end_date", "start_date", b"start_date"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["end_date", b"end_date", "frequency", b"frequency", "is_reported", b"is_reported", "label", b"label", "start_date", b"start_date"]) -> None: ... + +global___FiscalPeriod = FiscalPeriod diff --git a/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2_grpc.py new file mode 100644 index 00000000..fa203470 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/calendar_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/calendar_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/calendar_service_pb2.py b/exabel/stubs/exabel/api/data/v1/calendar_service_pb2.py new file mode 100644 index 00000000..86f02ade --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/calendar_service_pb2.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/calendar_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/calendar_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import calendar_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_calendar__messages__pb2 +from ...time import time_range_pb2 as exabel_dot_api_dot_time_dot_time__range__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/data/v1/calendar_service.proto\x12\x12\x65xabel.api.data.v1\x1a*exabel/api/data/v1/calendar_messages.proto\x1a exabel/api/time/time_range.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\xc3\x01\n\x19GetCompanyCalendarRequest\x12(\n\x07\x63ompany\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x63ompanyName\xe0\x41\x02\x12\x30\n\tfrequency\x18\x02 \x01(\x0e\x32\x1d.exabel.api.data.v1.Frequency\x12.\n\ntime_range\x18\x03 \x01(\x0b\x32\x1a.exabel.api.time.TimeRange\x12\x1a\n\x12include_unreported\x18\x04 \x01(\x08\"D\n\x0f\x43ompanyCalendar\x12\x31\n\x07periods\x18\x01 \x03(\x0b\x32 .exabel.api.data.v1.FiscalPeriod\"\x82\x01\n\x1f\x42\x61tchCreateFiscalPeriodsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x63ompanyName\xe0\x41\x02\x12\x36\n\x07periods\x18\x02 \x03(\x0b\x32 .exabel.api.data.v1.FiscalPeriodB\x03\xe0\x41\x02\"\"\n BatchCreateFiscalPeriodsResponse\"v\n\x19\x44\x65leteFiscalPeriodRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x63ompanyName\xe0\x41\x02\x12\x30\n\x06period\x18\x02 \x01(\x0b\x32 .exabel.api.data.v1.FiscalPeriod\"u\n\x18ListFiscalPeriodsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x63ompanyName\xe0\x41\x02\x12\x30\n\tfrequency\x18\x02 \x01(\x0e\x32\x1d.exabel.api.data.v1.Frequency\"N\n\x19ListFiscalPeriodsResponse\x12\x31\n\x07periods\x18\x01 \x03(\x0b\x32 .exabel.api.data.v1.FiscalPeriod\"\'\n%ListCompaniesWithFiscalPeriodsRequest\";\n&ListCompaniesWithFiscalPeriodsResponse\x12\x11\n\tcompanies\x18\x01 \x03(\t2\xe3\x08\n\x0f\x43\x61lendarService\x12\xc7\x01\n\x12GetCompanyCalendar\x12-.exabel.api.data.v1.GetCompanyCalendarRequest\x1a#.exabel.api.data.v1.CompanyCalendar\"]\x92\x41\x1d\x12\x1bGet company fiscal calendar\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{company=entityTypes/company/entities/*}/calendar\x12\xf8\x01\n\x18\x42\x61tchCreateFiscalPeriods\x12\x33.exabel.api.data.v1.BatchCreateFiscalPeriodsRequest\x1a\x34.exabel.api.data.v1.BatchCreateFiscalPeriodsResponse\"q\x92\x41\x1e\x12\x1c\x43reate custom fiscal periods\x82\xd3\xe4\x93\x02J\"E/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods:batchCreate:\x01*\x12\xd2\x01\n\x11ListFiscalPeriods\x12,.exabel.api.data.v1.ListFiscalPeriodsRequest\x1a-.exabel.api.data.v1.ListFiscalPeriodsResponse\"`\x92\x41\x1c\x12\x1aList custom fiscal periods\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods\x12\xbf\x01\n\x12\x44\x65leteFiscalPeriod\x12-.exabel.api.data.v1.DeleteFiscalPeriodRequest\x1a\x16.google.protobuf.Empty\"b\x92\x41\x1e\x12\x1c\x44\x65lete custom fiscal periods\x82\xd3\xe4\x93\x02;*9/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods\x12\xf3\x01\n\x1eListCompaniesWithFiscalPeriods\x12\x39.exabel.api.data.v1.ListCompaniesWithFiscalPeriodsRequest\x1a:.exabel.api.data.v1.ListCompaniesWithFiscalPeriodsResponse\"Z\x92\x41+\x12)List companies with custom fiscal periods\x82\xd3\xe4\x93\x02&\x12$/v1/companiesWithCustomFiscalPeriodsBH\n\x16\x63om.exabel.api.data.v1B\x14\x43\x61lendarServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.calendar_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\024CalendarServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_GETCOMPANYCALENDARREQUEST'].fields_by_name['company']._loaded_options = None + _globals['_GETCOMPANYCALENDARREQUEST'].fields_by_name['company']._serialized_options = b'\222A\021\312>\016\372\002\013companyName\340A\002' + _globals['_BATCHCREATEFISCALPERIODSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_BATCHCREATEFISCALPERIODSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\021\312>\016\372\002\013companyName\340A\002' + _globals['_BATCHCREATEFISCALPERIODSREQUEST'].fields_by_name['periods']._loaded_options = None + _globals['_BATCHCREATEFISCALPERIODSREQUEST'].fields_by_name['periods']._serialized_options = b'\340A\002' + _globals['_DELETEFISCALPERIODREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_DELETEFISCALPERIODREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\021\312>\016\372\002\013companyName\340A\002' + _globals['_LISTFISCALPERIODSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTFISCALPERIODSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\021\312>\016\372\002\013companyName\340A\002' + _globals['_CALENDARSERVICE'].methods_by_name['GetCompanyCalendar']._loaded_options = None + _globals['_CALENDARSERVICE'].methods_by_name['GetCompanyCalendar']._serialized_options = b'\222A\035\022\033Get company fiscal calendar\202\323\344\223\0027\0225/v1/{company=entityTypes/company/entities/*}/calendar' + _globals['_CALENDARSERVICE'].methods_by_name['BatchCreateFiscalPeriods']._loaded_options = None + _globals['_CALENDARSERVICE'].methods_by_name['BatchCreateFiscalPeriods']._serialized_options = b'\222A\036\022\034Create custom fiscal periods\202\323\344\223\002J\"E/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods:batchCreate:\001*' + _globals['_CALENDARSERVICE'].methods_by_name['ListFiscalPeriods']._loaded_options = None + _globals['_CALENDARSERVICE'].methods_by_name['ListFiscalPeriods']._serialized_options = b'\222A\034\022\032List custom fiscal periods\202\323\344\223\002;\0229/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods' + _globals['_CALENDARSERVICE'].methods_by_name['DeleteFiscalPeriod']._loaded_options = None + _globals['_CALENDARSERVICE'].methods_by_name['DeleteFiscalPeriod']._serialized_options = b'\222A\036\022\034Delete custom fiscal periods\202\323\344\223\002;*9/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods' + _globals['_CALENDARSERVICE'].methods_by_name['ListCompaniesWithFiscalPeriods']._loaded_options = None + _globals['_CALENDARSERVICE'].methods_by_name['ListCompaniesWithFiscalPeriods']._serialized_options = b'\222A+\022)List companies with custom fiscal periods\202\323\344\223\002&\022$/v1/companiesWithCustomFiscalPeriods' + _globals['_GETCOMPANYCALENDARREQUEST']._serialized_start=284 + _globals['_GETCOMPANYCALENDARREQUEST']._serialized_end=479 + _globals['_COMPANYCALENDAR']._serialized_start=481 + _globals['_COMPANYCALENDAR']._serialized_end=549 + _globals['_BATCHCREATEFISCALPERIODSREQUEST']._serialized_start=552 + _globals['_BATCHCREATEFISCALPERIODSREQUEST']._serialized_end=682 + _globals['_BATCHCREATEFISCALPERIODSRESPONSE']._serialized_start=684 + _globals['_BATCHCREATEFISCALPERIODSRESPONSE']._serialized_end=718 + _globals['_DELETEFISCALPERIODREQUEST']._serialized_start=720 + _globals['_DELETEFISCALPERIODREQUEST']._serialized_end=838 + _globals['_LISTFISCALPERIODSREQUEST']._serialized_start=840 + _globals['_LISTFISCALPERIODSREQUEST']._serialized_end=957 + _globals['_LISTFISCALPERIODSRESPONSE']._serialized_start=959 + _globals['_LISTFISCALPERIODSRESPONSE']._serialized_end=1037 + _globals['_LISTCOMPANIESWITHFISCALPERIODSREQUEST']._serialized_start=1039 + _globals['_LISTCOMPANIESWITHFISCALPERIODSREQUEST']._serialized_end=1078 + _globals['_LISTCOMPANIESWITHFISCALPERIODSRESPONSE']._serialized_start=1080 + _globals['_LISTCOMPANIESWITHFISCALPERIODSRESPONSE']._serialized_end=1139 + _globals['_CALENDARSERVICE']._serialized_start=1142 + _globals['_CALENDARSERVICE']._serialized_end=2265 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/data/v1/calendar_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/calendar_service_pb2.pyi new file mode 100644 index 00000000..ee1f4209 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/calendar_service_pb2.pyi @@ -0,0 +1,215 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2025 Exabel AS. All rights reserved.""" + +import builtins +import collections.abc +from . import calendar_messages_pb2 +from ...time import time_range_pb2 +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +import typing +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class GetCompanyCalendarRequest(google.protobuf.message.Message): + """A request to get the fiscal calendar for a company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + COMPANY_FIELD_NUMBER: builtins.int + FREQUENCY_FIELD_NUMBER: builtins.int + TIME_RANGE_FIELD_NUMBER: builtins.int + INCLUDE_UNREPORTED_FIELD_NUMBER: builtins.int + company: builtins.str + """The resource name of the company (e.g., "entityTypes/company/entities/F_12345-E").""" + frequency: exabel.api.data.v1.calendar_messages_pb2.Frequency.ValueType + """The requested frequency. If not set, uses the company's reporting frequency (FQ or FS).""" + include_unreported: builtins.bool + """Whether to include unreported (future) fiscal periods. + If false, only periods that have been reported are returned. + Default is false. + """ + @property + def time_range(self) -> exabel.api.time.time_range_pb2.TimeRange: + """The time range for fiscal periods. Returns all periods whose end date falls within this range. + If not set, returns all historical periods and, if include_unreported is true, future periods + for the current fiscal year and two fiscal years into the future. + """ + + def __init__( + self, + *, + company: builtins.str | None = ..., + frequency: exabel.api.data.v1.calendar_messages_pb2.Frequency.ValueType | None = ..., + time_range: exabel.api.time.time_range_pb2.TimeRange | None = ..., + include_unreported: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["time_range", b"time_range"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["company", b"company", "frequency", b"frequency", "include_unreported", b"include_unreported", "time_range", b"time_range"]) -> None: ... + +global___GetCompanyCalendarRequest = GetCompanyCalendarRequest + +@typing.final +class CompanyCalendar(google.protobuf.message.Message): + """A company's fiscal calendar.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PERIODS_FIELD_NUMBER: builtins.int + @property + def periods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod]: + """The fiscal periods for the company.""" + + def __init__( + self, + *, + periods: collections.abc.Iterable[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["periods", b"periods"]) -> None: ... + +global___CompanyCalendar = CompanyCalendar + +@typing.final +class BatchCreateFiscalPeriodsRequest(google.protobuf.message.Message): + """A request to create multiple custom fiscal periods for a company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + PERIODS_FIELD_NUMBER: builtins.int + parent: builtins.str + """The resource name of the company.""" + @property + def periods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod]: + """The custom fiscal periods to add.""" + + def __init__( + self, + *, + parent: builtins.str | None = ..., + periods: collections.abc.Iterable[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["parent", b"parent", "periods", b"periods"]) -> None: ... + +global___BatchCreateFiscalPeriodsRequest = BatchCreateFiscalPeriodsRequest + +@typing.final +class BatchCreateFiscalPeriodsResponse(google.protobuf.message.Message): + """The response to a request to create custom fiscal periods.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + def __init__( + self, + ) -> None: ... + +global___BatchCreateFiscalPeriodsResponse = BatchCreateFiscalPeriodsResponse + +@typing.final +class DeleteFiscalPeriodRequest(google.protobuf.message.Message): + """A request to delete a fiscal period for a company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + PERIOD_FIELD_NUMBER: builtins.int + parent: builtins.str + """The resource name of the company.""" + @property + def period(self) -> exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod: + """The custom fiscal periods to delete. If not set, will delete all custom fiscal periods + for the given company. + """ + + def __init__( + self, + *, + parent: builtins.str | None = ..., + period: exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["period", b"period"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["parent", b"parent", "period", b"period"]) -> None: ... + +global___DeleteFiscalPeriodRequest = DeleteFiscalPeriodRequest + +@typing.final +class ListFiscalPeriodsRequest(google.protobuf.message.Message): + """A request to list the custom fiscal periods for a company.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + FREQUENCY_FIELD_NUMBER: builtins.int + parent: builtins.str + """The resource name of the company.""" + frequency: exabel.api.data.v1.calendar_messages_pb2.Frequency.ValueType + """Optionally, a frequency. + If a frequency is provided, only the custom fiscal periods of that frequency are returned. + Otherwise, all the custom fiscal periods for the company are returned. + """ + def __init__( + self, + *, + parent: builtins.str | None = ..., + frequency: exabel.api.data.v1.calendar_messages_pb2.Frequency.ValueType | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["frequency", b"frequency", "parent", b"parent"]) -> None: ... + +global___ListFiscalPeriodsRequest = ListFiscalPeriodsRequest + +@typing.final +class ListFiscalPeriodsResponse(google.protobuf.message.Message): + """The response to a request to list custom fiscal periods.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PERIODS_FIELD_NUMBER: builtins.int + @property + def periods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod]: + """The fiscal periods of the requested company.""" + + def __init__( + self, + *, + periods: collections.abc.Iterable[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["periods", b"periods"]) -> None: ... + +global___ListFiscalPeriodsResponse = ListFiscalPeriodsResponse + +@typing.final +class ListCompaniesWithFiscalPeriodsRequest(google.protobuf.message.Message): + """A request to list all the companies for which custom fiscal periods have been uploaded.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + def __init__( + self, + ) -> None: ... + +global___ListCompaniesWithFiscalPeriodsRequest = ListCompaniesWithFiscalPeriodsRequest + +@typing.final +class ListCompaniesWithFiscalPeriodsResponse(google.protobuf.message.Message): + """The response to a request to list companies with custom fiscal periods.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + COMPANIES_FIELD_NUMBER: builtins.int + @property + def companies(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """A list of resource names of the companies that have custom fiscal periods.""" + + def __init__( + self, + *, + companies: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["companies", b"companies"]) -> None: ... + +global___ListCompaniesWithFiscalPeriodsResponse = ListCompaniesWithFiscalPeriodsResponse diff --git a/exabel/stubs/exabel/api/data/v1/calendar_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/calendar_service_pb2_grpc.py new file mode 100644 index 00000000..236821f8 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/calendar_service_pb2_grpc.py @@ -0,0 +1,286 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import calendar_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/calendar_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class CalendarServiceStub(object): + """Service for managing fiscal calendar data. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GetCompanyCalendar = channel.unary_unary( + '/exabel.api.data.v1.CalendarService/GetCompanyCalendar', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.GetCompanyCalendarRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.CompanyCalendar.FromString, + _registered_method=True) + self.BatchCreateFiscalPeriods = channel.unary_unary( + '/exabel.api.data.v1.CalendarService/BatchCreateFiscalPeriods', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsResponse.FromString, + _registered_method=True) + self.ListFiscalPeriods = channel.unary_unary( + '/exabel.api.data.v1.CalendarService/ListFiscalPeriods', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsResponse.FromString, + _registered_method=True) + self.DeleteFiscalPeriod = channel.unary_unary( + '/exabel.api.data.v1.CalendarService/DeleteFiscalPeriod', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.DeleteFiscalPeriodRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.ListCompaniesWithFiscalPeriods = channel.unary_unary( + '/exabel.api.data.v1.CalendarService/ListCompaniesWithFiscalPeriods', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsResponse.FromString, + _registered_method=True) + + +class CalendarServiceServicer(object): + """Service for managing fiscal calendar data. + """ + + def GetCompanyCalendar(self, request, context): + """Gets the fiscal calendar for a company. + + Returns the fiscal periods for a company within the specified time range + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchCreateFiscalPeriods(self, request, context): + """Creates multiple custom fiscal periods for a given company. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListFiscalPeriods(self, request, context): + """Lists the custom fiscal periods for a company. + + Lists the custom fiscal periods for a given company. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteFiscalPeriod(self, request, context): + """Deletes one or all fiscal period for a company. + + Deletes one or all fiscal period for a given company. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListCompaniesWithFiscalPeriods(self, request, context): + """Lists all the companies with custom fiscal periods. + + Lists all the companies for which there are custom fiscal periods. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_CalendarServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GetCompanyCalendar': grpc.unary_unary_rpc_method_handler( + servicer.GetCompanyCalendar, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.GetCompanyCalendarRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.CompanyCalendar.SerializeToString, + ), + 'BatchCreateFiscalPeriods': grpc.unary_unary_rpc_method_handler( + servicer.BatchCreateFiscalPeriods, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsResponse.SerializeToString, + ), + 'ListFiscalPeriods': grpc.unary_unary_rpc_method_handler( + servicer.ListFiscalPeriods, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsResponse.SerializeToString, + ), + 'DeleteFiscalPeriod': grpc.unary_unary_rpc_method_handler( + servicer.DeleteFiscalPeriod, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.DeleteFiscalPeriodRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'ListCompaniesWithFiscalPeriods': grpc.unary_unary_rpc_method_handler( + servicer.ListCompaniesWithFiscalPeriods, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.CalendarService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.CalendarService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class CalendarService(object): + """Service for managing fiscal calendar data. + """ + + @staticmethod + def GetCompanyCalendar(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.CalendarService/GetCompanyCalendar', + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.GetCompanyCalendarRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.CompanyCalendar.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def BatchCreateFiscalPeriods(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.CalendarService/BatchCreateFiscalPeriods', + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListFiscalPeriods(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.CalendarService/ListFiscalPeriods', + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteFiscalPeriod(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.CalendarService/DeleteFiscalPeriod', + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.DeleteFiscalPeriodRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListCompaniesWithFiscalPeriods(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.CalendarService/ListCompaniesWithFiscalPeriods', + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/data/v1/common_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/common_messages_pb2.py new file mode 100644 index 00000000..baa8110c --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/common_messages_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/common_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/common_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/common_messages.proto\x12\x12\x65xabel.api.data.v1\"F\n\tEntitySet\x12\x10\n\x08\x65ntities\x18\x01 \x03(\t\x12\x0c\n\x04tags\x18\x02 \x03(\t\x12\x19\n\x11\x65xcluded_entities\x18\x03 \x03(\tBG\n\x16\x63om.exabel.api.data.v1B\x13\x43ommonMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.common_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\023CommonMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_ENTITYSET']._serialized_start=64 + _globals['_ENTITYSET']._serialized_end=134 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/common_messages_pb2.pyi similarity index 75% rename from exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/common_messages_pb2.pyi index 9dd3a83a..622ba509 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/common_messages_pb2.pyi @@ -2,12 +2,14 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2024 Exabel AS. All rights reserved.""" + import builtins import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final @@ -16,11 +18,12 @@ class EntitySet(google.protobuf.message.Message): The result is the union of the individual entities and the entities covered by all tags, minus the excluded entities. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENTITIES_FIELD_NUMBER: builtins.int TAGS_FIELD_NUMBER: builtins.int EXCLUDED_ENTITIES_FIELD_NUMBER: builtins.int - @property def entities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Resource name of individual entities.""" @@ -35,9 +38,13 @@ class EntitySet(google.protobuf.message.Message): tags above. """ - def __init__(self, *, entities: collections.abc.Iterable[builtins.str] | None=..., tags: collections.abc.Iterable[builtins.str] | None=..., excluded_entities: collections.abc.Iterable[builtins.str] | None=...) -> None: - ... + def __init__( + self, + *, + entities: collections.abc.Iterable[builtins.str] | None = ..., + tags: collections.abc.Iterable[builtins.str] | None = ..., + excluded_entities: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entities", b"entities", "excluded_entities", b"excluded_entities", "tags", b"tags"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entities', b'entities', 'excluded_entities', b'excluded_entities', 'tags', b'tags']) -> None: - ... -global___EntitySet = EntitySet \ No newline at end of file +global___EntitySet = EntitySet diff --git a/exabel/stubs/exabel/api/data/v1/common_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/common_messages_pb2_grpc.py new file mode 100644 index 00000000..dceef657 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/common_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/common_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/data_set_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/data_set_messages_pb2.py new file mode 100644 index 00000000..ea79e3b7 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/data_set_messages_pb2.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/data_set_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/data_set_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/data/v1/data_set_messages.proto\x12\x12\x65xabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\xde\x03\n\x07\x44\x61taSet\x12>\n\x04name\x18\x01 \x01(\tB0\x92\x41\'J\x14\"dataSets/ns.stores\"\xca>\x0e\xfa\x02\x0b\x64\x61taSetName\xe0\x41\x05\xe0\x41\x02\x12\x18\n\x0blegacy_name\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12#\n\x0c\x64isplay_name\x18\x02 \x01(\tB\r\x92\x41\nJ\x08\"Stores\"\x12>\n\x0b\x64\x65scription\x18\x03 \x01(\tB)\x92\x41&J$\"The data set of all store entities\"\x12N\n\x07signals\x18\x04 \x03(\tB=\x92\x41\x37J5[\"signals/ns.customer_amount\", \"signals/ns.visitors\"]\xe0\x41\x06\x12J\n\x0f\x64\x65rived_signals\x18\x07 \x03(\tB1\x92\x41.J,[\"derivedSignals/321\", \"derivedSignals/432\"]\x12V\n\x13highlighted_signals\x18\x06 \x03(\tB9\x92\x41\x33J1[\"signals/ns.average_data\", \"derivedSignals/321\"]\xe0\x41\x06\x12 \n\tread_only\x18\x05 \x01(\x08\x42\r\x92\x41\x07J\x05\x66\x61lse\xe0\x41\x03\x42H\n\x16\x63om.exabel.api.data.v1B\x14\x44\x61taSetMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.data_set_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\024DataSetMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_DATASET'].fields_by_name['name']._loaded_options = None + _globals['_DATASET'].fields_by_name['name']._serialized_options = b'\222A\'J\024\"dataSets/ns.stores\"\312>\016\372\002\013dataSetName\340A\005\340A\002' + _globals['_DATASET'].fields_by_name['legacy_name']._loaded_options = None + _globals['_DATASET'].fields_by_name['legacy_name']._serialized_options = b'\340A\003' + _globals['_DATASET'].fields_by_name['display_name']._loaded_options = None + _globals['_DATASET'].fields_by_name['display_name']._serialized_options = b'\222A\nJ\010\"Stores\"' + _globals['_DATASET'].fields_by_name['description']._loaded_options = None + _globals['_DATASET'].fields_by_name['description']._serialized_options = b'\222A&J$\"The data set of all store entities\"' + _globals['_DATASET'].fields_by_name['signals']._loaded_options = None + _globals['_DATASET'].fields_by_name['signals']._serialized_options = b'\222A7J5[\"signals/ns.customer_amount\", \"signals/ns.visitors\"]\340A\006' + _globals['_DATASET'].fields_by_name['derived_signals']._loaded_options = None + _globals['_DATASET'].fields_by_name['derived_signals']._serialized_options = b'\222A.J,[\"derivedSignals/321\", \"derivedSignals/432\"]' + _globals['_DATASET'].fields_by_name['highlighted_signals']._loaded_options = None + _globals['_DATASET'].fields_by_name['highlighted_signals']._serialized_options = b'\222A3J1[\"signals/ns.average_data\", \"derivedSignals/321\"]\340A\006' + _globals['_DATASET'].fields_by_name['read_only']._loaded_options = None + _globals['_DATASET'].fields_by_name['read_only']._serialized_options = b'\222A\007J\005false\340A\003' + _globals['_DATASET']._serialized_start=148 + _globals['_DATASET']._serialized_end=626 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/data_set_messages_pb2.pyi similarity index 52% rename from exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/data_set_messages_pb2.pyi index 910da5ef..c5d74216 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/data_set_messages_pb2.pyi @@ -2,18 +2,22 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2024 Exabel AS. All rights reserved.""" + import builtins import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class DataSet(google.protobuf.message.Message): """A data set resource in the Data API.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int LEGACY_NAME_FIELD_NUMBER: builtins.int DISPLAY_NAME_FIELD_NUMBER: builtins.int @@ -23,16 +27,21 @@ class DataSet(google.protobuf.message.Message): HIGHLIGHTED_SIGNALS_FIELD_NUMBER: builtins.int READ_ONLY_FIELD_NUMBER: builtins.int name: builtins.str - 'Unique resource name of the data set, e.g. `dataSets/namespace.dataSetIdentifier`.\n The namespace must be one of the predetermined namespaces the customer has access to.\n The data set identifier must match the regex `\\w[\\w-]{0,63}`.\n ' + """Unique resource name of the data set, e.g. `dataSets/namespace.dataSetIdentifier`. + The namespace must be one of the predetermined namespaces the customer has access to. + The data set identifier must match the regex `\\w[\\w-]{0,63}`. + """ legacy_name: builtins.str - 'The legacy resource name of the data set. Only some data sets have legacy names, and the format\n is `dataSets/n`, where n is a positive integer. The legacy name cannot be changed here, but\n must be changed via the management API.\n ' + """The legacy resource name of the data set. Only some data sets have legacy names, and the format + is `dataSets/n`, where n is a positive integer. The legacy name cannot be changed here, but + must be changed via the management API. + """ display_name: builtins.str - 'Used when showing the data set in the Exabel app. Required when creating a data set.' + """Used when showing the data set in the Exabel app. Required when creating a data set.""" description: builtins.str - 'This is currently not used in the Exabel app, but may be in future.' + """This is currently not used in the Exabel app, but may be in future.""" read_only: builtins.bool - 'Data sets that you subscribe to will be read-only.' - + """Data sets that you subscribe to will be read-only.""" @property def signals(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """List of signals comprising the data set. Signals are represented by their resource names, @@ -49,9 +58,18 @@ class DataSet(google.protobuf.message.Message): def highlighted_signals(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """List of signals that are highlighted in this data set.""" - def __init__(self, *, name: builtins.str | None=..., legacy_name: builtins.str | None=..., display_name: builtins.str | None=..., description: builtins.str | None=..., signals: collections.abc.Iterable[builtins.str] | None=..., derived_signals: collections.abc.Iterable[builtins.str] | None=..., highlighted_signals: collections.abc.Iterable[builtins.str] | None=..., read_only: builtins.bool | None=...) -> None: - ... + def __init__( + self, + *, + name: builtins.str | None = ..., + legacy_name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + description: builtins.str | None = ..., + signals: collections.abc.Iterable[builtins.str] | None = ..., + derived_signals: collections.abc.Iterable[builtins.str] | None = ..., + highlighted_signals: collections.abc.Iterable[builtins.str] | None = ..., + read_only: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["derived_signals", b"derived_signals", "description", b"description", "display_name", b"display_name", "highlighted_signals", b"highlighted_signals", "legacy_name", b"legacy_name", "name", b"name", "read_only", b"read_only", "signals", b"signals"]) -> None: ... - def ClearField(self, field_name: typing.Literal['derived_signals', b'derived_signals', 'description', b'description', 'display_name', b'display_name', 'highlighted_signals', b'highlighted_signals', 'legacy_name', b'legacy_name', 'name', b'name', 'read_only', b'read_only', 'signals', b'signals']) -> None: - ... -global___DataSet = DataSet \ No newline at end of file +global___DataSet = DataSet diff --git a/exabel/stubs/exabel/api/data/v1/data_set_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/data_set_messages_pb2_grpc.py new file mode 100644 index 00000000..17d08762 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/data_set_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/data_set_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/data_set_service_pb2.py b/exabel/stubs/exabel/api/data/v1/data_set_service_pb2.py new file mode 100644 index 00000000..48ae128f --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/data_set_service_pb2.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/data_set_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/data_set_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import data_set_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/data/v1/data_set_service.proto\x12\x12\x65xabel.api.data.v1\x1a*exabel/api/data/v1/data_set_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x15\n\x13ListDataSetsRequest\"F\n\x14ListDataSetsResponse\x12.\n\tdata_sets\x18\x01 \x03(\x0b\x32\x1b.exabel.api.data.v1.DataSet\":\n\x11GetDataSetRequest\x12%\n\x04name\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x64\x61taSetName\xe0\x41\x02\"J\n\x14\x43reateDataSetRequest\x12\x32\n\x08\x64\x61ta_set\x18\x01 \x01(\x0b\x32\x1b.exabel.api.data.v1.DataSetB\x03\xe0\x41\x02\"\x92\x01\n\x14UpdateDataSetRequest\x12\x32\n\x08\x64\x61ta_set\x18\x01 \x01(\x0b\x32\x1b.exabel.api.data.v1.DataSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"=\n\x14\x44\x65leteDataSetRequest\x12%\n\x04name\x18\x01 \x01(\tB\x17\x92\x41\x11\xca>\x0e\xfa\x02\x0b\x64\x61taSetName\xe0\x41\x02\x32\xd3\x05\n\x0e\x44\x61taSetService\x12\x8a\x01\n\x0cListDataSets\x12\'.exabel.api.data.v1.ListDataSetsRequest\x1a(.exabel.api.data.v1.ListDataSetsResponse\"\'\x92\x41\x10\x12\x0eList data sets\x82\xd3\xe4\x93\x02\x0e\x12\x0c/v1/dataSets\x12\x80\x01\n\nGetDataSet\x12%.exabel.api.data.v1.GetDataSetRequest\x1a\x1b.exabel.api.data.v1.DataSet\".\x92\x41\x0e\x12\x0cGet data set\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/{name=dataSets/*}\x12\x8a\x01\n\rCreateDataSet\x12(.exabel.api.data.v1.CreateDataSetRequest\x1a\x1b.exabel.api.data.v1.DataSet\"2\x92\x41\x11\x12\x0f\x43reate data set\x82\xd3\xe4\x93\x02\x18\"\x0c/v1/dataSets:\x08\x64\x61ta_set\x12\x9c\x01\n\rUpdateDataSet\x12(.exabel.api.data.v1.UpdateDataSetRequest\x1a\x1b.exabel.api.data.v1.DataSet\"D\x92\x41\x11\x12\x0fUpdate data set\x82\xd3\xe4\x93\x02*2\x1e/v1/{data_set.name=dataSets/*}:\x08\x64\x61ta_set\x12\x84\x01\n\rDeleteDataSet\x12(.exabel.api.data.v1.DeleteDataSetRequest\x1a\x16.google.protobuf.Empty\"1\x92\x41\x11\x12\x0f\x44\x65lete data set\x82\xd3\xe4\x93\x02\x17*\x15/v1/{name=dataSets/*}BG\n\x16\x63om.exabel.api.data.v1B\x13\x44\x61taSetServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.data_set_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\023DataSetServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_GETDATASETREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETDATASETREQUEST'].fields_by_name['name']._serialized_options = b'\222A\021\312>\016\372\002\013dataSetName\340A\002' + _globals['_CREATEDATASETREQUEST'].fields_by_name['data_set']._loaded_options = None + _globals['_CREATEDATASETREQUEST'].fields_by_name['data_set']._serialized_options = b'\340A\002' + _globals['_UPDATEDATASETREQUEST'].fields_by_name['data_set']._loaded_options = None + _globals['_UPDATEDATASETREQUEST'].fields_by_name['data_set']._serialized_options = b'\340A\002' + _globals['_DELETEDATASETREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETEDATASETREQUEST'].fields_by_name['name']._serialized_options = b'\222A\021\312>\016\372\002\013dataSetName\340A\002' + _globals['_DATASETSERVICE'].methods_by_name['ListDataSets']._loaded_options = None + _globals['_DATASETSERVICE'].methods_by_name['ListDataSets']._serialized_options = b'\222A\020\022\016List data sets\202\323\344\223\002\016\022\014/v1/dataSets' + _globals['_DATASETSERVICE'].methods_by_name['GetDataSet']._loaded_options = None + _globals['_DATASETSERVICE'].methods_by_name['GetDataSet']._serialized_options = b'\222A\016\022\014Get data set\202\323\344\223\002\027\022\025/v1/{name=dataSets/*}' + _globals['_DATASETSERVICE'].methods_by_name['CreateDataSet']._loaded_options = None + _globals['_DATASETSERVICE'].methods_by_name['CreateDataSet']._serialized_options = b'\222A\021\022\017Create data set\202\323\344\223\002\030\"\014/v1/dataSets:\010data_set' + _globals['_DATASETSERVICE'].methods_by_name['UpdateDataSet']._loaded_options = None + _globals['_DATASETSERVICE'].methods_by_name['UpdateDataSet']._serialized_options = b'\222A\021\022\017Update data set\202\323\344\223\002*2\036/v1/{data_set.name=dataSets/*}:\010data_set' + _globals['_DATASETSERVICE'].methods_by_name['DeleteDataSet']._loaded_options = None + _globals['_DATASETSERVICE'].methods_by_name['DeleteDataSet']._serialized_options = b'\222A\021\022\017Delete data set\202\323\344\223\002\027*\025/v1/{name=dataSets/*}' + _globals['_LISTDATASETSREQUEST']._serialized_start=283 + _globals['_LISTDATASETSREQUEST']._serialized_end=304 + _globals['_LISTDATASETSRESPONSE']._serialized_start=306 + _globals['_LISTDATASETSRESPONSE']._serialized_end=376 + _globals['_GETDATASETREQUEST']._serialized_start=378 + _globals['_GETDATASETREQUEST']._serialized_end=436 + _globals['_CREATEDATASETREQUEST']._serialized_start=438 + _globals['_CREATEDATASETREQUEST']._serialized_end=512 + _globals['_UPDATEDATASETREQUEST']._serialized_start=515 + _globals['_UPDATEDATASETREQUEST']._serialized_end=661 + _globals['_DELETEDATASETREQUEST']._serialized_start=663 + _globals['_DELETEDATASETREQUEST']._serialized_end=724 + _globals['_DATASETSERVICE']._serialized_start=727 + _globals['_DATASETSERVICE']._serialized_end=1450 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/data_set_service_pb2.pyi similarity index 60% rename from exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/data_set_service_pb2.pyi index 7312e519..466615b6 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/data_set_service_pb2.pyi @@ -2,87 +2,103 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import data_set_messages_pb2 import google.protobuf.descriptor import google.protobuf.field_mask_pb2 import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class ListDataSetsRequest(google.protobuf.message.Message): """The request to list data sets.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... + def __init__( + self, + ) -> None: ... + global___ListDataSetsRequest = ListDataSetsRequest @typing.final class ListDataSetsResponse(google.protobuf.message.Message): """The response to list data sets. Returns all known data sets.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - DATA_SETS_FIELD_NUMBER: builtins.int + DATA_SETS_FIELD_NUMBER: builtins.int @property def data_sets(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.data_set_messages_pb2.DataSet]: """List of data sets.""" - def __init__(self, *, data_sets: collections.abc.Iterable[exabel.api.data.v1.data_set_messages_pb2.DataSet] | None=...) -> None: - ... + def __init__( + self, + *, + data_sets: collections.abc.Iterable[exabel.api.data.v1.data_set_messages_pb2.DataSet] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["data_sets", b"data_sets"]) -> None: ... - def ClearField(self, field_name: typing.Literal['data_sets', b'data_sets']) -> None: - ... global___ListDataSetsResponse = ListDataSetsResponse @typing.final class GetDataSetRequest(google.protobuf.message.Message): """The request to get one data set.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the requested data set, for example `dataSets/ns.set1`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """The resource name of the requested data set, for example `dataSets/ns.set1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetDataSetRequest = GetDataSetRequest @typing.final class CreateDataSetRequest(google.protobuf.message.Message): """The response to create one data set.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - DATA_SET_FIELD_NUMBER: builtins.int + DATA_SET_FIELD_NUMBER: builtins.int @property def data_set(self) -> exabel.api.data.v1.data_set_messages_pb2.DataSet: """The data set to create.""" - def __init__(self, *, data_set: exabel.api.data.v1.data_set_messages_pb2.DataSet | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['data_set', b'data_set']) -> builtins.bool: - ... + def __init__( + self, + *, + data_set: exabel.api.data.v1.data_set_messages_pb2.DataSet | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["data_set", b"data_set"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["data_set", b"data_set"]) -> None: ... - def ClearField(self, field_name: typing.Literal['data_set', b'data_set']) -> None: - ... global___CreateDataSetRequest = CreateDataSetRequest @typing.final class UpdateDataSetRequest(google.protobuf.message.Message): """The request to update one data set.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + DATA_SET_FIELD_NUMBER: builtins.int UPDATE_MASK_FIELD_NUMBER: builtins.int ALLOW_MISSING_FIELD_NUMBER: builtins.int allow_missing: builtins.bool - 'If set to `true`, a new data set will be created if it did not exist, and `update_mask` is\n ignored.\n ' - + """If set to `true`, a new data set will be created if it did not exist, and `update_mask` is + ignored. + """ @property def data_set(self) -> exabel.api.data.v1.data_set_messages_pb2.DataSet: """The data set to update.""" @@ -96,14 +112,16 @@ class UpdateDataSetRequest(google.protobuf.message.Message): For REST requests, this is a comma-separated string. """ - def __init__(self, *, data_set: exabel.api.data.v1.data_set_messages_pb2.DataSet | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=..., allow_missing: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['data_set', b'data_set', 'update_mask', b'update_mask']) -> builtins.bool: - ... + def __init__( + self, + *, + data_set: exabel.api.data.v1.data_set_messages_pb2.DataSet | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + allow_missing: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["data_set", b"data_set", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["allow_missing", b"allow_missing", "data_set", b"data_set", "update_mask", b"update_mask"]) -> None: ... - def ClearField(self, field_name: typing.Literal['allow_missing', b'allow_missing', 'data_set', b'data_set', 'update_mask', b'update_mask']) -> None: - ... global___UpdateDataSetRequest = UpdateDataSetRequest @typing.final @@ -111,14 +129,17 @@ class DeleteDataSetRequest(google.protobuf.message.Message): """The request to delete one data set. A data set cannot be deleted if it is enabled for subscriptions. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the data set to delete, for example `dataSets/ns.set1`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... -global___DeleteDataSetRequest = DeleteDataSetRequest \ No newline at end of file + """The resource name of the data set to delete, for example `dataSets/ns.set1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... + +global___DeleteDataSetRequest = DeleteDataSetRequest diff --git a/exabel/stubs/exabel/api/data/v1/data_set_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/data_set_service_pb2_grpc.py new file mode 100644 index 00000000..fd5c2e23 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/data_set_service_pb2_grpc.py @@ -0,0 +1,313 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import data_set_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2 +from . import data_set_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/data_set_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class DataSetServiceStub(object): + """Service for managing data sets. Data sets are collections of signals that you may define and + manage, often to group data by source/vendor. The companies and entities that have time series + data for these signals are also part of the data set, and searchable within the data set in the + Exabel app. + + You may access data sets by subscribing to an Exabel data partner, or create your own data sets + from the data you import. + + See the User Guide for more information about data sets: https://help.exabel.com/docs/data-sets + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListDataSets = channel.unary_unary( + '/exabel.api.data.v1.DataSetService/ListDataSets', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsResponse.FromString, + _registered_method=True) + self.GetDataSet = channel.unary_unary( + '/exabel.api.data.v1.DataSetService/GetDataSet', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.GetDataSetRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, + _registered_method=True) + self.CreateDataSet = channel.unary_unary( + '/exabel.api.data.v1.DataSetService/CreateDataSet', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.CreateDataSetRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, + _registered_method=True) + self.UpdateDataSet = channel.unary_unary( + '/exabel.api.data.v1.DataSetService/UpdateDataSet', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.UpdateDataSetRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, + _registered_method=True) + self.DeleteDataSet = channel.unary_unary( + '/exabel.api.data.v1.DataSetService/DeleteDataSet', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.DeleteDataSetRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + + +class DataSetServiceServicer(object): + """Service for managing data sets. Data sets are collections of signals that you may define and + manage, often to group data by source/vendor. The companies and entities that have time series + data for these signals are also part of the data set, and searchable within the data set in the + Exabel app. + + You may access data sets by subscribing to an Exabel data partner, or create your own data sets + from the data you import. + + See the User Guide for more information about data sets: https://help.exabel.com/docs/data-sets + """ + + def ListDataSets(self, request, context): + """Lists all data sets. + + Lists all data sets available to your customer, including both your own data sets as well as + those that you have subscribed to. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetDataSet(self, request, context): + """Gets one data set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateDataSet(self, request, context): + """Creates one data set and returns it. + + It is also possible to create a data set by calling `UpdateDataSet` + with `allow_missing` set to `true`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateDataSet(self, request, context): + """Updates one data set and returns it. + + This can also be used to create a data set by setting `allow_missing` to `true`. + + Note that this method will update all fields unless `update_mask` is set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteDataSet(self, request, context): + """Deletes one data set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_DataSetServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListDataSets': grpc.unary_unary_rpc_method_handler( + servicer.ListDataSets, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsResponse.SerializeToString, + ), + 'GetDataSet': grpc.unary_unary_rpc_method_handler( + servicer.GetDataSet, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.GetDataSetRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.SerializeToString, + ), + 'CreateDataSet': grpc.unary_unary_rpc_method_handler( + servicer.CreateDataSet, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.CreateDataSetRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.SerializeToString, + ), + 'UpdateDataSet': grpc.unary_unary_rpc_method_handler( + servicer.UpdateDataSet, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.UpdateDataSetRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.SerializeToString, + ), + 'DeleteDataSet': grpc.unary_unary_rpc_method_handler( + servicer.DeleteDataSet, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.DeleteDataSetRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.DataSetService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.DataSetService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class DataSetService(object): + """Service for managing data sets. Data sets are collections of signals that you may define and + manage, often to group data by source/vendor. The companies and entities that have time series + data for these signals are also part of the data set, and searchable within the data set in the + Exabel app. + + You may access data sets by subscribing to an Exabel data partner, or create your own data sets + from the data you import. + + See the User Guide for more information about data sets: https://help.exabel.com/docs/data-sets + """ + + @staticmethod + def ListDataSets(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.DataSetService/ListDataSets', + exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetDataSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.DataSetService/GetDataSet', + exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.GetDataSetRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateDataSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.DataSetService/CreateDataSet', + exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.CreateDataSetRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateDataSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.DataSetService/UpdateDataSet', + exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.UpdateDataSetRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteDataSet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.DataSetService/DeleteDataSet', + exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.DeleteDataSetRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/data/v1/entity_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/entity_messages_pb2.py new file mode 100644 index 00000000..d40c910b --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/entity_messages_pb2.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/entity_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/entity_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/entity_messages.proto\x12\x12\x65xabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\xe2\x01\n\nEntityType\x12\x42\n\x04name\x18\x01 \x01(\tB4\x92\x41+J\x15\"entityTypes/company\"\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x05\xe0\x41\x02\x12&\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x10\x92\x41\rJ\x0b\"Companies\"\x12,\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x17\x92\x41\x14J\x12\"Public companies\"\x12\x16\n\tread_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12\"\n\x0eis_associative\x18\x05 \x01(\x08\x42\n\x92\x41\x07J\x05\x66\x61lse\"\xf7\x01\n\x06\x45ntity\x12@\n\x04name\x18\x01 \x01(\tB2\x92\x41)J\x17\"entities/ns.my_entity\"\xca>\r\xfa\x02\nentityName\xe0\x41\x05\xe0\x41\x02\x12&\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x10\x92\x41\rJ\x0b\"My Entity\"\x12>\n\x0b\x64\x65scription\x18\x03 \x01(\tB)\x92\x41&J$\"This is a description of My Entity\"\x12\x16\n\tread_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nproperties\x18\x64 \x01(\x0b\x32\x17.google.protobuf.StructBG\n\x16\x63om.exabel.api.data.v1B\x13\x45ntityMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.entity_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\023EntityMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_ENTITYTYPE'].fields_by_name['name']._loaded_options = None + _globals['_ENTITYTYPE'].fields_by_name['name']._serialized_options = b'\222A+J\025\"entityTypes/company\"\312>\021\372\002\016entityTypeName\340A\005\340A\002' + _globals['_ENTITYTYPE'].fields_by_name['display_name']._loaded_options = None + _globals['_ENTITYTYPE'].fields_by_name['display_name']._serialized_options = b'\222A\rJ\013\"Companies\"' + _globals['_ENTITYTYPE'].fields_by_name['description']._loaded_options = None + _globals['_ENTITYTYPE'].fields_by_name['description']._serialized_options = b'\222A\024J\022\"Public companies\"' + _globals['_ENTITYTYPE'].fields_by_name['read_only']._loaded_options = None + _globals['_ENTITYTYPE'].fields_by_name['read_only']._serialized_options = b'\340A\003' + _globals['_ENTITYTYPE'].fields_by_name['is_associative']._loaded_options = None + _globals['_ENTITYTYPE'].fields_by_name['is_associative']._serialized_options = b'\222A\007J\005false' + _globals['_ENTITY'].fields_by_name['name']._loaded_options = None + _globals['_ENTITY'].fields_by_name['name']._serialized_options = b'\222A)J\027\"entities/ns.my_entity\"\312>\r\372\002\nentityName\340A\005\340A\002' + _globals['_ENTITY'].fields_by_name['display_name']._loaded_options = None + _globals['_ENTITY'].fields_by_name['display_name']._serialized_options = b'\222A\rJ\013\"My Entity\"' + _globals['_ENTITY'].fields_by_name['description']._loaded_options = None + _globals['_ENTITY'].fields_by_name['description']._serialized_options = b'\222A&J$\"This is a description of My Entity\"' + _globals['_ENTITY'].fields_by_name['read_only']._loaded_options = None + _globals['_ENTITY'].fields_by_name['read_only']._serialized_options = b'\340A\003' + _globals['_ENTITYTYPE']._serialized_start=176 + _globals['_ENTITYTYPE']._serialized_end=402 + _globals['_ENTITY']._serialized_start=405 + _globals['_ENTITY']._serialized_end=652 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/data/v1/entity_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/entity_messages_pb2.pyi new file mode 100644 index 00000000..b54a5efc --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/entity_messages_pb2.pyi @@ -0,0 +1,98 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + +import builtins +import google.protobuf.descriptor +import google.protobuf.message +import google.protobuf.struct_pb2 +import typing + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class EntityType(google.protobuf.message.Message): + """An entity type resource in the Data API.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + READ_ONLY_FIELD_NUMBER: builtins.int + IS_ASSOCIATIVE_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the entity type, e.g. `entityTypes/entityTypeIdentifier` or + `entityTypes/namespace.entityTypeIdentifier`. The namespace must be empty (being global) or + a namespace accessible to the customer. + The entity type identifier must match the regex `\\w[\\w-]{0,63}`. + """ + display_name: builtins.str + """Used when showing the entity type in the Exabel app. Required when creating an entity type.""" + description: builtins.str + """Used when showing the entity type in the Exabel app.""" + read_only: builtins.bool + """Global entity types and those from data sets that you subscribe to will be read-only.""" + is_associative: builtins.bool + """Associative entity types connect multiple entity types - e.g. `company_occupation` to connect + `company` and `occupation` entity types. These are typically used to hold time series data + that is defined by the combination of 2 or more entities. + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + description: builtins.str | None = ..., + read_only: builtins.bool | None = ..., + is_associative: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "display_name", b"display_name", "is_associative", b"is_associative", "name", b"name", "read_only", b"read_only"]) -> None: ... + +global___EntityType = EntityType + +@typing.final +class Entity(google.protobuf.message.Message): + """An entity resource in the Data API. All entities have one entity type as its parent.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + READ_ONLY_FIELD_NUMBER: builtins.int + PROPERTIES_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the entity, + e.g. `entityTypes/entityTypeIdentifier/entities/entityIdentifier` or + `entityTypes/namespace1.entityTypeIdentifier/entities/namespace2.entityIdentifier`. + The namespaces must be empty (being global) or one of the predetermined namespaces the customer + has access to. If `namespace1` is not empty, it must be equal to `namespace2`. + The entity identifier must match the regex `\\w[\\w-]{0,63}`. + """ + display_name: builtins.str + """Used when showing the entity in the Exabel app. Required when creating an entity.""" + description: builtins.str + """Used when showing the entity in the Exabel app.""" + read_only: builtins.bool + """Global entities and those from data sets that you subscribe to will be read-only.""" + @property + def properties(self) -> google.protobuf.struct_pb2.Struct: + """Additional properties of this entity. This is currently not used in the Exabel app, but may be + in future. + """ + + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + description: builtins.str | None = ..., + read_only: builtins.bool | None = ..., + properties: google.protobuf.struct_pb2.Struct | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["properties", b"properties"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "display_name", b"display_name", "name", b"name", "properties", b"properties", "read_only", b"read_only"]) -> None: ... + +global___Entity = Entity diff --git a/exabel/stubs/exabel/api/data/v1/entity_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/entity_messages_pb2_grpc.py new file mode 100644 index 00000000..168cc4ba --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/entity_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/entity_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/entity_service_pb2.py b/exabel/stubs/exabel/api/data/v1/entity_service_pb2.py new file mode 100644 index 00000000..a8634770 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/entity_service_pb2.py @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/entity_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/entity_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import entity_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2 +from . import search_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_search__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'exabel/api/data/v1/entity_service.proto\x12\x12\x65xabel.api.data.v1\x1a(exabel/api/data/v1/entity_messages.proto\x1a(exabel/api/data/v1/search_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"?\n\x16ListEntityTypesRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t\"|\n\x17ListEntityTypesResponse\x12\x34\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32\x1e.exabel.api.data.v1.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"@\n\x14GetEntityTypeRequest\x12(\n\x04name\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x02\"j\n\x17\x43reateEntityTypeRequest\x12O\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32\x1e.exabel.api.data.v1.EntityTypeB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x02\"\xb2\x01\n\x17UpdateEntityTypeRequest\x12O\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32\x1e.exabel.api.data.v1.EntityTypeB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"C\n\x17\x44\x65leteEntityTypeRequest\x12(\n\x04name\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x02\"h\n\x13ListEntitiesRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"q\n\x14ListEntitiesResponse\x12,\n\x08\x65ntities\x18\x01 \x03(\x0b\x32\x1a.exabel.api.data.v1.Entity\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"T\n\x15\x44\x65leteEntitiesRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x02\x12\x0f\n\x07\x63onfirm\x18\x02 \x01(\x08\"8\n\x10GetEntityRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92\x41\x10\xca>\r\xfa\x02\nentityName\xe0\x41\x02\"r\n\x13\x43reateEntityRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x02\x12/\n\x06\x65ntity\x18\x02 \x01(\x0b\x32\x1a.exabel.api.data.v1.EntityB\x03\xe0\x41\x02\"\xa1\x01\n\x13UpdateEntityRequest\x12\x42\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x1a.exabel.api.data.v1.EntityB\x16\x92\x41\x10\xca>\r\xfa\x02\nentityName\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\";\n\x13\x44\x65leteEntityRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92\x41\x10\xca>\r\xfa\x02\nentityName\xe0\x41\x02\"\xd2\x01\n\x15SearchEntitiesRequest\x12*\n\x06parent\x18\x04 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0e\x65ntityTypeName\xe0\x41\x02\x12\x32\n\x05terms\x18\x01 \x03(\x0b\x32\x1e.exabel.api.data.v1.SearchTermB\x03\xe0\x41\x02\x12\x32\n\x07options\x18\x05 \x01(\x0b\x32!.exabel.api.data.v1.SearchOptions\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x96\x02\n\x16SearchEntitiesResponse\x12H\n\x07results\x18\x03 \x03(\x0b\x32\x37.exabel.api.data.v1.SearchEntitiesResponse.SearchResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12,\n\x08\x65ntities\x18\x01 \x03(\x0b\x32\x1a.exabel.api.data.v1.Entity\x1ak\n\x0cSearchResult\x12-\n\x05terms\x18\x01 \x03(\x0b\x32\x1e.exabel.api.data.v1.SearchTerm\x12,\n\x08\x65ntities\x18\x02 \x03(\x0b\x32\x1a.exabel.api.data.v1.Entity2\xf7\x0e\n\rEntityService\x12\x99\x01\n\x0fListEntityTypes\x12*.exabel.api.data.v1.ListEntityTypesRequest\x1a+.exabel.api.data.v1.ListEntityTypesResponse\"-\x92\x41\x13\x12\x11List entity types\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/entityTypes\x12\x8f\x01\n\rGetEntityType\x12(.exabel.api.data.v1.GetEntityTypeRequest\x1a\x1e.exabel.api.data.v1.EntityType\"4\x92\x41\x11\x12\x0fGet entity type\x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=entityTypes/*}\x12\x9c\x01\n\x10\x43reateEntityType\x12+.exabel.api.data.v1.CreateEntityTypeRequest\x1a\x1e.exabel.api.data.v1.EntityType\";\x92\x41\x14\x12\x12\x43reate entity type\x82\xd3\xe4\x93\x02\x1e\"\x0f/v1/entityTypes:\x0b\x65ntity_type\x12\xb1\x01\n\x10UpdateEntityType\x12+.exabel.api.data.v1.UpdateEntityTypeRequest\x1a\x1e.exabel.api.data.v1.EntityType\"P\x92\x41\x14\x12\x12Update entity type\x82\xd3\xe4\x93\x02\x33\x32$/v1/{entity_type.name=entityTypes/*}:\x0b\x65ntity_type\x12\x90\x01\n\x10\x44\x65leteEntityType\x12+.exabel.api.data.v1.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty\"7\x92\x41\x14\x12\x12\x44\x65lete entity type\x82\xd3\xe4\x93\x02\x1a*\x18/v1/{name=entityTypes/*}\x12\xa0\x01\n\x0cListEntities\x12\'.exabel.api.data.v1.ListEntitiesRequest\x1a(.exabel.api.data.v1.ListEntitiesResponse\"=\x92\x41\x0f\x12\rList entities\x82\xd3\xe4\x93\x02%\x12#/v1/{parent=entityTypes/*}/entities\x12\x9b\x01\n\x0e\x44\x65leteEntities\x12).exabel.api.data.v1.DeleteEntitiesRequest\x1a\x16.google.protobuf.Empty\"F\x92\x41\x18\x12\x16\x44\x65lete entities (bulk)\x82\xd3\xe4\x93\x02%*#/v1/{parent=entityTypes/*}/entities\x12\x89\x01\n\tGetEntity\x12$.exabel.api.data.v1.GetEntityRequest\x1a\x1a.exabel.api.data.v1.Entity\":\x92\x41\x0c\x12\nGet entity\x82\xd3\xe4\x93\x02%\x12#/v1/{name=entityTypes/*/entities/*}\x12\x9a\x01\n\x0c\x43reateEntity\x12\'.exabel.api.data.v1.CreateEntityRequest\x1a\x1a.exabel.api.data.v1.Entity\"E\x92\x41\x0f\x12\rCreate entity\x82\xd3\xe4\x93\x02-\"#/v1/{parent=entityTypes/*}/entities:\x06\x65ntity\x12\xa1\x01\n\x0cUpdateEntity\x12\'.exabel.api.data.v1.UpdateEntityRequest\x1a\x1a.exabel.api.data.v1.Entity\"L\x92\x41\x0f\x12\rUpdate entity\x82\xd3\xe4\x93\x02\x34\x32*/v1/{entity.name=entityTypes/*/entities/*}:\x06\x65ntity\x12\x8e\x01\n\x0c\x44\x65leteEntity\x12\'.exabel.api.data.v1.DeleteEntityRequest\x1a\x16.google.protobuf.Empty\"=\x92\x41\x0f\x12\rDelete entity\x82\xd3\xe4\x93\x02%*#/v1/{name=entityTypes/*/entities/*}\x12\xb2\x01\n\x0eSearchEntities\x12).exabel.api.data.v1.SearchEntitiesRequest\x1a*.exabel.api.data.v1.SearchEntitiesResponse\"I\x92\x41\x11\x12\x0fSearch entities\x82\xd3\xe4\x93\x02/\"*/v1/{parent=entityTypes/*}/entities:search:\x01*BF\n\x16\x63om.exabel.api.data.v1B\x12\x45ntityServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.entity_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\022EntityServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_GETENTITYTYPEREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETENTITYTYPEREQUEST'].fields_by_name['name']._serialized_options = b'\222A\024\312>\021\372\002\016entityTypeName\340A\002' + _globals['_CREATEENTITYTYPEREQUEST'].fields_by_name['entity_type']._loaded_options = None + _globals['_CREATEENTITYTYPEREQUEST'].fields_by_name['entity_type']._serialized_options = b'\222A\024\312>\021\372\002\016entityTypeName\340A\002' + _globals['_UPDATEENTITYTYPEREQUEST'].fields_by_name['entity_type']._loaded_options = None + _globals['_UPDATEENTITYTYPEREQUEST'].fields_by_name['entity_type']._serialized_options = b'\222A\024\312>\021\372\002\016entityTypeName\340A\002' + _globals['_DELETEENTITYTYPEREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETEENTITYTYPEREQUEST'].fields_by_name['name']._serialized_options = b'\222A\024\312>\021\372\002\016entityTypeName\340A\002' + _globals['_LISTENTITIESREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTENTITIESREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\024\312>\021\372\002\016entityTypeName\340A\002' + _globals['_DELETEENTITIESREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_DELETEENTITIESREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\024\312>\021\372\002\016entityTypeName\340A\002' + _globals['_GETENTITYREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETENTITYREQUEST'].fields_by_name['name']._serialized_options = b'\222A\020\312>\r\372\002\nentityName\340A\002' + _globals['_CREATEENTITYREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_CREATEENTITYREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\024\312>\021\372\002\016entityTypeName\340A\002' + _globals['_CREATEENTITYREQUEST'].fields_by_name['entity']._loaded_options = None + _globals['_CREATEENTITYREQUEST'].fields_by_name['entity']._serialized_options = b'\340A\002' + _globals['_UPDATEENTITYREQUEST'].fields_by_name['entity']._loaded_options = None + _globals['_UPDATEENTITYREQUEST'].fields_by_name['entity']._serialized_options = b'\222A\020\312>\r\372\002\nentityName\340A\002' + _globals['_DELETEENTITYREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETEENTITYREQUEST'].fields_by_name['name']._serialized_options = b'\222A\020\312>\r\372\002\nentityName\340A\002' + _globals['_SEARCHENTITIESREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_SEARCHENTITIESREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\024\312>\021\372\002\016entityTypeName\340A\002' + _globals['_SEARCHENTITIESREQUEST'].fields_by_name['terms']._loaded_options = None + _globals['_SEARCHENTITIESREQUEST'].fields_by_name['terms']._serialized_options = b'\340A\002' + _globals['_ENTITYSERVICE'].methods_by_name['ListEntityTypes']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['ListEntityTypes']._serialized_options = b'\222A\023\022\021List entity types\202\323\344\223\002\021\022\017/v1/entityTypes' + _globals['_ENTITYSERVICE'].methods_by_name['GetEntityType']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['GetEntityType']._serialized_options = b'\222A\021\022\017Get entity type\202\323\344\223\002\032\022\030/v1/{name=entityTypes/*}' + _globals['_ENTITYSERVICE'].methods_by_name['CreateEntityType']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['CreateEntityType']._serialized_options = b'\222A\024\022\022Create entity type\202\323\344\223\002\036\"\017/v1/entityTypes:\013entity_type' + _globals['_ENTITYSERVICE'].methods_by_name['UpdateEntityType']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['UpdateEntityType']._serialized_options = b'\222A\024\022\022Update entity type\202\323\344\223\00232$/v1/{entity_type.name=entityTypes/*}:\013entity_type' + _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntityType']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntityType']._serialized_options = b'\222A\024\022\022Delete entity type\202\323\344\223\002\032*\030/v1/{name=entityTypes/*}' + _globals['_ENTITYSERVICE'].methods_by_name['ListEntities']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['ListEntities']._serialized_options = b'\222A\017\022\rList entities\202\323\344\223\002%\022#/v1/{parent=entityTypes/*}/entities' + _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntities']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntities']._serialized_options = b'\222A\030\022\026Delete entities (bulk)\202\323\344\223\002%*#/v1/{parent=entityTypes/*}/entities' + _globals['_ENTITYSERVICE'].methods_by_name['GetEntity']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['GetEntity']._serialized_options = b'\222A\014\022\nGet entity\202\323\344\223\002%\022#/v1/{name=entityTypes/*/entities/*}' + _globals['_ENTITYSERVICE'].methods_by_name['CreateEntity']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['CreateEntity']._serialized_options = b'\222A\017\022\rCreate entity\202\323\344\223\002-\"#/v1/{parent=entityTypes/*}/entities:\006entity' + _globals['_ENTITYSERVICE'].methods_by_name['UpdateEntity']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['UpdateEntity']._serialized_options = b'\222A\017\022\rUpdate entity\202\323\344\223\00242*/v1/{entity.name=entityTypes/*/entities/*}:\006entity' + _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntity']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntity']._serialized_options = b'\222A\017\022\rDelete entity\202\323\344\223\002%*#/v1/{name=entityTypes/*/entities/*}' + _globals['_ENTITYSERVICE'].methods_by_name['SearchEntities']._loaded_options = None + _globals['_ENTITYSERVICE'].methods_by_name['SearchEntities']._serialized_options = b'\222A\021\022\017Search entities\202\323\344\223\002/\"*/v1/{parent=entityTypes/*}/entities:search:\001*' + _globals['_LISTENTITYTYPESREQUEST']._serialized_start=321 + _globals['_LISTENTITYTYPESREQUEST']._serialized_end=384 + _globals['_LISTENTITYTYPESRESPONSE']._serialized_start=386 + _globals['_LISTENTITYTYPESRESPONSE']._serialized_end=510 + _globals['_GETENTITYTYPEREQUEST']._serialized_start=512 + _globals['_GETENTITYTYPEREQUEST']._serialized_end=576 + _globals['_CREATEENTITYTYPEREQUEST']._serialized_start=578 + _globals['_CREATEENTITYTYPEREQUEST']._serialized_end=684 + _globals['_UPDATEENTITYTYPEREQUEST']._serialized_start=687 + _globals['_UPDATEENTITYTYPEREQUEST']._serialized_end=865 + _globals['_DELETEENTITYTYPEREQUEST']._serialized_start=867 + _globals['_DELETEENTITYTYPEREQUEST']._serialized_end=934 + _globals['_LISTENTITIESREQUEST']._serialized_start=936 + _globals['_LISTENTITIESREQUEST']._serialized_end=1040 + _globals['_LISTENTITIESRESPONSE']._serialized_start=1042 + _globals['_LISTENTITIESRESPONSE']._serialized_end=1155 + _globals['_DELETEENTITIESREQUEST']._serialized_start=1157 + _globals['_DELETEENTITIESREQUEST']._serialized_end=1241 + _globals['_GETENTITYREQUEST']._serialized_start=1243 + _globals['_GETENTITYREQUEST']._serialized_end=1299 + _globals['_CREATEENTITYREQUEST']._serialized_start=1301 + _globals['_CREATEENTITYREQUEST']._serialized_end=1415 + _globals['_UPDATEENTITYREQUEST']._serialized_start=1418 + _globals['_UPDATEENTITYREQUEST']._serialized_end=1579 + _globals['_DELETEENTITYREQUEST']._serialized_start=1581 + _globals['_DELETEENTITYREQUEST']._serialized_end=1640 + _globals['_SEARCHENTITIESREQUEST']._serialized_start=1643 + _globals['_SEARCHENTITIESREQUEST']._serialized_end=1853 + _globals['_SEARCHENTITIESRESPONSE']._serialized_start=1856 + _globals['_SEARCHENTITIESRESPONSE']._serialized_end=2134 + _globals['_SEARCHENTITIESRESPONSE_SEARCHRESULT']._serialized_start=2027 + _globals['_SEARCHENTITIESRESPONSE_SEARCHRESULT']._serialized_end=2134 + _globals['_ENTITYSERVICE']._serialized_start=2137 + _globals['_ENTITYSERVICE']._serialized_end=4048 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/entity_service_pb2.pyi similarity index 53% rename from exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/entity_service_pb2.pyi index d3193117..38777aae 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/entity_service_pb2.pyi @@ -2,46 +2,57 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import entity_messages_pb2 +from . import search_messages_pb2 import google.protobuf.descriptor import google.protobuf.field_mask_pb2 import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class ListEntityTypesRequest(google.protobuf.message.Message): """The request to list entity types.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int page_size: builtins.int - 'Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.' + """Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.""" page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the same\n query parameters.\n ' - - def __init__(self, *, page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... + """Token for a specific page of results, as returned from a previous list request with the same + query parameters. + """ + def __init__( + self, + *, + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token"]) -> None: ... - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token']) -> None: - ... global___ListEntityTypesRequest = ListEntityTypesRequest @typing.final class ListEntityTypesResponse(google.protobuf.message.Message): """The response to list entity types. Returns all known entity types.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENTITY_TYPES_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.' + """Token for the next page of results, which can be sent to a subsequent query.""" total_size: builtins.int - 'Total number of results, irrespective of paging.' - + """Total number of results, irrespective of paging.""" @property def entity_types(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.entity_messages_pb2.EntityType]: """List of entity types. @@ -49,58 +60,69 @@ class ListEntityTypesResponse(google.protobuf.message.Message): (NOT when the token is empty). """ - def __init__(self, *, entity_types: collections.abc.Iterable[exabel.api.data.v1.entity_messages_pb2.EntityType] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + entity_types: collections.abc.Iterable[exabel.api.data.v1.entity_messages_pb2.EntityType] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entity_types", b"entity_types", "next_page_token", b"next_page_token", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entity_types', b'entity_types', 'next_page_token', b'next_page_token', 'total_size', b'total_size']) -> None: - ... global___ListEntityTypesResponse = ListEntityTypesResponse @typing.final class GetEntityTypeRequest(google.protobuf.message.Message): """The request to get one entity type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the requested entity type, for example `entityTypes/ns.type1`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """The resource name of the requested entity type, for example `entityTypes/ns.type1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetEntityTypeRequest = GetEntityTypeRequest @typing.final class CreateEntityTypeRequest(google.protobuf.message.Message): """The request to create one entity type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - ENTITY_TYPE_FIELD_NUMBER: builtins.int + ENTITY_TYPE_FIELD_NUMBER: builtins.int @property def entity_type(self) -> exabel.api.data.v1.entity_messages_pb2.EntityType: """The entity type to create.""" - def __init__(self, *, entity_type: exabel.api.data.v1.entity_messages_pb2.EntityType | None=...) -> None: - ... + def __init__( + self, + *, + entity_type: exabel.api.data.v1.entity_messages_pb2.EntityType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["entity_type", b"entity_type"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["entity_type", b"entity_type"]) -> None: ... - def HasField(self, field_name: typing.Literal['entity_type', b'entity_type']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['entity_type', b'entity_type']) -> None: - ... global___CreateEntityTypeRequest = CreateEntityTypeRequest @typing.final class UpdateEntityTypeRequest(google.protobuf.message.Message): """The request to update one entity type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENTITY_TYPE_FIELD_NUMBER: builtins.int UPDATE_MASK_FIELD_NUMBER: builtins.int ALLOW_MISSING_FIELD_NUMBER: builtins.int allow_missing: builtins.bool - 'If set to `true`, a new entity type will be created if it did not exist, and `update_mask` is\n ignored.\n ' - + """If set to `true`, a new entity type will be created if it did not exist, and `update_mask` is + ignored. + """ @property def entity_type(self) -> exabel.api.data.v1.entity_messages_pb2.EntityType: """The entity type to update.""" @@ -113,141 +135,173 @@ class UpdateEntityTypeRequest(google.protobuf.message.Message): For REST requests, this is a comma-separated string. """ - def __init__(self, *, entity_type: exabel.api.data.v1.entity_messages_pb2.EntityType | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=..., allow_missing: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['entity_type', b'entity_type', 'update_mask', b'update_mask']) -> builtins.bool: - ... + def __init__( + self, + *, + entity_type: exabel.api.data.v1.entity_messages_pb2.EntityType | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + allow_missing: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["entity_type", b"entity_type", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["allow_missing", b"allow_missing", "entity_type", b"entity_type", "update_mask", b"update_mask"]) -> None: ... - def ClearField(self, field_name: typing.Literal['allow_missing', b'allow_missing', 'entity_type', b'entity_type', 'update_mask', b'update_mask']) -> None: - ... global___UpdateEntityTypeRequest = UpdateEntityTypeRequest @typing.final class DeleteEntityTypeRequest(google.protobuf.message.Message): """The request to delete one entity type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the entity type to delete, for example `entityTypes/ns.type1`.' + """The resource name of the entity type to delete, for example `entityTypes/ns.type1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___DeleteEntityTypeRequest = DeleteEntityTypeRequest @typing.final class ListEntitiesRequest(google.protobuf.message.Message): """The request to list entities.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int parent: builtins.str - 'The parent entity type of the entities to list, for example `entityTypes/ns.type1`.' + """The parent entity type of the entities to list, for example `entityTypes/ns.type1`.""" page_size: builtins.int - 'Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.' + """Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.""" page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the\n same query parameters.\n ' - - def __init__(self, *, parent: builtins.str | None=..., page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... + """Token for a specific page of results, as returned from a previous list request with the + same query parameters. + """ + def __init__( + self, + *, + parent: builtins.str | None = ..., + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token", "parent", b"parent"]) -> None: ... - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token', 'parent', b'parent']) -> None: - ... global___ListEntitiesRequest = ListEntitiesRequest @typing.final class ListEntitiesResponse(google.protobuf.message.Message): """The response to list entities. Returns all entities of a given entity type, with only name set.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENTITIES_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the number of results is less than the page size\n (NOT when the token is empty).\n ' + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the number of results is less than the page size + (NOT when the token is empty). + """ total_size: builtins.int - 'Total number of results, irrespective of paging.' - + """Total number of results, irrespective of paging.""" @property def entities(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.entity_messages_pb2.Entity]: """List of entities.""" - def __init__(self, *, entities: collections.abc.Iterable[exabel.api.data.v1.entity_messages_pb2.Entity] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + entities: collections.abc.Iterable[exabel.api.data.v1.entity_messages_pb2.Entity] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entities", b"entities", "next_page_token", b"next_page_token", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entities', b'entities', 'next_page_token', b'next_page_token', 'total_size', b'total_size']) -> None: - ... global___ListEntitiesResponse = ListEntitiesResponse @typing.final class DeleteEntitiesRequest(google.protobuf.message.Message): """The request to delete all entities of a given entity type.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int CONFIRM_FIELD_NUMBER: builtins.int parent: builtins.str - 'The parent entity type of the entities to delete, for example `entityTypes/ns.type1`.' + """The parent entity type of the entities to delete, for example `entityTypes/ns.type1`.""" confirm: builtins.bool - 'Safeguard against accidental deletion. Must be set to `true` for deletion to take place.' + """Safeguard against accidental deletion. Must be set to `true` for deletion to take place.""" + def __init__( + self, + *, + parent: builtins.str | None = ..., + confirm: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["confirm", b"confirm", "parent", b"parent"]) -> None: ... - def __init__(self, *, parent: builtins.str | None=..., confirm: builtins.bool | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['confirm', b'confirm', 'parent', b'parent']) -> None: - ... global___DeleteEntitiesRequest = DeleteEntitiesRequest @typing.final class GetEntityRequest(google.protobuf.message.Message): """The request to get one entity.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the requested entity, for example `entityTypes/ns.type1/entities/ns.entity1`.' + """The resource name of the requested entity, for example `entityTypes/ns.type1/entities/ns.entity1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetEntityRequest = GetEntityRequest @typing.final class CreateEntityRequest(google.protobuf.message.Message): """The response to create one entity.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int ENTITY_FIELD_NUMBER: builtins.int parent: builtins.str - 'The parent entity type of the created entity, for example `entityTypes/ns.type1`.' - + """The parent entity type of the created entity, for example `entityTypes/ns.type1`.""" @property def entity(self) -> exabel.api.data.v1.entity_messages_pb2.Entity: """The entity to create.""" - def __init__(self, *, parent: builtins.str | None=..., entity: exabel.api.data.v1.entity_messages_pb2.Entity | None=...) -> None: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + entity: exabel.api.data.v1.entity_messages_pb2.Entity | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["entity", b"entity"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["entity", b"entity", "parent", b"parent"]) -> None: ... - def HasField(self, field_name: typing.Literal['entity', b'entity']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['entity', b'entity', 'parent', b'parent']) -> None: - ... global___CreateEntityRequest = CreateEntityRequest @typing.final class UpdateEntityRequest(google.protobuf.message.Message): """The request to update one entity.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ENTITY_FIELD_NUMBER: builtins.int UPDATE_MASK_FIELD_NUMBER: builtins.int ALLOW_MISSING_FIELD_NUMBER: builtins.int allow_missing: builtins.bool - 'If set to `true`, a new entity will be created if it did not exist, and `update_mask` is\n ignored.\n ' - + """If set to `true`, a new entity will be created if it did not exist, and `update_mask` is + ignored. + """ @property def entity(self) -> exabel.api.data.v1.entity_messages_pb2.Entity: """The entity to update.""" @@ -260,47 +314,57 @@ class UpdateEntityRequest(google.protobuf.message.Message): For REST requests, this is a comma-separated string. """ - def __init__(self, *, entity: exabel.api.data.v1.entity_messages_pb2.Entity | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=..., allow_missing: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['entity', b'entity', 'update_mask', b'update_mask']) -> builtins.bool: - ... + def __init__( + self, + *, + entity: exabel.api.data.v1.entity_messages_pb2.Entity | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + allow_missing: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["entity", b"entity", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["allow_missing", b"allow_missing", "entity", b"entity", "update_mask", b"update_mask"]) -> None: ... - def ClearField(self, field_name: typing.Literal['allow_missing', b'allow_missing', 'entity', b'entity', 'update_mask', b'update_mask']) -> None: - ... global___UpdateEntityRequest = UpdateEntityRequest @typing.final class DeleteEntityRequest(google.protobuf.message.Message): """The request to delete one entity.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the entity to delete, for example `entityTypes/ns.type1/entities/ns.entity1`.' + """The resource name of the entity to delete, for example `entityTypes/ns.type1/entities/ns.entity1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___DeleteEntityRequest = DeleteEntityRequest @typing.final class SearchEntitiesRequest(google.protobuf.message.Message): """The request to search for one or more entities.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int TERMS_FIELD_NUMBER: builtins.int OPTIONS_FIELD_NUMBER: builtins.int PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int parent: builtins.str - 'The parent entity type of the entities to list, for example `entityTypes/ns.type1`.' + """The parent entity type of the entities to list, for example `entityTypes/ns.type1`.""" page_size: builtins.int - 'The maximum number of results to return. Defaults to 1000, which is also the maximum value\n of this field. (Not implemented yet.)\n ' + """The maximum number of results to return. Defaults to 1000, which is also the maximum value + of this field. (Not implemented yet.) + """ page_token: builtins.str - 'The page token to resume the results from, as returned from a previous request to this method\n with the same query parameters. (Not implemented yet.)\n ' - + """The page token to resume the results from, as returned from a previous request to this method + with the same query parameters. (Not implemented yet.) + """ @property def terms(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.search_messages_pb2.SearchTerm]: """Search terms.""" @@ -311,28 +375,34 @@ class SearchEntitiesRequest(google.protobuf.message.Message): field 'text'. """ - def __init__(self, *, parent: builtins.str | None=..., terms: collections.abc.Iterable[exabel.api.data.v1.search_messages_pb2.SearchTerm] | None=..., options: exabel.api.data.v1.search_messages_pb2.SearchOptions | None=..., page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['options', b'options']) -> builtins.bool: - ... + def __init__( + self, + *, + parent: builtins.str | None = ..., + terms: collections.abc.Iterable[exabel.api.data.v1.search_messages_pb2.SearchTerm] | None = ..., + options: exabel.api.data.v1.search_messages_pb2.SearchOptions | None = ..., + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["options", b"options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["options", b"options", "page_size", b"page_size", "page_token", b"page_token", "parent", b"parent", "terms", b"terms"]) -> None: ... - def ClearField(self, field_name: typing.Literal['options', b'options', 'page_size', b'page_size', 'page_token', b'page_token', 'parent', b'parent', 'terms', b'terms']) -> None: - ... global___SearchEntitiesRequest = SearchEntitiesRequest @typing.final class SearchEntitiesResponse(google.protobuf.message.Message): """The response to searching for entities. Returns all entities matching the search parameters.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class SearchResult(google.protobuf.message.Message): """The result of one search.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TERMS_FIELD_NUMBER: builtins.int ENTITIES_FIELD_NUMBER: builtins.int - @property def terms(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.search_messages_pb2.SearchTerm]: """The terms used for this search.""" @@ -341,17 +411,21 @@ class SearchEntitiesResponse(google.protobuf.message.Message): def entities(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.entity_messages_pb2.Entity]: """All entities matching one search, possibly empty if no entities matched this search.""" - def __init__(self, *, terms: collections.abc.Iterable[exabel.api.data.v1.search_messages_pb2.SearchTerm] | None=..., entities: collections.abc.Iterable[exabel.api.data.v1.entity_messages_pb2.Entity] | None=...) -> None: - ... + def __init__( + self, + *, + terms: collections.abc.Iterable[exabel.api.data.v1.search_messages_pb2.SearchTerm] | None = ..., + entities: collections.abc.Iterable[exabel.api.data.v1.entity_messages_pb2.Entity] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entities", b"entities", "terms", b"terms"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entities', b'entities', 'terms', b'terms']) -> None: - ... RESULTS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int ENTITIES_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'The page token where the search continues. Can be sent to a subsequent query. (Not implemented\n yet.)\n ' - + """The page token where the search continues. Can be sent to a subsequent query. (Not implemented + yet.) + """ @property def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SearchEntitiesResponse.SearchResult]: """The results of each search, in the request order. Note that some consecutive terms are defined @@ -365,9 +439,13 @@ class SearchEntitiesResponse(google.protobuf.message.Message): compatibility.) """ - def __init__(self, *, results: collections.abc.Iterable[global___SearchEntitiesResponse.SearchResult] | None=..., next_page_token: builtins.str | None=..., entities: collections.abc.Iterable[exabel.api.data.v1.entity_messages_pb2.Entity] | None=...) -> None: - ... + def __init__( + self, + *, + results: collections.abc.Iterable[global___SearchEntitiesResponse.SearchResult] | None = ..., + next_page_token: builtins.str | None = ..., + entities: collections.abc.Iterable[exabel.api.data.v1.entity_messages_pb2.Entity] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entities", b"entities", "next_page_token", b"next_page_token", "results", b"results"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entities', b'entities', 'next_page_token', b'next_page_token', 'results', b'results']) -> None: - ... -global___SearchEntitiesResponse = SearchEntitiesResponse \ No newline at end of file +global___SearchEntitiesResponse = SearchEntitiesResponse diff --git a/exabel/stubs/exabel/api/data/v1/entity_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/entity_service_pb2_grpc.py new file mode 100644 index 00000000..42feaccd --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/entity_service_pb2_grpc.py @@ -0,0 +1,651 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import entity_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2 +from . import entity_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/entity_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class EntityServiceStub(object): + """Service for managing entity types and entities. See the User Guide for more information about + entity types and entities: https://help.exabel.com/docs/entities + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListEntityTypes = channel.unary_unary( + '/exabel.api.data.v1.EntityService/ListEntityTypes', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesResponse.FromString, + _registered_method=True) + self.GetEntityType = channel.unary_unary( + '/exabel.api.data.v1.EntityService/GetEntityType', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityTypeRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, + _registered_method=True) + self.CreateEntityType = channel.unary_unary( + '/exabel.api.data.v1.EntityService/CreateEntityType', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityTypeRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, + _registered_method=True) + self.UpdateEntityType = channel.unary_unary( + '/exabel.api.data.v1.EntityService/UpdateEntityType', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityTypeRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, + _registered_method=True) + self.DeleteEntityType = channel.unary_unary( + '/exabel.api.data.v1.EntityService/DeleteEntityType', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.ListEntities = channel.unary_unary( + '/exabel.api.data.v1.EntityService/ListEntities', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesResponse.FromString, + _registered_method=True) + self.DeleteEntities = channel.unary_unary( + '/exabel.api.data.v1.EntityService/DeleteEntities', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntitiesRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.GetEntity = channel.unary_unary( + '/exabel.api.data.v1.EntityService/GetEntity', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, + _registered_method=True) + self.CreateEntity = channel.unary_unary( + '/exabel.api.data.v1.EntityService/CreateEntity', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, + _registered_method=True) + self.UpdateEntity = channel.unary_unary( + '/exabel.api.data.v1.EntityService/UpdateEntity', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, + _registered_method=True) + self.DeleteEntity = channel.unary_unary( + '/exabel.api.data.v1.EntityService/DeleteEntity', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.SearchEntities = channel.unary_unary( + '/exabel.api.data.v1.EntityService/SearchEntities', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesResponse.FromString, + _registered_method=True) + + +class EntityServiceServicer(object): + """Service for managing entity types and entities. See the User Guide for more information about + entity types and entities: https://help.exabel.com/docs/entities + """ + + def ListEntityTypes(self, request, context): + """Lists all known entity types. + + Lists all entity types available to your customer, including those created by you, and in the + global catalog. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetEntityType(self, request, context): + """Gets one entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateEntityType(self, request, context): + """Creates one entity type and returns it. + + It is also possible to create an entity type set by calling `UpdateEntityType` + with `allow_missing` set to `true`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateEntityType(self, request, context): + """Updates one entity type and returns it. + + This can also be used to create an entity type by setting `allow_missing` to `true`. + + Note that this method will update all fields unless `update_mask` is set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteEntityType(self, request, context): + """Deletes one entity type. + + This can only be performed on entity types with no entities. You should delete entities before + deleting their entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListEntities(self, request, context): + """Lists all entities of a given entity type. + + List all entities of a given entity type. + Some entity types are too large to be listed (company, regional, security, listing) - use the + Search method instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteEntities(self, request, context): + """Deletes entities. + + Deletes ***all*** entities of a given entity type, and their relationships and time series. + This is useful for cleaning up erroneous data imports and data that is no longer needed. + Note that the `confirm` field must be set to `true`. Only entities in your namespace(s) are + deleted, and the entity type itself is *not* deleted. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetEntity(self, request, context): + """Gets one entity. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateEntity(self, request, context): + """Creates one entity and returns it. + + It is also possible to create an entity by calling `UpdateEntity` + with `allow_missing` set to `true`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateEntity(self, request, context): + """Updates one entity and returns it. + + This can also be used to create an entity by setting `allow_missing` to `true`. + + Note that this method will update all fields unless `update_mask` is set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteEntity(self, request, context): + """Deletes one entity. + + This will delete ***all*** relationships and time series for the entity. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SearchEntities(self, request, context): + """Search for entities. + + Currently, only companies, securities, and listings can be searched. + + If multiple search terms are present, each search is performed individually, with results + returned in separate `SearchResult` objects. + + Companies may be searched by any of the following fields: + * `isin` (International Securities Identification Number) + * `mic` (Market Identifier Code) and `ticker` + * `bloomberg_ticker` (eg `AAPL US`) + * `bloomberg_symbol` (eg `AAPL US Equity`) + * `cusip` (Committee on Uniform Securities Identification Procedures) + * `figi` (Financial Instruments Global Identifier) + * `factset_identifier`: either FactSet entity identifier (eg `000C7F-E`) or FactSet permanent identifier (FSYM_ID, eg `R85KLC-S`) + * `text` + + `mic` and `ticker` must come in pairs, with `mic` immediately before `ticker`. Each pair is + treated as one search query. + + The `text` field supports free text search for ISINs, tickers and/or company names. If a + search term is sufficiently long, a prefix search will be performed. Up to five companies are + returned for each search. + + Securities may be searched by any of the following fields: + * `isin` + * `mic` and `ticker` + * `cusip` + + Listings may be searched by any of the following fields: + * `mic` and `ticker` + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_EntityServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.ListEntityTypes, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesResponse.SerializeToString, + ), + 'GetEntityType': grpc.unary_unary_rpc_method_handler( + servicer.GetEntityType, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityTypeRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.SerializeToString, + ), + 'CreateEntityType': grpc.unary_unary_rpc_method_handler( + servicer.CreateEntityType, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityTypeRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.SerializeToString, + ), + 'UpdateEntityType': grpc.unary_unary_rpc_method_handler( + servicer.UpdateEntityType, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityTypeRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.SerializeToString, + ), + 'DeleteEntityType': grpc.unary_unary_rpc_method_handler( + servicer.DeleteEntityType, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityTypeRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'ListEntities': grpc.unary_unary_rpc_method_handler( + servicer.ListEntities, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesResponse.SerializeToString, + ), + 'DeleteEntities': grpc.unary_unary_rpc_method_handler( + servicer.DeleteEntities, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntitiesRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'GetEntity': grpc.unary_unary_rpc_method_handler( + servicer.GetEntity, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.SerializeToString, + ), + 'CreateEntity': grpc.unary_unary_rpc_method_handler( + servicer.CreateEntity, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.SerializeToString, + ), + 'UpdateEntity': grpc.unary_unary_rpc_method_handler( + servicer.UpdateEntity, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.SerializeToString, + ), + 'DeleteEntity': grpc.unary_unary_rpc_method_handler( + servicer.DeleteEntity, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'SearchEntities': grpc.unary_unary_rpc_method_handler( + servicer.SearchEntities, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.EntityService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.EntityService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class EntityService(object): + """Service for managing entity types and entities. See the User Guide for more information about + entity types and entities: https://help.exabel.com/docs/entities + """ + + @staticmethod + def ListEntityTypes(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/ListEntityTypes', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetEntityType(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/GetEntityType', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityTypeRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateEntityType(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/CreateEntityType', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityTypeRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateEntityType(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/UpdateEntityType', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityTypeRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteEntityType(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/DeleteEntityType', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityTypeRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListEntities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/ListEntities', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteEntities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/DeleteEntities', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntitiesRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetEntity(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/GetEntity', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateEntity(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/CreateEntity', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateEntity(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/UpdateEntity', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteEntity(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/DeleteEntity', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SearchEntities(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.EntityService/SearchEntities', + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/data/v1/holiday_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/holiday_messages_pb2.py new file mode 100644 index 00000000..ec5b6a25 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/holiday_messages_pb2.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/holiday_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/holiday_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ...time import date_pb2 as exabel_dot_api_dot_time_dot_date__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/data/v1/holiday_messages.proto\x12\x12\x65xabel.api.data.v1\x1a\x1a\x65xabel/api/time/date.proto\"i\n\x14HolidaySpecification\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12-\n\x08holidays\x18\x03 \x03(\x0b\x32\x1b.exabel.api.data.v1.Holiday\"\x7f\n\x07Holiday\x12\r\n\x05label\x18\x01 \x01(\t\x12\x14\n\x0clower_window\x18\x02 \x01(\x05\x12\x14\n\x0cupper_window\x18\x03 \x01(\x05\x12\x13\n\x0bprior_scale\x18\x04 \x01(\x01\x12$\n\x05\x64\x61tes\x18\x05 \x03(\x0b\x32\x15.exabel.api.time.DateBH\n\x16\x63om.exabel.api.data.v1B\x14HolidayMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.holiday_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\024HolidayMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_HOLIDAYSPECIFICATION']._serialized_start=93 + _globals['_HOLIDAYSPECIFICATION']._serialized_end=198 + _globals['_HOLIDAY']._serialized_start=200 + _globals['_HOLIDAY']._serialized_end=327 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/holiday_messages_pb2.pyi similarity index 56% rename from exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/holiday_messages_pb2.pyi index ddf26026..da023a10 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/holiday_messages_pb2.pyi @@ -2,13 +2,16 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2025 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from ...time import date_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final @@ -16,24 +19,29 @@ class HolidaySpecification(google.protobuf.message.Message): """A holiday specification defining a set of holidays with their properties. Used for Prophet forecasting models. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int DISPLAY_NAME_FIELD_NUMBER: builtins.int HOLIDAYS_FIELD_NUMBER: builtins.int name: builtins.str - 'Resource name, e.g. "holidaySpecifications/123".' + """Resource name, e.g. "holidaySpecifications/123".""" display_name: builtins.str - 'Display name for the holiday specification.' - + """Display name for the holiday specification.""" @property def holidays(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Holiday]: """List of holidays in this specification.""" - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., holidays: collections.abc.Iterable[global___Holiday] | None=...) -> None: - ... + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + holidays: collections.abc.Iterable[global___Holiday] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["display_name", b"display_name", "holidays", b"holidays", "name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['display_name', b'display_name', 'holidays', b'holidays', 'name', b'name']) -> None: - ... global___HolidaySpecification = HolidaySpecification @typing.final @@ -41,30 +49,41 @@ class Holiday(google.protobuf.message.Message): """A single holiday with its occurrences and parameters. Parameters follow Facebook Prophet's holiday specification format. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + LABEL_FIELD_NUMBER: builtins.int LOWER_WINDOW_FIELD_NUMBER: builtins.int UPPER_WINDOW_FIELD_NUMBER: builtins.int PRIOR_SCALE_FIELD_NUMBER: builtins.int DATES_FIELD_NUMBER: builtins.int label: builtins.str - 'Label for the holiday.' + """Label for the holiday.""" lower_window: builtins.int - 'Number of days before the holiday to include in the window.\n Can be negative to extend the window backwards.\n ' + """Number of days before the holiday to include in the window. + Can be negative to extend the window backwards. + """ upper_window: builtins.int - 'Number of days after the holiday to include in the window.\n Can be negative to shorten the window.\n ' + """Number of days after the holiday to include in the window. + Can be negative to shorten the window. + """ prior_scale: builtins.float - 'Regularization parameter controlling the magnitude of the holiday effect.' - + """Regularization parameter controlling the magnitude of the holiday effect.""" @property def dates(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.time.date_pb2.Date]: """List of dates when this holiday occurs. Must contain at least one date. """ - def __init__(self, *, label: builtins.str | None=..., lower_window: builtins.int | None=..., upper_window: builtins.int | None=..., prior_scale: builtins.float | None=..., dates: collections.abc.Iterable[exabel.api.time.date_pb2.Date] | None=...) -> None: - ... + def __init__( + self, + *, + label: builtins.str | None = ..., + lower_window: builtins.int | None = ..., + upper_window: builtins.int | None = ..., + prior_scale: builtins.float | None = ..., + dates: collections.abc.Iterable[exabel.api.time.date_pb2.Date] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["dates", b"dates", "label", b"label", "lower_window", b"lower_window", "prior_scale", b"prior_scale", "upper_window", b"upper_window"]) -> None: ... - def ClearField(self, field_name: typing.Literal['dates', b'dates', 'label', b'label', 'lower_window', b'lower_window', 'prior_scale', b'prior_scale', 'upper_window', b'upper_window']) -> None: - ... -global___Holiday = Holiday \ No newline at end of file +global___Holiday = Holiday diff --git a/exabel/stubs/exabel/api/data/v1/holiday_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/holiday_messages_pb2_grpc.py new file mode 100644 index 00000000..a9e79a15 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/holiday_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/holiday_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/holiday_service_pb2.py b/exabel/stubs/exabel/api/data/v1/holiday_service_pb2.py new file mode 100644 index 00000000..db8dfac4 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/holiday_service_pb2.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/holiday_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/holiday_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import holiday_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/holiday_service.proto\x12\x12\x65xabel.api.data.v1\x1a)exabel/api/data/v1/holiday_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"I\n ListHolidaySpecificationsRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t\"\x86\x01\n!ListHolidaySpecificationsResponse\x12H\n\x16holiday_specifications\x18\x01 \x03(\x0b\x32(.exabel.api.data.v1.HolidaySpecification\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"q\n\x1eGetHolidaySpecificationRequest\x12O\n\x04name\x18\x01 \x01(\tBA\x92\x41;J\x1b\"holidaySpecifications/123\"\xca>\x1b\xfa\x02\x18holidaySpecificationName\xe0\x41\x02\"q\n!CreateHolidaySpecificationRequest\x12L\n\x15holiday_specification\x18\x01 \x01(\x0b\x32(.exabel.api.data.v1.HolidaySpecificationB\x03\xe0\x41\x02\"q\n!UpdateHolidaySpecificationRequest\x12L\n\x15holiday_specification\x18\x01 \x01(\x0b\x32(.exabel.api.data.v1.HolidaySpecificationB\x03\xe0\x41\x02\"t\n!DeleteHolidaySpecificationRequest\x12O\n\x04name\x18\x01 \x01(\tBA\x92\x41;J\x1b\"holidaySpecifications/123\"\xca>\x1b\xfa\x02\x18holidaySpecificationName\xe0\x41\x02\x32\xb2\x08\n\x0eHolidayService\x12\xcb\x01\n\x19ListHolidaySpecifications\x12\x34.exabel.api.data.v1.ListHolidaySpecificationsRequest\x1a\x35.exabel.api.data.v1.ListHolidaySpecificationsResponse\"A\x92\x41\x1d\x12\x1bList holiday specifications\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/holidaySpecifications\x12\xc1\x01\n\x17GetHolidaySpecification\x12\x32.exabel.api.data.v1.GetHolidaySpecificationRequest\x1a(.exabel.api.data.v1.HolidaySpecification\"H\x92\x41\x1b\x12\x19Get holiday specification\x82\xd3\xe4\x93\x02$\x12\"/v1/{name=holidaySpecifications/*}\x12\xd8\x01\n\x1a\x43reateHolidaySpecification\x12\x35.exabel.api.data.v1.CreateHolidaySpecificationRequest\x1a(.exabel.api.data.v1.HolidaySpecification\"Y\x92\x41\x1e\x12\x1c\x43reate holiday specification\x82\xd3\xe4\x93\x02\x32\"\x19/v1/holidaySpecifications:\x15holiday_specification\x12\xf7\x01\n\x1aUpdateHolidaySpecification\x12\x35.exabel.api.data.v1.UpdateHolidaySpecificationRequest\x1a(.exabel.api.data.v1.HolidaySpecification\"x\x92\x41\x1e\x12\x1cUpdate holiday specification\x82\xd3\xe4\x93\x02Q28/v1/{holiday_specification.name=holidaySpecifications/*}:\x15holiday_specification\x12\xb8\x01\n\x1a\x44\x65leteHolidaySpecification\x12\x35.exabel.api.data.v1.DeleteHolidaySpecificationRequest\x1a\x16.google.protobuf.Empty\"K\x92\x41\x1e\x12\x1c\x44\x65lete holiday specification\x82\xd3\xe4\x93\x02$*\"/v1/{name=holidaySpecifications/*}BG\n\x16\x63om.exabel.api.data.v1B\x13HolidayServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.holiday_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\023HolidayServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_GETHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['name']._serialized_options = b'\222A;J\033\"holidaySpecifications/123\"\312>\033\372\002\030holidaySpecificationName\340A\002' + _globals['_CREATEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['holiday_specification']._loaded_options = None + _globals['_CREATEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['holiday_specification']._serialized_options = b'\340A\002' + _globals['_UPDATEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['holiday_specification']._loaded_options = None + _globals['_UPDATEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['holiday_specification']._serialized_options = b'\340A\002' + _globals['_DELETEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['name']._serialized_options = b'\222A;J\033\"holidaySpecifications/123\"\312>\033\372\002\030holidaySpecificationName\340A\002' + _globals['_HOLIDAYSERVICE'].methods_by_name['ListHolidaySpecifications']._loaded_options = None + _globals['_HOLIDAYSERVICE'].methods_by_name['ListHolidaySpecifications']._serialized_options = b'\222A\035\022\033List holiday specifications\202\323\344\223\002\033\022\031/v1/holidaySpecifications' + _globals['_HOLIDAYSERVICE'].methods_by_name['GetHolidaySpecification']._loaded_options = None + _globals['_HOLIDAYSERVICE'].methods_by_name['GetHolidaySpecification']._serialized_options = b'\222A\033\022\031Get holiday specification\202\323\344\223\002$\022\"/v1/{name=holidaySpecifications/*}' + _globals['_HOLIDAYSERVICE'].methods_by_name['CreateHolidaySpecification']._loaded_options = None + _globals['_HOLIDAYSERVICE'].methods_by_name['CreateHolidaySpecification']._serialized_options = b'\222A\036\022\034Create holiday specification\202\323\344\223\0022\"\031/v1/holidaySpecifications:\025holiday_specification' + _globals['_HOLIDAYSERVICE'].methods_by_name['UpdateHolidaySpecification']._loaded_options = None + _globals['_HOLIDAYSERVICE'].methods_by_name['UpdateHolidaySpecification']._serialized_options = b'\222A\036\022\034Update holiday specification\202\323\344\223\002Q28/v1/{holiday_specification.name=holidaySpecifications/*}:\025holiday_specification' + _globals['_HOLIDAYSERVICE'].methods_by_name['DeleteHolidaySpecification']._loaded_options = None + _globals['_HOLIDAYSERVICE'].methods_by_name['DeleteHolidaySpecification']._serialized_options = b'\222A\036\022\034Delete holiday specification\202\323\344\223\002$*\"/v1/{name=holidaySpecifications/*}' + _globals['_LISTHOLIDAYSPECIFICATIONSREQUEST']._serialized_start=247 + _globals['_LISTHOLIDAYSPECIFICATIONSREQUEST']._serialized_end=320 + _globals['_LISTHOLIDAYSPECIFICATIONSRESPONSE']._serialized_start=323 + _globals['_LISTHOLIDAYSPECIFICATIONSRESPONSE']._serialized_end=457 + _globals['_GETHOLIDAYSPECIFICATIONREQUEST']._serialized_start=459 + _globals['_GETHOLIDAYSPECIFICATIONREQUEST']._serialized_end=572 + _globals['_CREATEHOLIDAYSPECIFICATIONREQUEST']._serialized_start=574 + _globals['_CREATEHOLIDAYSPECIFICATIONREQUEST']._serialized_end=687 + _globals['_UPDATEHOLIDAYSPECIFICATIONREQUEST']._serialized_start=689 + _globals['_UPDATEHOLIDAYSPECIFICATIONREQUEST']._serialized_end=802 + _globals['_DELETEHOLIDAYSPECIFICATIONREQUEST']._serialized_start=804 + _globals['_DELETEHOLIDAYSPECIFICATIONREQUEST']._serialized_end=920 + _globals['_HOLIDAYSERVICE']._serialized_start=923 + _globals['_HOLIDAYSERVICE']._serialized_end=1997 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/holiday_service_pb2.pyi similarity index 57% rename from exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/holiday_service_pb2.pyi index 511697e1..ebedea56 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/holiday_service_pb2.pyi @@ -2,123 +2,146 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2025 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import holiday_messages_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class ListHolidaySpecificationsRequest(google.protobuf.message.Message): """Request to list holiday specifications.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int page_size: builtins.int - 'Maximum number of results to return. If not set, the server will pick an appropriate default.' + """Maximum number of results to return. If not set, the server will pick an appropriate default.""" page_token: builtins.str - 'Page token for pagination.' - - def __init__(self, *, page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... + """Page token for pagination.""" + def __init__( + self, + *, + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token"]) -> None: ... - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token']) -> None: - ... global___ListHolidaySpecificationsRequest = ListHolidaySpecificationsRequest @typing.final class ListHolidaySpecificationsResponse(google.protobuf.message.Message): """Response from listing holiday specifications.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + HOLIDAY_SPECIFICATIONS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token to retrieve the next page of results, or empty if there are no more results.' - + """Token to retrieve the next page of results, or empty if there are no more results.""" @property def holiday_specifications(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification]: """List of holiday specifications.""" - def __init__(self, *, holiday_specifications: collections.abc.Iterable[exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification] | None=..., next_page_token: builtins.str | None=...) -> None: - ... + def __init__( + self, + *, + holiday_specifications: collections.abc.Iterable[exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification] | None = ..., + next_page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["holiday_specifications", b"holiday_specifications", "next_page_token", b"next_page_token"]) -> None: ... - def ClearField(self, field_name: typing.Literal['holiday_specifications', b'holiday_specifications', 'next_page_token', b'next_page_token']) -> None: - ... global___ListHolidaySpecificationsResponse = ListHolidaySpecificationsResponse @typing.final class GetHolidaySpecificationRequest(google.protobuf.message.Message): """Request to get a holiday specification.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'Resource name of the holiday specification.\n Format: "holidaySpecifications/123"\n ' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """Resource name of the holiday specification. + Format: "holidaySpecifications/123" + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetHolidaySpecificationRequest = GetHolidaySpecificationRequest @typing.final class CreateHolidaySpecificationRequest(google.protobuf.message.Message): """Request to create a holiday specification.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - HOLIDAY_SPECIFICATION_FIELD_NUMBER: builtins.int + HOLIDAY_SPECIFICATION_FIELD_NUMBER: builtins.int @property def holiday_specification(self) -> exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification: """The holiday specification to create. The name field will be ignored and a new resource name will be assigned. """ - def __init__(self, *, holiday_specification: exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification | None=...) -> None: - ... + def __init__( + self, + *, + holiday_specification: exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["holiday_specification", b"holiday_specification"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["holiday_specification", b"holiday_specification"]) -> None: ... - def HasField(self, field_name: typing.Literal['holiday_specification', b'holiday_specification']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['holiday_specification', b'holiday_specification']) -> None: - ... global___CreateHolidaySpecificationRequest = CreateHolidaySpecificationRequest @typing.final class UpdateHolidaySpecificationRequest(google.protobuf.message.Message): """Request to update a holiday specification.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - HOLIDAY_SPECIFICATION_FIELD_NUMBER: builtins.int + HOLIDAY_SPECIFICATION_FIELD_NUMBER: builtins.int @property def holiday_specification(self) -> exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification: """The holiday specification to update. The name field must be set and must match an existing holiday specification. """ - def __init__(self, *, holiday_specification: exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['holiday_specification', b'holiday_specification']) -> builtins.bool: - ... + def __init__( + self, + *, + holiday_specification: exabel.api.data.v1.holiday_messages_pb2.HolidaySpecification | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["holiday_specification", b"holiday_specification"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["holiday_specification", b"holiday_specification"]) -> None: ... - def ClearField(self, field_name: typing.Literal['holiday_specification', b'holiday_specification']) -> None: - ... global___UpdateHolidaySpecificationRequest = UpdateHolidaySpecificationRequest @typing.final class DeleteHolidaySpecificationRequest(google.protobuf.message.Message): """Request to delete a holiday specification.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'Resource name of the holiday specification to delete.\n Format: "holidaySpecifications/123"\n ' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... -global___DeleteHolidaySpecificationRequest = DeleteHolidaySpecificationRequest \ No newline at end of file + """Resource name of the holiday specification to delete. + Format: "holidaySpecifications/123" + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... + +global___DeleteHolidaySpecificationRequest = DeleteHolidaySpecificationRequest diff --git a/exabel/stubs/exabel/api/data/v1/holiday_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/holiday_service_pb2_grpc.py new file mode 100644 index 00000000..25c5b25b --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/holiday_service_pb2_grpc.py @@ -0,0 +1,291 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import holiday_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2 +from . import holiday_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/holiday_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class HolidayServiceStub(object): + """Service for managing custom holiday specifications for Prophet forecasting. + + Holiday specifications define sets of holidays with their properties (dates, windows, weights) + that can be used when forecasting with the Prophet model. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListHolidaySpecifications = channel.unary_unary( + '/exabel.api.data.v1.HolidayService/ListHolidaySpecifications', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsResponse.FromString, + _registered_method=True) + self.GetHolidaySpecification = channel.unary_unary( + '/exabel.api.data.v1.HolidayService/GetHolidaySpecification', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.GetHolidaySpecificationRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, + _registered_method=True) + self.CreateHolidaySpecification = channel.unary_unary( + '/exabel.api.data.v1.HolidayService/CreateHolidaySpecification', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.CreateHolidaySpecificationRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, + _registered_method=True) + self.UpdateHolidaySpecification = channel.unary_unary( + '/exabel.api.data.v1.HolidayService/UpdateHolidaySpecification', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.UpdateHolidaySpecificationRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, + _registered_method=True) + self.DeleteHolidaySpecification = channel.unary_unary( + '/exabel.api.data.v1.HolidayService/DeleteHolidaySpecification', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.DeleteHolidaySpecificationRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + + +class HolidayServiceServicer(object): + """Service for managing custom holiday specifications for Prophet forecasting. + + Holiday specifications define sets of holidays with their properties (dates, windows, weights) + that can be used when forecasting with the Prophet model. + """ + + def ListHolidaySpecifications(self, request, context): + """Lists all holiday specifications. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetHolidaySpecification(self, request, context): + """Gets one holiday specification. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateHolidaySpecification(self, request, context): + """Creates a new holiday specification. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateHolidaySpecification(self, request, context): + """Updates an existing holiday specification. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteHolidaySpecification(self, request, context): + """Deletes a holiday specification. + + Note: Deleting a holiday specification that is referenced by KPI mapping groups + will cause forecasting to fail for those groups until the reference is removed or updated. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_HolidayServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListHolidaySpecifications': grpc.unary_unary_rpc_method_handler( + servicer.ListHolidaySpecifications, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsResponse.SerializeToString, + ), + 'GetHolidaySpecification': grpc.unary_unary_rpc_method_handler( + servicer.GetHolidaySpecification, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.GetHolidaySpecificationRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.SerializeToString, + ), + 'CreateHolidaySpecification': grpc.unary_unary_rpc_method_handler( + servicer.CreateHolidaySpecification, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.CreateHolidaySpecificationRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.SerializeToString, + ), + 'UpdateHolidaySpecification': grpc.unary_unary_rpc_method_handler( + servicer.UpdateHolidaySpecification, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.UpdateHolidaySpecificationRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.SerializeToString, + ), + 'DeleteHolidaySpecification': grpc.unary_unary_rpc_method_handler( + servicer.DeleteHolidaySpecification, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.DeleteHolidaySpecificationRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.HolidayService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.HolidayService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class HolidayService(object): + """Service for managing custom holiday specifications for Prophet forecasting. + + Holiday specifications define sets of holidays with their properties (dates, windows, weights) + that can be used when forecasting with the Prophet model. + """ + + @staticmethod + def ListHolidaySpecifications(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.HolidayService/ListHolidaySpecifications', + exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetHolidaySpecification(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.HolidayService/GetHolidaySpecification', + exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.GetHolidaySpecificationRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateHolidaySpecification(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.HolidayService/CreateHolidaySpecification', + exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.CreateHolidaySpecificationRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateHolidaySpecification(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.HolidayService/UpdateHolidaySpecification', + exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.UpdateHolidaySpecificationRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteHolidaySpecification(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.HolidayService/DeleteHolidaySpecification', + exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.DeleteHolidaySpecificationRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/data/v1/import_job_service_pb2.py b/exabel/stubs/exabel/api/data/v1/import_job_service_pb2.py new file mode 100644 index 00000000..6d59c092 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/import_job_service_pb2.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/import_job_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/import_job_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+exabel/api/data/v1/import_job_service.proto\x12\x12\x65xabel.api.data.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"4\n\x0eRunTaskRequest\x12\"\n\x04name\x18\x01 \x01(\tB\x14\x92\x41\x0e\xca>\x0b\xfa\x02\x08taskName\xe0\x41\x02\"\x11\n\x0fRunTaskResponse2\x9e\x01\n\x10ImportJobService\x12\x89\x01\n\x07RunTask\x12\".exabel.api.data.v1.RunTaskRequest\x1a#.exabel.api.data.v1.RunTaskResponse\"5\x92\x41\x11\x12\x0fRun import task\x82\xd3\xe4\x93\x02\x1b\"\x16/v1/{name=tasks/*}:run:\x01*BJ\n\x16\x63om.exabel.api.data.v1B\x16ImportJobsServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.import_job_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\026ImportJobsServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_RUNTASKREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_RUNTASKREQUEST'].fields_by_name['name']._serialized_options = b'\222A\016\312>\013\372\002\010taskName\340A\002' + _globals['_IMPORTJOBSERVICE'].methods_by_name['RunTask']._loaded_options = None + _globals['_IMPORTJOBSERVICE'].methods_by_name['RunTask']._serialized_options = b'\222A\021\022\017Run import task\202\323\344\223\002\033\"\026/v1/{name=tasks/*}:run:\001*' + _globals['_RUNTASKREQUEST']._serialized_start=178 + _globals['_RUNTASKREQUEST']._serialized_end=230 + _globals['_RUNTASKRESPONSE']._serialized_start=232 + _globals['_RUNTASKRESPONSE']._serialized_end=249 + _globals['_IMPORTJOBSERVICE']._serialized_start=252 + _globals['_IMPORTJOBSERVICE']._serialized_end=410 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/import_job_service_pb2.pyi similarity index 66% rename from exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/import_job_service_pb2.pyi index f6ed99c1..29362452 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/import_job_service_pb2.pyi @@ -2,32 +2,40 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import google.protobuf.descriptor import google.protobuf.message import typing + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class RunTaskRequest(google.protobuf.message.Message): """The request run task.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the task to run, for example `tasks/123`.' + """The resource name of the task to run, for example `tasks/123`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___RunTaskRequest = RunTaskRequest @typing.final class RunTaskResponse(google.protobuf.message.Message): """The response to run task.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... -global___RunTaskResponse = RunTaskResponse \ No newline at end of file + def __init__( + self, + ) -> None: ... + +global___RunTaskResponse = RunTaskResponse diff --git a/exabel/stubs/exabel/api/data/v1/import_job_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/import_job_service_pb2_grpc.py new file mode 100644 index 00000000..570daccd --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/import_job_service_pb2_grpc.py @@ -0,0 +1,118 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import import_job_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/import_job_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class ImportJobServiceStub(object): + """Service for managing import jobs. + + As set of import job stages is run as a single import job task. See the User Guide for more + information on import jobs: https://help.exabel.com/docs/importing-via-import-jobs + + The only current supported operation is run a given import job task. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.RunTask = channel.unary_unary( + '/exabel.api.data.v1.ImportJobService/RunTask', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskResponse.FromString, + _registered_method=True) + + +class ImportJobServiceServicer(object): + """Service for managing import jobs. + + As set of import job stages is run as a single import job task. See the User Guide for more + information on import jobs: https://help.exabel.com/docs/importing-via-import-jobs + + The only current supported operation is run a given import job task. + """ + + def RunTask(self, request, context): + """Runs an import task. + + Runs all the stages of an import job task. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ImportJobServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'RunTask': grpc.unary_unary_rpc_method_handler( + servicer.RunTask, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.ImportJobService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.ImportJobService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class ImportJobService(object): + """Service for managing import jobs. + + As set of import job stages is run as a single import job task. See the User Guide for more + information on import jobs: https://help.exabel.com/docs/importing-via-import-jobs + + The only current supported operation is run a given import job task. + """ + + @staticmethod + def RunTask(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.ImportJobService/RunTask', + exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/data/v1/namespace_service_pb2.py b/exabel/stubs/exabel/api/data/v1/namespace_service_pb2.py new file mode 100644 index 00000000..b2fecb6d --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/namespace_service_pb2.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/namespace_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/namespace_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import namespaces_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_namespaces__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/data/v1/namespace_service.proto\x12\x12\x65xabel.api.data.v1\x1a,exabel/api/data/v1/namespaces_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x17\n\x15ListNamespacesRequest\"K\n\x16ListNamespacesResponse\x12\x31\n\nnamespaces\x18\x01 \x03(\x0b\x32\x1d.exabel.api.data.v1.Namespace2\xa8\x01\n\x10NamespaceService\x12\x93\x01\n\x0eListNamespaces\x12).exabel.api.data.v1.ListNamespacesRequest\x1a*.exabel.api.data.v1.ListNamespacesResponse\"*\x92\x41\x11\x12\x0fList namespaces\x82\xd3\xe4\x93\x02\x10\x12\x0e/v1/namespacesBI\n\x16\x63om.exabel.api.data.v1B\x15NamespaceServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.namespace_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\025NamespaceServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_NAMESPACESERVICE'].methods_by_name['ListNamespaces']._loaded_options = None + _globals['_NAMESPACESERVICE'].methods_by_name['ListNamespaces']._serialized_options = b'\222A\021\022\017List namespaces\202\323\344\223\002\020\022\016/v1/namespaces' + _globals['_LISTNAMESPACESREQUEST']._serialized_start=190 + _globals['_LISTNAMESPACESREQUEST']._serialized_end=213 + _globals['_LISTNAMESPACESRESPONSE']._serialized_start=215 + _globals['_LISTNAMESPACESRESPONSE']._serialized_end=290 + _globals['_NAMESPACESERVICE']._serialized_start=293 + _globals['_NAMESPACESERVICE']._serialized_end=461 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/namespace_service_pb2.pyi similarity index 73% rename from exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/namespace_service_pb2.pyi index 8e420f93..5aa5df8c 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/namespace_service_pb2.pyi @@ -2,39 +2,48 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import namespaces_messages_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class ListNamespacesRequest(google.protobuf.message.Message): """The request to list namespaces.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... + def __init__( + self, + ) -> None: ... + global___ListNamespacesRequest = ListNamespacesRequest @typing.final class ListNamespacesResponse(google.protobuf.message.Message): """The response to list namespaces.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAMESPACES_FIELD_NUMBER: builtins.int + NAMESPACES_FIELD_NUMBER: builtins.int @property def namespaces(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.namespaces_messages_pb2.Namespace]: """List of namespaces accessible to your customer. In addition, all customers have read access to the global namespace; this will not be listed in the response. """ - def __init__(self, *, namespaces: collections.abc.Iterable[exabel.api.data.v1.namespaces_messages_pb2.Namespace] | None=...) -> None: - ... + def __init__( + self, + *, + namespaces: collections.abc.Iterable[exabel.api.data.v1.namespaces_messages_pb2.Namespace] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["namespaces", b"namespaces"]) -> None: ... - def ClearField(self, field_name: typing.Literal['namespaces', b'namespaces']) -> None: - ... -global___ListNamespacesResponse = ListNamespacesResponse \ No newline at end of file +global___ListNamespacesResponse = ListNamespacesResponse diff --git a/exabel/stubs/exabel/api/data/v1/namespace_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/namespace_service_pb2_grpc.py new file mode 100644 index 00000000..837e992b --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/namespace_service_pb2_grpc.py @@ -0,0 +1,117 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import namespace_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/namespace_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class NamespaceServiceStub(object): + """Service for managing namespaces. Namespaces allow Exabel to keep customer data segregated and + private to users of that customer. + + If you have an Exabel full platform license, you will have your own private namespace. All data + that you import will be created in that namespace, and therefore kept private. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListNamespaces = channel.unary_unary( + '/exabel.api.data.v1.NamespaceService/ListNamespaces', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesResponse.FromString, + _registered_method=True) + + +class NamespaceServiceServicer(object): + """Service for managing namespaces. Namespaces allow Exabel to keep customer data segregated and + private to users of that customer. + + If you have an Exabel full platform license, you will have your own private namespace. All data + that you import will be created in that namespace, and therefore kept private. + """ + + def ListNamespaces(self, request, context): + """Lists namespaces. + + Lists all namespaces accessible to your customer. If you have your own namespace, it will + listed as writeable. You may also have read access to other namespaces, depending on your + subscriptions. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_NamespaceServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListNamespaces': grpc.unary_unary_rpc_method_handler( + servicer.ListNamespaces, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.NamespaceService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.NamespaceService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class NamespaceService(object): + """Service for managing namespaces. Namespaces allow Exabel to keep customer data segregated and + private to users of that customer. + + If you have an Exabel full platform license, you will have your own private namespace. All data + that you import will be created in that namespace, and therefore kept private. + """ + + @staticmethod + def ListNamespaces(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.NamespaceService/ListNamespaces', + exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2.py new file mode 100644 index 00000000..028fd00b --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/namespaces_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/namespaces_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,exabel/api/data/v1/namespaces_messages.proto\x12\x12\x65xabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\"6\n\tNamespace\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\twriteable\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x42K\n\x16\x63om.exabel.api.data.v1B\x17NamespacesMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.namespaces_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\027NamespacesMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_NAMESPACE'].fields_by_name['name']._loaded_options = None + _globals['_NAMESPACE'].fields_by_name['name']._serialized_options = b'\340A\003' + _globals['_NAMESPACE'].fields_by_name['writeable']._loaded_options = None + _globals['_NAMESPACE'].fields_by_name['writeable']._serialized_options = b'\340A\003' + _globals['_NAMESPACE']._serialized_start=101 + _globals['_NAMESPACE']._serialized_end=155 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2.pyi similarity index 53% rename from exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2.pyi index 731a5228..157f059d 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2.pyi @@ -2,26 +2,34 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import google.protobuf.descriptor import google.protobuf.message import typing + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class Namespace(google.protobuf.message.Message): """A namespace resource in the Data API.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int WRITEABLE_FIELD_NUMBER: builtins.int name: builtins.str - 'Unique resource name of the namespace, e.g. `namespaces/namespaceIdentifier`.' + """Unique resource name of the namespace, e.g. `namespaces/namespaceIdentifier`.""" writeable: builtins.bool - 'Whether your customer has write access to the namespace. Your own customer namespace will\n always be writeable.\n ' - - def __init__(self, *, name: builtins.str | None=..., writeable: builtins.bool | None=...) -> None: - ... + """Whether your customer has write access to the namespace. Your own customer namespace will + always be writeable. + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + writeable: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name", "writeable", b"writeable"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name', 'writeable', b'writeable']) -> None: - ... -global___Namespace = Namespace \ No newline at end of file +global___Namespace = Namespace diff --git a/exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2_grpc.py new file mode 100644 index 00000000..76f2c461 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/namespaces_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/namespaces_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2.py new file mode 100644 index 00000000..6501f929 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/relationship_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/relationship_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.exabel/api/data/v1/relationship_messages.proto\x12\x12\x65xabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x85\x02\n\x10RelationshipType\x12S\n\x04name\x18\x01 \x01(\tBE\x92\x41\x17\xfa\x02\x14relationshipTypeName\xe0\x41\x05\xe0\x41\x02\x12\x41\n\x0b\x64\x65scription\x18\x02 \x01(\tB,\x92\x41)J\'\"Indicates that an entity owns a store\"\x12\x16\n\tread_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x12\x14\n\x0cis_ownership\x18\x04 \x01(\x08\x12+\n\nproperties\x18\x64 \x01(\x0b\x32\x17.google.protobuf.Struct\"\xf5\x02\n\x0cRelationship\x12R\n\x06parent\x18\x01 \x01(\tBB\x92\x41\x17\xfa\x02\x14relationshipTypeName\xe0\x41\x02\x12\x45\n\x0b\x66rom_entity\x18\x02 \x01(\tB0\x92\x41*J(\"entityTypes/company/entities/F_12345-E\"\xe0\x41\x02\x12K\n\tto_entity\x18\x03 \x01(\tB8\x92\x41\x32J0\"entityTypes/ns.store/entities/ns.some_store_id\"\xe0\x41\x02\x12\x38\n\x0b\x64\x65scription\x18\x04 \x01(\tB#\x92\x41 J\x1e\"F_12345-E owns some_store_id\"\x12\x16\n\tread_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nproperties\x18\x64 \x01(\x0b\x32\x17.google.protobuf.StructBM\n\x16\x63om.exabel.api.data.v1B\x19RelationshipMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.relationship_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\031RelationshipMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_RELATIONSHIPTYPE'].fields_by_name['name']._loaded_options = None + _globals['_RELATIONSHIPTYPE'].fields_by_name['name']._serialized_options = b'\222A\027\372\002\024relationshipTypeName\340A\005\340A\002' + _globals['_RELATIONSHIPTYPE'].fields_by_name['description']._loaded_options = None + _globals['_RELATIONSHIPTYPE'].fields_by_name['description']._serialized_options = b'\222A)J\'\"Indicates that an entity owns a store\"' + _globals['_RELATIONSHIPTYPE'].fields_by_name['read_only']._loaded_options = None + _globals['_RELATIONSHIPTYPE'].fields_by_name['read_only']._serialized_options = b'\340A\003' + _globals['_RELATIONSHIP'].fields_by_name['parent']._loaded_options = None + _globals['_RELATIONSHIP'].fields_by_name['parent']._serialized_options = b'\222A\027\372\002\024relationshipTypeName\340A\002' + _globals['_RELATIONSHIP'].fields_by_name['from_entity']._loaded_options = None + _globals['_RELATIONSHIP'].fields_by_name['from_entity']._serialized_options = b'\222A*J(\"entityTypes/company/entities/F_12345-E\"\340A\002' + _globals['_RELATIONSHIP'].fields_by_name['to_entity']._loaded_options = None + _globals['_RELATIONSHIP'].fields_by_name['to_entity']._serialized_options = b'\222A2J0\"entityTypes/ns.store/entities/ns.some_store_id\"\340A\002' + _globals['_RELATIONSHIP'].fields_by_name['description']._loaded_options = None + _globals['_RELATIONSHIP'].fields_by_name['description']._serialized_options = b'\222A J\036\"F_12345-E owns some_store_id\"' + _globals['_RELATIONSHIP'].fields_by_name['read_only']._loaded_options = None + _globals['_RELATIONSHIP'].fields_by_name['read_only']._serialized_options = b'\340A\003' + _globals['_RELATIONSHIPTYPE']._serialized_start=182 + _globals['_RELATIONSHIPTYPE']._serialized_end=443 + _globals['_RELATIONSHIP']._serialized_start=446 + _globals['_RELATIONSHIP']._serialized_end=819 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2.pyi new file mode 100644 index 00000000..a54cf59a --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2.pyi @@ -0,0 +1,109 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + +import builtins +import google.protobuf.descriptor +import google.protobuf.message +import google.protobuf.struct_pb2 +import typing + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class RelationshipType(google.protobuf.message.Message): + """A relationship type resource in the Data API.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + READ_ONLY_FIELD_NUMBER: builtins.int + IS_OWNERSHIP_FIELD_NUMBER: builtins.int + PROPERTIES_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the relationship type, e.g. + `relationshipTypes/namespace.relationshipTypeIdentifier`. + The namespace must be empty (being global) or a namespace accessible to the customer. + The relationship type identifier must match the regex `[A-Z][A-Z0-9_]{0,63}`. + """ + description: builtins.str + """This is currently not used in the Exabel app, but may be in future.""" + read_only: builtins.bool + """Global relationship types and those from data sets that you subscribe to will be read-only.""" + is_ownership: builtins.bool + """Whether this relationship type specifies an `ownership` in the data set model. Ownership + relationships must go *from* the owner *to* the child entity. + """ + @property + def properties(self) -> google.protobuf.struct_pb2.Struct: + """Additional properties of this relationship type. This is currently not used in the Exabel app, + but may be in future. + """ + + def __init__( + self, + *, + name: builtins.str | None = ..., + description: builtins.str | None = ..., + read_only: builtins.bool | None = ..., + is_ownership: builtins.bool | None = ..., + properties: google.protobuf.struct_pb2.Struct | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["properties", b"properties"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "is_ownership", b"is_ownership", "name", b"name", "properties", b"properties", "read_only", b"read_only"]) -> None: ... + +global___RelationshipType = RelationshipType + +@typing.final +class Relationship(google.protobuf.message.Message): + """A relationship resource in the Data API. All relationships have one relationship type as its + parent. Relationships do not have resource names, but are identified by their (type, from, to) + triple. There can only be one relationship of one type between two entities (as viewed by a + single user). The namespaces of the end points must either be empty (being global) or one of the + predetermined namespaces the customer has access to. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + FROM_ENTITY_FIELD_NUMBER: builtins.int + TO_ENTITY_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + READ_ONLY_FIELD_NUMBER: builtins.int + PROPERTIES_FIELD_NUMBER: builtins.int + parent: builtins.str + """Parent relationship type, e.g. `relationshipTypes/ns.type1`.""" + from_entity: builtins.str + """Resource name of entity the relationship starts from, e.g. + `entityTypes/ns.type1/entities/ns.entity1`. + """ + to_entity: builtins.str + """Resource name of entity the relationship goes to, e.g. + `entityTypes/ns.type2/entities/ns.entity2`. + """ + description: builtins.str + """This is currently not used in the Exabel app, but may be in future.""" + read_only: builtins.bool + """Global relationships and those from data sets that you subscribe to will be read-only.""" + @property + def properties(self) -> google.protobuf.struct_pb2.Struct: + """Additional properties of this relationship. This is currently not used in the Exabel app, but + may be in future. + """ + + def __init__( + self, + *, + parent: builtins.str | None = ..., + from_entity: builtins.str | None = ..., + to_entity: builtins.str | None = ..., + description: builtins.str | None = ..., + read_only: builtins.bool | None = ..., + properties: google.protobuf.struct_pb2.Struct | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["properties", b"properties"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "from_entity", b"from_entity", "parent", b"parent", "properties", b"properties", "read_only", b"read_only", "to_entity", b"to_entity"]) -> None: ... + +global___Relationship = Relationship diff --git a/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2_grpc.py new file mode 100644 index 00000000..2499043b --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/relationship_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/relationship_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/relationship_service_pb2.py b/exabel/stubs/exabel/api/data/v1/relationship_service_pb2.py new file mode 100644 index 00000000..bce01bcf --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/relationship_service_pb2.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/relationship_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/relationship_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import relationship_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-exabel/api/data/v1/relationship_service.proto\x12\x12\x65xabel.api.data.v1\x1a.exabel/api/data/v1/relationship_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"E\n\x1cListRelationshipTypesRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t\"\x8e\x01\n\x1dListRelationshipTypesResponse\x12@\n\x12relationship_types\x18\x01 \x03(\x0b\x32$.exabel.api.data.v1.RelationshipType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"e\n\x1d\x43reateRelationshipTypeRequest\x12\x44\n\x11relationship_type\x18\x01 \x01(\x0b\x32$.exabel.api.data.v1.RelationshipTypeB\x03\xe0\x41\x02\"\xad\x01\n\x1dUpdateRelationshipTypeRequest\x12\x44\n\x11relationship_type\x18\x01 \x01(\x0b\x32$.exabel.api.data.v1.RelationshipTypeB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"O\n\x1d\x44\x65leteRelationshipTypeRequest\x12.\n\x04name\x18\x01 \x01(\tB \x92\x41\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0\x41\x02\"L\n\x1aGetRelationshipTypeRequest\x12.\n\x04name\x18\x01 \x01(\tB \x92\x41\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0\x41\x02\"\x9b\x01\n\x18ListRelationshipsRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \x92\x41\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0\x41\x02\x12\x13\n\x0b\x66rom_entity\x18\x02 \x01(\t\x12\x11\n\tto_entity\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"\x81\x01\n\x19ListRelationshipsResponse\x12\x37\n\rrelationships\x18\x01 \x03(\x0b\x32 .exabel.api.data.v1.Relationship\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"|\n\x16GetRelationshipRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \x92\x41\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0\x41\x02\x12\x18\n\x0b\x66rom_entity\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tto_entity\x18\x03 \x01(\tB\x03\xe0\x41\x02\"X\n\x19\x43reateRelationshipRequest\x12;\n\x0crelationship\x18\x01 \x01(\x0b\x32 .exabel.api.data.v1.RelationshipB\x03\xe0\x41\x02\"\xa0\x01\n\x19UpdateRelationshipRequest\x12;\n\x0crelationship\x18\x01 \x01(\x0b\x32 .exabel.api.data.v1.RelationshipB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\"\x7f\n\x19\x44\x65leteRelationshipRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \x92\x41\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0\x41\x02\x12\x18\n\x0b\x66rom_entity\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tto_entity\x18\x03 \x01(\tB\x03\xe0\x41\x02\x32\x94\x12\n\x13RelationshipService\x12\xb7\x01\n\x15ListRelationshipTypes\x12\x30.exabel.api.data.v1.ListRelationshipTypesRequest\x1a\x31.exabel.api.data.v1.ListRelationshipTypesResponse\"9\x92\x41\x19\x12\x17List relationship types\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/relationshipTypes\x12\xad\x01\n\x13GetRelationshipType\x12..exabel.api.data.v1.GetRelationshipTypeRequest\x1a$.exabel.api.data.v1.RelationshipType\"@\x92\x41\x17\x12\x15Get relationship type\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{name=relationshipTypes/*}\x12\xc0\x01\n\x16\x43reateRelationshipType\x12\x31.exabel.api.data.v1.CreateRelationshipTypeRequest\x1a$.exabel.api.data.v1.RelationshipType\"M\x92\x41\x1a\x12\x18\x43reate relationship type\x82\xd3\xe4\x93\x02*\"\x15/v1/relationshipTypes:\x11relationship_type\x12\xdb\x01\n\x16UpdateRelationshipType\x12\x31.exabel.api.data.v1.UpdateRelationshipTypeRequest\x1a$.exabel.api.data.v1.RelationshipType\"h\x92\x41\x1a\x12\x18Update relationship type\x82\xd3\xe4\x93\x02\x45\x32\x30/v1/{relationship_type.name=relationshipTypes/*}:\x11relationship_type\x12\xa8\x01\n\x16\x44\x65leteRelationshipType\x12\x31.exabel.api.data.v1.DeleteRelationshipTypeRequest\x1a\x16.google.protobuf.Empty\"C\x92\x41\x1a\x12\x18\x44\x65lete relationship type\x82\xd3\xe4\x93\x02 *\x1e/v1/{name=relationshipTypes/*}\x12\xbf\x01\n\x11ListRelationships\x12,.exabel.api.data.v1.ListRelationshipsRequest\x1a-.exabel.api.data.v1.ListRelationshipsResponse\"M\x92\x41\x14\x12\x12List relationships\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=relationshipTypes/*}/relationships\x12\xf9\x01\n\x0fGetRelationship\x12*.exabel.api.data.v1.GetRelationshipRequest\x1a .exabel.api.data.v1.Relationship\"\x97\x01\x92\x41\x12\x12\x10Get relationship\x82\xd3\xe4\x93\x02|\x12z/v1/{parent=relationshipTypes/*}/relationships/{from_entity=entityTypes/*/entities/*}/{to_entity=entityTypes/*/entities/*}\x12\xd0\x01\n\x12\x43reateRelationship\x12-.exabel.api.data.v1.CreateRelationshipRequest\x1a .exabel.api.data.v1.Relationship\"i\x92\x41\x15\x12\x13\x43reate relationship\x82\xd3\xe4\x93\x02K\";/v1/{relationship.parent=relationshipTypes/*}/relationships:\x0crelationship\x12\x87\x03\n\x12UpdateRelationship\x12-.exabel.api.data.v1.UpdateRelationshipRequest\x1a .exabel.api.data.v1.Relationship\"\x9f\x02\x92\x41\x15\x12\x13Update relationship\x82\xd3\xe4\x93\x02\x80\x02\x32;/v1/{relationship.parent=relationshipTypes/*}/relationships:\x0crelationshipZ\xb2\x01\x32\xa1\x01/v1/{relationship.parent=relationshipTypes/*}/relationships/{relationship.from_entity=entityTypes/*/entities/*}/{relationship.to_entity=entityTypes/*/entities/*}:\x0crelationship\x12\xab\x02\n\x12\x44\x65leteRelationship\x12-.exabel.api.data.v1.DeleteRelationshipRequest\x1a\x16.google.protobuf.Empty\"\xcd\x01\x92\x41\x15\x12\x13\x44\x65lete relationship\x82\xd3\xe4\x93\x02\xae\x01*./v1/{parent=relationshipTypes/*}/relationshipsZ|*z/v1/{parent=relationshipTypes/*}/relationships/{from_entity=entityTypes/*/entities/*}/{to_entity=entityTypes/*/entities/*}BL\n\x16\x63om.exabel.api.data.v1B\x18RelationshipServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.relationship_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\030RelationshipServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_CREATERELATIONSHIPTYPEREQUEST'].fields_by_name['relationship_type']._loaded_options = None + _globals['_CREATERELATIONSHIPTYPEREQUEST'].fields_by_name['relationship_type']._serialized_options = b'\340A\002' + _globals['_UPDATERELATIONSHIPTYPEREQUEST'].fields_by_name['relationship_type']._loaded_options = None + _globals['_UPDATERELATIONSHIPTYPEREQUEST'].fields_by_name['relationship_type']._serialized_options = b'\340A\002' + _globals['_DELETERELATIONSHIPTYPEREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETERELATIONSHIPTYPEREQUEST'].fields_by_name['name']._serialized_options = b'\222A\032\312>\027\372\002\024relationshipTypeName\340A\002' + _globals['_GETRELATIONSHIPTYPEREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETRELATIONSHIPTYPEREQUEST'].fields_by_name['name']._serialized_options = b'\222A\032\312>\027\372\002\024relationshipTypeName\340A\002' + _globals['_LISTRELATIONSHIPSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTRELATIONSHIPSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\032\312>\027\372\002\024relationshipTypeName\340A\002' + _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\032\312>\027\372\002\024relationshipTypeName\340A\002' + _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['from_entity']._loaded_options = None + _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['from_entity']._serialized_options = b'\340A\002' + _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['to_entity']._loaded_options = None + _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['to_entity']._serialized_options = b'\340A\002' + _globals['_CREATERELATIONSHIPREQUEST'].fields_by_name['relationship']._loaded_options = None + _globals['_CREATERELATIONSHIPREQUEST'].fields_by_name['relationship']._serialized_options = b'\340A\002' + _globals['_UPDATERELATIONSHIPREQUEST'].fields_by_name['relationship']._loaded_options = None + _globals['_UPDATERELATIONSHIPREQUEST'].fields_by_name['relationship']._serialized_options = b'\340A\002' + _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\032\312>\027\372\002\024relationshipTypeName\340A\002' + _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['from_entity']._loaded_options = None + _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['from_entity']._serialized_options = b'\340A\002' + _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['to_entity']._loaded_options = None + _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['to_entity']._serialized_options = b'\340A\002' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['ListRelationshipTypes']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['ListRelationshipTypes']._serialized_options = b'\222A\031\022\027List relationship types\202\323\344\223\002\027\022\025/v1/relationshipTypes' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['GetRelationshipType']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['GetRelationshipType']._serialized_options = b'\222A\027\022\025Get relationship type\202\323\344\223\002 \022\036/v1/{name=relationshipTypes/*}' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['CreateRelationshipType']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['CreateRelationshipType']._serialized_options = b'\222A\032\022\030Create relationship type\202\323\344\223\002*\"\025/v1/relationshipTypes:\021relationship_type' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['UpdateRelationshipType']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['UpdateRelationshipType']._serialized_options = b'\222A\032\022\030Update relationship type\202\323\344\223\002E20/v1/{relationship_type.name=relationshipTypes/*}:\021relationship_type' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['DeleteRelationshipType']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['DeleteRelationshipType']._serialized_options = b'\222A\032\022\030Delete relationship type\202\323\344\223\002 *\036/v1/{name=relationshipTypes/*}' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['ListRelationships']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['ListRelationships']._serialized_options = b'\222A\024\022\022List relationships\202\323\344\223\0020\022./v1/{parent=relationshipTypes/*}/relationships' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['GetRelationship']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['GetRelationship']._serialized_options = b'\222A\022\022\020Get relationship\202\323\344\223\002|\022z/v1/{parent=relationshipTypes/*}/relationships/{from_entity=entityTypes/*/entities/*}/{to_entity=entityTypes/*/entities/*}' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['CreateRelationship']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['CreateRelationship']._serialized_options = b'\222A\025\022\023Create relationship\202\323\344\223\002K\";/v1/{relationship.parent=relationshipTypes/*}/relationships:\014relationship' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['UpdateRelationship']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['UpdateRelationship']._serialized_options = b'\222A\025\022\023Update relationship\202\323\344\223\002\200\0022;/v1/{relationship.parent=relationshipTypes/*}/relationships:\014relationshipZ\262\0012\241\001/v1/{relationship.parent=relationshipTypes/*}/relationships/{relationship.from_entity=entityTypes/*/entities/*}/{relationship.to_entity=entityTypes/*/entities/*}:\014relationship' + _globals['_RELATIONSHIPSERVICE'].methods_by_name['DeleteRelationship']._loaded_options = None + _globals['_RELATIONSHIPSERVICE'].methods_by_name['DeleteRelationship']._serialized_options = b'\222A\025\022\023Delete relationship\202\323\344\223\002\256\001*./v1/{parent=relationshipTypes/*}/relationshipsZ|*z/v1/{parent=relationshipTypes/*}/relationships/{from_entity=entityTypes/*/entities/*}/{to_entity=entityTypes/*/entities/*}' + _globals['_LISTRELATIONSHIPTYPESREQUEST']._serialized_start=291 + _globals['_LISTRELATIONSHIPTYPESREQUEST']._serialized_end=360 + _globals['_LISTRELATIONSHIPTYPESRESPONSE']._serialized_start=363 + _globals['_LISTRELATIONSHIPTYPESRESPONSE']._serialized_end=505 + _globals['_CREATERELATIONSHIPTYPEREQUEST']._serialized_start=507 + _globals['_CREATERELATIONSHIPTYPEREQUEST']._serialized_end=608 + _globals['_UPDATERELATIONSHIPTYPEREQUEST']._serialized_start=611 + _globals['_UPDATERELATIONSHIPTYPEREQUEST']._serialized_end=784 + _globals['_DELETERELATIONSHIPTYPEREQUEST']._serialized_start=786 + _globals['_DELETERELATIONSHIPTYPEREQUEST']._serialized_end=865 + _globals['_GETRELATIONSHIPTYPEREQUEST']._serialized_start=867 + _globals['_GETRELATIONSHIPTYPEREQUEST']._serialized_end=943 + _globals['_LISTRELATIONSHIPSREQUEST']._serialized_start=946 + _globals['_LISTRELATIONSHIPSREQUEST']._serialized_end=1101 + _globals['_LISTRELATIONSHIPSRESPONSE']._serialized_start=1104 + _globals['_LISTRELATIONSHIPSRESPONSE']._serialized_end=1233 + _globals['_GETRELATIONSHIPREQUEST']._serialized_start=1235 + _globals['_GETRELATIONSHIPREQUEST']._serialized_end=1359 + _globals['_CREATERELATIONSHIPREQUEST']._serialized_start=1361 + _globals['_CREATERELATIONSHIPREQUEST']._serialized_end=1449 + _globals['_UPDATERELATIONSHIPREQUEST']._serialized_start=1452 + _globals['_UPDATERELATIONSHIPREQUEST']._serialized_end=1612 + _globals['_DELETERELATIONSHIPREQUEST']._serialized_start=1614 + _globals['_DELETERELATIONSHIPREQUEST']._serialized_end=1741 + _globals['_RELATIONSHIPSERVICE']._serialized_start=1744 + _globals['_RELATIONSHIPSERVICE']._serialized_end=4068 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/data/v1/relationship_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/relationship_service_pb2.pyi new file mode 100644 index 00000000..6992c7c3 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/relationship_service_pb2.pyi @@ -0,0 +1,356 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + +import builtins +import collections.abc +from . import relationship_messages_pb2 +import google.protobuf.descriptor +import google.protobuf.field_mask_pb2 +import google.protobuf.internal.containers +import google.protobuf.message +import typing +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class ListRelationshipTypesRequest(google.protobuf.message.Message): + """The request to list relationship types.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PAGE_SIZE_FIELD_NUMBER: builtins.int + PAGE_TOKEN_FIELD_NUMBER: builtins.int + page_size: builtins.int + """Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.""" + page_token: builtins.str + """Token for a specific page of results, as returned from a previous list request with the same + query parameters. + """ + def __init__( + self, + *, + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token"]) -> None: ... + +global___ListRelationshipTypesRequest = ListRelationshipTypesRequest + +@typing.final +class ListRelationshipTypesResponse(google.protobuf.message.Message): + """The response to list relationship types. Returns all known relationship types.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + RELATIONSHIP_TYPES_FIELD_NUMBER: builtins.int + NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int + TOTAL_SIZE_FIELD_NUMBER: builtins.int + next_page_token: builtins.str + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the number of results is less than the page size + (NOT when the token is empty). + """ + total_size: builtins.int + """Total number of results, irrespective of paging.""" + @property + def relationship_types(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.relationship_messages_pb2.RelationshipType]: + """List of relationship types.""" + + def __init__( + self, + *, + relationship_types: collections.abc.Iterable[exabel.api.data.v1.relationship_messages_pb2.RelationshipType] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["next_page_token", b"next_page_token", "relationship_types", b"relationship_types", "total_size", b"total_size"]) -> None: ... + +global___ListRelationshipTypesResponse = ListRelationshipTypesResponse + +@typing.final +class CreateRelationshipTypeRequest(google.protobuf.message.Message): + """The request to create one relationship type.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + RELATIONSHIP_TYPE_FIELD_NUMBER: builtins.int + @property + def relationship_type(self) -> exabel.api.data.v1.relationship_messages_pb2.RelationshipType: + """The relationship type to create.""" + + def __init__( + self, + *, + relationship_type: exabel.api.data.v1.relationship_messages_pb2.RelationshipType | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["relationship_type", b"relationship_type"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["relationship_type", b"relationship_type"]) -> None: ... + +global___CreateRelationshipTypeRequest = CreateRelationshipTypeRequest + +@typing.final +class UpdateRelationshipTypeRequest(google.protobuf.message.Message): + """The request to update one relationship type.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + RELATIONSHIP_TYPE_FIELD_NUMBER: builtins.int + UPDATE_MASK_FIELD_NUMBER: builtins.int + ALLOW_MISSING_FIELD_NUMBER: builtins.int + allow_missing: builtins.bool + """If set to `true`, a new relationship type will be created if it did not exist, and + `update_mask` is ignored. + """ + @property + def relationship_type(self) -> exabel.api.data.v1.relationship_messages_pb2.RelationshipType: + """The relationship type to update.""" + + @property + def update_mask(self) -> google.protobuf.field_mask_pb2.FieldMask: + """Use this to update only selected fields. For example, specify `description` to update only the + description. If `allow_missing` is set, this field is ignored. + + For REST requests, this is a comma-separated string. + """ + + def __init__( + self, + *, + relationship_type: exabel.api.data.v1.relationship_messages_pb2.RelationshipType | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + allow_missing: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["relationship_type", b"relationship_type", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["allow_missing", b"allow_missing", "relationship_type", b"relationship_type", "update_mask", b"update_mask"]) -> None: ... + +global___UpdateRelationshipTypeRequest = UpdateRelationshipTypeRequest + +@typing.final +class DeleteRelationshipTypeRequest(google.protobuf.message.Message): + """The request to delete one relationship type.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + name: builtins.str + """The resource name of the relationship type to delete, for example `relationshipTypes/ns.type1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... + +global___DeleteRelationshipTypeRequest = DeleteRelationshipTypeRequest + +@typing.final +class GetRelationshipTypeRequest(google.protobuf.message.Message): + """The response to get one relationship type.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + name: builtins.str + """The resource name of the requested relationship type, for example `relationshipTypes/ns.type1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... + +global___GetRelationshipTypeRequest = GetRelationshipTypeRequest + +@typing.final +class ListRelationshipsRequest(google.protobuf.message.Message): + """The request to list relationship of a specific type.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + FROM_ENTITY_FIELD_NUMBER: builtins.int + TO_ENTITY_FIELD_NUMBER: builtins.int + PAGE_SIZE_FIELD_NUMBER: builtins.int + PAGE_TOKEN_FIELD_NUMBER: builtins.int + parent: builtins.str + """The type of the relationship, for example `relationshipTypes/ns.type1`. + Use parent `relationshipTypes/-` to include all types. + """ + from_entity: builtins.str + """Resource name of entity to list relationships from, e.g. + `entityTypes/ns.type1/entities/ns.entity1`. + """ + to_entity: builtins.str + """Resource name of entity to list relationships to, e.g. + `entityTypes/ns.type2/entities/ns.entity2`. + """ + page_size: builtins.int + """Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.""" + page_token: builtins.str + """Token for a specific page of results, as returned from a previous list request with the + same query parameters. + """ + def __init__( + self, + *, + parent: builtins.str | None = ..., + from_entity: builtins.str | None = ..., + to_entity: builtins.str | None = ..., + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["from_entity", b"from_entity", "page_size", b"page_size", "page_token", b"page_token", "parent", b"parent", "to_entity", b"to_entity"]) -> None: ... + +global___ListRelationshipsRequest = ListRelationshipsRequest + +@typing.final +class ListRelationshipsResponse(google.protobuf.message.Message): + """The response to list relationships.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + RELATIONSHIPS_FIELD_NUMBER: builtins.int + NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int + TOTAL_SIZE_FIELD_NUMBER: builtins.int + next_page_token: builtins.str + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the number of results is less than the page size + (NOT when the token is empty). + """ + total_size: builtins.int + """Total number of results, irrespective of paging.""" + @property + def relationships(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.relationship_messages_pb2.Relationship]: + """List of relationships. **Does not** return `description` or `properties`.""" + + def __init__( + self, + *, + relationships: collections.abc.Iterable[exabel.api.data.v1.relationship_messages_pb2.Relationship] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["next_page_token", b"next_page_token", "relationships", b"relationships", "total_size", b"total_size"]) -> None: ... + +global___ListRelationshipsResponse = ListRelationshipsResponse + +@typing.final +class GetRelationshipRequest(google.protobuf.message.Message): + """The request to get one relationship.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + FROM_ENTITY_FIELD_NUMBER: builtins.int + TO_ENTITY_FIELD_NUMBER: builtins.int + parent: builtins.str + """The type of the relationship, for example `relationshipTypes/ns.type1`.""" + from_entity: builtins.str + """Resource name of entity the relationship starts from, e.g. + `entityTypes/ns.type1/entities/ns.entity1`. + """ + to_entity: builtins.str + """Resource name of entity the relationship goes to, e.g. + `entityTypes/ns.type2/entities/ns.entity2`. + """ + def __init__( + self, + *, + parent: builtins.str | None = ..., + from_entity: builtins.str | None = ..., + to_entity: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["from_entity", b"from_entity", "parent", b"parent", "to_entity", b"to_entity"]) -> None: ... + +global___GetRelationshipRequest = GetRelationshipRequest + +@typing.final +class CreateRelationshipRequest(google.protobuf.message.Message): + """The request to create one relationship.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + RELATIONSHIP_FIELD_NUMBER: builtins.int + @property + def relationship(self) -> exabel.api.data.v1.relationship_messages_pb2.Relationship: + """The relationship to create.""" + + def __init__( + self, + *, + relationship: exabel.api.data.v1.relationship_messages_pb2.Relationship | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["relationship", b"relationship"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["relationship", b"relationship"]) -> None: ... + +global___CreateRelationshipRequest = CreateRelationshipRequest + +@typing.final +class UpdateRelationshipRequest(google.protobuf.message.Message): + """The request to update one relationship.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + RELATIONSHIP_FIELD_NUMBER: builtins.int + UPDATE_MASK_FIELD_NUMBER: builtins.int + ALLOW_MISSING_FIELD_NUMBER: builtins.int + allow_missing: builtins.bool + """If set to `true`, a new relationship will be created if it did not exist, and `update_mask` is + ignored. + """ + @property + def relationship(self) -> exabel.api.data.v1.relationship_messages_pb2.Relationship: + """The relationship to update.""" + + @property + def update_mask(self) -> google.protobuf.field_mask_pb2.FieldMask: + """Use this to update only selected fields. For example, specify `description` to update only the + description. If `allow_missing` is set, this field is ignored. + + For REST requests, this is a comma-separated string. + """ + + def __init__( + self, + *, + relationship: exabel.api.data.v1.relationship_messages_pb2.Relationship | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + allow_missing: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["relationship", b"relationship", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["allow_missing", b"allow_missing", "relationship", b"relationship", "update_mask", b"update_mask"]) -> None: ... + +global___UpdateRelationshipRequest = UpdateRelationshipRequest + +@typing.final +class DeleteRelationshipRequest(google.protobuf.message.Message): + """The request to delete one relationship.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + FROM_ENTITY_FIELD_NUMBER: builtins.int + TO_ENTITY_FIELD_NUMBER: builtins.int + parent: builtins.str + """The parent of the relationship to delete, for example `relationshipTypes/ns.type1`.""" + from_entity: builtins.str + """Resource name of entity the relationship starts from, e.g. + `entityTypes/ns.type1/entities/ns.entity1`. + """ + to_entity: builtins.str + """Resource name of entity the relationship goes to, e.g. + `entityTypes/ns.type2/entities/ns.entity2`. + """ + def __init__( + self, + *, + parent: builtins.str | None = ..., + from_entity: builtins.str | None = ..., + to_entity: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["from_entity", b"from_entity", "parent", b"parent", "to_entity", b"to_entity"]) -> None: ... + +global___DeleteRelationshipRequest = DeleteRelationshipRequest diff --git a/exabel/stubs/exabel/api/data/v1/relationship_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/relationship_service_pb2_grpc.py new file mode 100644 index 00000000..978194b9 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/relationship_service_pb2_grpc.py @@ -0,0 +1,531 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import relationship_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2 +from . import relationship_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/relationship_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class RelationshipServiceStub(object): + """Service for managing relationship types and relationships. See the User Guide for more + information about relationship types and relationships: + https://help.exabel.com/docs/relationships + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListRelationshipTypes = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/ListRelationshipTypes', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesResponse.FromString, + _registered_method=True) + self.GetRelationshipType = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/GetRelationshipType', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipTypeRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, + _registered_method=True) + self.CreateRelationshipType = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/CreateRelationshipType', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipTypeRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, + _registered_method=True) + self.UpdateRelationshipType = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/UpdateRelationshipType', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipTypeRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, + _registered_method=True) + self.DeleteRelationshipType = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/DeleteRelationshipType', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipTypeRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.ListRelationships = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/ListRelationships', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsResponse.FromString, + _registered_method=True) + self.GetRelationship = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/GetRelationship', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, + _registered_method=True) + self.CreateRelationship = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/CreateRelationship', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, + _registered_method=True) + self.UpdateRelationship = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/UpdateRelationship', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, + _registered_method=True) + self.DeleteRelationship = channel.unary_unary( + '/exabel.api.data.v1.RelationshipService/DeleteRelationship', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + + +class RelationshipServiceServicer(object): + """Service for managing relationship types and relationships. See the User Guide for more + information about relationship types and relationships: + https://help.exabel.com/docs/relationships + """ + + def ListRelationshipTypes(self, request, context): + """List all relationship types from a common catalog. + + Lists all relationship types available to your customer, including those created by you, and in + the global catalog. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetRelationshipType(self, request, context): + """Gets one relationship type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateRelationshipType(self, request, context): + """Creates one relationship type and returns it. + + It is also possible to create a relationship type by calling `UpdateRelationshipType` + with `allow_missing` set to `true`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateRelationshipType(self, request, context): + """Updates one relationship type and returns it. + + This can also be used to create a relationship type by setting `allow_missing` to `true`. + + Note that this method update all fields unless `update_mask` is set. + + Note that modifying the `is_ownership` property may be a slow operation, as all individual + relationships of this type will have to be updated. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteRelationshipType(self, request, context): + """Deletes one relationship type. + + This can only be performed on relationship types with no relationships. You should delete + relationships before deleting their entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListRelationships(self, request, context): + """Lists relationship of a specific type. + + If neither `from_entity` or `to_entity` is given, it is expected that this call will + take some time to complete. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetRelationship(self, request, context): + """Gets one relationship. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateRelationship(self, request, context): + """Creates one relationship and returns it. + + It is also possible to create a relationship by calling `UpdateRelationship` + with `allow_missing` set to `true`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateRelationship(self, request, context): + """Updates one relationship and returns it. + + This can also be used to create a relationship by setting `allow_missing` to `true`. + + Note that this method will update all fields unless `update_mask` is set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteRelationship(self, request, context): + """Deletes one relationship. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_RelationshipServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListRelationshipTypes': grpc.unary_unary_rpc_method_handler( + servicer.ListRelationshipTypes, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesResponse.SerializeToString, + ), + 'GetRelationshipType': grpc.unary_unary_rpc_method_handler( + servicer.GetRelationshipType, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipTypeRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.SerializeToString, + ), + 'CreateRelationshipType': grpc.unary_unary_rpc_method_handler( + servicer.CreateRelationshipType, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipTypeRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.SerializeToString, + ), + 'UpdateRelationshipType': grpc.unary_unary_rpc_method_handler( + servicer.UpdateRelationshipType, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipTypeRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.SerializeToString, + ), + 'DeleteRelationshipType': grpc.unary_unary_rpc_method_handler( + servicer.DeleteRelationshipType, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipTypeRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'ListRelationships': grpc.unary_unary_rpc_method_handler( + servicer.ListRelationships, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsResponse.SerializeToString, + ), + 'GetRelationship': grpc.unary_unary_rpc_method_handler( + servicer.GetRelationship, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.SerializeToString, + ), + 'CreateRelationship': grpc.unary_unary_rpc_method_handler( + servicer.CreateRelationship, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.SerializeToString, + ), + 'UpdateRelationship': grpc.unary_unary_rpc_method_handler( + servicer.UpdateRelationship, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.SerializeToString, + ), + 'DeleteRelationship': grpc.unary_unary_rpc_method_handler( + servicer.DeleteRelationship, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.RelationshipService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.RelationshipService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class RelationshipService(object): + """Service for managing relationship types and relationships. See the User Guide for more + information about relationship types and relationships: + https://help.exabel.com/docs/relationships + """ + + @staticmethod + def ListRelationshipTypes(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/ListRelationshipTypes', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetRelationshipType(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/GetRelationshipType', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipTypeRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateRelationshipType(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/CreateRelationshipType', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipTypeRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateRelationshipType(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/UpdateRelationshipType', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipTypeRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteRelationshipType(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/DeleteRelationshipType', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipTypeRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListRelationships(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/ListRelationships', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetRelationship(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/GetRelationship', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateRelationship(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/CreateRelationship', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateRelationship(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/UpdateRelationship', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteRelationship(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.RelationshipService/DeleteRelationship', + exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/data/v1/search_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/search_messages_pb2.py new file mode 100644 index 00000000..f9fba8b2 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/search_messages_pb2.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/search_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/search_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/search_messages.proto\x12\x12\x65xabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"O\n\nSearchTerm\x12\x1d\n\x05\x66ield\x18\x01 \x01(\tB\x0e\x92\x41\x08J\x06\"text\"\xe0\x41\x02\x12\"\n\x05query\x18\x02 \x01(\tB\x13\x92\x41\rJ\x0b\"microsoft\"\xe0\x41\x02\"E\n\rSearchOptions\x12\x34\n\x08universe\x18\x01 \x01(\x0e\x32\".exabel.api.data.v1.SearchUniverse*Z\n\x0eSearchUniverse\x12\x1f\n\x1bSEARCH_UNIVERSE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45XABEL_COMPANIES\x10\x01\x12\x11\n\rALL_COMPANIES\x10\x02\x42G\n\x16\x63om.exabel.api.data.v1B\x13SearchMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.search_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\023SearchMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_SEARCHTERM'].fields_by_name['field']._loaded_options = None + _globals['_SEARCHTERM'].fields_by_name['field']._serialized_options = b'\222A\010J\006\"text\"\340A\002' + _globals['_SEARCHTERM'].fields_by_name['query']._loaded_options = None + _globals['_SEARCHTERM'].fields_by_name['query']._serialized_options = b'\222A\rJ\013\"microsoft\"\340A\002' + _globals['_SEARCHUNIVERSE']._serialized_start=297 + _globals['_SEARCHUNIVERSE']._serialized_end=387 + _globals['_SEARCHTERM']._serialized_start=145 + _globals['_SEARCHTERM']._serialized_end=224 + _globals['_SEARCHOPTIONS']._serialized_start=226 + _globals['_SEARCHOPTIONS']._serialized_end=295 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/data/v1/search_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/search_messages_pb2.pyi new file mode 100644 index 00000000..09f9489f --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/search_messages_pb2.pyi @@ -0,0 +1,98 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + +import builtins +import google.protobuf.descriptor +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _SearchUniverse: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _SearchUniverseEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SearchUniverse.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + SEARCH_UNIVERSE_UNSPECIFIED: _SearchUniverse.ValueType # 0 + """No search universe specified. This is the default behaviour. + For text search for entityTypes/company, this searches the Exabel company universe. + """ + EXABEL_COMPANIES: _SearchUniverse.ValueType # 1 + """Search all companies in the Exabel company universe. This includes all companies with + price data or a directly connected time series. Only supported for text search for + entityTypes/company. + """ + ALL_COMPANIES: _SearchUniverse.ValueType # 2 + """Search all companies, including companies not in the Exabel company universe. This includes all + FactSet companies of type 'SUB' and 'PVT'. Only supported for text search for entityTypes/company. + """ + +class SearchUniverse(_SearchUniverse, metaclass=_SearchUniverseEnumTypeWrapper): + """Enum to select search universe.""" + +SEARCH_UNIVERSE_UNSPECIFIED: SearchUniverse.ValueType # 0 +"""No search universe specified. This is the default behaviour. +For text search for entityTypes/company, this searches the Exabel company universe. +""" +EXABEL_COMPANIES: SearchUniverse.ValueType # 1 +"""Search all companies in the Exabel company universe. This includes all companies with +price data or a directly connected time series. Only supported for text search for +entityTypes/company. +""" +ALL_COMPANIES: SearchUniverse.ValueType # 2 +"""Search all companies, including companies not in the Exabel company universe. This includes all +FactSet companies of type 'SUB' and 'PVT'. Only supported for text search for entityTypes/company. +""" +global___SearchUniverse = SearchUniverse + +@typing.final +class SearchTerm(google.protobuf.message.Message): + """A single search term in a search request.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + FIELD_FIELD_NUMBER: builtins.int + QUERY_FIELD_NUMBER: builtins.int + field: builtins.str + """The name of the field that should be matched. Field names are + case-insensitive. + """ + query: builtins.str + """The query against which the field is matched.""" + def __init__( + self, + *, + field: builtins.str | None = ..., + query: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["field", b"field", "query", b"query"]) -> None: ... + +global___SearchTerm = SearchTerm + +@typing.final +class SearchOptions(google.protobuf.message.Message): + """Options on how the search should be performed.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + UNIVERSE_FIELD_NUMBER: builtins.int + universe: global___SearchUniverse.ValueType + """The entity universe to search. Currently only supported for 'text' search for entityType/company.""" + def __init__( + self, + *, + universe: global___SearchUniverse.ValueType | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["universe", b"universe"]) -> None: ... + +global___SearchOptions = SearchOptions diff --git a/exabel/stubs/exabel/api/data/v1/search_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/search_messages_pb2_grpc.py new file mode 100644 index 00000000..b0d37d9f --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/search_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/search_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/service_pb2.py b/exabel/stubs/exabel/api/data/v1/service_pb2.py new file mode 100644 index 00000000..aeb1debe --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/service_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n exabel/api/data/v1/service.proto\x12\x12\x65xabel.api.data.v1\x1a.protoc_gen_openapiv2/options/annotations.protoB\x8c\x03\n\x16\x63om.exabel.api.data.v1B\x0cServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1\x92\x41\xc8\x02\x12P\n\x0f\x45xabel Data API\"5\n\x06\x45xabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x06\x31.0.25\x1a\x13\x64\x61ta.api.exabel.com*\x01\x02\x32\x10\x61pplication/json:\x10\x61pplication/jsonZR\n#\n\x07\x41PI key\x12\x18\x08\x02\x12\x07\x41PI key\x1a\tx-api-key \x02\n+\n\x06\x42\x65\x61rer\x12!\x08\x02\x12\x0c\x41\x63\x63\x65ss token\x1a\rauthorization \x02\x62\r\n\x0b\n\x07\x41PI key\x12\x00\x62\x0c\n\n\n\x06\x42\x65\x61rer\x12\x00rG\n\x1eMore about the Exabel Data API\x12%https://help.exabel.com/docs/data-apib\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\014ServiceProtoP\001Z\026exabel.com/api/data/v1\222A\310\002\022P\n\017Exabel Data API\"5\n\006Exabel\022\027https://www.exabel.com/\032\022support@exabel.com2\0061.0.25\032\023data.api.exabel.com*\001\0022\020application/json:\020application/jsonZR\n#\n\007API key\022\030\010\002\022\007API key\032\tx-api-key \002\n+\n\006Bearer\022!\010\002\022\014Access token\032\rauthorization \002b\r\n\013\n\007API key\022\000b\014\n\n\n\006Bearer\022\000rG\n\036More about the Exabel Data API\022%https://help.exabel.com/docs/data-api' +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/service_pb2.pyi similarity index 74% rename from exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/service_pb2.pyi index 9095da7d..500cf0cd 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/service_pb2.pyi @@ -2,5 +2,7 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import google.protobuf.descriptor -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor \ No newline at end of file + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/exabel/stubs/exabel/api/data/v1/service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/service_pb2_grpc.py new file mode 100644 index 00000000..89025ce0 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/service_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/signal_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/signal_messages_pb2.py new file mode 100644 index 00000000..6bb118fa --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/signal_messages_pb2.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/signal_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/signal_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import common_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_common__messages__pb2 +from ...math import aggregation_pb2 as exabel_dot_api_dot_math_dot_aggregation__pb2 +from ...math import change_pb2 as exabel_dot_api_dot_math_dot_change__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/signal_messages.proto\x12\x12\x65xabel.api.data.v1\x1a(exabel/api/data/v1/common_messages.proto\x1a!exabel/api/math/aggregation.proto\x1a\x1c\x65xabel/api/math/change.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\xdb\x02\n\x06Signal\x12<\n\x04name\x18\x01 \x01(\tB.\x92\x41%J\x13\"signals/ns.signal\"\xca>\r\xfa\x02\nsignalName\xe0\x41\x05\xe0\x41\x02\x12\x17\n\x0b\x65ntity_type\x18\x02 \x01(\tB\x02\x18\x01\x12&\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x10\x92\x41\rJ\x0b\"My signal\"\x12/\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x1a\x92\x41\x17J\x15\"Describes my signal\"\x12\x39\n\x13\x64ownsampling_method\x18\x05 \x01(\x0e\x32\x1c.exabel.api.math.Aggregation\x12\x16\n\tread_only\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12N\n\x0c\x65ntity_types\x18\x07 \x03(\tB8\x92\x41\x32J0[\"entityTypes/ns.type1\", \"entityTypes/ns.type2\"]\xe0\x41\x03\"\xc7\x03\n\rDerivedSignal\x12\x44\n\x04name\x18\x01 \x01(\tB6\x92\x41-J\x14\"derivedSignals/321\"\xca>\x14\xfa\x02\x11\x64\x65rivedSignalName\xe0\x41\x05\xe0\x41\x02\x12\x16\n\tdata_sets\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12)\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x13\x92\x41\rJ\x0b\"My signal\"\xe0\x41\x03\x12*\n\x05label\x18\n \x01(\tB\x1b\x92\x41\x15J\x13\"signal_expression\"\xe0\x41\x03\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x1d\x92\x41\x17J\x15\"Describes my signal\"\xe0\x41\x03\x12\x12\n\nexpression\x18\t \x01(\t\x12>\n\x13\x64ownsampling_method\x18\x05 \x01(\x0e\x32\x1c.exabel.api.math.AggregationB\x03\xe0\x41\x03\x12,\n\x06\x63hange\x18\x06 \x01(\x0e\x32\x17.exabel.api.math.ChangeB\x03\xe0\x41\x03\x12\x36\n\nentity_set\x18\x07 \x01(\x0b\x32\x1d.exabel.api.data.v1.EntitySetB\x03\xe0\x41\x03\x12\x13\n\x0bhighlighted\x18\x08 \x01(\x08\"L\n\x0e\x44\x65rivedSignals\x12:\n\x0f\x64\x65rived_signals\x18\x01 \x03(\x0b\x32!.exabel.api.data.v1.DerivedSignalBG\n\x16\x63om.exabel.api.data.v1B\x13SignalMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.signal_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\023SignalMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_SIGNAL'].fields_by_name['name']._loaded_options = None + _globals['_SIGNAL'].fields_by_name['name']._serialized_options = b'\222A%J\023\"signals/ns.signal\"\312>\r\372\002\nsignalName\340A\005\340A\002' + _globals['_SIGNAL'].fields_by_name['entity_type']._loaded_options = None + _globals['_SIGNAL'].fields_by_name['entity_type']._serialized_options = b'\030\001' + _globals['_SIGNAL'].fields_by_name['display_name']._loaded_options = None + _globals['_SIGNAL'].fields_by_name['display_name']._serialized_options = b'\222A\rJ\013\"My signal\"' + _globals['_SIGNAL'].fields_by_name['description']._loaded_options = None + _globals['_SIGNAL'].fields_by_name['description']._serialized_options = b'\222A\027J\025\"Describes my signal\"' + _globals['_SIGNAL'].fields_by_name['read_only']._loaded_options = None + _globals['_SIGNAL'].fields_by_name['read_only']._serialized_options = b'\340A\003' + _globals['_SIGNAL'].fields_by_name['entity_types']._loaded_options = None + _globals['_SIGNAL'].fields_by_name['entity_types']._serialized_options = b'\222A2J0[\"entityTypes/ns.type1\", \"entityTypes/ns.type2\"]\340A\003' + _globals['_DERIVEDSIGNAL'].fields_by_name['name']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['name']._serialized_options = b'\222A-J\024\"derivedSignals/321\"\312>\024\372\002\021derivedSignalName\340A\005\340A\002' + _globals['_DERIVEDSIGNAL'].fields_by_name['data_sets']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['data_sets']._serialized_options = b'\340A\003' + _globals['_DERIVEDSIGNAL'].fields_by_name['display_name']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['display_name']._serialized_options = b'\222A\rJ\013\"My signal\"\340A\003' + _globals['_DERIVEDSIGNAL'].fields_by_name['label']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['label']._serialized_options = b'\222A\025J\023\"signal_expression\"\340A\003' + _globals['_DERIVEDSIGNAL'].fields_by_name['description']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['description']._serialized_options = b'\222A\027J\025\"Describes my signal\"\340A\003' + _globals['_DERIVEDSIGNAL'].fields_by_name['downsampling_method']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['downsampling_method']._serialized_options = b'\340A\003' + _globals['_DERIVEDSIGNAL'].fields_by_name['change']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['change']._serialized_options = b'\340A\003' + _globals['_DERIVEDSIGNAL'].fields_by_name['entity_set']._loaded_options = None + _globals['_DERIVEDSIGNAL'].fields_by_name['entity_set']._serialized_options = b'\340A\003' + _globals['_SIGNAL']._serialized_start=253 + _globals['_SIGNAL']._serialized_end=600 + _globals['_DERIVEDSIGNAL']._serialized_start=603 + _globals['_DERIVEDSIGNAL']._serialized_end=1058 + _globals['_DERIVEDSIGNALS']._serialized_start=1060 + _globals['_DERIVEDSIGNALS']._serialized_end=1136 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/data/v1/signal_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/signal_messages_pb2.pyi new file mode 100644 index 00000000..f27759aa --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/signal_messages_pb2.pyi @@ -0,0 +1,159 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2024 Exabel AS. All rights reserved.""" + +import builtins +import collections.abc +from . import common_messages_pb2 +from ...math import aggregation_pb2 +from ...math import change_pb2 +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +import typing +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class Signal(google.protobuf.message.Message): + """A signal resource in the Data API. Signals are normally associated with a set of entity types, + but may apply to any entities. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + ENTITY_TYPE_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + DOWNSAMPLING_METHOD_FIELD_NUMBER: builtins.int + READ_ONLY_FIELD_NUMBER: builtins.int + ENTITY_TYPES_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the raw data signal, e.g. `signals/signalIdentifier` or + `signals/namespace.signalIdentifier`. The namespace must be empty (being global) or a + namespace accessible to the customer. + The signal identifier must match the regex `[a-zA-Z]\\w{0,127}`. + """ + entity_type: builtins.str + """No longer in use.""" + display_name: builtins.str + """Used when showing the signal in the Exabel app. Required when creating a signal.""" + description: builtins.str + """Used when showing the signal in the Exabel app.""" + downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType + """The default downsampling method to use when this signal is re-sampled into larger intervals. + When two or more values in an interval needs to be aggregated into a single value, specifies + how they are combined. + """ + read_only: builtins.bool + """Global signals and those from data sets that you subscribe to will be read-only.""" + @property + def entity_types(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """List of entity types that this signal has time series for, e.g. + `entityTypes/ns.type1`, `entityTypes/ns.type2`. + """ + + def __init__( + self, + *, + name: builtins.str | None = ..., + entity_type: builtins.str | None = ..., + display_name: builtins.str | None = ..., + description: builtins.str | None = ..., + downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType | None = ..., + read_only: builtins.bool | None = ..., + entity_types: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "display_name", b"display_name", "downsampling_method", b"downsampling_method", "entity_type", b"entity_type", "entity_types", b"entity_types", "name", b"name", "read_only", b"read_only"]) -> None: ... + +global___Signal = Signal + +@typing.final +class DerivedSignal(google.protobuf.message.Message): + """A derived signal resource in the Data API. A derived signal is part of one data set and can be + added or removed using the `derived_signals` field of `UpdateDataSet`. It cannot be edited + through the Data API; it must be edited in the library. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DATA_SETS_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + LABEL_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + EXPRESSION_FIELD_NUMBER: builtins.int + DOWNSAMPLING_METHOD_FIELD_NUMBER: builtins.int + CHANGE_FIELD_NUMBER: builtins.int + ENTITY_SET_FIELD_NUMBER: builtins.int + HIGHLIGHTED_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the derived signal, e.g. `derivedSignals/signalIdentifier`. Derived + signals don't have namespaces in their resource names. The signal identifier must be numeric. + """ + display_name: builtins.str + """The display name of the signal.""" + label: builtins.str + """The label of the signal.""" + description: builtins.str + """The description of the signal.""" + expression: builtins.str + """The signal expression.""" + downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType + """The default downsampling method to use when this signal is re-sampled into larger intervals. + When two or more values in an interval needs to be aggregated into a single value, specifies + how they are combined. + """ + change: exabel.api.math.change_pb2.Change.ValueType + """The method used to calculate changes in this signal.""" + highlighted: builtins.bool + """Whether this derived signal is highlighted (inside a specific data set).""" + @property + def data_sets(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """The data set(s) this derived signal belongs to.""" + + @property + def entity_set(self) -> exabel.api.data.v1.common_messages_pb2.EntitySet: + """The set of entities that this derived signal is valid for.""" + + def __init__( + self, + *, + name: builtins.str | None = ..., + data_sets: collections.abc.Iterable[builtins.str] | None = ..., + display_name: builtins.str | None = ..., + label: builtins.str | None = ..., + description: builtins.str | None = ..., + expression: builtins.str | None = ..., + downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType | None = ..., + change: exabel.api.math.change_pb2.Change.ValueType | None = ..., + entity_set: exabel.api.data.v1.common_messages_pb2.EntitySet | None = ..., + highlighted: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["entity_set", b"entity_set"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["change", b"change", "data_sets", b"data_sets", "description", b"description", "display_name", b"display_name", "downsampling_method", b"downsampling_method", "entity_set", b"entity_set", "expression", b"expression", "highlighted", b"highlighted", "label", b"label", "name", b"name"]) -> None: ... + +global___DerivedSignal = DerivedSignal + +@typing.final +class DerivedSignals(google.protobuf.message.Message): + """A list of signals.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + DERIVED_SIGNALS_FIELD_NUMBER: builtins.int + @property + def derived_signals(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DerivedSignal]: + """The list of signals.""" + + def __init__( + self, + *, + derived_signals: collections.abc.Iterable[global___DerivedSignal] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["derived_signals", b"derived_signals"]) -> None: ... + +global___DerivedSignals = DerivedSignals diff --git a/exabel/stubs/exabel/api/data/v1/signal_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/signal_messages_pb2_grpc.py new file mode 100644 index 00000000..46f40cfe --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/signal_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/signal_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/signal_service_pb2.py b/exabel/stubs/exabel/api/data/v1/signal_service_pb2.py new file mode 100644 index 00000000..674a02ec --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/signal_service_pb2.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/signal_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/signal_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import signal_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'exabel/api/data/v1/signal_service.proto\x12\x12\x65xabel.api.data.v1\x1a(exabel/api/data/v1/signal_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\";\n\x12ListSignalsRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t\"o\n\x13ListSignalsResponse\x12+\n\x07signals\x18\x01 \x03(\x0b\x32\x1a.exabel.api.data.v1.Signal\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"8\n\x10GetSignalRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92\x41\x10\xca>\r\xfa\x02\nsignalName\xe0\x41\x02\"e\n\x13\x43reateSignalRequest\x12/\n\x06signal\x18\x01 \x01(\x0b\x32\x1a.exabel.api.data.v1.SignalB\x03\xe0\x41\x02\x12\x1d\n\x15\x63reate_library_signal\x18\x02 \x01(\x08\"\xad\x01\n\x13UpdateSignalRequest\x12/\n\x06signal\x18\x01 \x01(\x0b\x32\x1a.exabel.api.data.v1.SignalB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\x12\x1d\n\x15\x63reate_library_signal\x18\x04 \x01(\x08\";\n\x13\x44\x65leteSignalRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92\x41\x10\xca>\r\xfa\x02\nsignalName\xe0\x41\x02\"B\n\x19ListDerivedSignalsRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t\"\x85\x01\n\x1aListDerivedSignalsResponse\x12:\n\x0f\x64\x65rived_signals\x18\x01 \x03(\x0b\x32!.exabel.api.data.v1.DerivedSignal\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"3\n\x1b\x46ilterDerivedSignalsRequest\x12\x14\n\x0c\x65ntity_names\x18\x01 \x03(\t\"\xd8\x01\n\x1c\x46ilterDerivedSignalsResponse\x12]\n\x0f\x64\x65rived_signals\x18\x01 \x03(\x0b\x32\x44.exabel.api.data.v1.FilterDerivedSignalsResponse.DerivedSignalsEntry\x1aY\n\x13\x44\x65rivedSignalsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x31\n\x05value\x18\x02 \x01(\x0b\x32\".exabel.api.data.v1.DerivedSignals:\x02\x38\x01\"F\n\x17GetDerivedSignalRequest\x12+\n\x04name\x18\x01 \x01(\tB\x1d\x92\x41\x17\xca>\x14\xfa\x02\x11\x64\x65rivedSignalName\xe0\x41\x02\x32\xb3\t\n\rSignalService\x12\x84\x01\n\x0bListSignals\x12&.exabel.api.data.v1.ListSignalsRequest\x1a\'.exabel.api.data.v1.ListSignalsResponse\"$\x92\x41\x0e\x12\x0cList signals\x82\xd3\xe4\x93\x02\r\x12\x0b/v1/signals\x12z\n\tGetSignal\x12$.exabel.api.data.v1.GetSignalRequest\x1a\x1a.exabel.api.data.v1.Signal\"+\x92\x41\x0c\x12\nGet signal\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/{name=signals/*}\x12\x82\x01\n\x0c\x43reateSignal\x12\'.exabel.api.data.v1.CreateSignalRequest\x1a\x1a.exabel.api.data.v1.Signal\"-\x92\x41\x0f\x12\rCreate signal\x82\xd3\xe4\x93\x02\x15\"\x0b/v1/signals:\x06signal\x12\x92\x01\n\x0cUpdateSignal\x12\'.exabel.api.data.v1.UpdateSignalRequest\x1a\x1a.exabel.api.data.v1.Signal\"=\x92\x41\x0f\x12\rUpdate signal\x82\xd3\xe4\x93\x02%2\x1b/v1/{signal.name=signals/*}:\x06signal\x12\x7f\n\x0c\x44\x65leteSignal\x12\'.exabel.api.data.v1.DeleteSignalRequest\x1a\x16.google.protobuf.Empty\".\x92\x41\x0f\x12\rDelete signal\x82\xd3\xe4\x93\x02\x16*\x14/v1/{name=signals/*}\x12\xa8\x01\n\x12ListDerivedSignals\x12-.exabel.api.data.v1.ListDerivedSignalsRequest\x1a..exabel.api.data.v1.ListDerivedSignalsResponse\"3\x92\x41\x16\x12\x14List derived signals\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/derivedSignals\x12\xb7\x01\n\x14\x46ilterDerivedSignals\x12/.exabel.api.data.v1.FilterDerivedSignalsRequest\x1a\x30.exabel.api.data.v1.FilterDerivedSignalsResponse\"<\x92\x41\x18\x12\x16\x46ilter derived signals\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/derivedSignals:filter\x12\x9e\x01\n\x10GetDerivedSignal\x12+.exabel.api.data.v1.GetDerivedSignalRequest\x1a!.exabel.api.data.v1.DerivedSignal\":\x92\x41\x14\x12\x12Get derived signal\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/{name=derivedSignals/*}BF\n\x16\x63om.exabel.api.data.v1B\x12SignalServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.signal_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\022SignalServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_GETSIGNALREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETSIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\222A\020\312>\r\372\002\nsignalName\340A\002' + _globals['_CREATESIGNALREQUEST'].fields_by_name['signal']._loaded_options = None + _globals['_CREATESIGNALREQUEST'].fields_by_name['signal']._serialized_options = b'\340A\002' + _globals['_UPDATESIGNALREQUEST'].fields_by_name['signal']._loaded_options = None + _globals['_UPDATESIGNALREQUEST'].fields_by_name['signal']._serialized_options = b'\340A\002' + _globals['_DELETESIGNALREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETESIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\222A\020\312>\r\372\002\nsignalName\340A\002' + _globals['_FILTERDERIVEDSIGNALSRESPONSE_DERIVEDSIGNALSENTRY']._loaded_options = None + _globals['_FILTERDERIVEDSIGNALSRESPONSE_DERIVEDSIGNALSENTRY']._serialized_options = b'8\001' + _globals['_GETDERIVEDSIGNALREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETDERIVEDSIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\222A\027\312>\024\372\002\021derivedSignalName\340A\002' + _globals['_SIGNALSERVICE'].methods_by_name['ListSignals']._loaded_options = None + _globals['_SIGNALSERVICE'].methods_by_name['ListSignals']._serialized_options = b'\222A\016\022\014List signals\202\323\344\223\002\r\022\013/v1/signals' + _globals['_SIGNALSERVICE'].methods_by_name['GetSignal']._loaded_options = None + _globals['_SIGNALSERVICE'].methods_by_name['GetSignal']._serialized_options = b'\222A\014\022\nGet signal\202\323\344\223\002\026\022\024/v1/{name=signals/*}' + _globals['_SIGNALSERVICE'].methods_by_name['CreateSignal']._loaded_options = None + _globals['_SIGNALSERVICE'].methods_by_name['CreateSignal']._serialized_options = b'\222A\017\022\rCreate signal\202\323\344\223\002\025\"\013/v1/signals:\006signal' + _globals['_SIGNALSERVICE'].methods_by_name['UpdateSignal']._loaded_options = None + _globals['_SIGNALSERVICE'].methods_by_name['UpdateSignal']._serialized_options = b'\222A\017\022\rUpdate signal\202\323\344\223\002%2\033/v1/{signal.name=signals/*}:\006signal' + _globals['_SIGNALSERVICE'].methods_by_name['DeleteSignal']._loaded_options = None + _globals['_SIGNALSERVICE'].methods_by_name['DeleteSignal']._serialized_options = b'\222A\017\022\rDelete signal\202\323\344\223\002\026*\024/v1/{name=signals/*}' + _globals['_SIGNALSERVICE'].methods_by_name['ListDerivedSignals']._loaded_options = None + _globals['_SIGNALSERVICE'].methods_by_name['ListDerivedSignals']._serialized_options = b'\222A\026\022\024List derived signals\202\323\344\223\002\024\022\022/v1/derivedSignals' + _globals['_SIGNALSERVICE'].methods_by_name['FilterDerivedSignals']._loaded_options = None + _globals['_SIGNALSERVICE'].methods_by_name['FilterDerivedSignals']._serialized_options = b'\222A\030\022\026Filter derived signals\202\323\344\223\002\033\022\031/v1/derivedSignals:filter' + _globals['_SIGNALSERVICE'].methods_by_name['GetDerivedSignal']._loaded_options = None + _globals['_SIGNALSERVICE'].methods_by_name['GetDerivedSignal']._serialized_options = b'\222A\024\022\022Get derived signal\202\323\344\223\002\035\022\033/v1/{name=derivedSignals/*}' + _globals['_LISTSIGNALSREQUEST']._serialized_start=279 + _globals['_LISTSIGNALSREQUEST']._serialized_end=338 + _globals['_LISTSIGNALSRESPONSE']._serialized_start=340 + _globals['_LISTSIGNALSRESPONSE']._serialized_end=451 + _globals['_GETSIGNALREQUEST']._serialized_start=453 + _globals['_GETSIGNALREQUEST']._serialized_end=509 + _globals['_CREATESIGNALREQUEST']._serialized_start=511 + _globals['_CREATESIGNALREQUEST']._serialized_end=612 + _globals['_UPDATESIGNALREQUEST']._serialized_start=615 + _globals['_UPDATESIGNALREQUEST']._serialized_end=788 + _globals['_DELETESIGNALREQUEST']._serialized_start=790 + _globals['_DELETESIGNALREQUEST']._serialized_end=849 + _globals['_LISTDERIVEDSIGNALSREQUEST']._serialized_start=851 + _globals['_LISTDERIVEDSIGNALSREQUEST']._serialized_end=917 + _globals['_LISTDERIVEDSIGNALSRESPONSE']._serialized_start=920 + _globals['_LISTDERIVEDSIGNALSRESPONSE']._serialized_end=1053 + _globals['_FILTERDERIVEDSIGNALSREQUEST']._serialized_start=1055 + _globals['_FILTERDERIVEDSIGNALSREQUEST']._serialized_end=1106 + _globals['_FILTERDERIVEDSIGNALSRESPONSE']._serialized_start=1109 + _globals['_FILTERDERIVEDSIGNALSRESPONSE']._serialized_end=1325 + _globals['_FILTERDERIVEDSIGNALSRESPONSE_DERIVEDSIGNALSENTRY']._serialized_start=1236 + _globals['_FILTERDERIVEDSIGNALSRESPONSE_DERIVEDSIGNALSENTRY']._serialized_end=1325 + _globals['_GETDERIVEDSIGNALREQUEST']._serialized_start=1327 + _globals['_GETDERIVEDSIGNALREQUEST']._serialized_end=1397 + _globals['_SIGNALSERVICE']._serialized_start=1400 + _globals['_SIGNALSERVICE']._serialized_end=2603 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/signal_service_pb2.pyi similarity index 51% rename from exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/signal_service_pb2.pyi index 00f2142d..ab35f097 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/signal_service_pb2.pyi @@ -2,108 +2,138 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import signal_messages_pb2 import google.protobuf.descriptor import google.protobuf.field_mask_pb2 import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class ListSignalsRequest(google.protobuf.message.Message): """The request to list signals.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int page_size: builtins.int - 'Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.' + """Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.""" page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the same\n query parameters.\n ' + """Token for a specific page of results, as returned from a previous list request with the same + query parameters. + """ + def __init__( + self, + *, + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token"]) -> None: ... - def __init__(self, *, page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token']) -> None: - ... global___ListSignalsRequest = ListSignalsRequest @typing.final class ListSignalsResponse(google.protobuf.message.Message): """The response to list signals. Returns all known signals.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SIGNALS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the number of results is less than the page size\n (NOT when the token is empty).\n ' + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the number of results is less than the page size + (NOT when the token is empty). + """ total_size: builtins.int - 'Total number of results, irrespective of paging.' - + """Total number of results, irrespective of paging.""" @property def signals(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.signal_messages_pb2.Signal]: """List of signals.""" - def __init__(self, *, signals: collections.abc.Iterable[exabel.api.data.v1.signal_messages_pb2.Signal] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + signals: collections.abc.Iterable[exabel.api.data.v1.signal_messages_pb2.Signal] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["next_page_token", b"next_page_token", "signals", b"signals", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['next_page_token', b'next_page_token', 'signals', b'signals', 'total_size', b'total_size']) -> None: - ... global___ListSignalsResponse = ListSignalsResponse @typing.final class GetSignalRequest(google.protobuf.message.Message): """The request to get one signal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the requested signal, for example `signals/ns.signal1`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """The resource name of the requested signal, for example `signals/ns.signal1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetSignalRequest = GetSignalRequest @typing.final class CreateSignalRequest(google.protobuf.message.Message): """The request to create one signal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SIGNAL_FIELD_NUMBER: builtins.int CREATE_LIBRARY_SIGNAL_FIELD_NUMBER: builtins.int create_library_signal: builtins.bool - 'Set to `true` to also create a derived signal in the Library, referencing this new raw data\n signal. This will be created in the "Upload" folder.\n ' - + """Set to `true` to also create a derived signal in the Library, referencing this new raw data + signal. This will be created in the "Upload" folder. + """ @property def signal(self) -> exabel.api.data.v1.signal_messages_pb2.Signal: """The signal to create.""" - def __init__(self, *, signal: exabel.api.data.v1.signal_messages_pb2.Signal | None=..., create_library_signal: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['signal', b'signal']) -> builtins.bool: - ... + def __init__( + self, + *, + signal: exabel.api.data.v1.signal_messages_pb2.Signal | None = ..., + create_library_signal: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["signal", b"signal"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["create_library_signal", b"create_library_signal", "signal", b"signal"]) -> None: ... - def ClearField(self, field_name: typing.Literal['create_library_signal', b'create_library_signal', 'signal', b'signal']) -> None: - ... global___CreateSignalRequest = CreateSignalRequest @typing.final class UpdateSignalRequest(google.protobuf.message.Message): """The request to update one signal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + SIGNAL_FIELD_NUMBER: builtins.int UPDATE_MASK_FIELD_NUMBER: builtins.int ALLOW_MISSING_FIELD_NUMBER: builtins.int CREATE_LIBRARY_SIGNAL_FIELD_NUMBER: builtins.int allow_missing: builtins.bool - 'If set to `true`, a new raw data signal will be created if it did not exist, and `update_mask`\n is ignored.\n ' + """If set to `true`, a new raw data signal will be created if it did not exist, and `update_mask` + is ignored. + """ create_library_signal: builtins.bool - 'Set to `true` to also create a derived signal in the Library, referencing this new raw data\n signal. This will be created in the "Upload" folder. This is only applicable if a new raw\n data signal has been created (with `allow_missing` set to `true`).\n ' - + """Set to `true` to also create a derived signal in the Library, referencing this new raw data + signal. This will be created in the "Upload" folder. This is only applicable if a new raw + data signal has been created (with `allow_missing` set to `true`). + """ @property def signal(self) -> exabel.api.data.v1.signal_messages_pb2.Signal: """The signal to update.""" @@ -116,139 +146,166 @@ class UpdateSignalRequest(google.protobuf.message.Message): For REST requests, this is a comma-separated string. """ - def __init__(self, *, signal: exabel.api.data.v1.signal_messages_pb2.Signal | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=..., allow_missing: builtins.bool | None=..., create_library_signal: builtins.bool | None=...) -> None: - ... + def __init__( + self, + *, + signal: exabel.api.data.v1.signal_messages_pb2.Signal | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + allow_missing: builtins.bool | None = ..., + create_library_signal: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["signal", b"signal", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["allow_missing", b"allow_missing", "create_library_signal", b"create_library_signal", "signal", b"signal", "update_mask", b"update_mask"]) -> None: ... - def HasField(self, field_name: typing.Literal['signal', b'signal', 'update_mask', b'update_mask']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['allow_missing', b'allow_missing', 'create_library_signal', b'create_library_signal', 'signal', b'signal', 'update_mask', b'update_mask']) -> None: - ... global___UpdateSignalRequest = UpdateSignalRequest @typing.final class DeleteSignalRequest(google.protobuf.message.Message): """The request to delete one signal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the signal to delete, for example `signals/ns.signal1`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """The resource name of the signal to delete, for example `signals/ns.signal1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___DeleteSignalRequest = DeleteSignalRequest @typing.final class ListDerivedSignalsRequest(google.protobuf.message.Message): """The request to list derived signals.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PAGE_SIZE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int page_size: builtins.int - 'Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.' + """Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.""" page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the same\n query parameters.\n ' - - def __init__(self, *, page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... + """Token for a specific page of results, as returned from a previous list request with the same + query parameters. + """ + def __init__( + self, + *, + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token"]) -> None: ... - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token']) -> None: - ... global___ListDerivedSignalsRequest = ListDerivedSignalsRequest @typing.final class ListDerivedSignalsResponse(google.protobuf.message.Message): """The response to list derived signals. Returns all known derived signals.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + DERIVED_SIGNALS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int TOTAL_SIZE_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the number of results is less than the page size\n (NOT when the token is empty).\n ' + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the number of results is less than the page size + (NOT when the token is empty). + """ total_size: builtins.int - 'Total number of results, irrespective of paging.' - + """Total number of results, irrespective of paging.""" @property def derived_signals(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.signal_messages_pb2.DerivedSignal]: """List of derived signals.""" - def __init__(self, *, derived_signals: collections.abc.Iterable[exabel.api.data.v1.signal_messages_pb2.DerivedSignal] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... + def __init__( + self, + *, + derived_signals: collections.abc.Iterable[exabel.api.data.v1.signal_messages_pb2.DerivedSignal] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["derived_signals", b"derived_signals", "next_page_token", b"next_page_token", "total_size", b"total_size"]) -> None: ... - def ClearField(self, field_name: typing.Literal['derived_signals', b'derived_signals', 'next_page_token', b'next_page_token', 'total_size', b'total_size']) -> None: - ... global___ListDerivedSignalsResponse = ListDerivedSignalsResponse @typing.final class FilterDerivedSignalsRequest(google.protobuf.message.Message): """The request to filter derived signals.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - ENTITY_NAMES_FIELD_NUMBER: builtins.int + ENTITY_NAMES_FIELD_NUMBER: builtins.int @property def entity_names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """The resource names of the entities to filter on. At least one entity must be specified. A derived signal is returned only if at least one of the entities are included in the signal. """ - def __init__(self, *, entity_names: collections.abc.Iterable[builtins.str] | None=...) -> None: - ... + def __init__( + self, + *, + entity_names: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["entity_names", b"entity_names"]) -> None: ... - def ClearField(self, field_name: typing.Literal['entity_names', b'entity_names']) -> None: - ... global___FilterDerivedSignalsRequest = FilterDerivedSignalsRequest @typing.final class FilterDerivedSignalsResponse(google.protobuf.message.Message): """The response to filter derived signals.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class DerivedSignalsEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> exabel.api.data.v1.signal_messages_pb2.DerivedSignals: - ... - - def __init__(self, *, key: builtins.str | None=..., value: exabel.api.data.v1.signal_messages_pb2.DerivedSignals | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... + def value(self) -> exabel.api.data.v1.signal_messages_pb2.DerivedSignals: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: exabel.api.data.v1.signal_messages_pb2.DerivedSignals | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... DERIVED_SIGNALS_FIELD_NUMBER: builtins.int - @property def derived_signals(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, exabel.api.data.v1.signal_messages_pb2.DerivedSignals]: """List of filtered derived signals, grouped by data set resource name.""" - def __init__(self, *, derived_signals: collections.abc.Mapping[builtins.str, exabel.api.data.v1.signal_messages_pb2.DerivedSignals] | None=...) -> None: - ... + def __init__( + self, + *, + derived_signals: collections.abc.Mapping[builtins.str, exabel.api.data.v1.signal_messages_pb2.DerivedSignals] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["derived_signals", b"derived_signals"]) -> None: ... - def ClearField(self, field_name: typing.Literal['derived_signals', b'derived_signals']) -> None: - ... global___FilterDerivedSignalsResponse = FilterDerivedSignalsResponse @typing.final class GetDerivedSignalRequest(google.protobuf.message.Message): """The request to get one derived signal.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the requested signal, for example `derivedSignals/321`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... -global___GetDerivedSignalRequest = GetDerivedSignalRequest \ No newline at end of file + """The resource name of the requested signal, for example `derivedSignals/321`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... + +global___GetDerivedSignalRequest = GetDerivedSignalRequest diff --git a/exabel/stubs/exabel/api/data/v1/signal_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/signal_service_pb2_grpc.py new file mode 100644 index 00000000..0b4682bf --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/signal_service_pb2_grpc.py @@ -0,0 +1,433 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import signal_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2 +from . import signal_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/signal_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class SignalServiceStub(object): + """Service for managing raw data signals. See the User Guide for more information about raw data + signals: https://help.exabel.com/docs/signals + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListSignals = channel.unary_unary( + '/exabel.api.data.v1.SignalService/ListSignals', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsResponse.FromString, + _registered_method=True) + self.GetSignal = channel.unary_unary( + '/exabel.api.data.v1.SignalService/GetSignal', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetSignalRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, + _registered_method=True) + self.CreateSignal = channel.unary_unary( + '/exabel.api.data.v1.SignalService/CreateSignal', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.CreateSignalRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, + _registered_method=True) + self.UpdateSignal = channel.unary_unary( + '/exabel.api.data.v1.SignalService/UpdateSignal', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.UpdateSignalRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, + _registered_method=True) + self.DeleteSignal = channel.unary_unary( + '/exabel.api.data.v1.SignalService/DeleteSignal', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.DeleteSignalRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.ListDerivedSignals = channel.unary_unary( + '/exabel.api.data.v1.SignalService/ListDerivedSignals', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsResponse.FromString, + _registered_method=True) + self.FilterDerivedSignals = channel.unary_unary( + '/exabel.api.data.v1.SignalService/FilterDerivedSignals', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsResponse.FromString, + _registered_method=True) + self.GetDerivedSignal = channel.unary_unary( + '/exabel.api.data.v1.SignalService/GetDerivedSignal', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetDerivedSignalRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.DerivedSignal.FromString, + _registered_method=True) + + +class SignalServiceServicer(object): + """Service for managing raw data signals. See the User Guide for more information about raw data + signals: https://help.exabel.com/docs/signals + """ + + def ListSignals(self, request, context): + """Lists all known signals. + + Lists all raw data signals available to your customer, including those created by you, and in + the global catalog. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetSignal(self, request, context): + """Gets one signal. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateSignal(self, request, context): + """Creates one signal and returns it. + + It is also possible to create a signal by calling `UpdateSignal` + with `allow_missing` set to `true`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateSignal(self, request, context): + """Updates one signal and returns it. + + This can also be used to create a signal by setting `allow_missing` to `true`. + + Note that this method will update all fields unless `update_mask` is set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteSignal(self, request, context): + """Deletes one signal. ALL time series for this signal will also be deleted. + + This will delete ***all*** time series for this signal. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListDerivedSignals(self, request, context): + """Lists all known derived signals. + + Lists all derived data signals available to your customer, including those created by you, in the + global catalog, and from data sets you are subscribed to. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def FilterDerivedSignals(self, request, context): + """Gets all derived signals that apply to at least one of several entities. + + Selects from all derived data signals available to your customer (including those created by you, in the + global catalog, and from data sets you are subscribed to), those signals that apply to at least one of the + requested entities. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetDerivedSignal(self, request, context): + """Gets one derived signal. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_SignalServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListSignals': grpc.unary_unary_rpc_method_handler( + servicer.ListSignals, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsResponse.SerializeToString, + ), + 'GetSignal': grpc.unary_unary_rpc_method_handler( + servicer.GetSignal, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetSignalRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.SerializeToString, + ), + 'CreateSignal': grpc.unary_unary_rpc_method_handler( + servicer.CreateSignal, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.CreateSignalRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.SerializeToString, + ), + 'UpdateSignal': grpc.unary_unary_rpc_method_handler( + servicer.UpdateSignal, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.UpdateSignalRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.SerializeToString, + ), + 'DeleteSignal': grpc.unary_unary_rpc_method_handler( + servicer.DeleteSignal, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.DeleteSignalRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'ListDerivedSignals': grpc.unary_unary_rpc_method_handler( + servicer.ListDerivedSignals, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsResponse.SerializeToString, + ), + 'FilterDerivedSignals': grpc.unary_unary_rpc_method_handler( + servicer.FilterDerivedSignals, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsResponse.SerializeToString, + ), + 'GetDerivedSignal': grpc.unary_unary_rpc_method_handler( + servicer.GetDerivedSignal, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetDerivedSignalRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.DerivedSignal.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.SignalService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.SignalService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class SignalService(object): + """Service for managing raw data signals. See the User Guide for more information about raw data + signals: https://help.exabel.com/docs/signals + """ + + @staticmethod + def ListSignals(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.SignalService/ListSignals', + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.SignalService/GetSignal', + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetSignalRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.SignalService/CreateSignal', + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.CreateSignalRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.SignalService/UpdateSignal', + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.UpdateSignalRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.SignalService/DeleteSignal', + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.DeleteSignalRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListDerivedSignals(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.SignalService/ListDerivedSignals', + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def FilterDerivedSignals(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.SignalService/FilterDerivedSignals', + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetDerivedSignal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.SignalService/GetDerivedSignal', + exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetDerivedSignalRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.DerivedSignal.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/data/v1/time_series_messages_pb2.py b/exabel/stubs/exabel/api/data/v1/time_series_messages_pb2.py new file mode 100644 index 00000000..0b0f5579 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/time_series_messages_pb2.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/time_series_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/time_series_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ...time import time_range_pb2 as exabel_dot_api_dot_time_dot_time__range__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 +from google.type import decimal_pb2 as google_dot_type_dot_decimal__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-exabel/api/data/v1/time_series_messages.proto\x12\x12\x65xabel.api.data.v1\x1a exabel/api/time/time_range.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x19google/type/decimal.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x83\x02\n\nTimeSeries\x12y\n\x04name\x18\x01 \x01(\tBk\x92\x41\x62JL\"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors\"\xca>\x11\xfa\x02\x0etimeSeriesName\xe0\x41\x05\xe0\x41\x02\x12\x33\n\x06points\x18\x02 \x03(\x0b\x32#.exabel.api.data.v1.TimeSeriesPoint\x12\x16\n\tread_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x12-\n\x05units\x18\x04 \x01(\x0b\x32\x19.exabel.api.data.v1.UnitsB\x03\xe0\x41\x01\"\x9d\x01\n\x0fTimeSeriesPoint\x12-\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.DoubleValue\x12.\n\nknown_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"u\n\x0eTimeSeriesView\x12.\n\ntime_range\x18\x01 \x01(\x0b\x32\x1a.exabel.api.time.TimeRange\x12\x33\n\nknown_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\"\x9f\x01\n\x10\x44\x65\x66\x61ultKnownTime\x12\x16\n\x0c\x63urrent_time\x18\x01 \x01(\x08H\x00\x12\x30\n\nknown_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x30\n\x0btime_offset\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x42\x0f\n\rspecification\"\x94\x01\n\x05Units\x12/\n\x05units\x18\x01 \x03(\x0b\x32\x18.exabel.api.data.v1.UnitB\x06\xe0\x41\x01\xe0\x41\x05\x12\x30\n\nmultiplier\x18\x02 \x01(\x0b\x32\x14.google.type.DecimalB\x06\xe0\x41\x01\xe0\x41\x05\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01J\x04\x08\x04\x10\x05R\x08is_ratio\"\x85\x02\n\x04Unit\x12=\n\tdimension\x18\x01 \x01(\x0e\x32\".exabel.api.data.v1.Unit.DimensionB\x06\xe0\x41\x01\xe0\x41\x05\x12\x14\n\x04unit\x18\x02 \x01(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x18\n\x08\x65xponent\x18\x03 \x01(\x11\x42\x06\xe0\x41\x01\xe0\x41\x05\"\x8d\x01\n\tDimension\x12\x15\n\x11\x44IMENSION_UNKNOWN\x10\x00\x12\x16\n\x12\x44IMENSION_CURRENCY\x10\x01\x12\x12\n\x0e\x44IMENSION_MASS\x10\x02\x12\x14\n\x10\x44IMENSION_LENGTH\x10\x03\x12\x12\n\x0e\x44IMENSION_TIME\x10\x04\x12\x13\n\x0f\x44IMENSION_RATIO\x10\x05\x42K\n\x16\x63om.exabel.api.data.v1B\x17TimeSeriesMessagesProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.time_series_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\027TimeSeriesMessagesProtoP\001Z\026exabel.com/api/data/v1' + _globals['_TIMESERIES'].fields_by_name['name']._loaded_options = None + _globals['_TIMESERIES'].fields_by_name['name']._serialized_options = b'\222AbJL\"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors\"\312>\021\372\002\016timeSeriesName\340A\005\340A\002' + _globals['_TIMESERIES'].fields_by_name['read_only']._loaded_options = None + _globals['_TIMESERIES'].fields_by_name['read_only']._serialized_options = b'\340A\003' + _globals['_TIMESERIES'].fields_by_name['units']._loaded_options = None + _globals['_TIMESERIES'].fields_by_name['units']._serialized_options = b'\340A\001' + _globals['_TIMESERIESPOINT'].fields_by_name['time']._loaded_options = None + _globals['_TIMESERIESPOINT'].fields_by_name['time']._serialized_options = b'\340A\002' + _globals['_TIMESERIESVIEW'].fields_by_name['known_time']._loaded_options = None + _globals['_TIMESERIESVIEW'].fields_by_name['known_time']._serialized_options = b'\340A\001' + _globals['_UNITS'].fields_by_name['units']._loaded_options = None + _globals['_UNITS'].fields_by_name['units']._serialized_options = b'\340A\001\340A\005' + _globals['_UNITS'].fields_by_name['multiplier']._loaded_options = None + _globals['_UNITS'].fields_by_name['multiplier']._serialized_options = b'\340A\001\340A\005' + _globals['_UNITS'].fields_by_name['description']._loaded_options = None + _globals['_UNITS'].fields_by_name['description']._serialized_options = b'\340A\001' + _globals['_UNIT'].fields_by_name['dimension']._loaded_options = None + _globals['_UNIT'].fields_by_name['dimension']._serialized_options = b'\340A\001\340A\005' + _globals['_UNIT'].fields_by_name['unit']._loaded_options = None + _globals['_UNIT'].fields_by_name['unit']._serialized_options = b'\340A\001\340A\005' + _globals['_UNIT'].fields_by_name['exponent']._loaded_options = None + _globals['_UNIT'].fields_by_name['exponent']._serialized_options = b'\340A\001\340A\005' + _globals['_TIMESERIES']._serialized_start=309 + _globals['_TIMESERIES']._serialized_end=568 + _globals['_TIMESERIESPOINT']._serialized_start=571 + _globals['_TIMESERIESPOINT']._serialized_end=728 + _globals['_TIMESERIESVIEW']._serialized_start=730 + _globals['_TIMESERIESVIEW']._serialized_end=847 + _globals['_DEFAULTKNOWNTIME']._serialized_start=850 + _globals['_DEFAULTKNOWNTIME']._serialized_end=1009 + _globals['_UNITS']._serialized_start=1012 + _globals['_UNITS']._serialized_end=1160 + _globals['_UNIT']._serialized_start=1163 + _globals['_UNIT']._serialized_end=1424 + _globals['_UNIT_DIMENSION']._serialized_start=1283 + _globals['_UNIT_DIMENSION']._serialized_end=1424 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2.pyi b/exabel/stubs/exabel/api/data/v1/time_series_messages_pb2.pyi similarity index 52% rename from exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2.pyi rename to exabel/stubs/exabel/api/data/v1/time_series_messages_pb2.pyi index 72d43ccb..ab0a0f60 100644 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2.pyi +++ b/exabel/stubs/exabel/api/data/v1/time_series_messages_pb2.pyi @@ -2,9 +2,10 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from ...time import time_range_pb2 import google.protobuf.descriptor import google.protobuf.duration_pb2 import google.protobuf.internal.containers @@ -15,10 +16,13 @@ import google.protobuf.wrappers_pb2 import google.type.decimal_pb2 import sys import typing + if sys.version_info >= (3, 10): import typing as typing_extensions else: import typing_extensions +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final @@ -30,16 +34,24 @@ class TimeSeries(google.protobuf.message.Message): be retrieved via this API. They may still be listed in a `ListTimeSeries` request and be used on the Exabel platform. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int POINTS_FIELD_NUMBER: builtins.int READ_ONLY_FIELD_NUMBER: builtins.int UNITS_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the time series, for example\n `entityTypes/ns1.type/entities/ns2.entities/signals/ns3.signal`.\n An alternative name for the same time series is\n `signals/ns3.signal/entityTypes/ns1.type/entities/ns2.entity`, but the former is the canonical\n version which always will be returned by the server. The namespaces must be empty (being\n global) or one of the predetermined namespaces the customer has access to. If ns2 is not empty,\n it must be equals to ns3, and if ns1 is not empty, all three namespaces must be equal.\n ' + """The resource name of the time series, for example + `entityTypes/ns1.type/entities/ns2.entities/signals/ns3.signal`. + An alternative name for the same time series is + `signals/ns3.signal/entityTypes/ns1.type/entities/ns2.entity`, but the former is the canonical + version which always will be returned by the server. The namespaces must be empty (being + global) or one of the predetermined namespaces the customer has access to. If ns2 is not empty, + it must be equals to ns3, and if ns1 is not empty, all three namespaces must be equal. + """ read_only: builtins.bool - 'Global time series and those from data sets that you subscribe to will be read-only.' - + """Global time series and those from data sets that you subscribe to will be read-only.""" @property def points(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TimeSeriesPoint]: """List of time series data points. Data points are always returned by Exabel in chronological @@ -52,24 +64,28 @@ class TimeSeries(google.protobuf.message.Message): is not present. Once set, only the `description` field of `units` may be updated. """ - def __init__(self, *, name: builtins.str | None=..., points: collections.abc.Iterable[global___TimeSeriesPoint] | None=..., read_only: builtins.bool | None=..., units: global___Units | None=...) -> None: - ... + def __init__( + self, + *, + name: builtins.str | None = ..., + points: collections.abc.Iterable[global___TimeSeriesPoint] | None = ..., + read_only: builtins.bool | None = ..., + units: global___Units | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["units", b"units"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["name", b"name", "points", b"points", "read_only", b"read_only", "units", b"units"]) -> None: ... - def HasField(self, field_name: typing.Literal['units', b'units']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name', 'points', b'points', 'read_only', b'read_only', 'units', b'units']) -> None: - ... global___TimeSeries = TimeSeries @typing.final class TimeSeriesPoint(google.protobuf.message.Message): """A time series point of a time series.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TIME_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int KNOWN_TIME_FIELD_NUMBER: builtins.int - @property def time(self) -> google.protobuf.timestamp_pb2.Timestamp: """Timestamp of this data point, truncated to whole seconds.""" @@ -85,14 +101,16 @@ class TimeSeriesPoint(google.protobuf.message.Message): def known_time(self) -> google.protobuf.timestamp_pb2.Timestamp: """Known time of this data point.""" - def __init__(self, *, time: google.protobuf.timestamp_pb2.Timestamp | None=..., value: google.protobuf.wrappers_pb2.DoubleValue | None=..., known_time: google.protobuf.timestamp_pb2.Timestamp | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['known_time', b'known_time', 'time', b'time', 'value', b'value']) -> builtins.bool: - ... + def __init__( + self, + *, + time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + value: google.protobuf.wrappers_pb2.DoubleValue | None = ..., + known_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["known_time", b"known_time", "time", b"time", "value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["known_time", b"known_time", "time", b"time", "value", b"value"]) -> None: ... - def ClearField(self, field_name: typing.Literal['known_time', b'known_time', 'time', b'time', 'value', b'value']) -> None: - ... global___TimeSeriesPoint = TimeSeriesPoint @typing.final @@ -100,10 +118,11 @@ class TimeSeriesView(google.protobuf.message.Message): """A view of the time series, specifying which parts of its data to return. The default view is to only return the name of the time series. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + TIME_RANGE_FIELD_NUMBER: builtins.int KNOWN_TIME_FIELD_NUMBER: builtins.int - @property def time_range(self) -> exabel.api.time.time_range_pb2.TimeRange: """The time range of points to return. If the time series is provided by Exabel, this field will @@ -118,14 +137,15 @@ class TimeSeriesView(google.protobuf.message.Message): returned. """ - def __init__(self, *, time_range: exabel.api.time.time_range_pb2.TimeRange | None=..., known_time: google.protobuf.timestamp_pb2.Timestamp | None=...) -> None: - ... + def __init__( + self, + *, + time_range: exabel.api.time.time_range_pb2.TimeRange | None = ..., + known_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["known_time", b"known_time", "time_range", b"time_range"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["known_time", b"known_time", "time_range", b"time_range"]) -> None: ... - def HasField(self, field_name: typing.Literal['known_time', b'known_time', 'time_range', b'time_range']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['known_time', b'known_time', 'time_range', b'time_range']) -> None: - ... global___TimeSeriesView = TimeSeriesView @typing.final @@ -133,13 +153,14 @@ class DefaultKnownTime(google.protobuf.message.Message): """A default known time specification to use when creating or updating time series. If any inserted values has a value for its known_time, that value is used instead. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + CURRENT_TIME_FIELD_NUMBER: builtins.int KNOWN_TIME_FIELD_NUMBER: builtins.int TIME_OFFSET_FIELD_NUMBER: builtins.int current_time: builtins.bool - 'Specifies the current system time as the default known time for all inserted data points.' - + """Specifies the current system time as the default known time for all inserted data points.""" @property def known_time(self) -> google.protobuf.timestamp_pb2.Timestamp: """Specifies a specific timestamp as the default known time for all inserted data points.""" @@ -148,17 +169,17 @@ class DefaultKnownTime(google.protobuf.message.Message): def time_offset(self) -> google.protobuf.duration_pb2.Duration: """Specifies a time offset from each data point's timestamp to be its default known time.""" - def __init__(self, *, current_time: builtins.bool | None=..., known_time: google.protobuf.timestamp_pb2.Timestamp | None=..., time_offset: google.protobuf.duration_pb2.Duration | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['current_time', b'current_time', 'known_time', b'known_time', 'specification', b'specification', 'time_offset', b'time_offset']) -> builtins.bool: - ... + def __init__( + self, + *, + current_time: builtins.bool | None = ..., + known_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + time_offset: google.protobuf.duration_pb2.Duration | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["current_time", b"current_time", "known_time", b"known_time", "specification", b"specification", "time_offset", b"time_offset"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["current_time", b"current_time", "known_time", b"known_time", "specification", b"specification", "time_offset", b"time_offset"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["specification", b"specification"]) -> typing.Literal["current_time", "known_time", "time_offset"] | None: ... - def ClearField(self, field_name: typing.Literal['current_time', b'current_time', 'known_time', b'known_time', 'specification', b'specification', 'time_offset', b'time_offset']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['specification', b'specification']) -> typing.Literal['current_time', 'known_time', 'time_offset'] | None: - ... global___DefaultKnownTime = DefaultKnownTime @typing.final @@ -167,13 +188,16 @@ class Units(google.protobuf.message.Message): field is not present. If present, but empty, the unit of the time series is known to be dimensionless and unscaled. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + UNITS_FIELD_NUMBER: builtins.int MULTIPLIER_FIELD_NUMBER: builtins.int DESCRIPTION_FIELD_NUMBER: builtins.int description: builtins.str - 'Optionally a more detailed description of the units of this time series,\n for instance "Number of customers" or "Gross value in millions (EUR)".\n ' - + """Optionally a more detailed description of the units of this time series, + for instance "Number of customers" or "Gross value in millions (EUR)". + """ @property def units(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Unit]: """The product of all individual unit parts of this unit. For instance, if a time series measures @@ -191,67 +215,95 @@ class Units(google.protobuf.message.Message): measured in percent, but given as values from 0 to 100, the multiplier would be "0.01". """ - def __init__(self, *, units: collections.abc.Iterable[global___Unit] | None=..., multiplier: google.type.decimal_pb2.Decimal | None=..., description: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['multiplier', b'multiplier']) -> builtins.bool: - ... + def __init__( + self, + *, + units: collections.abc.Iterable[global___Unit] | None = ..., + multiplier: google.type.decimal_pb2.Decimal | None = ..., + description: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["multiplier", b"multiplier"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "multiplier", b"multiplier", "units", b"units"]) -> None: ... - def ClearField(self, field_name: typing.Literal['description', b'description', 'multiplier', b'multiplier', 'units', b'units']) -> None: - ... global___Units = Units @typing.final class Unit(google.protobuf.message.Message): """An individual unit, measuring one dimension.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Dimension: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType class _DimensionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Unit._Dimension.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - DIMENSION_UNKNOWN: Unit._Dimension.ValueType - "The dimension of this unit is unknown, but may be inferred from the unit's symbol." - DIMENSION_CURRENCY: Unit._Dimension.ValueType - 'The dimension is a monetary currency. A unit of this dimension must be one of the ISO-4217\n three letter currency codes.\n ' - DIMENSION_MASS: Unit._Dimension.ValueType - 'The dimension is a mass. The SI unit of mass is "kg", but other units may also be used.' - DIMENSION_LENGTH: Unit._Dimension.ValueType - 'The dimension is a one dimensional size. The SI unit of length is "m", but other units may\n also be used.\n ' - DIMENSION_TIME: Unit._Dimension.ValueType - 'The dimension is an amount of time. The SI unit of time is "s", but other units may also be\n used.\n ' - DIMENSION_RATIO: Unit._Dimension.ValueType - 'This unit is a ratio (strictly speaking without a dimension). Symbol is typically\n empty or "%".\n ' + DIMENSION_UNKNOWN: Unit._Dimension.ValueType # 0 + """The dimension of this unit is unknown, but may be inferred from the unit's symbol.""" + DIMENSION_CURRENCY: Unit._Dimension.ValueType # 1 + """The dimension is a monetary currency. A unit of this dimension must be one of the ISO-4217 + three letter currency codes. + """ + DIMENSION_MASS: Unit._Dimension.ValueType # 2 + """The dimension is a mass. The SI unit of mass is "kg", but other units may also be used.""" + DIMENSION_LENGTH: Unit._Dimension.ValueType # 3 + """The dimension is a one dimensional size. The SI unit of length is "m", but other units may + also be used. + """ + DIMENSION_TIME: Unit._Dimension.ValueType # 4 + """The dimension is an amount of time. The SI unit of time is "s", but other units may also be + used. + """ + DIMENSION_RATIO: Unit._Dimension.ValueType # 5 + """This unit is a ratio (strictly speaking without a dimension). Symbol is typically + empty or "%". + """ class Dimension(_Dimension, metaclass=_DimensionEnumTypeWrapper): """The supported dimensions in the Exabel platform.""" - DIMENSION_UNKNOWN: Unit.Dimension.ValueType - "The dimension of this unit is unknown, but may be inferred from the unit's symbol." - DIMENSION_CURRENCY: Unit.Dimension.ValueType - 'The dimension is a monetary currency. A unit of this dimension must be one of the ISO-4217\n three letter currency codes.\n ' - DIMENSION_MASS: Unit.Dimension.ValueType - 'The dimension is a mass. The SI unit of mass is "kg", but other units may also be used.' - DIMENSION_LENGTH: Unit.Dimension.ValueType - 'The dimension is a one dimensional size. The SI unit of length is "m", but other units may\n also be used.\n ' - DIMENSION_TIME: Unit.Dimension.ValueType - 'The dimension is an amount of time. The SI unit of time is "s", but other units may also be\n used.\n ' - DIMENSION_RATIO: Unit.Dimension.ValueType - 'This unit is a ratio (strictly speaking without a dimension). Symbol is typically\n empty or "%".\n ' + + DIMENSION_UNKNOWN: Unit.Dimension.ValueType # 0 + """The dimension of this unit is unknown, but may be inferred from the unit's symbol.""" + DIMENSION_CURRENCY: Unit.Dimension.ValueType # 1 + """The dimension is a monetary currency. A unit of this dimension must be one of the ISO-4217 + three letter currency codes. + """ + DIMENSION_MASS: Unit.Dimension.ValueType # 2 + """The dimension is a mass. The SI unit of mass is "kg", but other units may also be used.""" + DIMENSION_LENGTH: Unit.Dimension.ValueType # 3 + """The dimension is a one dimensional size. The SI unit of length is "m", but other units may + also be used. + """ + DIMENSION_TIME: Unit.Dimension.ValueType # 4 + """The dimension is an amount of time. The SI unit of time is "s", but other units may also be + used. + """ + DIMENSION_RATIO: Unit.Dimension.ValueType # 5 + """This unit is a ratio (strictly speaking without a dimension). Symbol is typically + empty or "%". + """ + DIMENSION_FIELD_NUMBER: builtins.int UNIT_FIELD_NUMBER: builtins.int EXPONENT_FIELD_NUMBER: builtins.int dimension: global___Unit.Dimension.ValueType - 'The dimension of this unit.' + """The dimension of this unit.""" unit: builtins.str - 'The short hand symbol of a dimension of this unit, for instance "m" or "EUR".\n Required, except for ratio units.\n ' + """The short hand symbol of a dimension of this unit, for instance "m" or "EUR". + Required, except for ratio units. + """ exponent: builtins.int - "The exponent (power) of this unit. It can be positive or negative, but if it is 0, the unit's\n exponent defaults to the value 1.\n " - - def __init__(self, *, dimension: global___Unit.Dimension.ValueType | None=..., unit: builtins.str | None=..., exponent: builtins.int | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['dimension', b'dimension', 'exponent', b'exponent', 'unit', b'unit']) -> None: - ... -global___Unit = Unit \ No newline at end of file + """The exponent (power) of this unit. It can be positive or negative, but if it is 0, the unit's + exponent defaults to the value 1. + """ + def __init__( + self, + *, + dimension: global___Unit.Dimension.ValueType | None = ..., + unit: builtins.str | None = ..., + exponent: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["dimension", b"dimension", "exponent", b"exponent", "unit", b"unit"]) -> None: ... + +global___Unit = Unit diff --git a/exabel/stubs/exabel/api/data/v1/time_series_messages_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/time_series_messages_pb2_grpc.py new file mode 100644 index 00000000..d24f1587 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/time_series_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/time_series_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/data/v1/time_series_service_pb2.py b/exabel/stubs/exabel/api/data/v1/time_series_service_pb2.py new file mode 100644 index 00000000..37de6e91 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/time_series_service_pb2.py @@ -0,0 +1,133 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/data/v1/time_series_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/data/v1/time_series_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import time_series_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,exabel/api/data/v1/time_series_service.proto\x12\x12\x65xabel.api.data.v1\x1a-exabel/api/data/v1/time_series_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"l\n\x15ListTimeSeriesRequest\x12,\n\x06parent\x18\x01 \x01(\tB\x1c\x92\x41\x16\xca>\x13\xfa\x02\x10timeSeriesParent\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"z\n\x16ListTimeSeriesResponse\x12\x33\n\x0btime_series\x18\x01 \x03(\x0b\x32\x1e.exabel.api.data.v1.TimeSeries\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"r\n\x14GetTimeSeriesRequest\x12(\n\x04name\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0etimeSeriesName\xe0\x41\x02\x12\x30\n\x04view\x18\x02 \x01(\x0b\x32\".exabel.api.data.v1.TimeSeriesView\"\x9b\x01\n\rInsertOptions\x12@\n\x12\x64\x65\x66\x61ult_known_time\x18\x01 \x01(\x0b\x32$.exabel.api.data.v1.DefaultKnownTime\x12\x16\n\ncreate_tag\x18\x02 \x01(\x08\x42\x02\x18\x01\x12\x1c\n\x0fshould_optimise\x18\x03 \x01(\x08H\x00\x88\x01\x01\x42\x12\n\x10_should_optimise\"\xa7\x01\n\rUpdateOptions\x12\x15\n\rallow_missing\x18\x01 \x01(\x08\x12&\n\x1creplace_existing_time_series\x18\x02 \x01(\x08H\x00\x12\x1c\n\x12replace_known_time\x18\x03 \x01(\x08H\x00\x12&\n\x1creplace_existing_data_points\x18\x04 \x01(\x08H\x00\x42\x11\n\x0freplace_options\"\xd4\x02\n\x17\x43reateTimeSeriesRequest\x12\x38\n\x0btime_series\x18\x01 \x01(\x0b\x32\x1e.exabel.api.data.v1.TimeSeriesB\x03\xe0\x41\x02\x12\x30\n\x04view\x18\x02 \x01(\x0b\x32\".exabel.api.data.v1.TimeSeriesView\x12\x39\n\x0einsert_options\x18\x06 \x01(\x0b\x32!.exabel.api.data.v1.InsertOptions\x12\x44\n\x12\x64\x65\x66\x61ult_known_time\x18\x03 \x01(\x0b\x32$.exabel.api.data.v1.DefaultKnownTimeB\x02\x18\x01\x12\x16\n\ncreate_tag\x18\x04 \x01(\x08\x42\x02\x18\x01\x12 \n\x0fshould_optimise\x18\x05 \x01(\x08\x42\x02\x18\x01H\x00\x88\x01\x01\x42\x12\n\x10_should_optimise\"\xca\x03\n\x17UpdateTimeSeriesRequest\x12\x38\n\x0btime_series\x18\x01 \x01(\x0b\x32\x1e.exabel.api.data.v1.TimeSeriesB\x03\xe0\x41\x02\x12\x30\n\x04view\x18\x02 \x01(\x0b\x32\".exabel.api.data.v1.TimeSeriesView\x12\x39\n\x0einsert_options\x18\x08 \x01(\x0b\x32!.exabel.api.data.v1.InsertOptions\x12\x39\n\x0eupdate_options\x18\t \x01(\x0b\x32!.exabel.api.data.v1.UpdateOptions\x12\x44\n\x12\x64\x65\x66\x61ult_known_time\x18\x03 \x01(\x0b\x32$.exabel.api.data.v1.DefaultKnownTimeB\x02\x18\x01\x12\x19\n\rallow_missing\x18\x04 \x01(\x08\x42\x02\x18\x01\x12\x16\n\ncreate_tag\x18\x05 \x01(\x08\x42\x02\x18\x01\x12 \n\x0fshould_optimise\x18\x06 \x01(\x08\x42\x02\x18\x01H\x00\x88\x01\x01\x12\x1e\n\x12replace_known_time\x18\x07 \x01(\x08\x42\x02\x18\x01\x42\x12\n\x10_should_optimise\"\xee\x03\n\x17ImportTimeSeriesRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x0btime_series\x18\x02 \x03(\x0b\x32\x1e.exabel.api.data.v1.TimeSeries\x12\x1a\n\x12status_in_response\x18\x06 \x01(\x08\x12\x39\n\x0einsert_options\x18\n \x01(\x0b\x32!.exabel.api.data.v1.InsertOptions\x12\x39\n\x0eupdate_options\x18\x0b \x01(\x0b\x32!.exabel.api.data.v1.UpdateOptions\x12\x44\n\x12\x64\x65\x66\x61ult_known_time\x18\x03 \x01(\x0b\x32$.exabel.api.data.v1.DefaultKnownTimeB\x02\x18\x01\x12\x19\n\rallow_missing\x18\x04 \x01(\x08\x42\x02\x18\x01\x12\x16\n\ncreate_tag\x18\x05 \x01(\x08\x42\x02\x18\x01\x12(\n\x1creplace_existing_time_series\x18\x07 \x01(\x08\x42\x02\x18\x01\x12 \n\x0fshould_optimise\x18\x08 \x01(\x08\x42\x02\x18\x01H\x00\x88\x01\x01\x12\x1e\n\x12replace_known_time\x18\t \x01(\x08\x42\x02\x18\x01\x42\x12\n\x10_should_optimise\"\xa2\x02\n\x18ImportTimeSeriesResponse\x12X\n\tresponses\x18\x01 \x03(\x0b\x32\x45.exabel.api.data.v1.ImportTimeSeriesResponse.SingleTimeSeriesResponse\x1a\xab\x01\n\x18SingleTimeSeriesResponse\x12k\n\x10time_series_name\x18\x01 \x01(\tBQ\x92\x41NJL\"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors\"\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status\"C\n\x17\x44\x65leteTimeSeriesRequest\x12(\n\x04name\x18\x01 \x01(\tB\x1a\x92\x41\x14\xca>\x11\xfa\x02\x0etimeSeriesName\xe0\x41\x02\"\x8a\x01\n\"BatchDeleteTimeSeriesPointsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x0btime_series\x18\x02 \x03(\x0b\x32\x1e.exabel.api.data.v1.TimeSeries\x12\x1a\n\x12status_in_response\x18\x03 \x01(\x08\"\xc2\x02\n#BatchDeleteTimeSeriesPointsResponse\x12h\n\tresponses\x18\x01 \x03(\x0b\x32U.exabel.api.data.v1.BatchDeleteTimeSeriesPointsResponse.BatchDeleteTimeSeriesResponse\x1a\xb0\x01\n\x1d\x42\x61tchDeleteTimeSeriesResponse\x12k\n\x10time_series_name\x18\x01 \x01(\tBQ\x92\x41NJL\"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors\"\x12\"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status2\x89\x0e\n\x11TimeSeriesService\x12\xdb\x01\n\x0eListTimeSeries\x12).exabel.api.data.v1.ListTimeSeriesRequest\x1a*.exabel.api.data.v1.ListTimeSeriesResponse\"r\x92\x41\x12\x12\x10List time series\x82\xd3\xe4\x93\x02W\x12\x30/v1/{parent=entityTypes/*/entities/*}/timeSeriesZ#\x12!/v1/{parent=signals/*}/timeSeries\x12\xd5\x01\n\rGetTimeSeries\x12(.exabel.api.data.v1.GetTimeSeriesRequest\x1a\x1e.exabel.api.data.v1.TimeSeries\"z\x92\x41\x11\x12\x0fGet time series\x82\xd3\xe4\x93\x02`\x12-/v1/{name=entityTypes/*/entities/*/signals/*}Z/\x12-/v1/{name=signals/*/entityTypes/*/entities/*}\x12\x92\x02\n\x10\x43reateTimeSeries\x12+.exabel.api.data.v1.CreateTimeSeriesRequest\x1a\x1e.exabel.api.data.v1.TimeSeries\"\xb0\x01\x92\x41\x14\x12\x12\x43reate time series\x82\xd3\xe4\x93\x02\x92\x01\"9/v1/{time_series.name=entityTypes/*/entities/*/signals/*}:\x0btime_seriesZH\"9/v1/{time_series.name=signals/*/entityTypes/*/entities/*}:\x0btime_series\x12\x92\x02\n\x10UpdateTimeSeries\x12+.exabel.api.data.v1.UpdateTimeSeriesRequest\x1a\x1e.exabel.api.data.v1.TimeSeries\"\xb0\x01\x92\x41\x14\x12\x12Update time series\x82\xd3\xe4\x93\x02\x92\x01\x32\x39/v1/{time_series.name=entityTypes/*/entities/*/signals/*}:\x0btime_seriesZH29/v1/{time_series.name=signals/*/entityTypes/*/entities/*}:\x0btime_series\x12\xf8\x01\n\x10ImportTimeSeries\x12+.exabel.api.data.v1.ImportTimeSeriesRequest\x1a,.exabel.api.data.v1.ImportTimeSeriesResponse\"\x88\x01\x92\x41\x14\x12\x12Import time series\x82\xd3\xe4\x93\x02k\"7/v1/{parent=entityTypes/*/entities/*}/timeSeries:import:\x01*Z-\"(/v1/{parent=signals/*}/timeSeries:import:\x01*\x12\xbf\x02\n\x1b\x42\x61tchDeleteTimeSeriesPoints\x12\x36.exabel.api.data.v1.BatchDeleteTimeSeriesPointsRequest\x1a\x37.exabel.api.data.v1.BatchDeleteTimeSeriesPointsResponse\"\xae\x01\x92\x41!\x12\x1f\x42\x61tch delete time series points\x82\xd3\xe4\x93\x02\x83\x01\"C/v1/{parent=entityTypes/*/entities/*}/timeSeries/points:batchDelete:\x01*Z9\"4/v1/{parent=signals/*}/timeSeries/points:batchDelete:\x01*\x12\xd6\x01\n\x10\x44\x65leteTimeSeries\x12+.exabel.api.data.v1.DeleteTimeSeriesRequest\x1a\x16.google.protobuf.Empty\"}\x92\x41\x14\x12\x12\x44\x65lete time series\x82\xd3\xe4\x93\x02`*-/v1/{name=entityTypes/*/entities/*/signals/*}Z/*-/v1/{name=signals/*/entityTypes/*/entities/*}BJ\n\x16\x63om.exabel.api.data.v1B\x16TimeSeriesServiceProtoP\x01Z\x16\x65xabel.com/api/data/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.time_series_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\026com.exabel.api.data.v1B\026TimeSeriesServiceProtoP\001Z\026exabel.com/api/data/v1' + _globals['_LISTTIMESERIESREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTTIMESERIESREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\026\312>\023\372\002\020timeSeriesParent\340A\002' + _globals['_GETTIMESERIESREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETTIMESERIESREQUEST'].fields_by_name['name']._serialized_options = b'\222A\024\312>\021\372\002\016timeSeriesName\340A\002' + _globals['_INSERTOPTIONS'].fields_by_name['create_tag']._loaded_options = None + _globals['_INSERTOPTIONS'].fields_by_name['create_tag']._serialized_options = b'\030\001' + _globals['_CREATETIMESERIESREQUEST'].fields_by_name['time_series']._loaded_options = None + _globals['_CREATETIMESERIESREQUEST'].fields_by_name['time_series']._serialized_options = b'\340A\002' + _globals['_CREATETIMESERIESREQUEST'].fields_by_name['default_known_time']._loaded_options = None + _globals['_CREATETIMESERIESREQUEST'].fields_by_name['default_known_time']._serialized_options = b'\030\001' + _globals['_CREATETIMESERIESREQUEST'].fields_by_name['create_tag']._loaded_options = None + _globals['_CREATETIMESERIESREQUEST'].fields_by_name['create_tag']._serialized_options = b'\030\001' + _globals['_CREATETIMESERIESREQUEST'].fields_by_name['should_optimise']._loaded_options = None + _globals['_CREATETIMESERIESREQUEST'].fields_by_name['should_optimise']._serialized_options = b'\030\001' + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['time_series']._loaded_options = None + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['time_series']._serialized_options = b'\340A\002' + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['default_known_time']._loaded_options = None + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['default_known_time']._serialized_options = b'\030\001' + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['allow_missing']._loaded_options = None + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['allow_missing']._serialized_options = b'\030\001' + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['create_tag']._loaded_options = None + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['create_tag']._serialized_options = b'\030\001' + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['should_optimise']._loaded_options = None + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['should_optimise']._serialized_options = b'\030\001' + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['replace_known_time']._loaded_options = None + _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['replace_known_time']._serialized_options = b'\030\001' + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['parent']._serialized_options = b'\340A\002' + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['default_known_time']._loaded_options = None + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['default_known_time']._serialized_options = b'\030\001' + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['allow_missing']._loaded_options = None + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['allow_missing']._serialized_options = b'\030\001' + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['create_tag']._loaded_options = None + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['create_tag']._serialized_options = b'\030\001' + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['replace_existing_time_series']._loaded_options = None + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['replace_existing_time_series']._serialized_options = b'\030\001' + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['should_optimise']._loaded_options = None + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['should_optimise']._serialized_options = b'\030\001' + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['replace_known_time']._loaded_options = None + _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['replace_known_time']._serialized_options = b'\030\001' + _globals['_IMPORTTIMESERIESRESPONSE_SINGLETIMESERIESRESPONSE'].fields_by_name['time_series_name']._loaded_options = None + _globals['_IMPORTTIMESERIESRESPONSE_SINGLETIMESERIESRESPONSE'].fields_by_name['time_series_name']._serialized_options = b'\222ANJL\"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors\"' + _globals['_DELETETIMESERIESREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETETIMESERIESREQUEST'].fields_by_name['name']._serialized_options = b'\222A\024\312>\021\372\002\016timeSeriesName\340A\002' + _globals['_BATCHDELETETIMESERIESPOINTSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_BATCHDELETETIMESERIESPOINTSREQUEST'].fields_by_name['parent']._serialized_options = b'\340A\002' + _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE_BATCHDELETETIMESERIESRESPONSE'].fields_by_name['time_series_name']._loaded_options = None + _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE_BATCHDELETETIMESERIESRESPONSE'].fields_by_name['time_series_name']._serialized_options = b'\222ANJL\"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors\"' + _globals['_TIMESERIESSERVICE'].methods_by_name['ListTimeSeries']._loaded_options = None + _globals['_TIMESERIESSERVICE'].methods_by_name['ListTimeSeries']._serialized_options = b'\222A\022\022\020List time series\202\323\344\223\002W\0220/v1/{parent=entityTypes/*/entities/*}/timeSeriesZ#\022!/v1/{parent=signals/*}/timeSeries' + _globals['_TIMESERIESSERVICE'].methods_by_name['GetTimeSeries']._loaded_options = None + _globals['_TIMESERIESSERVICE'].methods_by_name['GetTimeSeries']._serialized_options = b'\222A\021\022\017Get time series\202\323\344\223\002`\022-/v1/{name=entityTypes/*/entities/*/signals/*}Z/\022-/v1/{name=signals/*/entityTypes/*/entities/*}' + _globals['_TIMESERIESSERVICE'].methods_by_name['CreateTimeSeries']._loaded_options = None + _globals['_TIMESERIESSERVICE'].methods_by_name['CreateTimeSeries']._serialized_options = b'\222A\024\022\022Create time series\202\323\344\223\002\222\001\"9/v1/{time_series.name=entityTypes/*/entities/*/signals/*}:\013time_seriesZH\"9/v1/{time_series.name=signals/*/entityTypes/*/entities/*}:\013time_series' + _globals['_TIMESERIESSERVICE'].methods_by_name['UpdateTimeSeries']._loaded_options = None + _globals['_TIMESERIESSERVICE'].methods_by_name['UpdateTimeSeries']._serialized_options = b'\222A\024\022\022Update time series\202\323\344\223\002\222\00129/v1/{time_series.name=entityTypes/*/entities/*/signals/*}:\013time_seriesZH29/v1/{time_series.name=signals/*/entityTypes/*/entities/*}:\013time_series' + _globals['_TIMESERIESSERVICE'].methods_by_name['ImportTimeSeries']._loaded_options = None + _globals['_TIMESERIESSERVICE'].methods_by_name['ImportTimeSeries']._serialized_options = b'\222A\024\022\022Import time series\202\323\344\223\002k\"7/v1/{parent=entityTypes/*/entities/*}/timeSeries:import:\001*Z-\"(/v1/{parent=signals/*}/timeSeries:import:\001*' + _globals['_TIMESERIESSERVICE'].methods_by_name['BatchDeleteTimeSeriesPoints']._loaded_options = None + _globals['_TIMESERIESSERVICE'].methods_by_name['BatchDeleteTimeSeriesPoints']._serialized_options = b'\222A!\022\037Batch delete time series points\202\323\344\223\002\203\001\"C/v1/{parent=entityTypes/*/entities/*}/timeSeries/points:batchDelete:\001*Z9\"4/v1/{parent=signals/*}/timeSeries/points:batchDelete:\001*' + _globals['_TIMESERIESSERVICE'].methods_by_name['DeleteTimeSeries']._loaded_options = None + _globals['_TIMESERIESSERVICE'].methods_by_name['DeleteTimeSeries']._serialized_options = b'\222A\024\022\022Delete time series\202\323\344\223\002`*-/v1/{name=entityTypes/*/entities/*/signals/*}Z/*-/v1/{name=signals/*/entityTypes/*/entities/*}' + _globals['_LISTTIMESERIESREQUEST']._serialized_start=280 + _globals['_LISTTIMESERIESREQUEST']._serialized_end=388 + _globals['_LISTTIMESERIESRESPONSE']._serialized_start=390 + _globals['_LISTTIMESERIESRESPONSE']._serialized_end=512 + _globals['_GETTIMESERIESREQUEST']._serialized_start=514 + _globals['_GETTIMESERIESREQUEST']._serialized_end=628 + _globals['_INSERTOPTIONS']._serialized_start=631 + _globals['_INSERTOPTIONS']._serialized_end=786 + _globals['_UPDATEOPTIONS']._serialized_start=789 + _globals['_UPDATEOPTIONS']._serialized_end=956 + _globals['_CREATETIMESERIESREQUEST']._serialized_start=959 + _globals['_CREATETIMESERIESREQUEST']._serialized_end=1299 + _globals['_UPDATETIMESERIESREQUEST']._serialized_start=1302 + _globals['_UPDATETIMESERIESREQUEST']._serialized_end=1760 + _globals['_IMPORTTIMESERIESREQUEST']._serialized_start=1763 + _globals['_IMPORTTIMESERIESREQUEST']._serialized_end=2257 + _globals['_IMPORTTIMESERIESRESPONSE']._serialized_start=2260 + _globals['_IMPORTTIMESERIESRESPONSE']._serialized_end=2550 + _globals['_IMPORTTIMESERIESRESPONSE_SINGLETIMESERIESRESPONSE']._serialized_start=2379 + _globals['_IMPORTTIMESERIESRESPONSE_SINGLETIMESERIESRESPONSE']._serialized_end=2550 + _globals['_DELETETIMESERIESREQUEST']._serialized_start=2552 + _globals['_DELETETIMESERIESREQUEST']._serialized_end=2619 + _globals['_BATCHDELETETIMESERIESPOINTSREQUEST']._serialized_start=2622 + _globals['_BATCHDELETETIMESERIESPOINTSREQUEST']._serialized_end=2760 + _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE']._serialized_start=2763 + _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE']._serialized_end=3085 + _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE_BATCHDELETETIMESERIESRESPONSE']._serialized_start=2909 + _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE_BATCHDELETETIMESERIESRESPONSE']._serialized_end=3085 + _globals['_TIMESERIESSERVICE']._serialized_start=3088 + _globals['_TIMESERIESSERVICE']._serialized_end=4889 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/data/v1/time_series_service_pb2.pyi b/exabel/stubs/exabel/api/data/v1/time_series_service_pb2.pyi new file mode 100644 index 00000000..52f60faf --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/time_series_service_pb2.pyi @@ -0,0 +1,538 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + +import builtins +import collections.abc +from . import time_series_messages_pb2 +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +import google.rpc.status_pb2 +import typing +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing.final +class ListTimeSeriesRequest(google.protobuf.message.Message): + """The request to list time series. This request has an implicit empty `TimeSeriesView` parameter, + so only the canonical names are returned. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + PAGE_SIZE_FIELD_NUMBER: builtins.int + PAGE_TOKEN_FIELD_NUMBER: builtins.int + parent: builtins.str + """The parent entity or signal of time series to list, for example `entityTypes/ns.type1/entities/ns.entity1` + or `signal/ns.signal1`. + """ + page_size: builtins.int + """Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.""" + page_token: builtins.str + """Token for a specific page of results, as returned from a previous list request with the same + query parameters. + """ + def __init__( + self, + *, + parent: builtins.str | None = ..., + page_size: builtins.int | None = ..., + page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["page_size", b"page_size", "page_token", b"page_token", "parent", b"parent"]) -> None: ... + +global___ListTimeSeriesRequest = ListTimeSeriesRequest + +@typing.final +class ListTimeSeriesResponse(google.protobuf.message.Message): + """The response to list time series. Returns all matching time series.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TIME_SERIES_FIELD_NUMBER: builtins.int + NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int + TOTAL_SIZE_FIELD_NUMBER: builtins.int + next_page_token: builtins.str + """Token for the next page of results, which can be sent to a subsequent query. + The end of the list is reached when the number of results is less than the page size + (NOT when the token is empty). + """ + total_size: builtins.int + """Total number of results, irrespective of paging.""" + @property + def time_series(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.time_series_messages_pb2.TimeSeries]: + """List of time series. Only the resource `name` field is returned.""" + + def __init__( + self, + *, + time_series: collections.abc.Iterable[exabel.api.data.v1.time_series_messages_pb2.TimeSeries] | None = ..., + next_page_token: builtins.str | None = ..., + total_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["next_page_token", b"next_page_token", "time_series", b"time_series", "total_size", b"total_size"]) -> None: ... + +global___ListTimeSeriesResponse = ListTimeSeriesResponse + +@typing.final +class GetTimeSeriesRequest(google.protobuf.message.Message): + """The request to get one time series. The returned time series will contain its canonical name. + Not all time series are capable of returning data. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + VIEW_FIELD_NUMBER: builtins.int + name: builtins.str + """The resource name of the requested time series, for example + `entityTypes/ns.type1/entities/ns.entity1/signals/ns.signal1` + or `signals/ns.signal1/entityTypes/ns.type1/entities/ns.entity1`. The returned time series will + always contain its canonical name `entityTypes/ns.type1/entities/ns.entity1/signals/ns.signal1`. + """ + @property + def view(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView: + """Specifies which parts of the time series should be returned in the request.""" + + def __init__( + self, + *, + name: builtins.str | None = ..., + view: exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["view", b"view"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["name", b"name", "view", b"view"]) -> None: ... + +global___GetTimeSeriesRequest = GetTimeSeriesRequest + +@typing.final +class InsertOptions(google.protobuf.message.Message): + """Common options when insert time series values.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + DEFAULT_KNOWN_TIME_FIELD_NUMBER: builtins.int + CREATE_TAG_FIELD_NUMBER: builtins.int + SHOULD_OPTIMISE_FIELD_NUMBER: builtins.int + create_tag: builtins.bool + """This field is not in use anymore.""" + should_optimise: builtins.bool + """Whether time series storage optimisation should be enabled or not. If not set, optimisation is + at the discretion of the server. + """ + @property + def default_known_time(self) -> exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime: + """The specification of the default known time to use for points that don't explicitly have a + known time set. If not set, the time of insertion is used as the default known time + (`current_time = true`). + """ + + def __init__( + self, + *, + default_known_time: exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime | None = ..., + create_tag: builtins.bool | None = ..., + should_optimise: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_should_optimise", b"_should_optimise", "default_known_time", b"default_known_time", "should_optimise", b"should_optimise"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_should_optimise", b"_should_optimise", "create_tag", b"create_tag", "default_known_time", b"default_known_time", "should_optimise", b"should_optimise"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_should_optimise", b"_should_optimise"]) -> typing.Literal["should_optimise"] | None: ... + +global___InsertOptions = InsertOptions + +@typing.final +class UpdateOptions(google.protobuf.message.Message): + """Common options when updating one or more time series.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ALLOW_MISSING_FIELD_NUMBER: builtins.int + REPLACE_EXISTING_TIME_SERIES_FIELD_NUMBER: builtins.int + REPLACE_KNOWN_TIME_FIELD_NUMBER: builtins.int + REPLACE_EXISTING_DATA_POINTS_FIELD_NUMBER: builtins.int + allow_missing: builtins.bool + """If set to `true`, new time series will be created if they did not exist.""" + replace_existing_time_series: builtins.bool + """Set to `true` to first delete all data from existing time series, including units. This means + that all historical, point-in-time and units data for the time series will be destroyed and + replaced with the data in this call. + Use with care! For instance: If this flag is set, and an import job splits one time series + over multiple calls, only the data in the last call will be kept. + """ + replace_known_time: builtins.bool + """Specifies that the known times of _all_ inserted points are a fixed timestamp specified in + `insert_options.default_known_time`, and additionally that all existing values of the + time series should be unset at this timestamp. If this is set, either + `insert_options.default_known_time.current_time` or + `insert_options.default_known_time.known_time` must be set, and it is an error to specify the + known time of any inserted points. + Use with care! For instance: If this flag is set, and an import job splits one time series + over multiple calls, only the data in the last call will be kept. + """ + replace_existing_data_points: builtins.bool + """Whether to remove existing data points for other known times of the inserted time series + points. Data points for times not present in the request will be left untouched. + """ + def __init__( + self, + *, + allow_missing: builtins.bool | None = ..., + replace_existing_time_series: builtins.bool | None = ..., + replace_known_time: builtins.bool | None = ..., + replace_existing_data_points: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["replace_existing_data_points", b"replace_existing_data_points", "replace_existing_time_series", b"replace_existing_time_series", "replace_known_time", b"replace_known_time", "replace_options", b"replace_options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["allow_missing", b"allow_missing", "replace_existing_data_points", b"replace_existing_data_points", "replace_existing_time_series", b"replace_existing_time_series", "replace_known_time", b"replace_known_time", "replace_options", b"replace_options"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["replace_options", b"replace_options"]) -> typing.Literal["replace_existing_time_series", "replace_known_time", "replace_existing_data_points"] | None: ... + +global___UpdateOptions = UpdateOptions + +@typing.final +class CreateTimeSeriesRequest(google.protobuf.message.Message): + """The request to create one time series. The parents of the time series will be inferred from + `time_series.name`. The returned time series will contain its canonical name. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TIME_SERIES_FIELD_NUMBER: builtins.int + VIEW_FIELD_NUMBER: builtins.int + INSERT_OPTIONS_FIELD_NUMBER: builtins.int + DEFAULT_KNOWN_TIME_FIELD_NUMBER: builtins.int + CREATE_TAG_FIELD_NUMBER: builtins.int + SHOULD_OPTIMISE_FIELD_NUMBER: builtins.int + create_tag: builtins.bool + """This field is not in use anymore.""" + should_optimise: builtins.bool + """This field is deprecated and replaced with insert_options.should_optimise.""" + @property + def time_series(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeries: + """The time series to create.""" + + @property + def view(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView: + """Specifies which parts of the time series should be returned in the request.""" + + @property + def insert_options(self) -> global___InsertOptions: + """Insert options for this request.""" + + @property + def default_known_time(self) -> exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime: + """This field is deprecated and replaced with insert_options.default_known_time.""" + + def __init__( + self, + *, + time_series: exabel.api.data.v1.time_series_messages_pb2.TimeSeries | None = ..., + view: exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView | None = ..., + insert_options: global___InsertOptions | None = ..., + default_known_time: exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime | None = ..., + create_tag: builtins.bool | None = ..., + should_optimise: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_should_optimise", b"_should_optimise", "default_known_time", b"default_known_time", "insert_options", b"insert_options", "should_optimise", b"should_optimise", "time_series", b"time_series", "view", b"view"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_should_optimise", b"_should_optimise", "create_tag", b"create_tag", "default_known_time", b"default_known_time", "insert_options", b"insert_options", "should_optimise", b"should_optimise", "time_series", b"time_series", "view", b"view"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_should_optimise", b"_should_optimise"]) -> typing.Literal["should_optimise"] | None: ... + +global___CreateTimeSeriesRequest = CreateTimeSeriesRequest + +@typing.final +class UpdateTimeSeriesRequest(google.protobuf.message.Message): + """The request to update one time series. The returned time series will contain its canonical name.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TIME_SERIES_FIELD_NUMBER: builtins.int + VIEW_FIELD_NUMBER: builtins.int + INSERT_OPTIONS_FIELD_NUMBER: builtins.int + UPDATE_OPTIONS_FIELD_NUMBER: builtins.int + DEFAULT_KNOWN_TIME_FIELD_NUMBER: builtins.int + ALLOW_MISSING_FIELD_NUMBER: builtins.int + CREATE_TAG_FIELD_NUMBER: builtins.int + SHOULD_OPTIMISE_FIELD_NUMBER: builtins.int + REPLACE_KNOWN_TIME_FIELD_NUMBER: builtins.int + allow_missing: builtins.bool + """This field is deprecated and replaced with update_options.allow_missing.""" + create_tag: builtins.bool + """This field is not in use anymore.""" + should_optimise: builtins.bool + """This field is deprecated and replaced with insert_options.should_optimise.""" + replace_known_time: builtins.bool + """This field is deprecated and replaced with update_options.replace_known_time.""" + @property + def time_series(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeries: + """The time series to update. The data in this request and the existing data are merged together: + All points in the request will overwrite the existing points with the same key, unless + the new value is empty, in which case the point will be deleted. + """ + + @property + def view(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView: + """Specifies which parts of the time series should be returned in the request.""" + + @property + def insert_options(self) -> global___InsertOptions: + """Insert options for this request.""" + + @property + def update_options(self) -> global___UpdateOptions: + """Update options for this request.""" + + @property + def default_known_time(self) -> exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime: + """This field is deprecated and replaced with insert_options.default_known_time.""" + + def __init__( + self, + *, + time_series: exabel.api.data.v1.time_series_messages_pb2.TimeSeries | None = ..., + view: exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView | None = ..., + insert_options: global___InsertOptions | None = ..., + update_options: global___UpdateOptions | None = ..., + default_known_time: exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime | None = ..., + allow_missing: builtins.bool | None = ..., + create_tag: builtins.bool | None = ..., + should_optimise: builtins.bool | None = ..., + replace_known_time: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_should_optimise", b"_should_optimise", "default_known_time", b"default_known_time", "insert_options", b"insert_options", "should_optimise", b"should_optimise", "time_series", b"time_series", "update_options", b"update_options", "view", b"view"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_should_optimise", b"_should_optimise", "allow_missing", b"allow_missing", "create_tag", b"create_tag", "default_known_time", b"default_known_time", "insert_options", b"insert_options", "replace_known_time", b"replace_known_time", "should_optimise", b"should_optimise", "time_series", b"time_series", "update_options", b"update_options", "view", b"view"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_should_optimise", b"_should_optimise"]) -> typing.Literal["should_optimise"] | None: ... + +global___UpdateTimeSeriesRequest = UpdateTimeSeriesRequest + +@typing.final +class ImportTimeSeriesRequest(google.protobuf.message.Message): + """The request to import multiple time series. The parents of the time series will be inferred from + `time_series.name`. + """ + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + TIME_SERIES_FIELD_NUMBER: builtins.int + STATUS_IN_RESPONSE_FIELD_NUMBER: builtins.int + INSERT_OPTIONS_FIELD_NUMBER: builtins.int + UPDATE_OPTIONS_FIELD_NUMBER: builtins.int + DEFAULT_KNOWN_TIME_FIELD_NUMBER: builtins.int + ALLOW_MISSING_FIELD_NUMBER: builtins.int + CREATE_TAG_FIELD_NUMBER: builtins.int + REPLACE_EXISTING_TIME_SERIES_FIELD_NUMBER: builtins.int + SHOULD_OPTIMISE_FIELD_NUMBER: builtins.int + REPLACE_KNOWN_TIME_FIELD_NUMBER: builtins.int + parent: builtins.str + """The common parent of all time series to import. May include `-` as a wild card.""" + status_in_response: builtins.bool + """Set to `true` to report the status of each time series in the response. If `false`, a failure + for one time series will fail the entire request, and a sample of the failures will be + reported in the trailers. + """ + allow_missing: builtins.bool + """This field is deprecated and replaced with update_options.allow_missing.""" + create_tag: builtins.bool + """This field is not in use anymore.""" + replace_existing_time_series: builtins.bool + """This field is deprecated and replaced with update_options.replace_existing_time_series.""" + should_optimise: builtins.bool + """This field is deprecated and replaced with insert_options.should_optimise.""" + replace_known_time: builtins.bool + """This field is deprecated and replaced with update_options.replace_known_time.""" + @property + def time_series(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.time_series_messages_pb2.TimeSeries]: + """One or more time series to import.""" + + @property + def insert_options(self) -> global___InsertOptions: + """Insert options for this request.""" + + @property + def update_options(self) -> global___UpdateOptions: + """Update options for this request.""" + + @property + def default_known_time(self) -> exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime: + """This field is deprecated and replaced with insert_options.default_known_time.""" + + def __init__( + self, + *, + parent: builtins.str | None = ..., + time_series: collections.abc.Iterable[exabel.api.data.v1.time_series_messages_pb2.TimeSeries] | None = ..., + status_in_response: builtins.bool | None = ..., + insert_options: global___InsertOptions | None = ..., + update_options: global___UpdateOptions | None = ..., + default_known_time: exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime | None = ..., + allow_missing: builtins.bool | None = ..., + create_tag: builtins.bool | None = ..., + replace_existing_time_series: builtins.bool | None = ..., + should_optimise: builtins.bool | None = ..., + replace_known_time: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["_should_optimise", b"_should_optimise", "default_known_time", b"default_known_time", "insert_options", b"insert_options", "should_optimise", b"should_optimise", "update_options", b"update_options"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["_should_optimise", b"_should_optimise", "allow_missing", b"allow_missing", "create_tag", b"create_tag", "default_known_time", b"default_known_time", "insert_options", b"insert_options", "parent", b"parent", "replace_existing_time_series", b"replace_existing_time_series", "replace_known_time", b"replace_known_time", "should_optimise", b"should_optimise", "status_in_response", b"status_in_response", "time_series", b"time_series", "update_options", b"update_options"]) -> None: ... + def WhichOneof(self, oneof_group: typing.Literal["_should_optimise", b"_should_optimise"]) -> typing.Literal["should_optimise"] | None: ... + +global___ImportTimeSeriesRequest = ImportTimeSeriesRequest + +@typing.final +class ImportTimeSeriesResponse(google.protobuf.message.Message): + """The response to import multiple time series.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing.final + class SingleTimeSeriesResponse(google.protobuf.message.Message): + """The status for one time series.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TIME_SERIES_NAME_FIELD_NUMBER: builtins.int + STATUS_FIELD_NUMBER: builtins.int + time_series_name: builtins.str + """The resource name of the time series, for example + `entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors`. + """ + @property + def status(self) -> google.rpc.status_pb2.Status: + """The status for this time series. A `status.code = OK` indicates that the time series + was imported successfully. + """ + + def __init__( + self, + *, + time_series_name: builtins.str | None = ..., + status: google.rpc.status_pb2.Status | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["status", b"status"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["status", b"status", "time_series_name", b"time_series_name"]) -> None: ... + + RESPONSES_FIELD_NUMBER: builtins.int + @property + def responses(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImportTimeSeriesResponse.SingleTimeSeriesResponse]: + """One response for each time series, in order. This list is populated if and only if + `status_in_response` was set to `true` in the request. + """ + + def __init__( + self, + *, + responses: collections.abc.Iterable[global___ImportTimeSeriesResponse.SingleTimeSeriesResponse] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["responses", b"responses"]) -> None: ... + +global___ImportTimeSeriesResponse = ImportTimeSeriesResponse + +@typing.final +class DeleteTimeSeriesRequest(google.protobuf.message.Message): + """The request to delete one time series.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + name: builtins.str + """The resource name of the time series to be deleted, for example + `entityTypes/ns.type1/entities/ns.entity1/signals/ns.signal1` or + `signals/ns.signal1/entityTypes/ns.type1/entities/ns.entity1`. + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... + +global___DeleteTimeSeriesRequest = DeleteTimeSeriesRequest + +@typing.final +class BatchDeleteTimeSeriesPointsRequest(google.protobuf.message.Message): + """The request to batch delete specific points of one or more time series.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + TIME_SERIES_FIELD_NUMBER: builtins.int + STATUS_IN_RESPONSE_FIELD_NUMBER: builtins.int + parent: builtins.str + """The common parent of all time series to delete points from, for example + `entityTypes/ns.type1/entities/ns.entity1/signals/ns.signal1` or + `signals/ns.signal1/entityTypes/ns.type1/entities/ns.entity1`. + May include `-` as a wild card. + """ + status_in_response: builtins.bool + """Set to `true` to report the status of each time series in the response. If `false`, a failure + for one time series will fail the entire request, and a sample of the failures will be + reported in the trailers. + """ + @property + def time_series(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.time_series_messages_pb2.TimeSeries]: + """The list of time series points to delete. If a `known_time` is empty, _all_ data for the time + series at that time is deleted. For all points, `value` is ignored. Trying to delete points + from a non-existing time series will result in an error, but trying to delete a non-existing + point from an existing time series will _not_ result in an error. + """ + + def __init__( + self, + *, + parent: builtins.str | None = ..., + time_series: collections.abc.Iterable[exabel.api.data.v1.time_series_messages_pb2.TimeSeries] | None = ..., + status_in_response: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["parent", b"parent", "status_in_response", b"status_in_response", "time_series", b"time_series"]) -> None: ... + +global___BatchDeleteTimeSeriesPointsRequest = BatchDeleteTimeSeriesPointsRequest + +@typing.final +class BatchDeleteTimeSeriesPointsResponse(google.protobuf.message.Message): + """The response to batch delete multiple time series points.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing.final + class BatchDeleteTimeSeriesResponse(google.protobuf.message.Message): + """The status for one time series.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TIME_SERIES_NAME_FIELD_NUMBER: builtins.int + STATUS_FIELD_NUMBER: builtins.int + time_series_name: builtins.str + """The resource name of the time series, for example + `entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors`. + """ + @property + def status(self) -> google.rpc.status_pb2.Status: + """The status for this time series. A `status.code = OK` indicates that all time series points + was deleted successfully. + """ + + def __init__( + self, + *, + time_series_name: builtins.str | None = ..., + status: google.rpc.status_pb2.Status | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["status", b"status"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["status", b"status", "time_series_name", b"time_series_name"]) -> None: ... + + RESPONSES_FIELD_NUMBER: builtins.int + @property + def responses(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BatchDeleteTimeSeriesPointsResponse.BatchDeleteTimeSeriesResponse]: + """One response for each time series, in order. This list is populated if and only if + `status_in_response` was set to `true` in the request. + """ + + def __init__( + self, + *, + responses: collections.abc.Iterable[global___BatchDeleteTimeSeriesPointsResponse.BatchDeleteTimeSeriesResponse] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["responses", b"responses"]) -> None: ... + +global___BatchDeleteTimeSeriesPointsResponse = BatchDeleteTimeSeriesPointsResponse diff --git a/exabel/stubs/exabel/api/data/v1/time_series_service_pb2_grpc.py b/exabel/stubs/exabel/api/data/v1/time_series_service_pb2_grpc.py new file mode 100644 index 00000000..73a9fc11 --- /dev/null +++ b/exabel/stubs/exabel/api/data/v1/time_series_service_pb2_grpc.py @@ -0,0 +1,448 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import time_series_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2 +from . import time_series_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/data/v1/time_series_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class TimeSeriesServiceStub(object): + """Service for managing time series. See the User Guide for more information about time series: + https://help.exabel.com/docs/time-series + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListTimeSeries = channel.unary_unary( + '/exabel.api.data.v1.TimeSeriesService/ListTimeSeries', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesResponse.FromString, + _registered_method=True) + self.GetTimeSeries = channel.unary_unary( + '/exabel.api.data.v1.TimeSeriesService/GetTimeSeries', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.GetTimeSeriesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, + _registered_method=True) + self.CreateTimeSeries = channel.unary_unary( + '/exabel.api.data.v1.TimeSeriesService/CreateTimeSeries', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.CreateTimeSeriesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, + _registered_method=True) + self.UpdateTimeSeries = channel.unary_unary( + '/exabel.api.data.v1.TimeSeriesService/UpdateTimeSeries', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.UpdateTimeSeriesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, + _registered_method=True) + self.ImportTimeSeries = channel.unary_unary( + '/exabel.api.data.v1.TimeSeriesService/ImportTimeSeries', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesResponse.FromString, + _registered_method=True) + self.BatchDeleteTimeSeriesPoints = channel.unary_unary( + '/exabel.api.data.v1.TimeSeriesService/BatchDeleteTimeSeriesPoints', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsResponse.FromString, + _registered_method=True) + self.DeleteTimeSeries = channel.unary_unary( + '/exabel.api.data.v1.TimeSeriesService/DeleteTimeSeries', + request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.DeleteTimeSeriesRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + + +class TimeSeriesServiceServicer(object): + """Service for managing time series. See the User Guide for more information about time series: + https://help.exabel.com/docs/time-series + """ + + def ListTimeSeries(self, request, context): + """Lists time series. + + Lists all time series for one entity or for one signal. Only the names are returned. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetTimeSeries(self, request, context): + """Gets one time series. + + Use this method to get time series data points. + + *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps + must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateTimeSeries(self, request, context): + """Creates one time series. + + *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps + must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. + + The default `known_time` for a data point is insertion time, i.e. same as setting + `current_time` to `true`. To override the default behaviour, set one of the + `default_known_time` fields. + + The optional `view` argument lets you request for time series data points to be returned + within a date range. If this is not set, no values are returned. + + It is also possible to create a time series by calling `UpdateTimeSeries` + with `allow_missing` set to `true`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateTimeSeries(self, request, context): + """Updates one time series. + + This can also be used to create a time series by setting `allow_missing` to `true`. + + Updating a time series will usually create a new version of the time series. However, by + explicitly setting a known time, any version may be changed or updated. If a value already + exists with exactly the same timestamp *and* known time, it will be updated. Otherwise a new + point will be created. + + If a timestamp that is previously known is not included, its value is *not* deleted, even + though it is within the range of this update. The old value will simply continue to exist at + the new version. Data points without values are cleared from this version, meaning that the + old value will continue to exist up until the new version, then cease to exist. + + Time series storage is optimized by discarding values which haven't changed from the previous + versions. Note that this optimization may cause surprising behavior when updating older + versions. When older versions are updated, it is therefore recommended to perform a full + backload from this version on. + + The default `known_time` for a data point is insertion time, i.e. same as setting + `current_time` to `true`. To override the default behaviour, set one of the + `default_known_time` fields. + + *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps + must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. + + The optional `view` argument lets you request for time series data points to be returned + within a date range. If this is not set, no values are returned. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ImportTimeSeries(self, request, context): + """Creates or update multiple time series. + + Import multiple time series in bulk, by creating new time series or updating existing time + series. + + If you would like to import multiple time series belonging to different signals, specify `-` + as the signal identifier. (Signal identifiers are part of each time series' resource name, so + your time series will still be assigned to their corresponding signals.) + + The default `known_time` for a data point is insertion time, i.e. same as setting + `current_time` to `true`. To override the default behaviour, set one of the + `default_known_time` fields. + + *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps + must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchDeleteTimeSeriesPoints(self, request, context): + """Deletes specific time series points for multiple time series. + + Delete multiple time series points in bulk, by erasing the points from the storage. Use with + care: Time series storage is optimized by discarding values which haven't changed from the + previous versions. Note that this optimization may cause surprising behavior when updating + older versions. When older versions are deleted, it is therefore recommended to perform a full + backload from this version on. + + Deleting a value is both different from inserting NaN values, or inserting _no_ value. + + If you would like to delete multiple time series points belonging to different signals, + specify `-` as the signal identifier. (Signal identifiers are part of each time series' + resource name, so your time series will still be assigned to their corresponding signals.) + + *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps + must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteTimeSeries(self, request, context): + """Deletes one time series. + + This will delete the time series and ***all*** its data points. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_TimeSeriesServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListTimeSeries': grpc.unary_unary_rpc_method_handler( + servicer.ListTimeSeries, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesResponse.SerializeToString, + ), + 'GetTimeSeries': grpc.unary_unary_rpc_method_handler( + servicer.GetTimeSeries, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.GetTimeSeriesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.SerializeToString, + ), + 'CreateTimeSeries': grpc.unary_unary_rpc_method_handler( + servicer.CreateTimeSeries, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.CreateTimeSeriesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.SerializeToString, + ), + 'UpdateTimeSeries': grpc.unary_unary_rpc_method_handler( + servicer.UpdateTimeSeries, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.UpdateTimeSeriesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.SerializeToString, + ), + 'ImportTimeSeries': grpc.unary_unary_rpc_method_handler( + servicer.ImportTimeSeries, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesResponse.SerializeToString, + ), + 'BatchDeleteTimeSeriesPoints': grpc.unary_unary_rpc_method_handler( + servicer.BatchDeleteTimeSeriesPoints, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsRequest.FromString, + response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsResponse.SerializeToString, + ), + 'DeleteTimeSeries': grpc.unary_unary_rpc_method_handler( + servicer.DeleteTimeSeries, + request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.DeleteTimeSeriesRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.data.v1.TimeSeriesService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.data.v1.TimeSeriesService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class TimeSeriesService(object): + """Service for managing time series. See the User Guide for more information about time series: + https://help.exabel.com/docs/time-series + """ + + @staticmethod + def ListTimeSeries(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.TimeSeriesService/ListTimeSeries', + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetTimeSeries(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.TimeSeriesService/GetTimeSeries', + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.GetTimeSeriesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateTimeSeries(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.TimeSeriesService/CreateTimeSeries', + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.CreateTimeSeriesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateTimeSeries(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.TimeSeriesService/UpdateTimeSeries', + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.UpdateTimeSeriesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ImportTimeSeries(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.TimeSeriesService/ImportTimeSeries', + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def BatchDeleteTimeSeriesPoints(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.TimeSeriesService/BatchDeleteTimeSeriesPoints', + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsRequest.SerializeToString, + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteTimeSeries(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.data.v1.TimeSeriesService/DeleteTimeSeries', + exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.DeleteTimeSeriesRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel_data_sdk/stubs/exabel/api/management/__init__.py b/exabel/stubs/exabel/api/management/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/management/__init__.py rename to exabel/stubs/exabel/api/management/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/management/__init__.pyi b/exabel/stubs/exabel/api/management/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/management/__init__.pyi rename to exabel/stubs/exabel/api/management/__init__.pyi diff --git a/exabel_data_sdk/stubs/exabel/api/management/all_pb2.py b/exabel/stubs/exabel/api/management/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/management/all_pb2.py rename to exabel/stubs/exabel/api/management/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/management/all_pb2_grpc.py b/exabel/stubs/exabel/api/management/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/management/all_pb2_grpc.py rename to exabel/stubs/exabel/api/management/all_pb2_grpc.py diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/__init__.py b/exabel/stubs/exabel/api/management/v1/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/management/v1/__init__.py rename to exabel/stubs/exabel/api/management/v1/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/__init__.pyi b/exabel/stubs/exabel/api/management/v1/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/management/v1/__init__.pyi rename to exabel/stubs/exabel/api/management/v1/__init__.pyi diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/all_pb2.py b/exabel/stubs/exabel/api/management/v1/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/management/v1/all_pb2.py rename to exabel/stubs/exabel/api/management/v1/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/all_pb2_grpc.py b/exabel/stubs/exabel/api/management/v1/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/management/v1/all_pb2_grpc.py rename to exabel/stubs/exabel/api/management/v1/all_pb2_grpc.py diff --git a/exabel/stubs/exabel/api/management/v1/folder_messages_pb2.py b/exabel/stubs/exabel/api/management/v1/folder_messages_pb2.py new file mode 100644 index 00000000..14d2b421 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/folder_messages_pb2.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/management/v1/folder_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/management/v1/folder_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import user_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_user__messages__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.exabel/api/management/v1/folder_messages.proto\x12\x18\x65xabel.api.management.v1\x1a,exabel/api/management/v1/user_messages.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\xf3\x01\n\x06\x46older\x12\x30\n\x04name\x18\x01 \x01(\tB\"\x92\x41\x1fJ\r\"folders/123\"\xca>\r\xfa\x02\nfolderName\x12\x30\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x1a\x92\x41\x14J\x12\"My shared folder\"\xe0\x41\x02\x12\x34\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x1f\x92\x41\x1cJ\x1a\"This is my shared folder\"\x12\x12\n\x05write\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x12;\n\x05items\x18\x04 \x03(\x0b\x32$.exabel.api.management.v1.FolderItemB\x06\xe0\x41\x06\xe0\x41\x03\"\xf0\x02\n\nFolderItem\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\x92\x41\x1fJ\r\"folders/123\"\xca>\r\xfa\x02\nfolderName\x12*\n\x04name\x18\x02 \x01(\tB\x1c\x92\x41\x16J\x14\"derivedSignals/123\"\xe0\x41\x03\x12&\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x10\x92\x41\rJ\x0b\"my_signal\"\x12\x13\n\x0b\x64\x65scription\x18\t \x01(\t\x12;\n\titem_type\x18\x04 \x01(\x0e\x32(.exabel.api.management.v1.FolderItemType\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\ncreated_by\x18\x07 \x01(\t\x12\x12\n\nupdated_by\x18\x08 \x01(\t\"O\n\x0e\x46olderAccessor\x12.\n\x05group\x18\x01 \x01(\x0b\x32\x1f.exabel.api.management.v1.Group\x12\r\n\x05write\x18\x02 \x01(\x08\"B\n\x0cSearchResult\x12\x32\n\x04item\x18\x01 \x01(\x0b\x32$.exabel.api.management.v1.FolderItem*\xe0\x01\n\x0e\x46olderItemType\x12\x1c\n\x18\x46OLDER_ITEM_TYPE_INVALID\x10\x00\x12\x12\n\x0e\x44\x45RIVED_SIGNAL\x10\x01\x12\x14\n\x10PREDICTION_MODEL\x10\x02\x12\x16\n\x12PORTFOLIO_STRATEGY\x10\x03\x12\r\n\tDASHBOARD\x10\x04\x12\x0e\n\nDRILL_DOWN\x10\x05\x12\x07\n\x03TAG\x10\x06\x12\n\n\x06SCREEN\x10\x07\x12\x13\n\x0f\x46INANCIAL_MODEL\x10\x08\x12\t\n\x05\x43HART\x10\t\x12\x0f\n\x0bKPI_MAPPING\x10\n\x12\t\n\x05\x41LERT\x10\x0b\x42S\n\x1c\x63om.exabel.api.management.v1B\x13\x46olderMessagesProtoP\x01Z\x1c\x65xabel.com/api/management/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.folder_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\034com.exabel.api.management.v1B\023FolderMessagesProtoP\001Z\034exabel.com/api/management/v1' + _globals['_FOLDER'].fields_by_name['name']._loaded_options = None + _globals['_FOLDER'].fields_by_name['name']._serialized_options = b'\222A\037J\r\"folders/123\"\312>\r\372\002\nfolderName' + _globals['_FOLDER'].fields_by_name['display_name']._loaded_options = None + _globals['_FOLDER'].fields_by_name['display_name']._serialized_options = b'\222A\024J\022\"My shared folder\"\340A\002' + _globals['_FOLDER'].fields_by_name['description']._loaded_options = None + _globals['_FOLDER'].fields_by_name['description']._serialized_options = b'\222A\034J\032\"This is my shared folder\"' + _globals['_FOLDER'].fields_by_name['write']._loaded_options = None + _globals['_FOLDER'].fields_by_name['write']._serialized_options = b'\340A\003' + _globals['_FOLDER'].fields_by_name['items']._loaded_options = None + _globals['_FOLDER'].fields_by_name['items']._serialized_options = b'\340A\006\340A\003' + _globals['_FOLDERITEM'].fields_by_name['parent']._loaded_options = None + _globals['_FOLDERITEM'].fields_by_name['parent']._serialized_options = b'\222A\037J\r\"folders/123\"\312>\r\372\002\nfolderName' + _globals['_FOLDERITEM'].fields_by_name['name']._loaded_options = None + _globals['_FOLDERITEM'].fields_by_name['name']._serialized_options = b'\222A\026J\024\"derivedSignals/123\"\340A\003' + _globals['_FOLDERITEM'].fields_by_name['display_name']._loaded_options = None + _globals['_FOLDERITEM'].fields_by_name['display_name']._serialized_options = b'\222A\rJ\013\"my_signal\"' + _globals['_FOLDERITEMTYPE']._serialized_start=1003 + _globals['_FOLDERITEMTYPE']._serialized_end=1227 + _globals['_FOLDER']._serialized_start=237 + _globals['_FOLDER']._serialized_end=480 + _globals['_FOLDERITEM']._serialized_start=483 + _globals['_FOLDERITEM']._serialized_end=851 + _globals['_FOLDERACCESSOR']._serialized_start=853 + _globals['_FOLDERACCESSOR']._serialized_end=932 + _globals['_SEARCHRESULT']._serialized_start=934 + _globals['_SEARCHRESULT']._serialized_end=1000 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/management/v1/folder_messages_pb2.pyi b/exabel/stubs/exabel/api/management/v1/folder_messages_pb2.pyi new file mode 100644 index 00000000..2d791bca --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/folder_messages_pb2.pyi @@ -0,0 +1,222 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2022 Exabel AS. All rights reserved.""" + +import builtins +import collections.abc +from . import user_messages_pb2 +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import google.protobuf.timestamp_pb2 +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions +from ..... import exabel + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _FolderItemType: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _FolderItemTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_FolderItemType.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + FOLDER_ITEM_TYPE_INVALID: _FolderItemType.ValueType # 0 + """Invalid item type.""" + DERIVED_SIGNAL: _FolderItemType.ValueType # 1 + """Derived signal.""" + PREDICTION_MODEL: _FolderItemType.ValueType # 2 + """Prediction model.""" + PORTFOLIO_STRATEGY: _FolderItemType.ValueType # 3 + """Portfolio strategy.""" + DASHBOARD: _FolderItemType.ValueType # 4 + """Dashboard.""" + DRILL_DOWN: _FolderItemType.ValueType # 5 + """Company or entity drill down view.""" + TAG: _FolderItemType.ValueType # 6 + """Static tag.""" + SCREEN: _FolderItemType.ValueType # 7 + """Screen.""" + FINANCIAL_MODEL: _FolderItemType.ValueType # 8 + """Financial model.""" + CHART: _FolderItemType.ValueType # 9 + """Chart.""" + KPI_MAPPING: _FolderItemType.ValueType # 10 + """KPI mapping.""" + ALERT: _FolderItemType.ValueType # 11 + """Alert.""" + +class FolderItemType(_FolderItemType, metaclass=_FolderItemTypeEnumTypeWrapper): + """An enum representing the type of a folder item.""" + +FOLDER_ITEM_TYPE_INVALID: FolderItemType.ValueType # 0 +"""Invalid item type.""" +DERIVED_SIGNAL: FolderItemType.ValueType # 1 +"""Derived signal.""" +PREDICTION_MODEL: FolderItemType.ValueType # 2 +"""Prediction model.""" +PORTFOLIO_STRATEGY: FolderItemType.ValueType # 3 +"""Portfolio strategy.""" +DASHBOARD: FolderItemType.ValueType # 4 +"""Dashboard.""" +DRILL_DOWN: FolderItemType.ValueType # 5 +"""Company or entity drill down view.""" +TAG: FolderItemType.ValueType # 6 +"""Static tag.""" +SCREEN: FolderItemType.ValueType # 7 +"""Screen.""" +FINANCIAL_MODEL: FolderItemType.ValueType # 8 +"""Financial model.""" +CHART: FolderItemType.ValueType # 9 +"""Chart.""" +KPI_MAPPING: FolderItemType.ValueType # 10 +"""KPI mapping.""" +ALERT: FolderItemType.ValueType # 11 +"""Alert.""" +global___FolderItemType = FolderItemType + +@typing.final +class Folder(google.protobuf.message.Message): + """A folder.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + WRITE_FIELD_NUMBER: builtins.int + ITEMS_FIELD_NUMBER: builtins.int + name: builtins.str + """Unique resource name of the folder, e.g. `folders/123`. In the "Create folder" method, this is + ignored and may be left empty. + """ + display_name: builtins.str + """Appears in the Exabel Library in the list of folders.""" + description: builtins.str + """The description of the folder.""" + write: builtins.bool + """Whether the API caller has write access to the folder.""" + @property + def items(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FolderItem]: + """List of items in the folder. To add or remove folder items, use the "Move folder items" method.""" + + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + description: builtins.str | None = ..., + write: builtins.bool | None = ..., + items: collections.abc.Iterable[global___FolderItem] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "display_name", b"display_name", "items", b"items", "name", b"name", "write", b"write"]) -> None: ... + +global___Folder = Folder + +@typing.final +class FolderItem(google.protobuf.message.Message): + """An item in a folder.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARENT_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + DISPLAY_NAME_FIELD_NUMBER: builtins.int + DESCRIPTION_FIELD_NUMBER: builtins.int + ITEM_TYPE_FIELD_NUMBER: builtins.int + CREATE_TIME_FIELD_NUMBER: builtins.int + UPDATE_TIME_FIELD_NUMBER: builtins.int + CREATED_BY_FIELD_NUMBER: builtins.int + UPDATED_BY_FIELD_NUMBER: builtins.int + parent: builtins.str + """Resource name of the parent folder, e.g. `folders/123`.""" + name: builtins.str + """Resource name of the item, e.g. `derivedSignals/123` or `models/987`.""" + display_name: builtins.str + """Appears in the Exabel Library when viewing items in a folder, and also when the item is opened.""" + description: builtins.str + """Appears in the Exabel Library under each item, and when the item is opened.""" + item_type: global___FolderItemType.ValueType + """Item type.""" + created_by: builtins.str + """Resource name of the user who created the item.""" + updated_by: builtins.str + """Resource name of the user who last updated the item.""" + @property + def create_time(self) -> google.protobuf.timestamp_pb2.Timestamp: + """When the item was created.""" + + @property + def update_time(self) -> google.protobuf.timestamp_pb2.Timestamp: + """When the item was last updated.""" + + def __init__( + self, + *, + parent: builtins.str | None = ..., + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + description: builtins.str | None = ..., + item_type: global___FolderItemType.ValueType | None = ..., + create_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + update_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + created_by: builtins.str | None = ..., + updated_by: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["create_time", b"create_time", "update_time", b"update_time"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["create_time", b"create_time", "created_by", b"created_by", "description", b"description", "display_name", b"display_name", "item_type", b"item_type", "name", b"name", "parent", b"parent", "update_time", b"update_time", "updated_by", b"updated_by"]) -> None: ... + +global___FolderItem = FolderItem + +@typing.final +class FolderAccessor(google.protobuf.message.Message): + """An accessor of a folder.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + GROUP_FIELD_NUMBER: builtins.int + WRITE_FIELD_NUMBER: builtins.int + write: builtins.bool + """Whether the user group has write access. Read access is implied.""" + @property + def group(self) -> exabel.api.management.v1.user_messages_pb2.Group: + """User group that has access to the folder.""" + + def __init__( + self, + *, + group: exabel.api.management.v1.user_messages_pb2.Group | None = ..., + write: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["group", b"group"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["group", b"group", "write", b"write"]) -> None: ... + +global___FolderAccessor = FolderAccessor + +@typing.final +class SearchResult(google.protobuf.message.Message): + """A search result.""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ITEM_FIELD_NUMBER: builtins.int + @property + def item(self) -> global___FolderItem: + """The folder item.""" + + def __init__( + self, + *, + item: global___FolderItem | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["item", b"item"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["item", b"item"]) -> None: ... + +global___SearchResult = SearchResult diff --git a/exabel/stubs/exabel/api/management/v1/folder_messages_pb2_grpc.py b/exabel/stubs/exabel/api/management/v1/folder_messages_pb2_grpc.py new file mode 100644 index 00000000..4b9c9d14 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/folder_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/management/v1/folder_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/management/v1/library_service_pb2.py b/exabel/stubs/exabel/api/management/v1/library_service_pb2.py new file mode 100644 index 00000000..0a2cc614 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/library_service_pb2.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/management/v1/library_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/management/v1/library_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import folder_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.exabel/api/management/v1/library_service.proto\x12\x18\x65xabel.api.management.v1\x1a.exabel/api/management/v1/folder_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x14\n\x12ListFoldersRequest\"H\n\x13ListFoldersResponse\x12\x31\n\x07\x66olders\x18\x01 \x03(\x0b\x32 .exabel.api.management.v1.Folder\"8\n\x10GetFolderRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92\x41\x10\xca>\r\xfa\x02\nfolderName\xe0\x41\x02\"L\n\x13\x43reateFolderRequest\x12\x35\n\x06\x66older\x18\x01 \x01(\x0b\x32 .exabel.api.management.v1.FolderB\x03\xe0\x41\x02\"\x94\x01\n\x13UpdateFolderRequest\x12\x35\n\x06\x66older\x18\x01 \x01(\x0b\x32 .exabel.api.management.v1.FolderB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\";\n\x13\x44\x65leteFolderRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92\x41\x10\xca>\r\xfa\x02\nfolderName\xe0\x41\x02\"\x86\x01\n\x10ListItemsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\x92\x41\x1fJ\r\"folders/123\"\xca>\r\xfa\x02\nfolderName\xe0\x41\x01\x12;\n\titem_type\x18\x02 \x01(\x0e\x32(.exabel.api.management.v1.FolderItemType\"H\n\x11ListItemsResponse\x12\x33\n\x05items\x18\x01 \x03(\x0b\x32$.exabel.api.management.v1.FolderItem\"U\n\x10MoveItemsRequest\x12\x12\n\x05items\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12-\n\rtarget_folder\x18\x02 \x01(\tB\x16\x92\x41\x10\xca>\r\xfa\x02\nfolderName\xe0\x41\x02\"\x13\n\x11MoveItemsResponse\"?\n\x1aListFolderAccessorsRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92\x41\x10\xca>\r\xfa\x02\nfolderName\"a\n\x1bListFolderAccessorsResponse\x12\x42\n\x10\x66older_accessors\x18\x01 \x03(\x0b\x32(.exabel.api.management.v1.FolderAccessor\"y\n\x12ShareFolderRequest\x12\x32\n\x06\x66older\x18\x01 \x01(\tB\"\x92\x41\x1fJ\r\"folders/123\"\xca>\r\xfa\x02\nfolderName\x12 \n\x05group\x18\x02 \x01(\tB\x11\x92\x41\x0eJ\x0c\"groups/123\"\x12\r\n\x05write\x18\x03 \x01(\x08\"l\n\x14UnshareFolderRequest\x12\x32\n\x06\x66older\x18\x01 \x01(\tB\"\x92\x41\x1fJ\r\"folders/123\"\xca>\r\xfa\x02\nfolderName\x12 \n\x05group\x18\x02 \x01(\tB\x11\x92\x41\x0eJ\x0c\"groups/123\"\"\xd0\x01\n\x12SearchItemsRequest\x12=\n\x06\x66older\x18\x01 \x01(\tB-\x92\x41\'J\x0b\"folders/-\"\xca>\x17\xfa\x02\x14\x66olderNameAllFolders\xe0\x41\x02\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12@\n\titem_type\x18\x03 \x01(\x0e\x32(.exabel.api.management.v1.FolderItemTypeB\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x11\n\tpage_size\x18\x05 \x01(\x05\"g\n\x13SearchItemsResponse\x12\x37\n\x07results\x18\x01 \x03(\x0b\x32&.exabel.api.management.v1.SearchResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xdc\r\n\x0eLibraryService\x12\x90\x01\n\x0bListFolders\x12,.exabel.api.management.v1.ListFoldersRequest\x1a-.exabel.api.management.v1.ListFoldersResponse\"$\x92\x41\x0e\x12\x0cList folders\x82\xd3\xe4\x93\x02\r\x12\x0b/v1/folders\x12\x86\x01\n\tGetFolder\x12*.exabel.api.management.v1.GetFolderRequest\x1a .exabel.api.management.v1.Folder\"+\x92\x41\x0c\x12\nGet folder\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/{name=folders/*}\x12\x8e\x01\n\x0c\x43reateFolder\x12-.exabel.api.management.v1.CreateFolderRequest\x1a .exabel.api.management.v1.Folder\"-\x92\x41\x0f\x12\rCreate folder\x82\xd3\xe4\x93\x02\x15\"\x0b/v1/folders:\x06\x66older\x12\x9e\x01\n\x0cUpdateFolder\x12-.exabel.api.management.v1.UpdateFolderRequest\x1a .exabel.api.management.v1.Folder\"=\x92\x41\x0f\x12\rUpdate folder\x82\xd3\xe4\x93\x02%2\x1b/v1/{folder.name=folders/*}:\x06\x66older\x12\x85\x01\n\x0c\x44\x65leteFolder\x12-.exabel.api.management.v1.DeleteFolderRequest\x1a\x16.google.protobuf.Empty\".\x92\x41\x0f\x12\rDelete folder\x82\xd3\xe4\x93\x02\x16*\x14/v1/{name=folders/*}\x12\xa0\x01\n\tListItems\x12*.exabel.api.management.v1.ListItemsRequest\x1a+.exabel.api.management.v1.ListItemsResponse\":\x92\x41\x13\x12\x11List folder items\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{parent=folders/*}/items\x12\xab\x01\n\tMoveItems\x12*.exabel.api.management.v1.MoveItemsRequest\x1a+.exabel.api.management.v1.MoveItemsResponse\"E\x92\x41\x13\x12\x11Move folder items\x82\xd3\xe4\x93\x02)\"\'/v1/{target_folder=folders/*}:moveItems\x12\xc4\x01\n\x13ListFolderAccessors\x12\x34.exabel.api.management.v1.ListFolderAccessorsRequest\x1a\x35.exabel.api.management.v1.ListFolderAccessorsResponse\"@\x92\x41\x17\x12\x15List folder accessors\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{name=folders/*}/accessors\x12\x8d\x01\n\x0bShareFolder\x12,.exabel.api.management.v1.ShareFolderRequest\x1a\x16.google.protobuf.Empty\"8\x92\x41\x0e\x12\x0cShare folder\x82\xd3\xe4\x93\x02!\"\x1c/v1/{folder=folders/*}:share:\x01*\x12\x95\x01\n\rUnshareFolder\x12..exabel.api.management.v1.UnshareFolderRequest\x1a\x16.google.protobuf.Empty\"<\x92\x41\x10\x12\x0eUnshare folder\x82\xd3\xe4\x93\x02#\"\x1e/v1/{folder=folders/*}:unshare:\x01*\x12\xb3\x01\n\x0bSearchItems\x12,.exabel.api.management.v1.SearchItemsRequest\x1a-.exabel.api.management.v1.SearchItemsResponse\"G\x92\x41\x19\x12\x17Search for folder items\x82\xd3\xe4\x93\x02%\x12#/v1/{folder=folders/*}/items:searchBS\n\x1c\x63om.exabel.api.management.v1B\x13LibraryServiceProtoP\x01Z\x1c\x65xabel.com/api/management/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.library_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\034com.exabel.api.management.v1B\023LibraryServiceProtoP\001Z\034exabel.com/api/management/v1' + _globals['_GETFOLDERREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_GETFOLDERREQUEST'].fields_by_name['name']._serialized_options = b'\222A\020\312>\r\372\002\nfolderName\340A\002' + _globals['_CREATEFOLDERREQUEST'].fields_by_name['folder']._loaded_options = None + _globals['_CREATEFOLDERREQUEST'].fields_by_name['folder']._serialized_options = b'\340A\002' + _globals['_UPDATEFOLDERREQUEST'].fields_by_name['folder']._loaded_options = None + _globals['_UPDATEFOLDERREQUEST'].fields_by_name['folder']._serialized_options = b'\340A\002' + _globals['_DELETEFOLDERREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_DELETEFOLDERREQUEST'].fields_by_name['name']._serialized_options = b'\222A\020\312>\r\372\002\nfolderName\340A\002' + _globals['_LISTITEMSREQUEST'].fields_by_name['parent']._loaded_options = None + _globals['_LISTITEMSREQUEST'].fields_by_name['parent']._serialized_options = b'\222A\037J\r\"folders/123\"\312>\r\372\002\nfolderName\340A\001' + _globals['_MOVEITEMSREQUEST'].fields_by_name['items']._loaded_options = None + _globals['_MOVEITEMSREQUEST'].fields_by_name['items']._serialized_options = b'\340A\002' + _globals['_MOVEITEMSREQUEST'].fields_by_name['target_folder']._loaded_options = None + _globals['_MOVEITEMSREQUEST'].fields_by_name['target_folder']._serialized_options = b'\222A\020\312>\r\372\002\nfolderName\340A\002' + _globals['_LISTFOLDERACCESSORSREQUEST'].fields_by_name['name']._loaded_options = None + _globals['_LISTFOLDERACCESSORSREQUEST'].fields_by_name['name']._serialized_options = b'\222A\020\312>\r\372\002\nfolderName' + _globals['_SHAREFOLDERREQUEST'].fields_by_name['folder']._loaded_options = None + _globals['_SHAREFOLDERREQUEST'].fields_by_name['folder']._serialized_options = b'\222A\037J\r\"folders/123\"\312>\r\372\002\nfolderName' + _globals['_SHAREFOLDERREQUEST'].fields_by_name['group']._loaded_options = None + _globals['_SHAREFOLDERREQUEST'].fields_by_name['group']._serialized_options = b'\222A\016J\014\"groups/123\"' + _globals['_UNSHAREFOLDERREQUEST'].fields_by_name['folder']._loaded_options = None + _globals['_UNSHAREFOLDERREQUEST'].fields_by_name['folder']._serialized_options = b'\222A\037J\r\"folders/123\"\312>\r\372\002\nfolderName' + _globals['_UNSHAREFOLDERREQUEST'].fields_by_name['group']._loaded_options = None + _globals['_UNSHAREFOLDERREQUEST'].fields_by_name['group']._serialized_options = b'\222A\016J\014\"groups/123\"' + _globals['_SEARCHITEMSREQUEST'].fields_by_name['folder']._loaded_options = None + _globals['_SEARCHITEMSREQUEST'].fields_by_name['folder']._serialized_options = b'\222A\'J\013\"folders/-\"\312>\027\372\002\024folderNameAllFolders\340A\002' + _globals['_SEARCHITEMSREQUEST'].fields_by_name['query']._loaded_options = None + _globals['_SEARCHITEMSREQUEST'].fields_by_name['query']._serialized_options = b'\340A\002' + _globals['_SEARCHITEMSREQUEST'].fields_by_name['item_type']._loaded_options = None + _globals['_SEARCHITEMSREQUEST'].fields_by_name['item_type']._serialized_options = b'\340A\001' + _globals['_LIBRARYSERVICE'].methods_by_name['ListFolders']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['ListFolders']._serialized_options = b'\222A\016\022\014List folders\202\323\344\223\002\r\022\013/v1/folders' + _globals['_LIBRARYSERVICE'].methods_by_name['GetFolder']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['GetFolder']._serialized_options = b'\222A\014\022\nGet folder\202\323\344\223\002\026\022\024/v1/{name=folders/*}' + _globals['_LIBRARYSERVICE'].methods_by_name['CreateFolder']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['CreateFolder']._serialized_options = b'\222A\017\022\rCreate folder\202\323\344\223\002\025\"\013/v1/folders:\006folder' + _globals['_LIBRARYSERVICE'].methods_by_name['UpdateFolder']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['UpdateFolder']._serialized_options = b'\222A\017\022\rUpdate folder\202\323\344\223\002%2\033/v1/{folder.name=folders/*}:\006folder' + _globals['_LIBRARYSERVICE'].methods_by_name['DeleteFolder']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['DeleteFolder']._serialized_options = b'\222A\017\022\rDelete folder\202\323\344\223\002\026*\024/v1/{name=folders/*}' + _globals['_LIBRARYSERVICE'].methods_by_name['ListItems']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['ListItems']._serialized_options = b'\222A\023\022\021List folder items\202\323\344\223\002\036\022\034/v1/{parent=folders/*}/items' + _globals['_LIBRARYSERVICE'].methods_by_name['MoveItems']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['MoveItems']._serialized_options = b'\222A\023\022\021Move folder items\202\323\344\223\002)\"\'/v1/{target_folder=folders/*}:moveItems' + _globals['_LIBRARYSERVICE'].methods_by_name['ListFolderAccessors']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['ListFolderAccessors']._serialized_options = b'\222A\027\022\025List folder accessors\202\323\344\223\002 \022\036/v1/{name=folders/*}/accessors' + _globals['_LIBRARYSERVICE'].methods_by_name['ShareFolder']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['ShareFolder']._serialized_options = b'\222A\016\022\014Share folder\202\323\344\223\002!\"\034/v1/{folder=folders/*}:share:\001*' + _globals['_LIBRARYSERVICE'].methods_by_name['UnshareFolder']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['UnshareFolder']._serialized_options = b'\222A\020\022\016Unshare folder\202\323\344\223\002#\"\036/v1/{folder=folders/*}:unshare:\001*' + _globals['_LIBRARYSERVICE'].methods_by_name['SearchItems']._loaded_options = None + _globals['_LIBRARYSERVICE'].methods_by_name['SearchItems']._serialized_options = b'\222A\031\022\027Search for folder items\202\323\344\223\002%\022#/v1/{folder=folders/*}/items:search' + _globals['_LISTFOLDERSREQUEST']._serialized_start=298 + _globals['_LISTFOLDERSREQUEST']._serialized_end=318 + _globals['_LISTFOLDERSRESPONSE']._serialized_start=320 + _globals['_LISTFOLDERSRESPONSE']._serialized_end=392 + _globals['_GETFOLDERREQUEST']._serialized_start=394 + _globals['_GETFOLDERREQUEST']._serialized_end=450 + _globals['_CREATEFOLDERREQUEST']._serialized_start=452 + _globals['_CREATEFOLDERREQUEST']._serialized_end=528 + _globals['_UPDATEFOLDERREQUEST']._serialized_start=531 + _globals['_UPDATEFOLDERREQUEST']._serialized_end=679 + _globals['_DELETEFOLDERREQUEST']._serialized_start=681 + _globals['_DELETEFOLDERREQUEST']._serialized_end=740 + _globals['_LISTITEMSREQUEST']._serialized_start=743 + _globals['_LISTITEMSREQUEST']._serialized_end=877 + _globals['_LISTITEMSRESPONSE']._serialized_start=879 + _globals['_LISTITEMSRESPONSE']._serialized_end=951 + _globals['_MOVEITEMSREQUEST']._serialized_start=953 + _globals['_MOVEITEMSREQUEST']._serialized_end=1038 + _globals['_MOVEITEMSRESPONSE']._serialized_start=1040 + _globals['_MOVEITEMSRESPONSE']._serialized_end=1059 + _globals['_LISTFOLDERACCESSORSREQUEST']._serialized_start=1061 + _globals['_LISTFOLDERACCESSORSREQUEST']._serialized_end=1124 + _globals['_LISTFOLDERACCESSORSRESPONSE']._serialized_start=1126 + _globals['_LISTFOLDERACCESSORSRESPONSE']._serialized_end=1223 + _globals['_SHAREFOLDERREQUEST']._serialized_start=1225 + _globals['_SHAREFOLDERREQUEST']._serialized_end=1346 + _globals['_UNSHAREFOLDERREQUEST']._serialized_start=1348 + _globals['_UNSHAREFOLDERREQUEST']._serialized_end=1456 + _globals['_SEARCHITEMSREQUEST']._serialized_start=1459 + _globals['_SEARCHITEMSREQUEST']._serialized_end=1667 + _globals['_SEARCHITEMSRESPONSE']._serialized_start=1669 + _globals['_SEARCHITEMSRESPONSE']._serialized_end=1772 + _globals['_LIBRARYSERVICE']._serialized_start=1775 + _globals['_LIBRARYSERVICE']._serialized_end=3531 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2.pyi b/exabel/stubs/exabel/api/management/v1/library_service_pb2.pyi similarity index 56% rename from exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2.pyi rename to exabel/stubs/exabel/api/management/v1/library_service_pb2.pyi index 58431350..2c5d6b67 100644 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2.pyi +++ b/exabel/stubs/exabel/api/management/v1/library_service_pb2.pyi @@ -2,31 +2,38 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import folder_messages_pb2 import google.protobuf.descriptor import google.protobuf.field_mask_pb2 import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class ListFoldersRequest(google.protobuf.message.Message): """Request to ListFolders.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... + def __init__( + self, + ) -> None: ... + global___ListFoldersRequest = ListFoldersRequest @typing.final class ListFoldersResponse(google.protobuf.message.Message): """Response from ListFolders.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - FOLDERS_FIELD_NUMBER: builtins.int + FOLDERS_FIELD_NUMBER: builtins.int @property def folders(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.management.v1.folder_messages_pb2.Folder]: """List of accessible folders. @@ -35,58 +42,67 @@ class ListFoldersResponse(google.protobuf.message.Message): or "List folder items" methods to retrieve items. """ - def __init__(self, *, folders: collections.abc.Iterable[exabel.api.management.v1.folder_messages_pb2.Folder] | None=...) -> None: - ... + def __init__( + self, + *, + folders: collections.abc.Iterable[exabel.api.management.v1.folder_messages_pb2.Folder] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["folders", b"folders"]) -> None: ... - def ClearField(self, field_name: typing.Literal['folders', b'folders']) -> None: - ... global___ListFoldersResponse = ListFoldersResponse @typing.final class GetFolderRequest(google.protobuf.message.Message): """Request to GetFolder.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The folder resource name.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """The folder resource name.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___GetFolderRequest = GetFolderRequest @typing.final class CreateFolderRequest(google.protobuf.message.Message): """Request to CreateFolder.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - FOLDER_FIELD_NUMBER: builtins.int + FOLDER_FIELD_NUMBER: builtins.int @property def folder(self) -> exabel.api.management.v1.folder_messages_pb2.Folder: """The folder to create. Only the display name and description can be set.""" - def __init__(self, *, folder: exabel.api.management.v1.folder_messages_pb2.Folder | None=...) -> None: - ... + def __init__( + self, + *, + folder: exabel.api.management.v1.folder_messages_pb2.Folder | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["folder", b"folder"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["folder", b"folder"]) -> None: ... - def HasField(self, field_name: typing.Literal['folder', b'folder']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['folder', b'folder']) -> None: - ... global___CreateFolderRequest = CreateFolderRequest @typing.final class UpdateFolderRequest(google.protobuf.message.Message): """Request to UpdateFolder.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FOLDER_FIELD_NUMBER: builtins.int UPDATE_MASK_FIELD_NUMBER: builtins.int ALLOW_MISSING_FIELD_NUMBER: builtins.int allow_missing: builtins.bool - 'If set to `true`, a new folder will be created if it did not exist, and `update_mask` is\n ignored.\n ' - + """If set to `true`, a new folder will be created if it did not exist, and `update_mask` is + ignored. + """ @property def folder(self) -> exabel.api.management.v1.folder_messages_pb2.Folder: """The updated folder. The resource name must be set. Only the display name, and description can @@ -102,211 +118,260 @@ class UpdateFolderRequest(google.protobuf.message.Message): For REST requests, this is a comma-separated string. """ - def __init__(self, *, folder: exabel.api.management.v1.folder_messages_pb2.Folder | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=..., allow_missing: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['folder', b'folder', 'update_mask', b'update_mask']) -> builtins.bool: - ... + def __init__( + self, + *, + folder: exabel.api.management.v1.folder_messages_pb2.Folder | None = ..., + update_mask: google.protobuf.field_mask_pb2.FieldMask | None = ..., + allow_missing: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["folder", b"folder", "update_mask", b"update_mask"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["allow_missing", b"allow_missing", "folder", b"folder", "update_mask", b"update_mask"]) -> None: ... - def ClearField(self, field_name: typing.Literal['allow_missing', b'allow_missing', 'folder', b'folder', 'update_mask', b'update_mask']) -> None: - ... global___UpdateFolderRequest = UpdateFolderRequest @typing.final class DeleteFolderRequest(google.protobuf.message.Message): """Request to DeleteFolder.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The resource name of the folder to delete, for example `folders/1`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... + """The resource name of the folder to delete, for example `folders/1`.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___DeleteFolderRequest = DeleteFolderRequest @typing.final class ListItemsRequest(google.protobuf.message.Message): """Request to ListItems.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PARENT_FIELD_NUMBER: builtins.int ITEM_TYPE_FIELD_NUMBER: builtins.int parent: builtins.str - 'The folder to list items from. Optional.' + """The folder to list items from. Optional.""" item_type: exabel.api.management.v1.folder_messages_pb2.FolderItemType.ValueType - 'Specify an item type to list.' - - def __init__(self, *, parent: builtins.str | None=..., item_type: exabel.api.management.v1.folder_messages_pb2.FolderItemType.ValueType | None=...) -> None: - ... + """Specify an item type to list.""" + def __init__( + self, + *, + parent: builtins.str | None = ..., + item_type: exabel.api.management.v1.folder_messages_pb2.FolderItemType.ValueType | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["item_type", b"item_type", "parent", b"parent"]) -> None: ... - def ClearField(self, field_name: typing.Literal['item_type', b'item_type', 'parent', b'parent']) -> None: - ... global___ListItemsRequest = ListItemsRequest @typing.final class ListItemsResponse(google.protobuf.message.Message): """Response from ListItems.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - ITEMS_FIELD_NUMBER: builtins.int + ITEMS_FIELD_NUMBER: builtins.int @property def items(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.management.v1.folder_messages_pb2.FolderItem]: """List of folder items.""" - def __init__(self, *, items: collections.abc.Iterable[exabel.api.management.v1.folder_messages_pb2.FolderItem] | None=...) -> None: - ... + def __init__( + self, + *, + items: collections.abc.Iterable[exabel.api.management.v1.folder_messages_pb2.FolderItem] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["items", b"items"]) -> None: ... - def ClearField(self, field_name: typing.Literal['items', b'items']) -> None: - ... global___ListItemsResponse = ListItemsResponse @typing.final class MoveItemsRequest(google.protobuf.message.Message): """Request to MoveItems.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + ITEMS_FIELD_NUMBER: builtins.int TARGET_FOLDER_FIELD_NUMBER: builtins.int target_folder: builtins.str - 'The resource name of the target folder, for example `folders/10`.' - + """The resource name of the target folder, for example `folders/10`.""" @property def items(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """List of resource names of the items to move, e.g. `models/123` or `derivedSignals/987`.""" - def __init__(self, *, items: collections.abc.Iterable[builtins.str] | None=..., target_folder: builtins.str | None=...) -> None: - ... + def __init__( + self, + *, + items: collections.abc.Iterable[builtins.str] | None = ..., + target_folder: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["items", b"items", "target_folder", b"target_folder"]) -> None: ... - def ClearField(self, field_name: typing.Literal['items', b'items', 'target_folder', b'target_folder']) -> None: - ... global___MoveItemsRequest = MoveItemsRequest @typing.final class MoveItemsResponse(google.protobuf.message.Message): """Response from MoveItems.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... + def __init__( + self, + ) -> None: ... + global___MoveItemsResponse = MoveItemsResponse @typing.final class ListFolderAccessorsRequest(google.protobuf.message.Message): """Request to ListFolderAccessors.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int name: builtins.str - 'The folder resource name.' + """The folder resource name.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name"]) -> None: ... - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... global___ListFolderAccessorsRequest = ListFolderAccessorsRequest @typing.final class ListFolderAccessorsResponse(google.protobuf.message.Message): """Response from ListFolderAccessors.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - FOLDER_ACCESSORS_FIELD_NUMBER: builtins.int + FOLDER_ACCESSORS_FIELD_NUMBER: builtins.int @property def folder_accessors(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.management.v1.folder_messages_pb2.FolderAccessor]: """List of user groups with access to the folder. This does not include the users in each user group - those may be queried through the UserService. """ - def __init__(self, *, folder_accessors: collections.abc.Iterable[exabel.api.management.v1.folder_messages_pb2.FolderAccessor] | None=...) -> None: - ... + def __init__( + self, + *, + folder_accessors: collections.abc.Iterable[exabel.api.management.v1.folder_messages_pb2.FolderAccessor] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["folder_accessors", b"folder_accessors"]) -> None: ... - def ClearField(self, field_name: typing.Literal['folder_accessors', b'folder_accessors']) -> None: - ... global___ListFolderAccessorsResponse = ListFolderAccessorsResponse @typing.final class ShareFolderRequest(google.protobuf.message.Message): """Request to ShareFolder.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FOLDER_FIELD_NUMBER: builtins.int GROUP_FIELD_NUMBER: builtins.int WRITE_FIELD_NUMBER: builtins.int folder: builtins.str - 'Resource name of the folder to share.' + """Resource name of the folder to share.""" group: builtins.str - 'Resource name of the user group to share the folder with.' + """Resource name of the user group to share the folder with.""" write: builtins.bool - 'Whether the user group should have write access.' - - def __init__(self, *, folder: builtins.str | None=..., group: builtins.str | None=..., write: builtins.bool | None=...) -> None: - ... + """Whether the user group should have write access.""" + def __init__( + self, + *, + folder: builtins.str | None = ..., + group: builtins.str | None = ..., + write: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["folder", b"folder", "group", b"group", "write", b"write"]) -> None: ... - def ClearField(self, field_name: typing.Literal['folder', b'folder', 'group', b'group', 'write', b'write']) -> None: - ... global___ShareFolderRequest = ShareFolderRequest @typing.final class UnshareFolderRequest(google.protobuf.message.Message): """Request to UnshareFolder.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FOLDER_FIELD_NUMBER: builtins.int GROUP_FIELD_NUMBER: builtins.int folder: builtins.str - 'Resource name of the folder to unshare.' + """Resource name of the folder to unshare.""" group: builtins.str - 'Resource name of the user group to unshare the folder from.' - - def __init__(self, *, folder: builtins.str | None=..., group: builtins.str | None=...) -> None: - ... + """Resource name of the user group to unshare the folder from.""" + def __init__( + self, + *, + folder: builtins.str | None = ..., + group: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["folder", b"folder", "group", b"group"]) -> None: ... - def ClearField(self, field_name: typing.Literal['folder', b'folder', 'group', b'group']) -> None: - ... global___UnshareFolderRequest = UnshareFolderRequest @typing.final class SearchItemsRequest(google.protobuf.message.Message): """Request to SearchItems.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FOLDER_FIELD_NUMBER: builtins.int QUERY_FIELD_NUMBER: builtins.int ITEM_TYPE_FIELD_NUMBER: builtins.int PAGE_TOKEN_FIELD_NUMBER: builtins.int PAGE_SIZE_FIELD_NUMBER: builtins.int folder: builtins.str - 'Resource name of the folder to search in. Only "folders/-", meaning all folders, is supported.' + """Resource name of the folder to search in. Only "folders/-", meaning all folders, is supported.""" query: builtins.str - 'Search query.' + """Search query.""" item_type: exabel.api.management.v1.folder_messages_pb2.FolderItemType.ValueType - 'The type of items to search for.\n If not set, all types are included in the result.\n ' + """The type of items to search for. + If not set, all types are included in the result. + """ page_token: builtins.str - 'Token for a specific page of results, as returned from a previous search request with the same\n query parameters.\n ' + """Token for a specific page of results, as returned from a previous search request with the same + query parameters. + """ page_size: builtins.int - 'Maximum number of results to return. Defaults to 20.' - - def __init__(self, *, folder: builtins.str | None=..., query: builtins.str | None=..., item_type: exabel.api.management.v1.folder_messages_pb2.FolderItemType.ValueType | None=..., page_token: builtins.str | None=..., page_size: builtins.int | None=...) -> None: - ... + """Maximum number of results to return. Defaults to 20.""" + def __init__( + self, + *, + folder: builtins.str | None = ..., + query: builtins.str | None = ..., + item_type: exabel.api.management.v1.folder_messages_pb2.FolderItemType.ValueType | None = ..., + page_token: builtins.str | None = ..., + page_size: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["folder", b"folder", "item_type", b"item_type", "page_size", b"page_size", "page_token", b"page_token", "query", b"query"]) -> None: ... - def ClearField(self, field_name: typing.Literal['folder', b'folder', 'item_type', b'item_type', 'page_size', b'page_size', 'page_token', b'page_token', 'query', b'query']) -> None: - ... global___SearchItemsRequest = SearchItemsRequest @typing.final class SearchItemsResponse(google.protobuf.message.Message): """Response from SearchItems.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + RESULTS_FIELD_NUMBER: builtins.int NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int next_page_token: builtins.str - 'Continuation token. If non-empty, there may be more results to retrieve.' - + """Continuation token. If non-empty, there may be more results to retrieve.""" @property def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.management.v1.folder_messages_pb2.SearchResult]: """Search results.""" - def __init__(self, *, results: collections.abc.Iterable[exabel.api.management.v1.folder_messages_pb2.SearchResult] | None=..., next_page_token: builtins.str | None=...) -> None: - ... + def __init__( + self, + *, + results: collections.abc.Iterable[exabel.api.management.v1.folder_messages_pb2.SearchResult] | None = ..., + next_page_token: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["next_page_token", b"next_page_token", "results", b"results"]) -> None: ... - def ClearField(self, field_name: typing.Literal['next_page_token', b'next_page_token', 'results', b'results']) -> None: - ... -global___SearchItemsResponse = SearchItemsResponse \ No newline at end of file +global___SearchItemsResponse = SearchItemsResponse diff --git a/exabel/stubs/exabel/api/management/v1/library_service_pb2_grpc.py b/exabel/stubs/exabel/api/management/v1/library_service_pb2_grpc.py new file mode 100644 index 00000000..6213e918 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/library_service_pb2_grpc.py @@ -0,0 +1,596 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import folder_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2 +from . import library_service_pb2 as exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/management/v1/library_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class LibraryServiceStub(object): + """Service to manage library items. + + Requests to the LibraryService are executed in the context of the customer's service account (SA). + The SA is a special user that is a member of the customer user group, giving it access to all + folders that are shared with this user group, but not to private folders. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListFolders = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/ListFolders', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.FromString, + _registered_method=True) + self.GetFolder = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/GetFolder', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, + _registered_method=True) + self.CreateFolder = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/CreateFolder', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.CreateFolderRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, + _registered_method=True) + self.UpdateFolder = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/UpdateFolder', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UpdateFolderRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, + _registered_method=True) + self.DeleteFolder = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/DeleteFolder', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.DeleteFolderRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.ListItems = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/ListItems', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.FromString, + _registered_method=True) + self.MoveItems = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/MoveItems', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsResponse.FromString, + _registered_method=True) + self.ListFolderAccessors = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/ListFolderAccessors', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsResponse.FromString, + _registered_method=True) + self.ShareFolder = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/ShareFolder', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.UnshareFolder = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/UnshareFolder', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + _registered_method=True) + self.SearchItems = channel.unary_unary( + '/exabel.api.management.v1.LibraryService/SearchItems', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsResponse.FromString, + _registered_method=True) + + +class LibraryServiceServicer(object): + """Service to manage library items. + + Requests to the LibraryService are executed in the context of the customer's service account (SA). + The SA is a special user that is a member of the customer user group, giving it access to all + folders that are shared with this user group, but not to private folders. + """ + + def ListFolders(self, request, context): + """Lists all folders. + + Folders are returned without folder items - use the "Get folder" or "List folder items" + methods to get folder items. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetFolder(self, request, context): + """Gets a folder including its items. + + The folder will be returned with its items. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateFolder(self, request, context): + """Creates a folder. + + Only the display name and description can be set. Items must be added to the new folder + subsequently with the "Move folder items" method. + + The folder will be created as private to the service account user. To let other users access + this folder, you must also share it with the "Share folder" method. + + It is also possible to create a folder type by calling `UpdateFolder` + with `allow_missing` set to `true`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateFolder(self, request, context): + """Updates a folder. + + Only the display name and description can be updated. Items must be added to a folder with the + "Move folder items" method. + + This can also be used to create an entity by setting `allow_missing` to `true`. + + Note that this method will update all fields unless `update_mask` is set. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteFolder(self, request, context): + """Deletes a folder. + + The folder must be empty before it can be deleted. Use the "Move folder items" if needed to + move items into another folder. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListItems(self, request, context): + """Lists all items of a specific type. + + List all folder items of a specific type (e.g. derived signal, dashboard). To get all items in + a folder, use the "Get folder" method instead. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def MoveItems(self, request, context): + """Moves items to a folder. + + Specify the target folder that items should be moved into. The service account must have write + access to all items that you want to move. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListFolderAccessors(self, request, context): + """Lists the accessors of a specific folder. + + An accessor is a user group with either read-only or read/write access. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ShareFolder(self, request, context): + """Shares a folder with a group. + + You may find the user group resource names from the "List groups" method in the UserService. + - To grant write access to a group with only read access, call this method with the `write` flag set to `true`. + - To revoke only write access from a group, call this method with the `write` flag set to `false`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UnshareFolder(self, request, context): + """Removes sharing of a folder with a group. + + This revokes both read and write access. To revoke only write access, use the "Share folder" + method with the `write` flag set to `false`. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SearchItems(self, request, context): + """Search for folder items. + + Search for all folder items or items of a specific type (e.g. derived signal, dashboard) across all folders. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_LibraryServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListFolders': grpc.unary_unary_rpc_method_handler( + servicer.ListFolders, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.SerializeToString, + ), + 'GetFolder': grpc.unary_unary_rpc_method_handler( + servicer.GetFolder, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.SerializeToString, + ), + 'CreateFolder': grpc.unary_unary_rpc_method_handler( + servicer.CreateFolder, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.CreateFolderRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.SerializeToString, + ), + 'UpdateFolder': grpc.unary_unary_rpc_method_handler( + servicer.UpdateFolder, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UpdateFolderRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.SerializeToString, + ), + 'DeleteFolder': grpc.unary_unary_rpc_method_handler( + servicer.DeleteFolder, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.DeleteFolderRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'ListItems': grpc.unary_unary_rpc_method_handler( + servicer.ListItems, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.SerializeToString, + ), + 'MoveItems': grpc.unary_unary_rpc_method_handler( + servicer.MoveItems, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsResponse.SerializeToString, + ), + 'ListFolderAccessors': grpc.unary_unary_rpc_method_handler( + servicer.ListFolderAccessors, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsResponse.SerializeToString, + ), + 'ShareFolder': grpc.unary_unary_rpc_method_handler( + servicer.ShareFolder, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'UnshareFolder': grpc.unary_unary_rpc_method_handler( + servicer.UnshareFolder, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'SearchItems': grpc.unary_unary_rpc_method_handler( + servicer.SearchItems, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.management.v1.LibraryService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.management.v1.LibraryService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class LibraryService(object): + """Service to manage library items. + + Requests to the LibraryService are executed in the context of the customer's service account (SA). + The SA is a special user that is a member of the customer user group, giving it access to all + folders that are shared with this user group, but not to private folders. + """ + + @staticmethod + def ListFolders(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/ListFolders', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def GetFolder(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/GetFolder', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def CreateFolder(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/CreateFolder', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.CreateFolderRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UpdateFolder(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/UpdateFolder', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UpdateFolderRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def DeleteFolder(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/DeleteFolder', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.DeleteFolderRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListItems(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/ListItems', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def MoveItems(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/MoveItems', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListFolderAccessors(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/ListFolderAccessors', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ShareFolder(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/ShareFolder', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def UnshareFolder(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/UnshareFolder', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.SerializeToString, + google_dot_protobuf_dot_empty__pb2.Empty.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def SearchItems(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.LibraryService/SearchItems', + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel/stubs/exabel/api/management/v1/service_pb2.py b/exabel/stubs/exabel/api/management/v1/service_pb2.py new file mode 100644 index 00000000..6b4d09a8 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/service_pb2.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/management/v1/service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/management/v1/service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&exabel/api/management/v1/service.proto\x12\x18\x65xabel.api.management.v1\x1a.protoc_gen_openapiv2/options/annotations.protoB\xaf\x03\n\x1c\x63om.exabel.api.management.v1B\x0cServiceProtoP\x01Z\x1c\x65xabel.com/api/management/v1\x92\x41\xdf\x02\x12U\n\x15\x45xabel Management API\"5\n\x06\x45xabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x05\x31.0.0\x1a\x19management.api.exabel.com*\x01\x02\x32\x10\x61pplication/json:\x10\x61pplication/jsonZR\n#\n\x07\x41PI key\x12\x18\x08\x02\x12\x07\x41PI key\x1a\tx-api-key \x02\n+\n\x06\x42\x65\x61rer\x12!\x08\x02\x12\x0c\x41\x63\x63\x65ss token\x1a\rauthorization \x02\x62\r\n\x0b\n\x07\x41PI key\x12\x00\x62\x0c\n\n\n\x06\x42\x65\x61rer\x12\x00rS\n$More about the Exabel Management API\x12+https://help.exabel.com/docs/management-apib\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\034com.exabel.api.management.v1B\014ServiceProtoP\001Z\034exabel.com/api/management/v1\222A\337\002\022U\n\025Exabel Management API\"5\n\006Exabel\022\027https://www.exabel.com/\032\022support@exabel.com2\0051.0.0\032\031management.api.exabel.com*\001\0022\020application/json:\020application/jsonZR\n#\n\007API key\022\030\010\002\022\007API key\032\tx-api-key \002\n+\n\006Bearer\022!\010\002\022\014Access token\032\rauthorization \002b\r\n\013\n\007API key\022\000b\014\n\n\n\006Bearer\022\000rS\n$More about the Exabel Management API\022+https://help.exabel.com/docs/management-api' +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2.pyi b/exabel/stubs/exabel/api/management/v1/service_pb2.pyi similarity index 74% rename from exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2.pyi rename to exabel/stubs/exabel/api/management/v1/service_pb2.pyi index b5115531..c98e324e 100644 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2.pyi +++ b/exabel/stubs/exabel/api/management/v1/service_pb2.pyi @@ -2,5 +2,7 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2022 Exabel AS. All rights reserved.""" + import google.protobuf.descriptor -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor \ No newline at end of file + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor diff --git a/exabel/stubs/exabel/api/management/v1/service_pb2_grpc.py b/exabel/stubs/exabel/api/management/v1/service_pb2_grpc.py new file mode 100644 index 00000000..55884248 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/service_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/management/v1/service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/management/v1/user_messages_pb2.py b/exabel/stubs/exabel/api/management/v1/user_messages_pb2.py new file mode 100644 index 00000000..6ba0efc0 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/user_messages_pb2.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/management/v1/user_messages.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/management/v1/user_messages.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,exabel/api/management/v1/user_messages.proto\x12\x18\x65xabel.api.management.v1\x1a\x1fgoogle/api/field_behavior.proto\"9\n\x04User\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\r\n\x05\x65mail\x18\x02 \x01(\t\x12\x0f\n\x07\x62locked\x18\x03 \x01(\x08\"_\n\x05Group\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12-\n\x05users\x18\x03 \x03(\x0b\x32\x1e.exabel.api.management.v1.UserBQ\n\x1c\x63om.exabel.api.management.v1B\x11UserMessagesProtoP\x01Z\x1c\x65xabel.com/api/management/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.user_messages_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\034com.exabel.api.management.v1B\021UserMessagesProtoP\001Z\034exabel.com/api/management/v1' + _globals['_USER'].fields_by_name['name']._loaded_options = None + _globals['_USER'].fields_by_name['name']._serialized_options = b'\340A\003' + _globals['_GROUP'].fields_by_name['name']._loaded_options = None + _globals['_GROUP'].fields_by_name['name']._serialized_options = b'\340A\003' + _globals['_USER']._serialized_start=107 + _globals['_USER']._serialized_end=164 + _globals['_GROUP']._serialized_start=166 + _globals['_GROUP']._serialized_end=261 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2.pyi b/exabel/stubs/exabel/api/management/v1/user_messages_pb2.pyi similarity index 54% rename from exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2.pyi rename to exabel/stubs/exabel/api/management/v1/user_messages_pb2.pyi index 384ed57e..78936edc 100644 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2.pyi +++ b/exabel/stubs/exabel/api/management/v1/user_messages_pb2.pyi @@ -2,56 +2,70 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class User(google.protobuf.message.Message): """A user.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int EMAIL_FIELD_NUMBER: builtins.int BLOCKED_FIELD_NUMBER: builtins.int name: builtins.str - 'Unique resource name of the user, e.g. `users/123`.' + """Unique resource name of the user, e.g. `users/123`.""" email: builtins.str - "User's email." + """User's email.""" blocked: builtins.bool - 'Whether the user is blocked from accessing the system.' + """Whether the user is blocked from accessing the system.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + email: builtins.str | None = ..., + blocked: builtins.bool | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["blocked", b"blocked", "email", b"email", "name", b"name"]) -> None: ... - def __init__(self, *, name: builtins.str | None=..., email: builtins.str | None=..., blocked: builtins.bool | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['blocked', b'blocked', 'email', b'email', 'name', b'name']) -> None: - ... global___User = User @typing.final class Group(google.protobuf.message.Message): """A group.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int DISPLAY_NAME_FIELD_NUMBER: builtins.int USERS_FIELD_NUMBER: builtins.int name: builtins.str - 'Unique resource name of the user group, e.g. `groups/123`.' + """Unique resource name of the user group, e.g. `groups/123`.""" display_name: builtins.str - 'Display name of the user group, shown in the Library when sharing a folder with any of the\n customer user groups.\n ' - + """Display name of the user group, shown in the Library when sharing a folder with any of the + customer user groups. + """ @property def users(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___User]: """List of users in this user group. Only populated for some responses (refer to documentation for each method). """ - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., users: collections.abc.Iterable[global___User] | None=...) -> None: - ... + def __init__( + self, + *, + name: builtins.str | None = ..., + display_name: builtins.str | None = ..., + users: collections.abc.Iterable[global___User] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["display_name", b"display_name", "name", b"name", "users", b"users"]) -> None: ... - def ClearField(self, field_name: typing.Literal['display_name', b'display_name', 'name', b'name', 'users', b'users']) -> None: - ... -global___Group = Group \ No newline at end of file +global___Group = Group diff --git a/exabel/stubs/exabel/api/management/v1/user_messages_pb2_grpc.py b/exabel/stubs/exabel/api/management/v1/user_messages_pb2_grpc.py new file mode 100644 index 00000000..5795a440 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/user_messages_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/management/v1/user_messages_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/management/v1/user_service_pb2.py b/exabel/stubs/exabel/api/management/v1/user_service_pb2.py new file mode 100644 index 00000000..9b79a8f8 --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/user_service_pb2.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/management/v1/user_service.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/management/v1/user_service.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import user_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_user__messages__pb2 +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+exabel/api/management/v1/user_service.proto\x12\x18\x65xabel.api.management.v1\x1a,exabel/api/management/v1/user_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc_gen_openapiv2/options/annotations.proto\"\x13\n\x11ListGroupsRequest\"E\n\x12ListGroupsResponse\x12/\n\x06groups\x18\x01 \x03(\x0b\x32\x1f.exabel.api.management.v1.Group\"\x12\n\x10ListUsersRequest\"B\n\x11ListUsersResponse\x12-\n\x05users\x18\x01 \x03(\x0b\x32\x1e.exabel.api.management.v1.User2\xa4\x02\n\x0bUserService\x12\x8b\x01\n\nListGroups\x12+.exabel.api.management.v1.ListGroupsRequest\x1a,.exabel.api.management.v1.ListGroupsResponse\"\"\x92\x41\r\x12\x0bList groups\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/groups\x12\x86\x01\n\tListUsers\x12*.exabel.api.management.v1.ListUsersRequest\x1a+.exabel.api.management.v1.ListUsersResponse\" \x92\x41\x0c\x12\nList users\x82\xd3\xe4\x93\x02\x0b\x12\t/v1/usersBP\n\x1c\x63om.exabel.api.management.v1B\x10UserServiceProtoP\x01Z\x1c\x65xabel.com/api/management/v1b\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.user_service_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\034com.exabel.api.management.v1B\020UserServiceProtoP\001Z\034exabel.com/api/management/v1' + _globals['_USERSERVICE'].methods_by_name['ListGroups']._loaded_options = None + _globals['_USERSERVICE'].methods_by_name['ListGroups']._serialized_options = b'\222A\r\022\013List groups\202\323\344\223\002\014\022\n/v1/groups' + _globals['_USERSERVICE'].methods_by_name['ListUsers']._loaded_options = None + _globals['_USERSERVICE'].methods_by_name['ListUsers']._serialized_options = b'\222A\014\022\nList users\202\323\344\223\002\013\022\t/v1/users' + _globals['_LISTGROUPSREQUEST']._serialized_start=197 + _globals['_LISTGROUPSREQUEST']._serialized_end=216 + _globals['_LISTGROUPSRESPONSE']._serialized_start=218 + _globals['_LISTGROUPSRESPONSE']._serialized_end=287 + _globals['_LISTUSERSREQUEST']._serialized_start=289 + _globals['_LISTUSERSREQUEST']._serialized_end=307 + _globals['_LISTUSERSRESPONSE']._serialized_start=309 + _globals['_LISTUSERSRESPONSE']._serialized_end=375 + _globals['_USERSERVICE']._serialized_start=378 + _globals['_USERSERVICE']._serialized_end=670 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2.pyi b/exabel/stubs/exabel/api/management/v1/user_service_pb2.pyi similarity index 70% rename from exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2.pyi rename to exabel/stubs/exabel/api/management/v1/user_service_pb2.pyi index e78d2868..3b4ba30c 100644 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2.pyi +++ b/exabel/stubs/exabel/api/management/v1/user_service_pb2.pyi @@ -2,63 +2,78 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2022 Exabel AS. All rights reserved.""" + import builtins import collections.abc -from ..... import exabel +from . import user_messages_pb2 import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.message import typing +from ..... import exabel + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class ListGroupsRequest(google.protobuf.message.Message): """Request to ListGroups.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... + def __init__( + self, + ) -> None: ... + global___ListGroupsRequest = ListGroupsRequest @typing.final class ListGroupsResponse(google.protobuf.message.Message): """Response from ListGroups.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - GROUPS_FIELD_NUMBER: builtins.int + GROUPS_FIELD_NUMBER: builtins.int @property def groups(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.management.v1.user_messages_pb2.Group]: """List of user groups, including users in each user group.""" - def __init__(self, *, groups: collections.abc.Iterable[exabel.api.management.v1.user_messages_pb2.Group] | None=...) -> None: - ... + def __init__( + self, + *, + groups: collections.abc.Iterable[exabel.api.management.v1.user_messages_pb2.Group] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["groups", b"groups"]) -> None: ... - def ClearField(self, field_name: typing.Literal['groups', b'groups']) -> None: - ... global___ListGroupsResponse = ListGroupsResponse @typing.final class ListUsersRequest(google.protobuf.message.Message): """Request to ListUsers.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - def __init__(self) -> None: - ... + def __init__( + self, + ) -> None: ... + global___ListUsersRequest = ListUsersRequest @typing.final class ListUsersResponse(google.protobuf.message.Message): """Response from ListUsers.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor - USERS_FIELD_NUMBER: builtins.int + USERS_FIELD_NUMBER: builtins.int @property def users(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.management.v1.user_messages_pb2.User]: """List of users.""" - def __init__(self, *, users: collections.abc.Iterable[exabel.api.management.v1.user_messages_pb2.User] | None=...) -> None: - ... + def __init__( + self, + *, + users: collections.abc.Iterable[exabel.api.management.v1.user_messages_pb2.User] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["users", b"users"]) -> None: ... - def ClearField(self, field_name: typing.Literal['users', b'users']) -> None: - ... -global___ListUsersResponse = ListUsersResponse \ No newline at end of file +global___ListUsersResponse = ListUsersResponse diff --git a/exabel/stubs/exabel/api/management/v1/user_service_pb2_grpc.py b/exabel/stubs/exabel/api/management/v1/user_service_pb2_grpc.py new file mode 100644 index 00000000..ec74cc9b --- /dev/null +++ b/exabel/stubs/exabel/api/management/v1/user_service_pb2_grpc.py @@ -0,0 +1,155 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + +from . import user_service_pb2 as exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2 + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/management/v1/user_service_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) + + +class UserServiceStub(object): + """Service to manage users and groups. + + Supported operations are listing the current customer's user groups and users. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListGroups = channel.unary_unary( + '/exabel.api.management.v1.UserService/ListGroups', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsResponse.FromString, + _registered_method=True) + self.ListUsers = channel.unary_unary( + '/exabel.api.management.v1.UserService/ListUsers', + request_serializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersRequest.SerializeToString, + response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersResponse.FromString, + _registered_method=True) + + +class UserServiceServicer(object): + """Service to manage users and groups. + + Supported operations are listing the current customer's user groups and users. + """ + + def ListGroups(self, request, context): + """Lists all groups. Only groups for the current customer is returned. + + List all user groups in your customer, including the users in each user group. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListUsers(self, request, context): + """Lists all users in the current customer. + + List all users in your customer + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_UserServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListGroups': grpc.unary_unary_rpc_method_handler( + servicer.ListGroups, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsResponse.SerializeToString, + ), + 'ListUsers': grpc.unary_unary_rpc_method_handler( + servicer.ListUsers, + request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersRequest.FromString, + response_serializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'exabel.api.management.v1.UserService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('exabel.api.management.v1.UserService', rpc_method_handlers) + + + # This class is part of an EXPERIMENTAL API. +class UserService(object): + """Service to manage users and groups. + + Supported operations are listing the current customer's user groups and users. + """ + + @staticmethod + def ListGroups(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.UserService/ListGroups', + exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + + @staticmethod + def ListUsers(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/exabel.api.management.v1.UserService/ListUsers', + exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersRequest.SerializeToString, + exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/exabel_data_sdk/stubs/exabel/api/math/__init__.py b/exabel/stubs/exabel/api/math/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/math/__init__.py rename to exabel/stubs/exabel/api/math/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/math/__init__.pyi b/exabel/stubs/exabel/api/math/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/math/__init__.pyi rename to exabel/stubs/exabel/api/math/__init__.pyi diff --git a/exabel/stubs/exabel/api/math/aggregation_pb2.py b/exabel/stubs/exabel/api/math/aggregation_pb2.py new file mode 100644 index 00000000..85d3556c --- /dev/null +++ b/exabel/stubs/exabel/api/math/aggregation_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/math/aggregation.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/math/aggregation.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!exabel/api/math/aggregation.proto\x12\x0f\x65xabel.api.math*l\n\x0b\x41ggregation\x12\x17\n\x13\x41GGREGATION_INVALID\x10\x00\x12\x08\n\x04MEAN\x10\x01\x12\t\n\x05\x46IRST\x10\x02\x12\x08\n\x04LAST\x10\x03\x12\x07\n\x03SUM\x10\x04\x12\x07\n\x03MIN\x10\x05\x12\x07\n\x03MAX\x10\x06\x12\n\n\x06MEDIAN\x10\x07\x42>\n\x13\x63om.exabel.api.mathB\x10\x41ggregationProtoP\x01Z\x13\x65xabel.com/api/mathb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.math.aggregation_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\023com.exabel.api.mathB\020AggregationProtoP\001Z\023exabel.com/api/math' + _globals['_AGGREGATION']._serialized_start=54 + _globals['_AGGREGATION']._serialized_end=162 +# @@protoc_insertion_point(module_scope) diff --git a/exabel/stubs/exabel/api/math/aggregation_pb2.pyi b/exabel/stubs/exabel/api/math/aggregation_pb2.pyi new file mode 100644 index 00000000..985a8f78 --- /dev/null +++ b/exabel/stubs/exabel/api/math/aggregation_pb2.pyi @@ -0,0 +1,61 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright (c) 2019-2024 Exabel AS. All rights reserved.""" + +import builtins +import google.protobuf.descriptor +import google.protobuf.internal.enum_type_wrapper +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _Aggregation: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _AggregationEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Aggregation.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + AGGREGATION_INVALID: _Aggregation.ValueType # 0 + """Aggregation is unspecified and invalid. Aggregation must be set.""" + MEAN: _Aggregation.ValueType # 1 + """Takes the arithmetic mean of the data values. Example: 2, 1, 3, 5, 4 -> 3.""" + FIRST: _Aggregation.ValueType # 2 + """Selects the first value. Example: 2, 1, 3, 5, 4 -> 2.""" + LAST: _Aggregation.ValueType # 3 + """Selects the last value. Example: 2, 1, 3, 5, 4 -> 4.""" + SUM: _Aggregation.ValueType # 4 + """Sums the data values. Example: 2, 1, 3, 5, 4 -> 15.""" + MIN: _Aggregation.ValueType # 5 + """Selects the minimum value. Example: 2, 1, 3, 5, 4 -> 1.""" + MAX: _Aggregation.ValueType # 6 + """Selects the maximum value. Example: 2, 1, 3, 5, 4 -> 5.""" + MEDIAN: _Aggregation.ValueType # 7 + """Selects the median value. Example: 2, 1, 3, 5, 1000 -> 3.""" + +class Aggregation(_Aggregation, metaclass=_AggregationEnumTypeWrapper): + """Aggregation methods.""" + +AGGREGATION_INVALID: Aggregation.ValueType # 0 +"""Aggregation is unspecified and invalid. Aggregation must be set.""" +MEAN: Aggregation.ValueType # 1 +"""Takes the arithmetic mean of the data values. Example: 2, 1, 3, 5, 4 -> 3.""" +FIRST: Aggregation.ValueType # 2 +"""Selects the first value. Example: 2, 1, 3, 5, 4 -> 2.""" +LAST: Aggregation.ValueType # 3 +"""Selects the last value. Example: 2, 1, 3, 5, 4 -> 4.""" +SUM: Aggregation.ValueType # 4 +"""Sums the data values. Example: 2, 1, 3, 5, 4 -> 15.""" +MIN: Aggregation.ValueType # 5 +"""Selects the minimum value. Example: 2, 1, 3, 5, 4 -> 1.""" +MAX: Aggregation.ValueType # 6 +"""Selects the maximum value. Example: 2, 1, 3, 5, 4 -> 5.""" +MEDIAN: Aggregation.ValueType # 7 +"""Selects the median value. Example: 2, 1, 3, 5, 1000 -> 3.""" +global___Aggregation = Aggregation diff --git a/exabel/stubs/exabel/api/math/aggregation_pb2_grpc.py b/exabel/stubs/exabel/api/math/aggregation_pb2_grpc.py new file mode 100644 index 00000000..6559f776 --- /dev/null +++ b/exabel/stubs/exabel/api/math/aggregation_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/math/aggregation_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel_data_sdk/stubs/exabel/api/math/all_pb2.py b/exabel/stubs/exabel/api/math/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/math/all_pb2.py rename to exabel/stubs/exabel/api/math/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/math/all_pb2_grpc.py b/exabel/stubs/exabel/api/math/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/math/all_pb2_grpc.py rename to exabel/stubs/exabel/api/math/all_pb2_grpc.py diff --git a/exabel/stubs/exabel/api/math/change_pb2.py b/exabel/stubs/exabel/api/math/change_pb2.py new file mode 100644 index 00000000..d342416f --- /dev/null +++ b/exabel/stubs/exabel/api/math/change_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/math/change.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/math/change.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x65xabel/api/math/change.proto\x12\x0f\x65xabel.api.math*<\n\x06\x43hange\x12\x16\n\x12\x43HANGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08RELATIVE\x10\x01\x12\x0c\n\x08\x41\x42SOLUTE\x10\x02\x42\x39\n\x13\x63om.exabel.api.mathB\x0b\x43hangeProtoP\x01Z\x13\x65xabel.com/api/mathb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.math.change_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\023com.exabel.api.mathB\013ChangeProtoP\001Z\023exabel.com/api/math' + _globals['_CHANGE']._serialized_start=49 + _globals['_CHANGE']._serialized_end=109 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/math/change_pb2.pyi b/exabel/stubs/exabel/api/math/change_pb2.pyi similarity index 52% rename from exabel_data_sdk/stubs/exabel/api/math/change_pb2.pyi rename to exabel/stubs/exabel/api/math/change_pb2.pyi index 9902d4e0..9e7abc69 100644 --- a/exabel_data_sdk/stubs/exabel/api/math/change_pb2.pyi +++ b/exabel/stubs/exabel/api/math/change_pb2.pyi @@ -2,36 +2,40 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2024 Exabel AS. All rights reserved.""" + import builtins import google.protobuf.descriptor import google.protobuf.internal.enum_type_wrapper import sys import typing + if sys.version_info >= (3, 10): import typing as typing_extensions else: import typing_extensions + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class _Change: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType class _ChangeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Change.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - CHANGE_UNSPECIFIED: _Change.ValueType - 'Change is unspecified and invalid.' - RELATIVE: _Change.ValueType - 'Change should be calculated relative to the previous value. (Default.)' - ABSOLUTE: _Change.ValueType - 'Change should be calculated in absolute terms to the previous value.' + CHANGE_UNSPECIFIED: _Change.ValueType # 0 + """Change is unspecified and invalid.""" + RELATIVE: _Change.ValueType # 1 + """Change should be calculated relative to the previous value. (Default.)""" + ABSOLUTE: _Change.ValueType # 2 + """Change should be calculated in absolute terms to the previous value.""" class Change(_Change, metaclass=_ChangeEnumTypeWrapper): """Defines the possible methods to calculate change.""" -CHANGE_UNSPECIFIED: Change.ValueType -'Change is unspecified and invalid.' -RELATIVE: Change.ValueType -'Change should be calculated relative to the previous value. (Default.)' -ABSOLUTE: Change.ValueType -'Change should be calculated in absolute terms to the previous value.' -global___Change = Change \ No newline at end of file + +CHANGE_UNSPECIFIED: Change.ValueType # 0 +"""Change is unspecified and invalid.""" +RELATIVE: Change.ValueType # 1 +"""Change should be calculated relative to the previous value. (Default.)""" +ABSOLUTE: Change.ValueType # 2 +"""Change should be calculated in absolute terms to the previous value.""" +global___Change = Change diff --git a/exabel/stubs/exabel/api/math/change_pb2_grpc.py b/exabel/stubs/exabel/api/math/change_pb2_grpc.py new file mode 100644 index 00000000..60cf3304 --- /dev/null +++ b/exabel/stubs/exabel/api/math/change_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/math/change_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel_data_sdk/stubs/exabel/api/time/__init__.py b/exabel/stubs/exabel/api/time/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/time/__init__.py rename to exabel/stubs/exabel/api/time/__init__.py diff --git a/exabel_data_sdk/stubs/exabel/api/time/__init__.pyi b/exabel/stubs/exabel/api/time/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/time/__init__.pyi rename to exabel/stubs/exabel/api/time/__init__.pyi diff --git a/exabel_data_sdk/stubs/exabel/api/time/all_pb2.py b/exabel/stubs/exabel/api/time/all_pb2.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/time/all_pb2.py rename to exabel/stubs/exabel/api/time/all_pb2.py diff --git a/exabel_data_sdk/stubs/exabel/api/time/all_pb2_grpc.py b/exabel/stubs/exabel/api/time/all_pb2_grpc.py similarity index 100% rename from exabel_data_sdk/stubs/exabel/api/time/all_pb2_grpc.py rename to exabel/stubs/exabel/api/time/all_pb2_grpc.py diff --git a/exabel/stubs/exabel/api/time/date_pb2.py b/exabel/stubs/exabel/api/time/date_pb2.py new file mode 100644 index 00000000..2a983f78 --- /dev/null +++ b/exabel/stubs/exabel/api/time/date_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/time/date.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/time/date.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x65xabel/api/time/date.proto\x12\x0f\x65xabel.api.time\"0\n\x04\x44\x61te\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03\x64\x61y\x18\x03 \x01(\x05\x42\x37\n\x13\x63om.exabel.api.timeB\tDateProtoP\x01Z\x13\x65xabel.com/api/timeb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.time.date_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\023com.exabel.api.timeB\tDateProtoP\001Z\023exabel.com/api/time' + _globals['_DATE']._serialized_start=47 + _globals['_DATE']._serialized_end=95 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/time/date_pb2.pyi b/exabel/stubs/exabel/api/time/date_pb2.pyi similarity index 52% rename from exabel_data_sdk/stubs/exabel/api/time/date_pb2.pyi rename to exabel/stubs/exabel/api/time/date_pb2.pyi index c01719aa..5bca64f0 100644 --- a/exabel_data_sdk/stubs/exabel/api/time/date_pb2.pyi +++ b/exabel/stubs/exabel/api/time/date_pb2.pyi @@ -2,29 +2,38 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2025 Exabel AS. All rights reserved.""" + import builtins import google.protobuf.descriptor import google.protobuf.message import typing + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final class Date(google.protobuf.message.Message): """Represents a calendar date.""" + DESCRIPTOR: google.protobuf.descriptor.Descriptor + YEAR_FIELD_NUMBER: builtins.int MONTH_FIELD_NUMBER: builtins.int DAY_FIELD_NUMBER: builtins.int year: builtins.int - "The date's year." + """The date's year.""" month: builtins.int - 'The month of the year; must be between 1 and 12 inclusive.' + """The month of the year; must be between 1 and 12 inclusive.""" day: builtins.int - 'The day of the month, starting at 1; the day, month and year combined must\n define a valid calendar date.\n ' - - def __init__(self, *, year: builtins.int | None=..., month: builtins.int | None=..., day: builtins.int | None=...) -> None: - ... + """The day of the month, starting at 1; the day, month and year combined must + define a valid calendar date. + """ + def __init__( + self, + *, + year: builtins.int | None = ..., + month: builtins.int | None = ..., + day: builtins.int | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["day", b"day", "month", b"month", "year", b"year"]) -> None: ... - def ClearField(self, field_name: typing.Literal['day', b'day', 'month', b'month', 'year', b'year']) -> None: - ... -global___Date = Date \ No newline at end of file +global___Date = Date diff --git a/exabel/stubs/exabel/api/time/date_pb2_grpc.py b/exabel/stubs/exabel/api/time/date_pb2_grpc.py new file mode 100644 index 00000000..10c01060 --- /dev/null +++ b/exabel/stubs/exabel/api/time/date_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/time/date_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/exabel/api/time/time_range_pb2.py b/exabel/stubs/exabel/api/time/time_range_pb2.py new file mode 100644 index 00000000..f9df8db7 --- /dev/null +++ b/exabel/stubs/exabel/api/time/time_range_pb2.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: exabel/api/time/time_range.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'exabel/api/time/time_range.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n exabel/api/time/time_range.proto\x12\x0f\x65xabel.api.time\x1a\x1fgoogle/protobuf/timestamp.proto\"\x91\x01\n\tTimeRange\x12-\n\tfrom_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0c\x65xclude_from\x18\x02 \x01(\x08\x12+\n\x07to_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x12\n\ninclude_to\x18\x04 \x01(\x08\x42<\n\x13\x63om.exabel.api.timeB\x0eTimeRangeProtoP\x01Z\x13\x65xabel.com/api/timeb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.time.time_range_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'\n\023com.exabel.api.timeB\016TimeRangeProtoP\001Z\023exabel.com/api/time' + _globals['_TIMERANGE']._serialized_start=87 + _globals['_TIMERANGE']._serialized_end=232 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/exabel/api/time/time_range_pb2.pyi b/exabel/stubs/exabel/api/time/time_range_pb2.pyi similarity index 59% rename from exabel_data_sdk/stubs/exabel/api/time/time_range_pb2.pyi rename to exabel/stubs/exabel/api/time/time_range_pb2.pyi index 08e91c89..270721e8 100644 --- a/exabel_data_sdk/stubs/exabel/api/time/time_range_pb2.pyi +++ b/exabel/stubs/exabel/api/time/time_range_pb2.pyi @@ -2,11 +2,13 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" + import builtins import google.protobuf.descriptor import google.protobuf.message import google.protobuf.timestamp_pb2 import typing + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor @typing.final @@ -14,16 +16,17 @@ class TimeRange(google.protobuf.message.Message): """A time range represented by two google.protobuf.Timestamps. The default time range includes the start point and excludes the end point. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + FROM_TIME_FIELD_NUMBER: builtins.int EXCLUDE_FROM_FIELD_NUMBER: builtins.int TO_TIME_FIELD_NUMBER: builtins.int INCLUDE_TO_FIELD_NUMBER: builtins.int exclude_from: builtins.bool - 'Set to `true` to exclude the start point from the range.' + """Set to `true` to exclude the start point from the range.""" include_to: builtins.bool - 'Set to `true` to include the end point in the range.' - + """Set to `true` to include the end point in the range.""" @property def from_time(self) -> google.protobuf.timestamp_pb2.Timestamp: """Start of the time range, *included* in the range by default.""" @@ -32,12 +35,15 @@ class TimeRange(google.protobuf.message.Message): def to_time(self) -> google.protobuf.timestamp_pb2.Timestamp: """End of the time range, *excluded* from the range by default.""" - def __init__(self, *, from_time: google.protobuf.timestamp_pb2.Timestamp | None=..., exclude_from: builtins.bool | None=..., to_time: google.protobuf.timestamp_pb2.Timestamp | None=..., include_to: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['from_time', b'from_time', 'to_time', b'to_time']) -> builtins.bool: - ... + def __init__( + self, + *, + from_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + exclude_from: builtins.bool | None = ..., + to_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + include_to: builtins.bool | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["from_time", b"from_time", "to_time", b"to_time"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["exclude_from", b"exclude_from", "from_time", b"from_time", "include_to", b"include_to", "to_time", b"to_time"]) -> None: ... - def ClearField(self, field_name: typing.Literal['exclude_from', b'exclude_from', 'from_time', b'from_time', 'include_to', b'include_to', 'to_time', b'to_time']) -> None: - ... -global___TimeRange = TimeRange \ No newline at end of file +global___TimeRange = TimeRange diff --git a/exabel/stubs/exabel/api/time/time_range_pb2_grpc.py b/exabel/stubs/exabel/api/time/time_range_pb2_grpc.py new file mode 100644 index 00000000..5be269d5 --- /dev/null +++ b/exabel/stubs/exabel/api/time/time_range_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in exabel/api/time/time_range_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/__init__.py b/exabel/stubs/protoc_gen_openapiv2/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/protoc_gen_openapiv2/__init__.py rename to exabel/stubs/protoc_gen_openapiv2/__init__.py diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/__init__.pyi b/exabel/stubs/protoc_gen_openapiv2/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/protoc_gen_openapiv2/__init__.pyi rename to exabel/stubs/protoc_gen_openapiv2/__init__.pyi diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/__init__.py b/exabel/stubs/protoc_gen_openapiv2/options/__init__.py similarity index 100% rename from exabel_data_sdk/stubs/protoc_gen_openapiv2/options/__init__.py rename to exabel/stubs/protoc_gen_openapiv2/options/__init__.py diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/__init__.pyi b/exabel/stubs/protoc_gen_openapiv2/options/__init__.pyi similarity index 100% rename from exabel_data_sdk/stubs/protoc_gen_openapiv2/options/__init__.pyi rename to exabel/stubs/protoc_gen_openapiv2/options/__init__.pyi diff --git a/exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2.py b/exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2.py new file mode 100644 index 00000000..97de0635 --- /dev/null +++ b/exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: protoc_gen_openapiv2/options/annotations.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'protoc_gen_openapiv2/options/annotations.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 +from . import openapiv2_pb2 as protoc__gen__openapiv2_dot_options_dot_openapiv2__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.protoc_gen_openapiv2/options/annotations.proto\x12)grpc.gateway.protoc_gen_openapiv2.options\x1a google/protobuf/descriptor.proto\x1a,protoc_gen_openapiv2/options/openapiv2.proto:l\n\x11openapiv2_swagger\x12\x1c.google.protobuf.FileOptions\x18\x92\x08 \x01(\x0b\x32\x32.grpc.gateway.protoc_gen_openapiv2.options.Swagger:r\n\x13openapiv2_operation\x12\x1e.google.protobuf.MethodOptions\x18\x92\x08 \x01(\x0b\x32\x34.grpc.gateway.protoc_gen_openapiv2.options.Operation:m\n\x10openapiv2_schema\x12\x1f.google.protobuf.MessageOptions\x18\x92\x08 \x01(\x0b\x32\x31.grpc.gateway.protoc_gen_openapiv2.options.Schema:g\n\ropenapiv2_tag\x12\x1f.google.protobuf.ServiceOptions\x18\x92\x08 \x01(\x0b\x32..grpc.gateway.protoc_gen_openapiv2.options.Tag:n\n\x0fopenapiv2_field\x12\x1d.google.protobuf.FieldOptions\x18\x92\x08 \x01(\x0b\x32\x35.grpc.gateway.protoc_gen_openapiv2.options.JSONSchemaBHZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/optionsb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protoc_gen_openapiv2.options.annotations_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'ZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options' +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2.pyi b/exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2.pyi similarity index 56% rename from exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2.pyi rename to exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2.pyi index ab24fa2b..687b50f3 100644 --- a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2.pyi +++ b/exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2.pyi @@ -2,24 +2,48 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file """ + import builtins import google.protobuf.descriptor import google.protobuf.descriptor_pb2 import google.protobuf.internal.extension_dict +from . import openapiv2_pb2 from ... import protoc_gen_openapiv2 + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + OPENAPIV2_SWAGGER_FIELD_NUMBER: builtins.int OPENAPIV2_OPERATION_FIELD_NUMBER: builtins.int OPENAPIV2_SCHEMA_FIELD_NUMBER: builtins.int OPENAPIV2_TAG_FIELD_NUMBER: builtins.int OPENAPIV2_FIELD_FIELD_NUMBER: builtins.int openapiv2_swagger: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.FileOptions, protoc_gen_openapiv2.options.openapiv2_pb2.Swagger] -'ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.\n\nAll IDs are the same, as assigned. It is okay that they are the same, as they extend\ndifferent descriptor messages.\n' +"""ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + +All IDs are the same, as assigned. It is okay that they are the same, as they extend +different descriptor messages. +""" openapiv2_operation: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.MethodOptions, protoc_gen_openapiv2.options.openapiv2_pb2.Operation] -'ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.\n\nAll IDs are the same, as assigned. It is okay that they are the same, as they extend\ndifferent descriptor messages.\n' +"""ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + +All IDs are the same, as assigned. It is okay that they are the same, as they extend +different descriptor messages. +""" openapiv2_schema: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.MessageOptions, protoc_gen_openapiv2.options.openapiv2_pb2.Schema] -'ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.\n\nAll IDs are the same, as assigned. It is okay that they are the same, as they extend\ndifferent descriptor messages.\n' +"""ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + +All IDs are the same, as assigned. It is okay that they are the same, as they extend +different descriptor messages. +""" openapiv2_tag: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.ServiceOptions, protoc_gen_openapiv2.options.openapiv2_pb2.Tag] -'ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.\n\nAll IDs are the same, as assigned. It is okay that they are the same, as they extend\ndifferent descriptor messages.\n' +"""ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + +All IDs are the same, as assigned. It is okay that they are the same, as they extend +different descriptor messages. +""" openapiv2_field: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[google.protobuf.descriptor_pb2.FieldOptions, protoc_gen_openapiv2.options.openapiv2_pb2.JSONSchema] -'ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project.\n\nAll IDs are the same, as assigned. It is okay that they are the same, as they extend\ndifferent descriptor messages.\n' \ No newline at end of file +"""ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. + +All IDs are the same, as assigned. It is okay that they are the same, as they extend +different descriptor messages. +""" diff --git a/exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2_grpc.py b/exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2_grpc.py new file mode 100644 index 00000000..2eae88db --- /dev/null +++ b/exabel/stubs/protoc_gen_openapiv2/options/annotations_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in protoc_gen_openapiv2/options/annotations_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.py b/exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.py new file mode 100644 index 00000000..5fce2977 --- /dev/null +++ b/exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: protoc_gen_openapiv2/options/openapiv2.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'protoc_gen_openapiv2/options/openapiv2.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,protoc_gen_openapiv2/options/openapiv2.proto\x12)grpc.gateway.protoc_gen_openapiv2.options\x1a\x1cgoogle/protobuf/struct.proto\"\xdd\x06\n\x07Swagger\x12\x0f\n\x07swagger\x18\x01 \x01(\t\x12=\n\x04info\x18\x02 \x01(\x0b\x32/.grpc.gateway.protoc_gen_openapiv2.options.Info\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x11\n\tbase_path\x18\x04 \x01(\t\x12\x42\n\x07schemes\x18\x05 \x03(\x0e\x32\x31.grpc.gateway.protoc_gen_openapiv2.options.Scheme\x12\x10\n\x08\x63onsumes\x18\x06 \x03(\t\x12\x10\n\x08produces\x18\x07 \x03(\t\x12T\n\tresponses\x18\n \x03(\x0b\x32\x41.grpc.gateway.protoc_gen_openapiv2.options.Swagger.ResponsesEntry\x12\\\n\x14security_definitions\x18\x0b \x01(\x0b\x32>.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions\x12P\n\x08security\x18\x0c \x03(\x0b\x32>.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement\x12W\n\rexternal_docs\x18\x0e \x01(\x0b\x32@.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation\x12V\n\nextensions\x18\x0f \x03(\x0b\x32\x42.grpc.gateway.protoc_gen_openapiv2.options.Swagger.ExtensionsEntry\x1a\x65\n\x0eResponsesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x42\n\x05value\x18\x02 \x01(\x0b\x32\x33.grpc.gateway.protoc_gen_openapiv2.options.Response:\x02\x38\x01\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01J\x04\x08\x08\x10\tJ\x04\x08\t\x10\nJ\x04\x08\r\x10\x0e\"\xe6\x05\n\tOperation\x12\x0c\n\x04tags\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12W\n\rexternal_docs\x18\x04 \x01(\x0b\x32@.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation\x12\x14\n\x0coperation_id\x18\x05 \x01(\t\x12\x10\n\x08\x63onsumes\x18\x06 \x03(\t\x12\x10\n\x08produces\x18\x07 \x03(\t\x12V\n\tresponses\x18\t \x03(\x0b\x32\x43.grpc.gateway.protoc_gen_openapiv2.options.Operation.ResponsesEntry\x12\x42\n\x07schemes\x18\n \x03(\x0e\x32\x31.grpc.gateway.protoc_gen_openapiv2.options.Scheme\x12\x12\n\ndeprecated\x18\x0b \x01(\x08\x12P\n\x08security\x18\x0c \x03(\x0b\x32>.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement\x12X\n\nextensions\x18\r \x03(\x0b\x32\x44.grpc.gateway.protoc_gen_openapiv2.options.Operation.ExtensionsEntry\x1a\x65\n\x0eResponsesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x42\n\x05value\x18\x02 \x01(\x0b\x32\x33.grpc.gateway.protoc_gen_openapiv2.options.Response:\x02\x38\x01\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01J\x04\x08\x08\x10\t\"\xab\x01\n\x06Header\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0e\n\x06\x66ormat\x18\x03 \x01(\t\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x06 \x01(\t\x12\x0f\n\x07pattern\x18\r \x01(\tJ\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\tJ\x04\x08\t\x10\nJ\x04\x08\n\x10\x0bJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\rJ\x04\x08\x0e\x10\x0fJ\x04\x08\x0f\x10\x10J\x04\x08\x10\x10\x11J\x04\x08\x11\x10\x12J\x04\x08\x12\x10\x13\"\xc2\x04\n\x08Response\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x41\n\x06schema\x18\x02 \x01(\x0b\x32\x31.grpc.gateway.protoc_gen_openapiv2.options.Schema\x12Q\n\x07headers\x18\x03 \x03(\x0b\x32@.grpc.gateway.protoc_gen_openapiv2.options.Response.HeadersEntry\x12S\n\x08\x65xamples\x18\x04 \x03(\x0b\x32\x41.grpc.gateway.protoc_gen_openapiv2.options.Response.ExamplesEntry\x12W\n\nextensions\x18\x05 \x03(\x0b\x32\x43.grpc.gateway.protoc_gen_openapiv2.options.Response.ExtensionsEntry\x1a\x61\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12@\n\x05value\x18\x02 \x01(\x0b\x32\x31.grpc.gateway.protoc_gen_openapiv2.options.Header:\x02\x38\x01\x1a/\n\rExamplesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"\xff\x02\n\x04Info\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x18\n\x10terms_of_service\x18\x03 \x01(\t\x12\x43\n\x07\x63ontact\x18\x04 \x01(\x0b\x32\x32.grpc.gateway.protoc_gen_openapiv2.options.Contact\x12\x43\n\x07license\x18\x05 \x01(\x0b\x32\x32.grpc.gateway.protoc_gen_openapiv2.options.License\x12\x0f\n\x07version\x18\x06 \x01(\t\x12S\n\nextensions\x18\x07 \x03(\x0b\x32?.grpc.gateway.protoc_gen_openapiv2.options.Info.ExtensionsEntry\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"3\n\x07\x43ontact\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\r\n\x05\x65mail\x18\x03 \x01(\t\"$\n\x07License\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\"9\n\x15\x45xternalDocumentation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\"\xee\x01\n\x06Schema\x12J\n\x0bjson_schema\x18\x01 \x01(\x0b\x32\x35.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema\x12\x15\n\rdiscriminator\x18\x02 \x01(\t\x12\x11\n\tread_only\x18\x03 \x01(\x08\x12W\n\rexternal_docs\x18\x05 \x01(\x0b\x32@.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation\x12\x0f\n\x07\x65xample\x18\x06 \x01(\tJ\x04\x08\x04\x10\x05\"\xfc\x06\n\nJSONSchema\x12\x0b\n\x03ref\x18\x03 \x01(\t\x12\r\n\x05title\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x07 \x01(\t\x12\x11\n\tread_only\x18\x08 \x01(\x08\x12\x0f\n\x07\x65xample\x18\t \x01(\t\x12\x13\n\x0bmultiple_of\x18\n \x01(\x01\x12\x0f\n\x07maximum\x18\x0b \x01(\x01\x12\x19\n\x11\x65xclusive_maximum\x18\x0c \x01(\x08\x12\x0f\n\x07minimum\x18\r \x01(\x01\x12\x19\n\x11\x65xclusive_minimum\x18\x0e \x01(\x08\x12\x12\n\nmax_length\x18\x0f \x01(\x04\x12\x12\n\nmin_length\x18\x10 \x01(\x04\x12\x0f\n\x07pattern\x18\x11 \x01(\t\x12\x11\n\tmax_items\x18\x14 \x01(\x04\x12\x11\n\tmin_items\x18\x15 \x01(\x04\x12\x14\n\x0cunique_items\x18\x16 \x01(\x08\x12\x16\n\x0emax_properties\x18\x18 \x01(\x04\x12\x16\n\x0emin_properties\x18\x19 \x01(\x04\x12\x10\n\x08required\x18\x1a \x03(\t\x12\r\n\x05\x61rray\x18\" \x03(\t\x12Y\n\x04type\x18# \x03(\x0e\x32K.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes\x12\x0e\n\x06\x66ormat\x18$ \x01(\t\x12\x0c\n\x04\x65num\x18. \x03(\t\x12\x66\n\x13\x66ield_configuration\x18\xe9\x07 \x01(\x0b\x32H.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration\x1a-\n\x12\x46ieldConfiguration\x12\x17\n\x0fpath_param_name\x18/ \x01(\t\"w\n\x15JSONSchemaSimpleTypes\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05\x41RRAY\x10\x01\x12\x0b\n\x07\x42OOLEAN\x10\x02\x12\x0b\n\x07INTEGER\x10\x03\x12\x08\n\x04NULL\x10\x04\x12\n\n\x06NUMBER\x10\x05\x12\n\n\x06OBJECT\x10\x06\x12\n\n\x06STRING\x10\x07J\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03J\x04\x08\x04\x10\x05J\x04\x08\x12\x10\x13J\x04\x08\x13\x10\x14J\x04\x08\x17\x10\x18J\x04\x08\x1b\x10\x1cJ\x04\x08\x1c\x10\x1dJ\x04\x08\x1d\x10\x1eJ\x04\x08\x1e\x10\"J\x04\x08%\x10*J\x04\x08*\x10+J\x04\x08+\x10.\"y\n\x03Tag\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12W\n\rexternal_docs\x18\x03 \x01(\x0b\x32@.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentationJ\x04\x08\x01\x10\x02\"\xe1\x01\n\x13SecurityDefinitions\x12^\n\x08security\x18\x01 \x03(\x0b\x32L.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.SecurityEntry\x1aj\n\rSecurityEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b\x32\x39.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme:\x02\x38\x01\"\xa0\x06\n\x0eSecurityScheme\x12L\n\x04type\x18\x01 \x01(\x0e\x32>.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12H\n\x02in\x18\x04 \x01(\x0e\x32<.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In\x12L\n\x04\x66low\x18\x05 \x01(\x0e\x32>.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow\x12\x19\n\x11\x61uthorization_url\x18\x06 \x01(\t\x12\x11\n\ttoken_url\x18\x07 \x01(\t\x12\x41\n\x06scopes\x18\x08 \x01(\x0b\x32\x31.grpc.gateway.protoc_gen_openapiv2.options.Scopes\x12]\n\nextensions\x18\t \x03(\x0b\x32I.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.ExtensionsEntry\x1aI\n\x0f\x45xtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01\"K\n\x04Type\x12\x10\n\x0cTYPE_INVALID\x10\x00\x12\x0e\n\nTYPE_BASIC\x10\x01\x12\x10\n\x0cTYPE_API_KEY\x10\x02\x12\x0f\n\x0bTYPE_OAUTH2\x10\x03\"1\n\x02In\x12\x0e\n\nIN_INVALID\x10\x00\x12\x0c\n\x08IN_QUERY\x10\x01\x12\r\n\tIN_HEADER\x10\x02\"j\n\x04\x46low\x12\x10\n\x0c\x46LOW_INVALID\x10\x00\x12\x11\n\rFLOW_IMPLICIT\x10\x01\x12\x11\n\rFLOW_PASSWORD\x10\x02\x12\x14\n\x10\x46LOW_APPLICATION\x10\x03\x12\x14\n\x10\x46LOW_ACCESS_CODE\x10\x04\"\xcd\x02\n\x13SecurityRequirement\x12u\n\x14security_requirement\x18\x01 \x03(\x0b\x32W.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementEntry\x1a)\n\x18SecurityRequirementValue\x12\r\n\x05scope\x18\x01 \x03(\t\x1a\x93\x01\n\x18SecurityRequirementEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x66\n\x05value\x18\x02 \x01(\x0b\x32W.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue:\x02\x38\x01\"\x83\x01\n\x06Scopes\x12K\n\x05scope\x18\x01 \x03(\x0b\x32<.grpc.gateway.protoc_gen_openapiv2.options.Scopes.ScopeEntry\x1a,\n\nScopeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01*;\n\x06Scheme\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04HTTP\x10\x01\x12\t\n\x05HTTPS\x10\x02\x12\x06\n\x02WS\x10\x03\x12\x07\n\x03WSS\x10\x04\x42HZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/optionsb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protoc_gen_openapiv2.options.openapiv2_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'ZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options' + _globals['_SWAGGER_RESPONSESENTRY']._loaded_options = None + _globals['_SWAGGER_RESPONSESENTRY']._serialized_options = b'8\001' + _globals['_SWAGGER_EXTENSIONSENTRY']._loaded_options = None + _globals['_SWAGGER_EXTENSIONSENTRY']._serialized_options = b'8\001' + _globals['_OPERATION_RESPONSESENTRY']._loaded_options = None + _globals['_OPERATION_RESPONSESENTRY']._serialized_options = b'8\001' + _globals['_OPERATION_EXTENSIONSENTRY']._loaded_options = None + _globals['_OPERATION_EXTENSIONSENTRY']._serialized_options = b'8\001' + _globals['_RESPONSE_HEADERSENTRY']._loaded_options = None + _globals['_RESPONSE_HEADERSENTRY']._serialized_options = b'8\001' + _globals['_RESPONSE_EXAMPLESENTRY']._loaded_options = None + _globals['_RESPONSE_EXAMPLESENTRY']._serialized_options = b'8\001' + _globals['_RESPONSE_EXTENSIONSENTRY']._loaded_options = None + _globals['_RESPONSE_EXTENSIONSENTRY']._serialized_options = b'8\001' + _globals['_INFO_EXTENSIONSENTRY']._loaded_options = None + _globals['_INFO_EXTENSIONSENTRY']._serialized_options = b'8\001' + _globals['_SECURITYDEFINITIONS_SECURITYENTRY']._loaded_options = None + _globals['_SECURITYDEFINITIONS_SECURITYENTRY']._serialized_options = b'8\001' + _globals['_SECURITYSCHEME_EXTENSIONSENTRY']._loaded_options = None + _globals['_SECURITYSCHEME_EXTENSIONSENTRY']._serialized_options = b'8\001' + _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY']._loaded_options = None + _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY']._serialized_options = b'8\001' + _globals['_SCOPES_SCOPEENTRY']._loaded_options = None + _globals['_SCOPES_SCOPEENTRY']._serialized_options = b'8\001' + _globals['_SCHEME']._serialized_start=5781 + _globals['_SCHEME']._serialized_end=5840 + _globals['_SWAGGER']._serialized_start=122 + _globals['_SWAGGER']._serialized_end=983 + _globals['_SWAGGER_RESPONSESENTRY']._serialized_start=789 + _globals['_SWAGGER_RESPONSESENTRY']._serialized_end=890 + _globals['_SWAGGER_EXTENSIONSENTRY']._serialized_start=892 + _globals['_SWAGGER_EXTENSIONSENTRY']._serialized_end=965 + _globals['_OPERATION']._serialized_start=986 + _globals['_OPERATION']._serialized_end=1728 + _globals['_OPERATION_RESPONSESENTRY']._serialized_start=789 + _globals['_OPERATION_RESPONSESENTRY']._serialized_end=890 + _globals['_OPERATION_EXTENSIONSENTRY']._serialized_start=892 + _globals['_OPERATION_EXTENSIONSENTRY']._serialized_end=965 + _globals['_HEADER']._serialized_start=1731 + _globals['_HEADER']._serialized_end=1902 + _globals['_RESPONSE']._serialized_start=1905 + _globals['_RESPONSE']._serialized_end=2483 + _globals['_RESPONSE_HEADERSENTRY']._serialized_start=2262 + _globals['_RESPONSE_HEADERSENTRY']._serialized_end=2359 + _globals['_RESPONSE_EXAMPLESENTRY']._serialized_start=2361 + _globals['_RESPONSE_EXAMPLESENTRY']._serialized_end=2408 + _globals['_RESPONSE_EXTENSIONSENTRY']._serialized_start=892 + _globals['_RESPONSE_EXTENSIONSENTRY']._serialized_end=965 + _globals['_INFO']._serialized_start=2486 + _globals['_INFO']._serialized_end=2869 + _globals['_INFO_EXTENSIONSENTRY']._serialized_start=892 + _globals['_INFO_EXTENSIONSENTRY']._serialized_end=965 + _globals['_CONTACT']._serialized_start=2871 + _globals['_CONTACT']._serialized_end=2922 + _globals['_LICENSE']._serialized_start=2924 + _globals['_LICENSE']._serialized_end=2960 + _globals['_EXTERNALDOCUMENTATION']._serialized_start=2962 + _globals['_EXTERNALDOCUMENTATION']._serialized_end=3019 + _globals['_SCHEMA']._serialized_start=3022 + _globals['_SCHEMA']._serialized_end=3260 + _globals['_JSONSCHEMA']._serialized_start=3263 + _globals['_JSONSCHEMA']._serialized_end=4155 + _globals['_JSONSCHEMA_FIELDCONFIGURATION']._serialized_start=3911 + _globals['_JSONSCHEMA_FIELDCONFIGURATION']._serialized_end=3956 + _globals['_JSONSCHEMA_JSONSCHEMASIMPLETYPES']._serialized_start=3958 + _globals['_JSONSCHEMA_JSONSCHEMASIMPLETYPES']._serialized_end=4077 + _globals['_TAG']._serialized_start=4157 + _globals['_TAG']._serialized_end=4278 + _globals['_SECURITYDEFINITIONS']._serialized_start=4281 + _globals['_SECURITYDEFINITIONS']._serialized_end=4506 + _globals['_SECURITYDEFINITIONS_SECURITYENTRY']._serialized_start=4400 + _globals['_SECURITYDEFINITIONS_SECURITYENTRY']._serialized_end=4506 + _globals['_SECURITYSCHEME']._serialized_start=4509 + _globals['_SECURITYSCHEME']._serialized_end=5309 + _globals['_SECURITYSCHEME_EXTENSIONSENTRY']._serialized_start=892 + _globals['_SECURITYSCHEME_EXTENSIONSENTRY']._serialized_end=965 + _globals['_SECURITYSCHEME_TYPE']._serialized_start=5075 + _globals['_SECURITYSCHEME_TYPE']._serialized_end=5150 + _globals['_SECURITYSCHEME_IN']._serialized_start=5152 + _globals['_SECURITYSCHEME_IN']._serialized_end=5201 + _globals['_SECURITYSCHEME_FLOW']._serialized_start=5203 + _globals['_SECURITYSCHEME_FLOW']._serialized_end=5309 + _globals['_SECURITYREQUIREMENT']._serialized_start=5312 + _globals['_SECURITYREQUIREMENT']._serialized_end=5645 + _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE']._serialized_start=5454 + _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE']._serialized_end=5495 + _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY']._serialized_start=5498 + _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY']._serialized_end=5645 + _globals['_SCOPES']._serialized_start=5648 + _globals['_SCOPES']._serialized_end=5779 + _globals['_SCOPES_SCOPEENTRY']._serialized_start=5735 + _globals['_SCOPES_SCOPEENTRY']._serialized_end=5779 +# @@protoc_insertion_point(module_scope) diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.pyi b/exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.pyi similarity index 53% rename from exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.pyi rename to exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.pyi index 26337ce5..3ea56aa3 100644 --- a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.pyi +++ b/exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.pyi @@ -2,6 +2,7 @@ @generated by mypy-protobuf. Do not edit manually! isort:skip_file """ + import builtins import collections.abc import google.protobuf.descriptor @@ -11,33 +12,36 @@ import google.protobuf.message import google.protobuf.struct_pb2 import sys import typing + if sys.version_info >= (3, 10): import typing as typing_extensions else: import typing_extensions + DESCRIPTOR: google.protobuf.descriptor.FileDescriptor class _Scheme: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType class _SchemeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Scheme.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - UNKNOWN: _Scheme.ValueType - HTTP: _Scheme.ValueType - HTTPS: _Scheme.ValueType - WS: _Scheme.ValueType - WSS: _Scheme.ValueType + UNKNOWN: _Scheme.ValueType # 0 + HTTP: _Scheme.ValueType # 1 + HTTPS: _Scheme.ValueType # 2 + WS: _Scheme.ValueType # 3 + WSS: _Scheme.ValueType # 4 class Scheme(_Scheme, metaclass=_SchemeEnumTypeWrapper): """Scheme describes the schemes supported by the OpenAPI Swagger and Operation objects. """ -UNKNOWN: Scheme.ValueType -HTTP: Scheme.ValueType -HTTPS: Scheme.ValueType -WS: Scheme.ValueType -WSS: Scheme.ValueType + +UNKNOWN: Scheme.ValueType # 0 +HTTP: Scheme.ValueType # 1 +HTTPS: Scheme.ValueType # 2 +WS: Scheme.ValueType # 3 +WSS: Scheme.ValueType # 4 global___Scheme = Scheme @typing.final @@ -68,47 +72,45 @@ class Swagger(google.protobuf.message.Message): produces: "application/json"; }; """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class ResponsesEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> global___Response: - ... - - def __init__(self, *, key: builtins.str | None=..., value: global___Response | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... + def value(self) -> global___Response: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: global___Response | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... @typing.final class ExtensionsEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> google.protobuf.struct_pb2.Value: - ... - - def __init__(self, *, key: builtins.str | None=..., value: google.protobuf.struct_pb2.Value | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... + def value(self) -> google.protobuf.struct_pb2.Value: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: google.protobuf.struct_pb2.Value | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... SWAGGER_FIELD_NUMBER: builtins.int INFO_FIELD_NUMBER: builtins.int HOST_FIELD_NUMBER: builtins.int @@ -122,12 +124,27 @@ class Swagger(google.protobuf.message.Message): EXTERNAL_DOCS_FIELD_NUMBER: builtins.int EXTENSIONS_FIELD_NUMBER: builtins.int swagger: builtins.str - 'Specifies the OpenAPI Specification version being used. It can be\n used by the OpenAPI UI and other clients to interpret the API listing. The\n value MUST be "2.0".\n ' + """Specifies the OpenAPI Specification version being used. It can be + used by the OpenAPI UI and other clients to interpret the API listing. The + value MUST be "2.0". + """ host: builtins.str - 'The host (name or ip) serving the API. This MUST be the host only and does\n not include the scheme nor sub-paths. It MAY include a port. If the host is\n not included, the host serving the documentation is to be used (including\n the port). The host does not support path templating.\n ' + """The host (name or ip) serving the API. This MUST be the host only and does + not include the scheme nor sub-paths. It MAY include a port. If the host is + not included, the host serving the documentation is to be used (including + the port). The host does not support path templating. + """ base_path: builtins.str - 'The base path on which the API is served, which is relative to the host. If\n it is not included, the API is served directly under the host. The value\n MUST start with a leading slash (/). The basePath does not support path\n templating.\n Note that using `base_path` does not change the endpoint paths that are\n generated in the resulting OpenAPI file. If you wish to use `base_path`\n with relatively generated OpenAPI paths, the `base_path` prefix must be\n manually removed from your `google.api.http` paths and your code changed to\n serve the API from the `base_path`.\n ' - + """The base path on which the API is served, which is relative to the host. If + it is not included, the API is served directly under the host. The value + MUST start with a leading slash (/). The basePath does not support path + templating. + Note that using `base_path` does not change the endpoint paths that are + generated in the resulting OpenAPI file. If you wish to use `base_path` + with relatively generated OpenAPI paths, the `base_path` prefix must be + manually removed from your `google.api.http` paths and your code changed to + serve the API from the `base_path`. + """ @property def info(self) -> global___Info: """Provides metadata about the API. The metadata can be used by the @@ -178,17 +195,26 @@ class Swagger(google.protobuf.message.Message): """Additional external documentation.""" @property - def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: - ... + def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: ... + def __init__( + self, + *, + swagger: builtins.str | None = ..., + info: global___Info | None = ..., + host: builtins.str | None = ..., + base_path: builtins.str | None = ..., + schemes: collections.abc.Iterable[global___Scheme.ValueType] | None = ..., + consumes: collections.abc.Iterable[builtins.str] | None = ..., + produces: collections.abc.Iterable[builtins.str] | None = ..., + responses: collections.abc.Mapping[builtins.str, global___Response] | None = ..., + security_definitions: global___SecurityDefinitions | None = ..., + security: collections.abc.Iterable[global___SecurityRequirement] | None = ..., + external_docs: global___ExternalDocumentation | None = ..., + extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["external_docs", b"external_docs", "info", b"info", "security_definitions", b"security_definitions"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["base_path", b"base_path", "consumes", b"consumes", "extensions", b"extensions", "external_docs", b"external_docs", "host", b"host", "info", b"info", "produces", b"produces", "responses", b"responses", "schemes", b"schemes", "security", b"security", "security_definitions", b"security_definitions", "swagger", b"swagger"]) -> None: ... - def __init__(self, *, swagger: builtins.str | None=..., info: global___Info | None=..., host: builtins.str | None=..., base_path: builtins.str | None=..., schemes: collections.abc.Iterable[global___Scheme.ValueType] | None=..., consumes: collections.abc.Iterable[builtins.str] | None=..., produces: collections.abc.Iterable[builtins.str] | None=..., responses: collections.abc.Mapping[builtins.str, global___Response] | None=..., security_definitions: global___SecurityDefinitions | None=..., security: collections.abc.Iterable[global___SecurityRequirement] | None=..., external_docs: global___ExternalDocumentation | None=..., extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['external_docs', b'external_docs', 'info', b'info', 'security_definitions', b'security_definitions']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['base_path', b'base_path', 'consumes', b'consumes', 'extensions', b'extensions', 'external_docs', b'external_docs', 'host', b'host', 'info', b'info', 'produces', b'produces', 'responses', b'responses', 'schemes', b'schemes', 'security', b'security', 'security_definitions', b'security_definitions', 'swagger', b'swagger']) -> None: - ... global___Swagger = Swagger @typing.final @@ -219,47 +245,45 @@ class Operation(google.protobuf.message.Message): } } """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class ResponsesEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> global___Response: - ... - - def __init__(self, *, key: builtins.str | None=..., value: global___Response | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... + def value(self) -> global___Response: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: global___Response | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... @typing.final class ExtensionsEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> google.protobuf.struct_pb2.Value: - ... - - def __init__(self, *, key: builtins.str | None=..., value: google.protobuf.struct_pb2.Value | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... + def value(self) -> google.protobuf.struct_pb2.Value: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: google.protobuf.struct_pb2.Value | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... TAGS_FIELD_NUMBER: builtins.int SUMMARY_FIELD_NUMBER: builtins.int DESCRIPTION_FIELD_NUMBER: builtins.int @@ -273,14 +297,23 @@ class Operation(google.protobuf.message.Message): SECURITY_FIELD_NUMBER: builtins.int EXTENSIONS_FIELD_NUMBER: builtins.int summary: builtins.str - 'A short summary of what the operation does. For maximum readability in the\n swagger-ui, this field SHOULD be less than 120 characters.\n ' + """A short summary of what the operation does. For maximum readability in the + swagger-ui, this field SHOULD be less than 120 characters. + """ description: builtins.str - 'A verbose explanation of the operation behavior. GFM syntax can be used for\n rich text representation.\n ' + """A verbose explanation of the operation behavior. GFM syntax can be used for + rich text representation. + """ operation_id: builtins.str - 'Unique string used to identify the operation. The id MUST be unique among\n all operations described in the API. Tools and libraries MAY use the\n operationId to uniquely identify an operation, therefore, it is recommended\n to follow common programming naming conventions.\n ' + """Unique string used to identify the operation. The id MUST be unique among + all operations described in the API. Tools and libraries MAY use the + operationId to uniquely identify an operation, therefore, it is recommended + to follow common programming naming conventions. + """ deprecated: builtins.bool - 'Declares this operation to be deprecated. Usage of the declared operation\n should be refrained. Default value is false.\n ' - + """Declares this operation to be deprecated. Usage of the declared operation + should be refrained. Default value is false. + """ @property def tags(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """A list of tags for API documentation control. Tags can be used for logical @@ -328,17 +361,26 @@ class Operation(google.protobuf.message.Message): """ @property - def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: - ... - - def __init__(self, *, tags: collections.abc.Iterable[builtins.str] | None=..., summary: builtins.str | None=..., description: builtins.str | None=..., external_docs: global___ExternalDocumentation | None=..., operation_id: builtins.str | None=..., consumes: collections.abc.Iterable[builtins.str] | None=..., produces: collections.abc.Iterable[builtins.str] | None=..., responses: collections.abc.Mapping[builtins.str, global___Response] | None=..., schemes: collections.abc.Iterable[global___Scheme.ValueType] | None=..., deprecated: builtins.bool | None=..., security: collections.abc.Iterable[global___SecurityRequirement] | None=..., extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None=...) -> None: - ... + def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: ... + def __init__( + self, + *, + tags: collections.abc.Iterable[builtins.str] | None = ..., + summary: builtins.str | None = ..., + description: builtins.str | None = ..., + external_docs: global___ExternalDocumentation | None = ..., + operation_id: builtins.str | None = ..., + consumes: collections.abc.Iterable[builtins.str] | None = ..., + produces: collections.abc.Iterable[builtins.str] | None = ..., + responses: collections.abc.Mapping[builtins.str, global___Response] | None = ..., + schemes: collections.abc.Iterable[global___Scheme.ValueType] | None = ..., + deprecated: builtins.bool | None = ..., + security: collections.abc.Iterable[global___SecurityRequirement] | None = ..., + extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["external_docs", b"external_docs"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["consumes", b"consumes", "deprecated", b"deprecated", "description", b"description", "extensions", b"extensions", "external_docs", b"external_docs", "operation_id", b"operation_id", "produces", b"produces", "responses", b"responses", "schemes", b"schemes", "security", b"security", "summary", b"summary", "tags", b"tags"]) -> None: ... - def HasField(self, field_name: typing.Literal['external_docs', b'external_docs']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['consumes', b'consumes', 'deprecated', b'deprecated', 'description', b'description', 'extensions', b'extensions', 'external_docs', b'external_docs', 'operation_id', b'operation_id', 'produces', b'produces', 'responses', b'responses', 'schemes', b'schemes', 'security', b'security', 'summary', b'summary', 'tags', b'tags']) -> None: - ... global___Operation = Operation @typing.final @@ -347,28 +389,38 @@ class Header(google.protobuf.message.Message): See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTION_FIELD_NUMBER: builtins.int TYPE_FIELD_NUMBER: builtins.int FORMAT_FIELD_NUMBER: builtins.int DEFAULT_FIELD_NUMBER: builtins.int PATTERN_FIELD_NUMBER: builtins.int description: builtins.str - '`Description` is a short description of the header.' + """`Description` is a short description of the header.""" type: builtins.str - 'The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported.' + """The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported.""" format: builtins.str - '`Format` The extending format for the previously mentioned type.' + """`Format` The extending format for the previously mentioned type.""" default: builtins.str - '`Default` Declares the value of the header that the server will use if none is provided.\n See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2.\n Unlike JSON Schema this value MUST conform to the defined type for the header.\n ' + """`Default` Declares the value of the header that the server will use if none is provided. + See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. + Unlike JSON Schema this value MUST conform to the defined type for the header. + """ pattern: builtins.str - "'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3." - - def __init__(self, *, description: builtins.str | None=..., type: builtins.str | None=..., format: builtins.str | None=..., default: builtins.str | None=..., pattern: builtins.str | None=...) -> None: - ... + """'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3.""" + def __init__( + self, + *, + description: builtins.str | None = ..., + type: builtins.str | None = ..., + format: builtins.str | None = ..., + default: builtins.str | None = ..., + pattern: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["default", b"default", "description", b"description", "format", b"format", "pattern", b"pattern", "type", b"type"]) -> None: ... - def ClearField(self, field_name: typing.Literal['default', b'default', 'description', b'description', 'format', b'format', 'pattern', b'pattern', 'type', b'type']) -> None: - ... global___Header = Header @typing.final @@ -377,69 +429,70 @@ class Response(google.protobuf.message.Message): See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class HeadersEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> global___Header: - ... - - def __init__(self, *, key: builtins.str | None=..., value: global___Header | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... + def value(self) -> global___Header: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: global___Header | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... @typing.final class ExamplesEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str value: builtins.str - - def __init__(self, *, key: builtins.str | None=..., value: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... @typing.final class ExtensionsEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> google.protobuf.struct_pb2.Value: - ... - - def __init__(self, *, key: builtins.str | None=..., value: google.protobuf.struct_pb2.Value | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... + def value(self) -> google.protobuf.struct_pb2.Value: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: google.protobuf.struct_pb2.Value | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... DESCRIPTION_FIELD_NUMBER: builtins.int SCHEMA_FIELD_NUMBER: builtins.int HEADERS_FIELD_NUMBER: builtins.int EXAMPLES_FIELD_NUMBER: builtins.int EXTENSIONS_FIELD_NUMBER: builtins.int description: builtins.str - '`Description` is a short description of the response.\n GFM syntax can be used for rich text representation.\n ' - + """`Description` is a short description of the response. + GFM syntax can be used for rich text representation. + """ @property def schema(self) -> global___Schema: """`Schema` optionally defines the structure of the response. @@ -460,17 +513,19 @@ class Response(google.protobuf.message.Message): """ @property - def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: - ... - - def __init__(self, *, description: builtins.str | None=..., schema: global___Schema | None=..., headers: collections.abc.Mapping[builtins.str, global___Header] | None=..., examples: collections.abc.Mapping[builtins.str, builtins.str] | None=..., extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None=...) -> None: - ... + def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: ... + def __init__( + self, + *, + description: builtins.str | None = ..., + schema: global___Schema | None = ..., + headers: collections.abc.Mapping[builtins.str, global___Header] | None = ..., + examples: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., + extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["schema", b"schema"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "examples", b"examples", "extensions", b"extensions", "headers", b"headers", "schema", b"schema"]) -> None: ... - def HasField(self, field_name: typing.Literal['schema', b'schema']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'examples', b'examples', 'extensions', b'extensions', 'headers', b'headers', 'schema', b'schema']) -> None: - ... global___Response = Response @typing.final @@ -499,27 +554,27 @@ class Info(google.protobuf.message.Message): ... }; """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class ExtensionsEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> google.protobuf.struct_pb2.Value: - ... - - def __init__(self, *, key: builtins.str | None=..., value: google.protobuf.struct_pb2.Value | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... + def value(self) -> google.protobuf.struct_pb2.Value: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: google.protobuf.struct_pb2.Value | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... TITLE_FIELD_NUMBER: builtins.int DESCRIPTION_FIELD_NUMBER: builtins.int TERMS_OF_SERVICE_FIELD_NUMBER: builtins.int @@ -528,14 +583,17 @@ class Info(google.protobuf.message.Message): VERSION_FIELD_NUMBER: builtins.int EXTENSIONS_FIELD_NUMBER: builtins.int title: builtins.str - 'The title of the application.' + """The title of the application.""" description: builtins.str - 'A short description of the application. GFM syntax can be used for rich\n text representation.\n ' + """A short description of the application. GFM syntax can be used for rich + text representation. + """ terms_of_service: builtins.str - 'The Terms of Service for the API.' + """The Terms of Service for the API.""" version: builtins.str - 'Provides the version of the application API (not to be confused\n with the specification version).\n ' - + """Provides the version of the application API (not to be confused + with the specification version). + """ @property def contact(self) -> global___Contact: """The contact information for the exposed API.""" @@ -545,17 +603,21 @@ class Info(google.protobuf.message.Message): """The license information for the exposed API.""" @property - def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: - ... - - def __init__(self, *, title: builtins.str | None=..., description: builtins.str | None=..., terms_of_service: builtins.str | None=..., contact: global___Contact | None=..., license: global___License | None=..., version: builtins.str | None=..., extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['contact', b'contact', 'license', b'license']) -> builtins.bool: - ... + def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: ... + def __init__( + self, + *, + title: builtins.str | None = ..., + description: builtins.str | None = ..., + terms_of_service: builtins.str | None = ..., + contact: global___Contact | None = ..., + license: global___License | None = ..., + version: builtins.str | None = ..., + extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["contact", b"contact", "license", b"license"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["contact", b"contact", "description", b"description", "extensions", b"extensions", "license", b"license", "terms_of_service", b"terms_of_service", "title", b"title", "version", b"version"]) -> None: ... - def ClearField(self, field_name: typing.Literal['contact', b'contact', 'description', b'description', 'extensions', b'extensions', 'license', b'license', 'terms_of_service', b'terms_of_service', 'title', b'title', 'version', b'version']) -> None: - ... global___Info = Info @typing.final @@ -579,22 +641,31 @@ class Contact(google.protobuf.message.Message): ... }; """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int URL_FIELD_NUMBER: builtins.int EMAIL_FIELD_NUMBER: builtins.int name: builtins.str - 'The identifying name of the contact person/organization.' + """The identifying name of the contact person/organization.""" url: builtins.str - 'The URL pointing to the contact information. MUST be in the format of a\n URL.\n ' + """The URL pointing to the contact information. MUST be in the format of a + URL. + """ email: builtins.str - 'The email address of the contact person/organization. MUST be in the format\n of an email address.\n ' - - def __init__(self, *, name: builtins.str | None=..., url: builtins.str | None=..., email: builtins.str | None=...) -> None: - ... + """The email address of the contact person/organization. MUST be in the format + of an email address. + """ + def __init__( + self, + *, + name: builtins.str | None = ..., + url: builtins.str | None = ..., + email: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["email", b"email", "name", b"name", "url", b"url"]) -> None: ... - def ClearField(self, field_name: typing.Literal['email', b'email', 'name', b'name', 'url', b'url']) -> None: - ... global___Contact = Contact @typing.final @@ -617,19 +688,23 @@ class License(google.protobuf.message.Message): ... }; """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + NAME_FIELD_NUMBER: builtins.int URL_FIELD_NUMBER: builtins.int name: builtins.str - 'The license name used for the API.' + """The license name used for the API.""" url: builtins.str - 'A URL to the license used for the API. MUST be in the format of a URL.' + """A URL to the license used for the API. MUST be in the format of a URL.""" + def __init__( + self, + *, + name: builtins.str | None = ..., + url: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["name", b"name", "url", b"url"]) -> None: ... - def __init__(self, *, name: builtins.str | None=..., url: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name', 'url', b'url']) -> None: - ... global___License = License @typing.final @@ -650,19 +725,27 @@ class ExternalDocumentation(google.protobuf.message.Message): ... }; """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTION_FIELD_NUMBER: builtins.int URL_FIELD_NUMBER: builtins.int description: builtins.str - 'A short description of the target documentation. GFM syntax can be used for\n rich text representation.\n ' + """A short description of the target documentation. GFM syntax can be used for + rich text representation. + """ url: builtins.str - 'The URL for the target documentation. Value MUST be in the format\n of a URL.\n ' - - def __init__(self, *, description: builtins.str | None=..., url: builtins.str | None=...) -> None: - ... + """The URL for the target documentation. Value MUST be in the format + of a URL. + """ + def __init__( + self, + *, + description: builtins.str | None = ..., + url: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "url", b"url"]) -> None: ... - def ClearField(self, field_name: typing.Literal['description', b'description', 'url', b'url']) -> None: - ... global___ExternalDocumentation = ExternalDocumentation @typing.final @@ -671,35 +754,50 @@ class Schema(google.protobuf.message.Message): See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + JSON_SCHEMA_FIELD_NUMBER: builtins.int DISCRIMINATOR_FIELD_NUMBER: builtins.int READ_ONLY_FIELD_NUMBER: builtins.int EXTERNAL_DOCS_FIELD_NUMBER: builtins.int EXAMPLE_FIELD_NUMBER: builtins.int discriminator: builtins.str - 'Adds support for polymorphism. The discriminator is the schema property\n name that is used to differentiate between other schema that inherit this\n schema. The property name used MUST be defined at this schema and it MUST\n be in the required property list. When used, the value MUST be the name of\n this schema or any schema that inherits it.\n ' + """Adds support for polymorphism. The discriminator is the schema property + name that is used to differentiate between other schema that inherit this + schema. The property name used MUST be defined at this schema and it MUST + be in the required property list. When used, the value MUST be the name of + this schema or any schema that inherits it. + """ read_only: builtins.bool - 'Relevant only for Schema "properties" definitions. Declares the property as\n "read only". This means that it MAY be sent as part of a response but MUST\n NOT be sent as part of the request. Properties marked as readOnly being\n true SHOULD NOT be in the required list of the defined schema. Default\n value is false.\n ' + """Relevant only for Schema "properties" definitions. Declares the property as + "read only". This means that it MAY be sent as part of a response but MUST + NOT be sent as part of the request. Properties marked as readOnly being + true SHOULD NOT be in the required list of the defined schema. Default + value is false. + """ example: builtins.str - 'A free-form property to include an example of an instance for this schema in JSON.\n This is copied verbatim to the output.\n ' - + """A free-form property to include an example of an instance for this schema in JSON. + This is copied verbatim to the output. + """ @property - def json_schema(self) -> global___JSONSchema: - ... - + def json_schema(self) -> global___JSONSchema: ... @property def external_docs(self) -> global___ExternalDocumentation: """Additional external documentation for this schema.""" - def __init__(self, *, json_schema: global___JSONSchema | None=..., discriminator: builtins.str | None=..., read_only: builtins.bool | None=..., external_docs: global___ExternalDocumentation | None=..., example: builtins.str | None=...) -> None: - ... + def __init__( + self, + *, + json_schema: global___JSONSchema | None = ..., + discriminator: builtins.str | None = ..., + read_only: builtins.bool | None = ..., + external_docs: global___ExternalDocumentation | None = ..., + example: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["external_docs", b"external_docs", "json_schema", b"json_schema"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["discriminator", b"discriminator", "example", b"example", "external_docs", b"external_docs", "json_schema", b"json_schema", "read_only", b"read_only"]) -> None: ... - def HasField(self, field_name: typing.Literal['external_docs', b'external_docs', 'json_schema', b'json_schema']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['discriminator', b'discriminator', 'example', b'example', 'external_docs', b'external_docs', 'json_schema', b'json_schema', 'read_only', b'read_only']) -> None: - ... global___Schema = Schema @typing.final @@ -732,49 +830,56 @@ class JSONSchema(google.protobuf.message.Message): }]; } """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor class _JSONSchemaSimpleTypes: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType class _JSONSchemaSimpleTypesEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[JSONSchema._JSONSchemaSimpleTypes.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - UNKNOWN: JSONSchema._JSONSchemaSimpleTypes.ValueType - ARRAY: JSONSchema._JSONSchemaSimpleTypes.ValueType - BOOLEAN: JSONSchema._JSONSchemaSimpleTypes.ValueType - INTEGER: JSONSchema._JSONSchemaSimpleTypes.ValueType - NULL: JSONSchema._JSONSchemaSimpleTypes.ValueType - NUMBER: JSONSchema._JSONSchemaSimpleTypes.ValueType - OBJECT: JSONSchema._JSONSchemaSimpleTypes.ValueType - STRING: JSONSchema._JSONSchemaSimpleTypes.ValueType - - class JSONSchemaSimpleTypes(_JSONSchemaSimpleTypes, metaclass=_JSONSchemaSimpleTypesEnumTypeWrapper): - ... - UNKNOWN: JSONSchema.JSONSchemaSimpleTypes.ValueType - ARRAY: JSONSchema.JSONSchemaSimpleTypes.ValueType - BOOLEAN: JSONSchema.JSONSchemaSimpleTypes.ValueType - INTEGER: JSONSchema.JSONSchemaSimpleTypes.ValueType - NULL: JSONSchema.JSONSchemaSimpleTypes.ValueType - NUMBER: JSONSchema.JSONSchemaSimpleTypes.ValueType - OBJECT: JSONSchema.JSONSchemaSimpleTypes.ValueType - STRING: JSONSchema.JSONSchemaSimpleTypes.ValueType + UNKNOWN: JSONSchema._JSONSchemaSimpleTypes.ValueType # 0 + ARRAY: JSONSchema._JSONSchemaSimpleTypes.ValueType # 1 + BOOLEAN: JSONSchema._JSONSchemaSimpleTypes.ValueType # 2 + INTEGER: JSONSchema._JSONSchemaSimpleTypes.ValueType # 3 + NULL: JSONSchema._JSONSchemaSimpleTypes.ValueType # 4 + NUMBER: JSONSchema._JSONSchemaSimpleTypes.ValueType # 5 + OBJECT: JSONSchema._JSONSchemaSimpleTypes.ValueType # 6 + STRING: JSONSchema._JSONSchemaSimpleTypes.ValueType # 7 + + class JSONSchemaSimpleTypes(_JSONSchemaSimpleTypes, metaclass=_JSONSchemaSimpleTypesEnumTypeWrapper): ... + UNKNOWN: JSONSchema.JSONSchemaSimpleTypes.ValueType # 0 + ARRAY: JSONSchema.JSONSchemaSimpleTypes.ValueType # 1 + BOOLEAN: JSONSchema.JSONSchemaSimpleTypes.ValueType # 2 + INTEGER: JSONSchema.JSONSchemaSimpleTypes.ValueType # 3 + NULL: JSONSchema.JSONSchemaSimpleTypes.ValueType # 4 + NUMBER: JSONSchema.JSONSchemaSimpleTypes.ValueType # 5 + OBJECT: JSONSchema.JSONSchemaSimpleTypes.ValueType # 6 + STRING: JSONSchema.JSONSchemaSimpleTypes.ValueType # 7 @typing.final class FieldConfiguration(google.protobuf.message.Message): """'FieldConfiguration' provides additional field level properties used when generating the OpenAPI v2 file. These properties are not defined by OpenAPIv2, but they are used to control the generation. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + PATH_PARAM_NAME_FIELD_NUMBER: builtins.int path_param_name: builtins.str - 'Alternative parameter name when used as path parameter. If set, this will\n be used as the complete parameter name when this field is used as a path\n parameter. Use this to avoid having auto generated path parameter names\n for overlapping paths.\n ' - - def __init__(self, *, path_param_name: builtins.str | None=...) -> None: - ... + """Alternative parameter name when used as path parameter. If set, this will + be used as the complete parameter name when this field is used as a path + parameter. Use this to avoid having auto generated path parameter names + for overlapping paths. + """ + def __init__( + self, + *, + path_param_name: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["path_param_name", b"path_param_name"]) -> None: ... - def ClearField(self, field_name: typing.Literal['path_param_name', b'path_param_name']) -> None: - ... REF_FIELD_NUMBER: builtins.int TITLE_FIELD_NUMBER: builtins.int DESCRIPTION_FIELD_NUMBER: builtins.int @@ -801,21 +906,34 @@ class JSONSchema(google.protobuf.message.Message): ENUM_FIELD_NUMBER: builtins.int FIELD_CONFIGURATION_FIELD_NUMBER: builtins.int ref: builtins.str - 'Ref is used to define an external reference to include in the message.\n This could be a fully qualified proto message reference, and that type must\n be imported into the protofile. If no message is identified, the Ref will\n be used verbatim in the output.\n For example:\n `ref: ".google.protobuf.Timestamp"`.\n ' + """Ref is used to define an external reference to include in the message. + This could be a fully qualified proto message reference, and that type must + be imported into the protofile. If no message is identified, the Ref will + be used verbatim in the output. + For example: + `ref: ".google.protobuf.Timestamp"`. + """ title: builtins.str - 'The title of the schema.' + """The title of the schema.""" description: builtins.str - 'A short description of the schema.' + """A short description of the schema.""" default: builtins.str read_only: builtins.bool example: builtins.str - 'A free-form property to include a JSON example of this field. This is copied\n verbatim to the output swagger.json. Quotes must be escaped.\n This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject\n ' + """A free-form property to include a JSON example of this field. This is copied + verbatim to the output swagger.json. Quotes must be escaped. + This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + """ multiple_of: builtins.float maximum: builtins.float - 'Maximum represents an inclusive upper limit for a numeric instance. The\n value of MUST be a number,\n ' + """Maximum represents an inclusive upper limit for a numeric instance. The + value of MUST be a number, + """ exclusive_maximum: builtins.bool minimum: builtins.float - 'minimum represents an inclusive lower limit for a numeric instance. The\n value of MUST be a number,\n ' + """minimum represents an inclusive lower limit for a numeric instance. The + value of MUST be a number, + """ exclusive_minimum: builtins.bool max_length: builtins.int min_length: builtins.int @@ -826,20 +944,15 @@ class JSONSchema(google.protobuf.message.Message): max_properties: builtins.int min_properties: builtins.int format: builtins.str - '`Format`' - + """`Format`""" @property - def required(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: - ... - + def required(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... @property def array(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Items in 'array' must be unique.""" @property - def type(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[global___JSONSchema.JSONSchemaSimpleTypes.ValueType]: - ... - + def type(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[global___JSONSchema.JSONSchemaSimpleTypes.ValueType]: ... @property def enum(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: """Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1""" @@ -848,14 +961,38 @@ class JSONSchema(google.protobuf.message.Message): def field_configuration(self) -> global___JSONSchema.FieldConfiguration: """Additional field level properties used when generating the OpenAPI v2 file.""" - def __init__(self, *, ref: builtins.str | None=..., title: builtins.str | None=..., description: builtins.str | None=..., default: builtins.str | None=..., read_only: builtins.bool | None=..., example: builtins.str | None=..., multiple_of: builtins.float | None=..., maximum: builtins.float | None=..., exclusive_maximum: builtins.bool | None=..., minimum: builtins.float | None=..., exclusive_minimum: builtins.bool | None=..., max_length: builtins.int | None=..., min_length: builtins.int | None=..., pattern: builtins.str | None=..., max_items: builtins.int | None=..., min_items: builtins.int | None=..., unique_items: builtins.bool | None=..., max_properties: builtins.int | None=..., min_properties: builtins.int | None=..., required: collections.abc.Iterable[builtins.str] | None=..., array: collections.abc.Iterable[builtins.str] | None=..., type: collections.abc.Iterable[global___JSONSchema.JSONSchemaSimpleTypes.ValueType] | None=..., format: builtins.str | None=..., enum: collections.abc.Iterable[builtins.str] | None=..., field_configuration: global___JSONSchema.FieldConfiguration | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['field_configuration', b'field_configuration']) -> builtins.bool: - ... + def __init__( + self, + *, + ref: builtins.str | None = ..., + title: builtins.str | None = ..., + description: builtins.str | None = ..., + default: builtins.str | None = ..., + read_only: builtins.bool | None = ..., + example: builtins.str | None = ..., + multiple_of: builtins.float | None = ..., + maximum: builtins.float | None = ..., + exclusive_maximum: builtins.bool | None = ..., + minimum: builtins.float | None = ..., + exclusive_minimum: builtins.bool | None = ..., + max_length: builtins.int | None = ..., + min_length: builtins.int | None = ..., + pattern: builtins.str | None = ..., + max_items: builtins.int | None = ..., + min_items: builtins.int | None = ..., + unique_items: builtins.bool | None = ..., + max_properties: builtins.int | None = ..., + min_properties: builtins.int | None = ..., + required: collections.abc.Iterable[builtins.str] | None = ..., + array: collections.abc.Iterable[builtins.str] | None = ..., + type: collections.abc.Iterable[global___JSONSchema.JSONSchemaSimpleTypes.ValueType] | None = ..., + format: builtins.str | None = ..., + enum: collections.abc.Iterable[builtins.str] | None = ..., + field_configuration: global___JSONSchema.FieldConfiguration | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["field_configuration", b"field_configuration"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["array", b"array", "default", b"default", "description", b"description", "enum", b"enum", "example", b"example", "exclusive_maximum", b"exclusive_maximum", "exclusive_minimum", b"exclusive_minimum", "field_configuration", b"field_configuration", "format", b"format", "max_items", b"max_items", "max_length", b"max_length", "max_properties", b"max_properties", "maximum", b"maximum", "min_items", b"min_items", "min_length", b"min_length", "min_properties", b"min_properties", "minimum", b"minimum", "multiple_of", b"multiple_of", "pattern", b"pattern", "read_only", b"read_only", "ref", b"ref", "required", b"required", "title", b"title", "type", b"type", "unique_items", b"unique_items"]) -> None: ... - def ClearField(self, field_name: typing.Literal['array', b'array', 'default', b'default', 'description', b'description', 'enum', b'enum', 'example', b'example', 'exclusive_maximum', b'exclusive_maximum', 'exclusive_minimum', b'exclusive_minimum', 'field_configuration', b'field_configuration', 'format', b'format', 'max_items', b'max_items', 'max_length', b'max_length', 'max_properties', b'max_properties', 'maximum', b'maximum', 'min_items', b'min_items', 'min_length', b'min_length', 'min_properties', b'min_properties', 'minimum', b'minimum', 'multiple_of', b'multiple_of', 'pattern', b'pattern', 'read_only', b'read_only', 'ref', b'ref', 'required', b'required', 'title', b'title', 'type', b'type', 'unique_items', b'unique_items']) -> None: - ... global___JSONSchema = JSONSchema @typing.final @@ -864,24 +1001,28 @@ class Tag(google.protobuf.message.Message): See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor + DESCRIPTION_FIELD_NUMBER: builtins.int EXTERNAL_DOCS_FIELD_NUMBER: builtins.int description: builtins.str - 'A short description for the tag. GFM syntax can be used for rich text\n representation.\n ' - + """A short description for the tag. GFM syntax can be used for rich text + representation. + """ @property def external_docs(self) -> global___ExternalDocumentation: """Additional external documentation for this tag.""" - def __init__(self, *, description: builtins.str | None=..., external_docs: global___ExternalDocumentation | None=...) -> None: - ... + def __init__( + self, + *, + description: builtins.str | None = ..., + external_docs: global___ExternalDocumentation | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["external_docs", b"external_docs"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["description", b"description", "external_docs", b"external_docs"]) -> None: ... - def HasField(self, field_name: typing.Literal['external_docs', b'external_docs']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'external_docs', b'external_docs']) -> None: - ... global___Tag = Tag @typing.final @@ -895,40 +1036,41 @@ class SecurityDefinitions(google.protobuf.message.Message): specification. This does not enforce the security schemes on the operations and only serves to provide the relevant details for each scheme. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class SecurityEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> global___SecurityScheme: - ... - - def __init__(self, *, key: builtins.str | None=..., value: global___SecurityScheme | None=...) -> None: - ... + def value(self) -> global___SecurityScheme: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: global___SecurityScheme | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... SECURITY_FIELD_NUMBER: builtins.int - @property def security(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___SecurityScheme]: """A single security scheme definition, mapping a "name" to the scheme it defines. """ - def __init__(self, *, security: collections.abc.Mapping[builtins.str, global___SecurityScheme] | None=...) -> None: - ... + def __init__( + self, + *, + security: collections.abc.Mapping[builtins.str, global___SecurityScheme] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["security", b"security"]) -> None: ... - def ClearField(self, field_name: typing.Literal['security', b'security']) -> None: - ... global___SecurityDefinitions = SecurityDefinitions @typing.final @@ -943,85 +1085,88 @@ class SecurityScheme(google.protobuf.message.Message): a header or as a query parameter) and OAuth2's common flows (implicit, password, application and access code). """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor class _Type: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[SecurityScheme._Type.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - TYPE_INVALID: SecurityScheme._Type.ValueType - TYPE_BASIC: SecurityScheme._Type.ValueType - TYPE_API_KEY: SecurityScheme._Type.ValueType - TYPE_OAUTH2: SecurityScheme._Type.ValueType + TYPE_INVALID: SecurityScheme._Type.ValueType # 0 + TYPE_BASIC: SecurityScheme._Type.ValueType # 1 + TYPE_API_KEY: SecurityScheme._Type.ValueType # 2 + TYPE_OAUTH2: SecurityScheme._Type.ValueType # 3 class Type(_Type, metaclass=_TypeEnumTypeWrapper): """The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". """ - TYPE_INVALID: SecurityScheme.Type.ValueType - TYPE_BASIC: SecurityScheme.Type.ValueType - TYPE_API_KEY: SecurityScheme.Type.ValueType - TYPE_OAUTH2: SecurityScheme.Type.ValueType + + TYPE_INVALID: SecurityScheme.Type.ValueType # 0 + TYPE_BASIC: SecurityScheme.Type.ValueType # 1 + TYPE_API_KEY: SecurityScheme.Type.ValueType # 2 + TYPE_OAUTH2: SecurityScheme.Type.ValueType # 3 class _In: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType class _InEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[SecurityScheme._In.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - IN_INVALID: SecurityScheme._In.ValueType - IN_QUERY: SecurityScheme._In.ValueType - IN_HEADER: SecurityScheme._In.ValueType + IN_INVALID: SecurityScheme._In.ValueType # 0 + IN_QUERY: SecurityScheme._In.ValueType # 1 + IN_HEADER: SecurityScheme._In.ValueType # 2 class In(_In, metaclass=_InEnumTypeWrapper): """The location of the API key. Valid values are "query" or "header".""" - IN_INVALID: SecurityScheme.In.ValueType - IN_QUERY: SecurityScheme.In.ValueType - IN_HEADER: SecurityScheme.In.ValueType + + IN_INVALID: SecurityScheme.In.ValueType # 0 + IN_QUERY: SecurityScheme.In.ValueType # 1 + IN_HEADER: SecurityScheme.In.ValueType # 2 class _Flow: - ValueType = typing.NewType('ValueType', builtins.int) + ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType class _FlowEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[SecurityScheme._Flow.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - FLOW_INVALID: SecurityScheme._Flow.ValueType - FLOW_IMPLICIT: SecurityScheme._Flow.ValueType - FLOW_PASSWORD: SecurityScheme._Flow.ValueType - FLOW_APPLICATION: SecurityScheme._Flow.ValueType - FLOW_ACCESS_CODE: SecurityScheme._Flow.ValueType + FLOW_INVALID: SecurityScheme._Flow.ValueType # 0 + FLOW_IMPLICIT: SecurityScheme._Flow.ValueType # 1 + FLOW_PASSWORD: SecurityScheme._Flow.ValueType # 2 + FLOW_APPLICATION: SecurityScheme._Flow.ValueType # 3 + FLOW_ACCESS_CODE: SecurityScheme._Flow.ValueType # 4 class Flow(_Flow, metaclass=_FlowEnumTypeWrapper): """The flow used by the OAuth2 security scheme. Valid values are "implicit", "password", "application" or "accessCode". """ - FLOW_INVALID: SecurityScheme.Flow.ValueType - FLOW_IMPLICIT: SecurityScheme.Flow.ValueType - FLOW_PASSWORD: SecurityScheme.Flow.ValueType - FLOW_APPLICATION: SecurityScheme.Flow.ValueType - FLOW_ACCESS_CODE: SecurityScheme.Flow.ValueType + + FLOW_INVALID: SecurityScheme.Flow.ValueType # 0 + FLOW_IMPLICIT: SecurityScheme.Flow.ValueType # 1 + FLOW_PASSWORD: SecurityScheme.Flow.ValueType # 2 + FLOW_APPLICATION: SecurityScheme.Flow.ValueType # 3 + FLOW_ACCESS_CODE: SecurityScheme.Flow.ValueType # 4 @typing.final class ExtensionsEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> google.protobuf.struct_pb2.Value: - ... - - def __init__(self, *, key: builtins.str | None=..., value: google.protobuf.struct_pb2.Value | None=...) -> None: - ... + def value(self) -> google.protobuf.struct_pb2.Value: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: google.protobuf.struct_pb2.Value | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... TYPE_FIELD_NUMBER: builtins.int DESCRIPTION_FIELD_NUMBER: builtins.int NAME_FIELD_NUMBER: builtins.int @@ -1032,18 +1177,30 @@ class SecurityScheme(google.protobuf.message.Message): SCOPES_FIELD_NUMBER: builtins.int EXTENSIONS_FIELD_NUMBER: builtins.int type: global___SecurityScheme.Type.ValueType - 'The type of the security scheme. Valid values are "basic",\n "apiKey" or "oauth2".\n ' + """The type of the security scheme. Valid values are "basic", + "apiKey" or "oauth2". + """ description: builtins.str - 'A short description for security scheme.' + """A short description for security scheme.""" name: builtins.str - 'The name of the header or query parameter to be used.\n Valid for apiKey.\n ' + """The name of the header or query parameter to be used. + Valid for apiKey. + """ flow: global___SecurityScheme.Flow.ValueType - 'The flow used by the OAuth2 security scheme. Valid values are\n "implicit", "password", "application" or "accessCode".\n Valid for oauth2.\n ' + """The flow used by the OAuth2 security scheme. Valid values are + "implicit", "password", "application" or "accessCode". + Valid for oauth2. + """ authorization_url: builtins.str - 'The authorization URL to be used for this flow. This SHOULD be in\n the form of a URL.\n Valid for oauth2/implicit and oauth2/accessCode.\n ' + """The authorization URL to be used for this flow. This SHOULD be in + the form of a URL. + Valid for oauth2/implicit and oauth2/accessCode. + """ token_url: builtins.str - 'The token URL to be used for this flow. This SHOULD be in the\n form of a URL.\n Valid for oauth2/password, oauth2/application and oauth2/accessCode.\n ' - + """The token URL to be used for this flow. This SHOULD be in the + form of a URL. + Valid for oauth2/password, oauth2/application and oauth2/accessCode. + """ @property def scopes(self) -> global___Scopes: """The available scopes for the OAuth2 security scheme. @@ -1051,17 +1208,22 @@ class SecurityScheme(google.protobuf.message.Message): """ @property - def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: - ... - - def __init__(self, *, type: global___SecurityScheme.Type.ValueType | None=..., description: builtins.str | None=..., name: builtins.str | None=..., flow: global___SecurityScheme.Flow.ValueType | None=..., authorization_url: builtins.str | None=..., token_url: builtins.str | None=..., scopes: global___Scopes | None=..., extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['scopes', b'scopes']) -> builtins.bool: - ... + def extensions(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, google.protobuf.struct_pb2.Value]: ... + def __init__( + self, + *, + type: global___SecurityScheme.Type.ValueType | None = ..., + description: builtins.str | None = ..., + name: builtins.str | None = ..., + flow: global___SecurityScheme.Flow.ValueType | None = ..., + authorization_url: builtins.str | None = ..., + token_url: builtins.str | None = ..., + scopes: global___Scopes | None = ..., + extensions: collections.abc.Mapping[builtins.str, google.protobuf.struct_pb2.Value] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["scopes", b"scopes"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["authorization_url", b"authorization_url", "description", b"description", "extensions", b"extensions", "flow", b"flow", "in", b"in", "name", b"name", "scopes", b"scopes", "token_url", b"token_url", "type", b"type"]) -> None: ... - def ClearField(self, field_name: typing.Literal['authorization_url', b'authorization_url', 'description', b'description', 'extensions', b'extensions', 'flow', b'flow', 'in', b'in', 'name', b'name', 'scopes', b'scopes', 'token_url', b'token_url', 'type', b'type']) -> None: - ... global___SecurityScheme = SecurityScheme @typing.final @@ -1078,6 +1240,7 @@ class SecurityRequirement(google.protobuf.message.Message): The name used for each property MUST correspond to a security scheme declared in the Security Definitions. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final @@ -1086,40 +1249,38 @@ class SecurityRequirement(google.protobuf.message.Message): scope names required for the execution. For other security scheme types, the array MUST be empty. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor - SCOPE_FIELD_NUMBER: builtins.int + SCOPE_FIELD_NUMBER: builtins.int @property - def scope(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: - ... - - def __init__(self, *, scope: collections.abc.Iterable[builtins.str] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['scope', b'scope']) -> None: - ... + def scope(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + def __init__( + self, + *, + scope: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["scope", b"scope"]) -> None: ... @typing.final class SecurityRequirementEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str - @property - def value(self) -> global___SecurityRequirement.SecurityRequirementValue: - ... - - def __init__(self, *, key: builtins.str | None=..., value: global___SecurityRequirement.SecurityRequirementValue | None=...) -> None: - ... + def value(self) -> global___SecurityRequirement.SecurityRequirementValue: ... + def __init__( + self, + *, + key: builtins.str | None = ..., + value: global___SecurityRequirement.SecurityRequirementValue | None = ..., + ) -> None: ... + def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def HasField(self, field_name: typing.Literal['value', b'value']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... SECURITY_REQUIREMENT_FIELD_NUMBER: builtins.int - @property def security_requirement(self) -> google.protobuf.internal.containers.MessageMap[builtins.str, global___SecurityRequirement.SecurityRequirementValue]: """Each name must correspond to a security scheme which is declared in @@ -1128,11 +1289,13 @@ class SecurityRequirement(google.protobuf.message.Message): For other security scheme types, the array MUST be empty. """ - def __init__(self, *, security_requirement: collections.abc.Mapping[builtins.str, global___SecurityRequirement.SecurityRequirementValue] | None=...) -> None: - ... + def __init__( + self, + *, + security_requirement: collections.abc.Mapping[builtins.str, global___SecurityRequirement.SecurityRequirementValue] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["security_requirement", b"security_requirement"]) -> None: ... - def ClearField(self, field_name: typing.Literal['security_requirement', b'security_requirement']) -> None: - ... global___SecurityRequirement = SecurityRequirement @typing.final @@ -1143,32 +1306,37 @@ class Scopes(google.protobuf.message.Message): Lists the available scopes for an OAuth2 security scheme. """ + DESCRIPTOR: google.protobuf.descriptor.Descriptor @typing.final class ScopeEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor + KEY_FIELD_NUMBER: builtins.int VALUE_FIELD_NUMBER: builtins.int key: builtins.str value: builtins.str + def __init__( + self, + *, + key: builtins.str | None = ..., + value: builtins.str | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ... - def __init__(self, *, key: builtins.str | None=..., value: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['key', b'key', 'value', b'value']) -> None: - ... SCOPE_FIELD_NUMBER: builtins.int - @property def scope(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: """Maps between a name of a scope to a short description of it (as the value of the property). """ - def __init__(self, *, scope: collections.abc.Mapping[builtins.str, builtins.str] | None=...) -> None: - ... + def __init__( + self, + *, + scope: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing.Literal["scope", b"scope"]) -> None: ... - def ClearField(self, field_name: typing.Literal['scope', b'scope']) -> None: - ... -global___Scopes = Scopes \ No newline at end of file +global___Scopes = Scopes diff --git a/exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py b/exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py new file mode 100644 index 00000000..b1d09e8a --- /dev/null +++ b/exabel/stubs/protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py @@ -0,0 +1,24 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc +import warnings + + +GRPC_GENERATED_VERSION = '1.76.0' +GRPC_VERSION = grpc.__version__ +_version_not_supported = False + +try: + from grpc._utilities import first_version_is_lower + _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) +except ImportError: + _version_not_supported = True + +if _version_not_supported: + raise RuntimeError( + f'The grpc package installed is at version {GRPC_VERSION},' + + ' but the generated code in protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py depends on' + + f' grpcio>={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) diff --git a/exabel_data_sdk/tests/__init__.py b/exabel/tests/__init__.py similarity index 100% rename from exabel_data_sdk/tests/__init__.py rename to exabel/tests/__init__.py diff --git a/exabel_data_sdk/tests/client/__init__.py b/exabel/tests/client/__init__.py similarity index 100% rename from exabel_data_sdk/tests/client/__init__.py rename to exabel/tests/client/__init__.py diff --git a/exabel_data_sdk/tests/client/api/__init__.py b/exabel/tests/client/api/__init__.py similarity index 100% rename from exabel_data_sdk/tests/client/api/__init__.py rename to exabel/tests/client/api/__init__.py diff --git a/exabel_data_sdk/tests/client/api/api_client/__init__.py b/exabel/tests/client/api/api_client/__init__.py similarity index 100% rename from exabel_data_sdk/tests/client/api/api_client/__init__.py rename to exabel/tests/client/api/api_client/__init__.py diff --git a/exabel/tests/client/api/api_client/test_exabel_api_group.py b/exabel/tests/client/api/api_client/test_exabel_api_group.py new file mode 100644 index 00000000..22433f0b --- /dev/null +++ b/exabel/tests/client/api/api_client/test_exabel_api_group.py @@ -0,0 +1,14 @@ +from exabel.client.api.api_client.exabel_api_group import ExabelApiGroup +from exabel.client.client_config import ClientConfig + + +class TestExabelApiGroup: + def test_get_host(self): + config = ClientConfig(api_key="123", data_api_host="localhost") + assert "localhost" == ExabelApiGroup.DATA_API.get_host(config) + assert "management.api.exabel.com" == ExabelApiGroup.MANAGEMENT_API.get_host(config) + + def test_get_port(self): + config = ClientConfig(api_key="123", analytics_api_port=123) + assert 123 == ExabelApiGroup.ANALYTICS_API.get_port(config) + assert 21443 == ExabelApiGroup.MANAGEMENT_API.get_port(config) diff --git a/exabel_data_sdk/tests/client/api/data_classes/__init__.py b/exabel/tests/client/api/data_classes/__init__.py similarity index 100% rename from exabel_data_sdk/tests/client/api/data_classes/__init__.py rename to exabel/tests/client/api/data_classes/__init__.py diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_data_set.py b/exabel/tests/client/api/data_classes/test_data_set.py similarity index 82% rename from exabel_data_sdk/tests/client/api/data_classes/test_data_set.py rename to exabel/tests/client/api/data_classes/test_data_set.py index 5a56cb13..37e9a477 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_data_set.py +++ b/exabel/tests/client/api/data_classes/test_data_set.py @@ -1,9 +1,7 @@ -import unittest +from exabel.client.api.data_classes.data_set import DataSet -from exabel_data_sdk.client.api.data_classes.data_set import DataSet - -class TestDataSet(unittest.TestCase): +class TestDataSet: def test_proto_conversion(self): data_set = DataSet( name="dataSet/customerA.MyData", @@ -11,7 +9,7 @@ def test_proto_conversion(self): description="description", signals=["signals/ns.sig1", "signals/ns.sig2"], ) - self.assertEqual(data_set, DataSet.from_proto(data_set.to_proto())) + assert data_set == DataSet.from_proto(data_set.to_proto()) def test_constructor_without_signals(self): data_set = DataSet( @@ -19,7 +17,7 @@ def test_constructor_without_signals(self): display_name="Revenue per store.", description="description", ) - self.assertEqual([], data_set.signals) + assert [] == data_set.signals def test_equals(self): data_set_1 = DataSet( @@ -52,6 +50,6 @@ def test_equals(self): derived_signals=["derivedSignals/321", "derivedSignals/123"], highlighted_signals=["derivedSignals/123", "derivedSignals/321"], ) - self.assertEqual(data_set_1, data_set_2) - self.assertNotEqual(data_set_1, data_set_3) - self.assertNotEqual(data_set_1, data_set_4) + assert data_set_1 == data_set_2 + assert data_set_1 != data_set_3 + assert data_set_1 != data_set_4 diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_derived_signal.py b/exabel/tests/client/api/data_classes/test_derived_signal.py similarity index 63% rename from exabel_data_sdk/tests/client/api/data_classes/test_derived_signal.py rename to exabel/tests/client/api/data_classes/test_derived_signal.py index d3311ead..85b391fd 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_derived_signal.py +++ b/exabel/tests/client/api/data_classes/test_derived_signal.py @@ -1,18 +1,16 @@ -import unittest - -from exabel_data_sdk.client.api.data_classes.derived_signal import ( +from exabel.client.api.data_classes.derived_signal import ( DerivedSignal, DerivedSignalMetaData, DerivedSignalUnit, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.signal_messages_pb2 import ( +from exabel.stubs.exabel.api.data.v1.signal_messages_pb2 import ( DerivedSignal as ProtoDataApiDerivedSignal, ) -from exabel_data_sdk.stubs.exabel.api.math.aggregation_pb2 import Aggregation -from exabel_data_sdk.stubs.exabel.api.math.change_pb2 import Change +from exabel.stubs.exabel.api.math.aggregation_pb2 import Aggregation +from exabel.stubs.exabel.api.math.change_pb2 import Change -class TestDerivedSignal(unittest.TestCase): +class TestDerivedSignal: def test_from_analytics_api_proto(self): derived_signal = DerivedSignal( name="derivedSignals/456", @@ -28,9 +26,9 @@ def test_from_analytics_api_proto(self): ), ) converted = DerivedSignal.from_analytics_api_proto(derived_signal.to_analytics_api_proto()) - self.assertEqual(derived_signal, converted) - self.assertEqual(converted.metadata.downsampling_method, Aggregation.MEAN) - self.assertEqual(converted.metadata.change, Change.RELATIVE) + assert derived_signal == converted + assert converted.metadata.downsampling_method == Aggregation.MEAN + assert converted.metadata.change == Change.RELATIVE def test_from_data_api_proto(self): data_api_signal = ProtoDataApiDerivedSignal( @@ -43,5 +41,5 @@ def test_from_data_api_proto(self): change=Change.RELATIVE, ) signal = DerivedSignal.from_data_api_proto(data_api_signal) - self.assertEqual(signal.metadata.downsampling_method, Aggregation.MEAN) - self.assertEqual(signal.metadata.change, Change.RELATIVE) + assert signal.metadata.downsampling_method == Aggregation.MEAN + assert signal.metadata.change == Change.RELATIVE diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_entity.py b/exabel/tests/client/api/data_classes/test_entity.py similarity index 58% rename from exabel_data_sdk/tests/client/api/data_classes/test_entity.py rename to exabel/tests/client/api/data_classes/test_entity.py index 33ae2a1f..6153817c 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_entity.py +++ b/exabel/tests/client/api/data_classes/test_entity.py @@ -1,9 +1,7 @@ -import unittest +from exabel.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity import Entity - -class TestEntity(unittest.TestCase): +class TestEntity: def test_proto_conversion(self): entity = Entity( name="entityTypes/country/entities/no", @@ -11,4 +9,4 @@ def test_proto_conversion(self): description="Country Norway", properties={"a": False, "b": 3.5, "c": "c_value"}, ) - self.assertEqual(entity, Entity.from_proto(entity.to_proto())) + assert entity == Entity.from_proto(entity.to_proto()) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_entity_type.py b/exabel/tests/client/api/data_classes/test_entity_type.py similarity index 62% rename from exabel_data_sdk/tests/client/api/data_classes/test_entity_type.py rename to exabel/tests/client/api/data_classes/test_entity_type.py index 6e07d6c6..c6721d18 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_entity_type.py +++ b/exabel/tests/client/api/data_classes/test_entity_type.py @@ -1,10 +1,8 @@ -import unittest +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.stubs.exabel.api.data.v1.all_pb2 import EntityType as ProtoEntityType -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import EntityType as ProtoEntityType - -class TestEntityType(unittest.TestCase): +class TestEntityType: def test_from_proto(self): proto_entity_type = ProtoEntityType( name="entityTypes/country", @@ -21,4 +19,4 @@ def test_from_proto(self): read_only=True, is_associative=True, ) - self.assertEqual(entity_type, EntityType.from_proto(proto_entity_type)) + assert entity_type == EntityType.from_proto(proto_entity_type) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_folder.py b/exabel/tests/client/api/data_classes/test_folder.py similarity index 82% rename from exabel_data_sdk/tests/client/api/data_classes/test_folder.py rename to exabel/tests/client/api/data_classes/test_folder.py index 74bf196c..87897008 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_folder.py +++ b/exabel/tests/client/api/data_classes/test_folder.py @@ -1,13 +1,13 @@ -import unittest +import copy from datetime import datetime from dateutil import tz -from exabel_data_sdk.client.api.data_classes.folder import Folder -from exabel_data_sdk.client.api.data_classes.folder_item import FolderItem, FolderItemType +from exabel.client.api.data_classes.folder import Folder +from exabel.client.api.data_classes.folder_item import FolderItem, FolderItemType -class TestFolder(unittest.TestCase): +class TestFolder: def test_proto_conversion(self): folder = Folder( name="folders/123", @@ -27,7 +27,7 @@ def test_proto_conversion(self): ) ], ) - self.assertEqual(folder, Folder.from_proto(folder.to_proto())) + assert folder == Folder.from_proto(folder.to_proto()) def test_equals(self): folder_1 = Folder( @@ -54,5 +54,5 @@ def test_equals(self): write=True, items=[], ) - self.assertEqual(folder_1, folder_1) - self.assertNotEqual(folder_1, folder_2) + assert folder_1 == copy.copy(folder_1) + assert folder_1 != folder_2 diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_folder_accessor.py b/exabel/tests/client/api/data_classes/test_folder_accessor.py similarity index 53% rename from exabel_data_sdk/tests/client/api/data_classes/test_folder_accessor.py rename to exabel/tests/client/api/data_classes/test_folder_accessor.py index cec348f7..b678c71e 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_folder_accessor.py +++ b/exabel/tests/client/api/data_classes/test_folder_accessor.py @@ -1,15 +1,15 @@ -import unittest +import copy -from exabel_data_sdk.client.api.data_classes.folder_accessor import FolderAccessor -from exabel_data_sdk.client.api.data_classes.group import Group +from exabel.client.api.data_classes.folder_accessor import FolderAccessor +from exabel.client.api.data_classes.group import Group -class TestFolderAccessor(unittest.TestCase): +class TestFolderAccessor: def test_proto_conversion(self): folder_accessor = FolderAccessor( group=Group(name="groups/123", display_name="My group", users=[]), write=True ) - self.assertEqual(folder_accessor, FolderAccessor.from_proto(folder_accessor.to_proto())) + assert folder_accessor == FolderAccessor.from_proto(folder_accessor.to_proto()) def test_equals(self): folder_accessor_1 = FolderAccessor( @@ -18,5 +18,5 @@ def test_equals(self): folder_accessor_2 = FolderAccessor( group=Group(name="groups/12", display_name="My group", users=[]), write=True ) - self.assertEqual(folder_accessor_1, folder_accessor_1) - self.assertNotEqual(folder_accessor_1, folder_accessor_2) + assert folder_accessor_1 == copy.copy(folder_accessor_1) + assert folder_accessor_1 != folder_accessor_2 diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_folder_item.py b/exabel/tests/client/api/data_classes/test_folder_item.py similarity index 85% rename from exabel_data_sdk/tests/client/api/data_classes/test_folder_item.py rename to exabel/tests/client/api/data_classes/test_folder_item.py index f2739d0b..b99ed6fa 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_folder_item.py +++ b/exabel/tests/client/api/data_classes/test_folder_item.py @@ -1,12 +1,11 @@ -import unittest from datetime import datetime from dateutil import tz -from exabel_data_sdk.client.api.data_classes.folder_item import FolderItem, FolderItemType +from exabel.client.api.data_classes.folder_item import FolderItem, FolderItemType -class TestFolderItem(unittest.TestCase): +class TestFolderItem: def test_proto_conversion(self): folder_item = FolderItem( parent="folders/123", @@ -19,7 +18,7 @@ def test_proto_conversion(self): created_by="users/123", updated_by="users/234", ) - self.assertEqual(folder_item, FolderItem.from_proto(folder_item.to_proto())) + assert folder_item == FolderItem.from_proto(folder_item.to_proto()) def test_proto_conversion__item_without_created_and_updated_by(self): folder_item = FolderItem( @@ -33,7 +32,7 @@ def test_proto_conversion__item_without_created_and_updated_by(self): created_by=None, updated_by=None, ) - self.assertEqual(folder_item, FolderItem.from_proto(folder_item.to_proto())) + assert folder_item == FolderItem.from_proto(folder_item.to_proto()) def test_equals(self): folder_item_1 = FolderItem( @@ -69,5 +68,5 @@ def test_equals(self): created_by="users/123", updated_by="users/234", ) - self.assertEqual(folder_item_1, folder_item_2) - self.assertNotEqual(folder_item_1, folder_item_3) + assert folder_item_1 == folder_item_2 + assert folder_item_1 != folder_item_3 diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_group.py b/exabel/tests/client/api/data_classes/test_group.py similarity index 74% rename from exabel_data_sdk/tests/client/api/data_classes/test_group.py rename to exabel/tests/client/api/data_classes/test_group.py index 470a6748..54e882b1 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_group.py +++ b/exabel/tests/client/api/data_classes/test_group.py @@ -1,17 +1,15 @@ -import unittest +from exabel.client.api.data_classes.group import Group +from exabel.client.api.data_classes.user import User -from exabel_data_sdk.client.api.data_classes.group import Group -from exabel_data_sdk.client.api.data_classes.user import User - -class TestDataSet(unittest.TestCase): +class TestDataSet: def test_proto_conversion(self): group = Group( name="groups/123", display_name="My Group", users=[User(name="users/123", email="example@example.com", blocked=False)], ) - self.assertEqual(group, Group.from_proto(group.to_proto())) + assert group == Group.from_proto(group.to_proto()) def test_equals(self): group_1 = Group( @@ -36,5 +34,5 @@ def test_equals(self): User(name="users/1", email="example@example.com", blocked=False), ], ) - self.assertEqual(group_1, group_3) - self.assertNotEqual(group_1, group_2) + assert group_1 == group_3 + assert group_1 != group_2 diff --git a/exabel/tests/client/api/data_classes/test_namespace.py b/exabel/tests/client/api/data_classes/test_namespace.py new file mode 100644 index 00000000..afdd2096 --- /dev/null +++ b/exabel/tests/client/api/data_classes/test_namespace.py @@ -0,0 +1,10 @@ +from exabel.client.api.data_classes.namespace import Namespace + + +class TestNamespace: + def test_proto_conversion(self): + namespace = Namespace( + name="namespace/ns", + writeable=True, + ) + assert namespace == Namespace.from_proto(namespace.to_proto()) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_prediction_model_run.py b/exabel/tests/client/api/data_classes/test_prediction_model_run.py similarity index 67% rename from exabel_data_sdk/tests/client/api/data_classes/test_prediction_model_run.py rename to exabel/tests/client/api/data_classes/test_prediction_model_run.py index fc0cbd8d..fe7d3a19 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_prediction_model_run.py +++ b/exabel/tests/client/api/data_classes/test_prediction_model_run.py @@ -1,12 +1,10 @@ -import unittest - -from exabel_data_sdk.client.api.data_classes.prediction_model_run import ( +from exabel.client.api.data_classes.prediction_model_run import ( ModelConfiguration, PredictionModelRun, ) -class TestModelRun(unittest.TestCase): +class TestModelRun: def test_proto_conversion__with_configuration_source(self): model_run = PredictionModelRun( name="predictionModels/123/runs/4", @@ -15,7 +13,7 @@ def test_proto_conversion__with_configuration_source(self): configuration_source=2, auto_activate=True, ) - self.assertEqual(model_run, PredictionModelRun.from_proto(model_run.to_proto())) + assert model_run == PredictionModelRun.from_proto(model_run.to_proto()) def test_proto_conversion__without_configuration_source(self): model_run = PredictionModelRun( @@ -23,4 +21,4 @@ def test_proto_conversion__without_configuration_source(self): description="Test run", configuration=ModelConfiguration.ACTIVE, ) - self.assertEqual(model_run, PredictionModelRun.from_proto(model_run.to_proto())) + assert model_run == PredictionModelRun.from_proto(model_run.to_proto()) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_relationship.py b/exabel/tests/client/api/data_classes/test_relationship.py similarity index 62% rename from exabel_data_sdk/tests/client/api/data_classes/test_relationship.py rename to exabel/tests/client/api/data_classes/test_relationship.py index 068c8fe4..103043f7 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_relationship.py +++ b/exabel/tests/client/api/data_classes/test_relationship.py @@ -1,9 +1,7 @@ -import unittest +from exabel.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.data_classes.relationship import Relationship - -class TestRelationship(unittest.TestCase): +class TestRelationship: def test_proto_conversion(self): relationship = Relationship( relationship_type="relationshipTypes/ns1.owned_by", @@ -12,4 +10,4 @@ def test_proto_conversion(self): description="description", properties={"a": False, "b": 3.5, "c": "c_value"}, ) - self.assertEqual(relationship, Relationship.from_proto(relationship.to_proto())) + assert relationship == Relationship.from_proto(relationship.to_proto()) diff --git a/exabel/tests/client/api/data_classes/test_relationship_type.py b/exabel/tests/client/api/data_classes/test_relationship_type.py new file mode 100644 index 00000000..de0f572d --- /dev/null +++ b/exabel/tests/client/api/data_classes/test_relationship_type.py @@ -0,0 +1,11 @@ +from exabel.client.api.data_classes.relationship_type import RelationshipType + + +class TestRelationshipType: + def test_proto_conversion(self): + relationship_type = RelationshipType( + name="relationshipTypes/ns1.owned_by", + description="description", + properties={"a": False, "b": 3.5, "c": "c_value"}, + ) + assert relationship_type == RelationshipType.from_proto(relationship_type.to_proto()) diff --git a/exabel/tests/client/api/data_classes/test_request_error.py b/exabel/tests/client/api/data_classes/test_request_error.py new file mode 100644 index 00000000..b564a5b8 --- /dev/null +++ b/exabel/tests/client/api/data_classes/test_request_error.py @@ -0,0 +1,27 @@ +from exabel.client.api.data_classes.request_error import ErrorType + + +class TestErrorType: + def test_from_precondition_failure_violation(self): + assert ( + ErrorType.from_precondition_failure_violation_type("NOT_FOUND") == ErrorType.NOT_FOUND + ) + assert ( + ErrorType.from_precondition_failure_violation_type("FAILED_PRECONDITION") + == ErrorType.FAILED_PRECONDITION + ) + assert ( + ErrorType.from_precondition_failure_violation_type("PERMISSION_DENIED") + == ErrorType.PERMISSION_DENIED + ) + assert ( + ErrorType.from_precondition_failure_violation_type("UNAVAILABLE") + == ErrorType.UNAVAILABLE + ) + assert ErrorType.from_precondition_failure_violation_type("TIMEOUT") == ErrorType.TIMEOUT + assert ErrorType.from_precondition_failure_violation_type("INTERNAL") == ErrorType.INTERNAL + assert ErrorType.from_precondition_failure_violation_type("UNKNOWN") == ErrorType.UNKNOWN + assert ( + ErrorType.from_precondition_failure_violation_type("NOT_A_VALID_TYPE") + == ErrorType.UNKNOWN + ) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_signal.py b/exabel/tests/client/api/data_classes/test_signal.py similarity index 73% rename from exabel_data_sdk/tests/client/api/data_classes/test_signal.py rename to exabel/tests/client/api/data_classes/test_signal.py index eecd1a52..981d5e8e 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_signal.py +++ b/exabel/tests/client/api/data_classes/test_signal.py @@ -1,9 +1,7 @@ -import unittest +from exabel.client.api.data_classes.signal import Signal -from exabel_data_sdk.client.api.data_classes.signal import Signal - -class TestSignal(unittest.TestCase): +class TestSignal: def test_proto_conversion(self): signal = Signal( name="signals/customerA.revenue", @@ -11,7 +9,7 @@ def test_proto_conversion(self): description="description", read_only=True, ) - self.assertEqual(signal, Signal.from_proto(signal.to_proto())) + assert signal == Signal.from_proto(signal.to_proto()) def test_equality(self): signal1 = Signal( @@ -25,4 +23,4 @@ def test_equality(self): display_name="Revenue per store.", description="description", ) - self.assertEqual(signal1, signal2) + assert signal1 == signal2 diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_tag.py b/exabel/tests/client/api/data_classes/test_tag.py similarity index 76% rename from exabel_data_sdk/tests/client/api/data_classes/test_tag.py rename to exabel/tests/client/api/data_classes/test_tag.py index 0daf90e7..c50f2e06 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_tag.py +++ b/exabel/tests/client/api/data_classes/test_tag.py @@ -1,12 +1,11 @@ -import unittest from datetime import datetime from dateutil import tz -from exabel_data_sdk.client.api.data_classes.tag import Tag, TagMetaData +from exabel.client.api.data_classes.tag import Tag, TagMetaData -class TestTag(unittest.TestCase): +class TestTag: def test_proto_conversion(self): tag = Tag( name="tags/user:123", @@ -21,4 +20,4 @@ def test_proto_conversion(self): write_access=True, ), ) - self.assertEqual(tag, Tag.from_proto(tag.to_proto())) + assert tag == Tag.from_proto(tag.to_proto()) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_time_series.py b/exabel/tests/client/api/data_classes/test_time_series.py similarity index 71% rename from exabel_data_sdk/tests/client/api/data_classes/test_time_series.py rename to exabel/tests/client/api/data_classes/test_time_series.py index 50a2c69e..b1e9c31d 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_time_series.py +++ b/exabel/tests/client/api/data_classes/test_time_series.py @@ -1,9 +1,10 @@ import unittest import pandas as pd +import pytest from dateutil import tz -from exabel_data_sdk.client.api.data_classes.time_series import ( +from exabel.client.api.data_classes.time_series import ( Dimension, TimeSeries, TimeSeriesResourceName, @@ -17,53 +18,51 @@ def setUp(self) -> None: self.ts_name = TimeSeriesResourceName("entity_type", "entity", "signal") def test_time_series_resource_name(self) -> None: - self.assertEqual(self.ts_name.entity_type, "entity_type") - self.assertEqual(self.ts_name.entity, "entity") - self.assertEqual(self.ts_name.signal, "signal") + assert self.ts_name.entity_type == "entity_type" + assert self.ts_name.entity == "entity" + assert self.ts_name.signal == "signal" def test_entity_name(self) -> None: - self.assertEqual(self.ts_name.entity_name, "entityTypes/entity_type/entities/entity") + assert self.ts_name.entity_name == "entityTypes/entity_type/entities/entity" def test_signal_name(self) -> None: - self.assertEqual(self.ts_name.signal_name, "signals/signal") + assert self.ts_name.signal_name == "signals/signal" def test_canonical_name(self) -> None: ts_name = TimeSeriesResourceName("entity_type", "entity", "signal") - self.assertEqual( - ts_name.canonical_name, "entityTypes/entity_type/entities/entity/signals/signal" - ) + assert ts_name.canonical_name == "entityTypes/entity_type/entities/entity/signals/signal" def test_from_string(self) -> None: ts_name = TimeSeriesResourceName.from_string( "entityTypes/entity_type/entities/entity/signals/signal" ) - self.assertEqual(ts_name.entity_type, "entity_type") - self.assertEqual(ts_name.entity, "entity") - self.assertEqual(ts_name.signal, "signal") + assert ts_name.entity_type == "entity_type" + assert ts_name.entity == "entity" + assert ts_name.signal == "signal" ts_name = TimeSeriesResourceName.from_string( "signals/signal/entityTypes/entity_type/entities/entity" ) - self.assertEqual(ts_name.entity_type, "entity_type") - self.assertEqual(ts_name.entity, "entity") - self.assertEqual(ts_name.signal, "signal") + assert ts_name.entity_type == "entity_type" + assert ts_name.entity == "entity" + assert ts_name.signal == "signal" def test_from_string__unparsable_should_fail(self) -> None: - with self.assertRaises(ValueError): + with pytest.raises(ValueError): TimeSeriesResourceName.from_string("") - with self.assertRaises(ValueError): + with pytest.raises(ValueError): TimeSeriesResourceName.from_string("entityTypes/entity_type/entities/entity") - with self.assertRaises(ValueError): + with pytest.raises(ValueError): TimeSeriesResourceName.from_string("signals/signal") - with self.assertRaises(ValueError): + with pytest.raises(ValueError): TimeSeriesResourceName.from_string( "relationshipTypes/REL_TYPE/entityTypes/entity_type/entities/entity" ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): TimeSeriesResourceName.from_string( "entityTypes/entity_type/entities/entity/signals/signal/something" ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): TimeSeriesResourceName.from_string( "signals/signal/entityTypes/entity_type/entities/entity/something" ) @@ -90,7 +89,7 @@ def test_proto_conversion(self): ) time_series_proto_converted = TimeSeries.from_proto(time_series.to_proto()) pd.testing.assert_series_equal(time_series.series, time_series_proto_converted.series) - self.assertEqual(time_series.units, time_series_proto_converted.units) + assert time_series.units == time_series_proto_converted.units def test_proto_conversion__no_known_time(self): time_series = TimeSeries( @@ -111,18 +110,16 @@ def test_proto_conversion__no_known_time(self): ) time_series_proto_converted = TimeSeries.from_proto(time_series.to_proto()) pd.testing.assert_series_equal(time_series.series, time_series_proto_converted.series) - self.assertEqual(time_series.units, time_series_proto_converted.units) + assert time_series.units == time_series_proto_converted.units def test_time_series_name(self): time_series = TimeSeries( series=pd.Series([], dtype=float), ) time_series.name = "entityTypes/country/entities/no/signals/customerA.revenue" - self.assertEqual( - time_series.name, "entityTypes/country/entities/no/signals/customerA.revenue" - ) - self.assertEqual( - time_series.series.name, "entityTypes/country/entities/no/signals/customerA.revenue" + assert time_series.name == "entityTypes/country/entities/no/signals/customerA.revenue" + assert ( + time_series.series.name == "entityTypes/country/entities/no/signals/customerA.revenue" ) @@ -135,4 +132,4 @@ def test_proto_conversion(self): ], description="description", ) - self.assertEqual(units, Units.from_proto(units.to_proto())) + assert units == Units.from_proto(units.to_proto()) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_user.py b/exabel/tests/client/api/data_classes/test_user.py similarity index 54% rename from exabel_data_sdk/tests/client/api/data_classes/test_user.py rename to exabel/tests/client/api/data_classes/test_user.py index d85776cb..9c912cd5 100644 --- a/exabel_data_sdk/tests/client/api/data_classes/test_user.py +++ b/exabel/tests/client/api/data_classes/test_user.py @@ -1,15 +1,15 @@ -import unittest +import copy -from exabel_data_sdk.client.api.data_classes.user import User +from exabel.client.api.data_classes.user import User -class TestUser(unittest.TestCase): +class TestUser: def test_proto_conversion(self): user = User(name="users/123", email="example@example.com", blocked=False) - self.assertEqual(user, User.from_proto(user.to_proto())) + assert user == User.from_proto(user.to_proto()) def test_equals(self): user_1 = User(name="users/1", email="example@example.com", blocked=False) user_2 = User(name="users/2", email="example@example.com", blocked=False) - self.assertEqual(user_1, user_1) - self.assertNotEqual(user_1, user_2) + assert user_1 == copy.copy(user_1) + assert user_1 != user_2 diff --git a/exabel_data_sdk/tests/client/api/mock_entity_api.py b/exabel/tests/client/api/mock_entity_api.py similarity index 77% rename from exabel_data_sdk/tests/client/api/mock_entity_api.py rename to exabel/tests/client/api/mock_entity_api.py index 914bbfac..0963a5df 100644 --- a/exabel_data_sdk/tests/client/api/mock_entity_api.py +++ b/exabel/tests/client/api/mock_entity_api.py @@ -3,12 +3,12 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.api.search_service import SearchService -from exabel_data_sdk.tests.client.api.mock_resource_store import MockResourceStore +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.entity_api import EntityApi +from exabel.client.api.search_service import SearchService +from exabel.tests.client.api.mock_resource_store import MockResourceStore class MockEntityApi(EntityApi): @@ -23,7 +23,14 @@ def __init__(self): self._insert_standard_entity_types() def _insert_standard_entity_types(self): - for entity_type in ("brand", "business_segment", "company", "country", "region"): + for entity_type in ( + "brand", + "business_segment", + "company", + "country", + "region", + "acme.brand", + ): self.types.create(EntityType("entityTypes/" + entity_type, entity_type, "")) def list_entity_types( diff --git a/exabel_data_sdk/tests/client/api/mock_relationship_api.py b/exabel/tests/client/api/mock_relationship_api.py similarity index 90% rename from exabel_data_sdk/tests/client/api/mock_relationship_api.py rename to exabel/tests/client/api/mock_relationship_api.py index 031ab14d..796901d8 100644 --- a/exabel_data_sdk/tests/client/api/mock_relationship_api.py +++ b/exabel/tests/client/api/mock_relationship_api.py @@ -1,10 +1,10 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.data_classes.relationship_type import RelationshipType -from exabel_data_sdk.client.api.relationship_api import RelationshipApi -from exabel_data_sdk.tests.client.api.mock_resource_store import MockResourceStore +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.data_classes.relationship_type import RelationshipType +from exabel.client.api.relationship_api import RelationshipApi +from exabel.tests.client.api.mock_resource_store import MockResourceStore class MockRelationshipApi(RelationshipApi): diff --git a/exabel_data_sdk/tests/client/api/mock_resource_store.py b/exabel/tests/client/api/mock_resource_store.py similarity index 95% rename from exabel_data_sdk/tests/client/api/mock_resource_store.py rename to exabel/tests/client/api/mock_resource_store.py index 20b5988f..dee62526 100644 --- a/exabel_data_sdk/tests/client/api/mock_resource_store.py +++ b/exabel/tests/client/api/mock_resource_store.py @@ -1,8 +1,8 @@ from random import random from typing import Callable, Generic, TypeVar -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.request_error import ErrorType, RequestError ResourceT = TypeVar("ResourceT") diff --git a/exabel_data_sdk/tests/client/api/mock_signal_api.py b/exabel/tests/client/api/mock_signal_api.py similarity index 81% rename from exabel_data_sdk/tests/client/api/mock_signal_api.py rename to exabel/tests/client/api/mock_signal_api.py index 3f921112..e6f69533 100644 --- a/exabel_data_sdk/tests/client/api/mock_signal_api.py +++ b/exabel/tests/client/api/mock_signal_api.py @@ -1,9 +1,9 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.client.api.signal_api import SignalApi -from exabel_data_sdk.tests.client.api.mock_resource_store import MockResourceStore +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.signal import Signal +from exabel.client.api.signal_api import SignalApi +from exabel.tests.client.api.mock_resource_store import MockResourceStore class MockSignalApi(SignalApi): diff --git a/exabel_data_sdk/tests/client/api/test_bulk_insert_import.py b/exabel/tests/client/api/test_bulk_insert_import.py similarity index 69% rename from exabel_data_sdk/tests/client/api/test_bulk_insert_import.py rename to exabel/tests/client/api/test_bulk_insert_import.py index 69d6dc23..c4fed837 100644 --- a/exabel_data_sdk/tests/client/api/test_bulk_insert_import.py +++ b/exabel/tests/client/api/test_bulk_insert_import.py @@ -1,22 +1,23 @@ from __future__ import annotations import logging -import unittest +from collections import Counter from typing import Mapping, MutableSequence, Sequence from unittest import mock import pandas as pd +import pytest -from exabel_data_sdk.client.api.bulk_import import bulk_import -from exabel_data_sdk.client.api.bulk_insert import BulkInsertFailedError, _get_backoff, bulk_insert -from exabel_data_sdk.client.api.data_classes.request_error import ( +from exabel.client.api.bulk_import import bulk_import +from exabel.client.api.bulk_insert import BulkInsertFailedError, _get_backoff, bulk_insert +from exabel.client.api.data_classes.request_error import ( ErrorType, PreconditionFailure, RequestError, Violation, ) -from exabel_data_sdk.client.api.data_classes.time_series import TimeSeries, TimeSeriesResourceName -from exabel_data_sdk.client.api.resource_creation_result import ResourceCreationStatus +from exabel.client.api.data_classes.time_series import TimeSeries, TimeSeriesResourceName +from exabel.client.api.resource_creation_result import ResourceCreationStatus logger = logging.getLogger(__name__) @@ -34,20 +35,20 @@ def _get_ts_resources_map() -> Mapping[str, pd.Series]: return resource_map -class TestBulkInsert(unittest.TestCase): +class TestBulkInsert: def test_get_backoff(self): - self.assertEqual(1.0, _get_backoff(0)) - self.assertEqual(2.0, _get_backoff(1)) - self.assertEqual(4.0, _get_backoff(2)) - self.assertEqual(8.0, _get_backoff(3)) - self.assertEqual(16.0, _get_backoff(4)) - self.assertEqual(32.0, _get_backoff(5)) - self.assertEqual(64.0, _get_backoff(6)) - self.assertEqual(128.0, _get_backoff(7)) - self.assertEqual(256.0, _get_backoff(8)) - self.assertEqual(512.0, _get_backoff(9)) - self.assertEqual(600.0, _get_backoff(10)) - self.assertEqual(600.0, _get_backoff(11)) + assert 1.0 == _get_backoff(0) + assert 2.0 == _get_backoff(1) + assert 4.0 == _get_backoff(2) + assert 8.0 == _get_backoff(3) + assert 16.0 == _get_backoff(4) + assert 32.0 == _get_backoff(5) + assert 64.0 == _get_backoff(6) + assert 128.0 == _get_backoff(7) + assert 256.0 == _get_backoff(8) + assert 512.0 == _get_backoff(9) + assert 600.0 == _get_backoff(10) + assert 600.0 == _get_backoff(11) @staticmethod def _insert_func_side_effect(resource: pd.Series, *_, **__) -> ResourceCreationStatus: @@ -64,24 +65,24 @@ def test_bulk_insert(self): resources = list(resource_map.values()) insert_func = mock.Mock() insert_func.side_effect = self._insert_func_side_effect - with mock.patch("exabel_data_sdk.client.api.bulk_import._get_backoff", return_value=0): + with mock.patch("exabel.client.api.bulk_import._get_backoff", return_value=0): results = bulk_insert( resources, insert_func, ) - self.assertEqual(4, insert_func.call_count) - self.assertEqual(4, results.total_count) + assert 4 == insert_func.call_count + assert 4 == results.total_count actual_statuses = [result.status for result in results.results] expected_statuses = [ResourceCreationStatus.FAILED] * 3 + [ResourceCreationStatus.UPSERTED] - self.assertCountEqual(expected_statuses, actual_statuses) + assert Counter(expected_statuses) == Counter(actual_statuses) actual_failed_resources = [ result.resource for result in results.results if result.status == ResourceCreationStatus.FAILED ] expected_failed_resources = resources[1:] - self.assertCountEqual(expected_failed_resources, actual_failed_resources) + assert Counter(expected_failed_resources) == Counter(actual_failed_resources) def test_bulk_insert_with_invalid_proto_data_points_should_fail(self): insert_func = TimeSeries._series_to_time_series_points @@ -94,13 +95,13 @@ def test_bulk_insert_with_invalid_proto_data_points_should_fail(self): for i in range(40) ] - with self.assertRaises(BulkInsertFailedError): + with pytest.raises(BulkInsertFailedError): bulk_insert(series, insert_func, retries=0, threads=1) - with self.assertRaises(BulkInsertFailedError): + with pytest.raises(BulkInsertFailedError): bulk_insert(series, insert_func, retries=0, threads=4) -class TestBulkImport(unittest.TestCase): +class TestBulkImport: @staticmethod def _import_func_side_effect( resources: Sequence[pd.Series], *_, **__ @@ -128,27 +129,27 @@ def test_bulk_import(self): resources = list(resource_map.values()) import_func = mock.Mock() import_func.side_effect = self._import_func_side_effect - with mock.patch("exabel_data_sdk.client.api.bulk_import._get_backoff", return_value=0): + with mock.patch("exabel.client.api.bulk_import._get_backoff", return_value=0): results = bulk_import( resources, import_func, ) - self.assertEqual(3, import_func.call_count) - self.assertEqual(4, len(import_func.call_args_list[0][0][0])) - self.assertEqual(2, len(import_func.call_args_list[1][0][0])) - self.assertEqual(1, len(import_func.call_args_list[2][0][0])) + assert 3 == import_func.call_count + assert 4 == len(import_func.call_args_list[0][0][0]) + assert 2 == len(import_func.call_args_list[1][0][0]) + assert 1 == len(import_func.call_args_list[2][0][0]) - self.assertEqual(4, results.total_count) + assert 4 == results.total_count actual_statuses = [result.status for result in results.results] expected_statuses = [ResourceCreationStatus.FAILED] * 3 + [ResourceCreationStatus.UPSERTED] - self.assertCountEqual(expected_statuses, actual_statuses) + assert Counter(expected_statuses) == Counter(actual_statuses) actual_failed_resources = [ result.resource for result in results.results if result.status == ResourceCreationStatus.FAILED ] expected_failed_resources = resources[1:] - self.assertCountEqual(expected_failed_resources, actual_failed_resources) + assert Counter(expected_failed_resources) == Counter(actual_failed_resources) def test_bulk_import_with_invalid_proto_data_points_should_fail(self): def import_func(resources: Sequence[pd.Series]) -> None: @@ -165,13 +166,13 @@ def import_func(resources: Sequence[pd.Series]) -> None: for i in range(300) ] - with self.assertRaises(BulkInsertFailedError): + with pytest.raises(BulkInsertFailedError): bulk_import(series, import_func, retries=0, threads=1) - with self.assertRaises(BulkInsertFailedError): + with pytest.raises(BulkInsertFailedError): bulk_import(series, import_func, retries=0, threads=4) def test_bulk_import_empty_resources(self): import_func = mock.Mock() result = bulk_import([], import_func) - self.assertEqual(0, result.total_count) + assert 0 == result.total_count import_func.assert_called_once_with([]) diff --git a/exabel_data_sdk/tests/client/api/test_entity_api.py b/exabel/tests/client/api/test_entity_api.py similarity index 76% rename from exabel_data_sdk/tests/client/api/test_entity_api.py rename to exabel/tests/client/api/test_entity_api.py index c05bed9a..37959804 100644 --- a/exabel_data_sdk/tests/client/api/test_entity_api.py +++ b/exabel/tests/client/api/test_entity_api.py @@ -1,15 +1,14 @@ -import unittest from unittest import mock -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.tests.client.api.mock_entity_api import MockEntityApi +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.entity_api import EntityApi +from exabel.client.client_config import ClientConfig +from exabel.tests.client.api.mock_entity_api import MockEntityApi -class TestEntityApi(unittest.TestCase): +class TestEntityApi: def test_upsert(self): entity_api: EntityApi = MockEntityApi() expected = Entity( @@ -17,9 +16,9 @@ def test_upsert(self): display_name="Amazon", ) created_entity = entity_api.upsert_entity(expected) - self.assertEqual(expected, created_entity) + assert expected == created_entity updated_entity = entity_api.upsert_entity(expected) - self.assertEqual(expected, updated_entity) + assert expected == updated_entity def test_upsert_replaces_resource(self): entity_api: EntityApi = MockEntityApi() @@ -37,7 +36,7 @@ def test_upsert_replaces_resource(self): entity_api.create_entity(old_entity, old_entity.get_entity_type()) entity_api.upsert_entity(expected) actual_entity = entity_api.get_entity(expected.name) - self.assertEqual(expected, actual_entity) + assert expected == actual_entity def test_get_entity_type_iterator(self): entity_api = EntityApi(ClientConfig("api-key")) @@ -50,8 +49,8 @@ def test_get_entity_type_iterator(self): AssertionError("Should not be called"), ] entity_types = list(entity_api.get_entity_type_iterator()) - self.assertEqual(2555, len(entity_types)) - self.assertSequenceEqual([entity_type] * 2555, entity_types) + assert 2555 == len(entity_types) + assert [entity_type] * 2555 == entity_types entity_api.list_entity_types.assert_has_calls( [ mock.call(page_token=None, page_size=1000), @@ -70,8 +69,8 @@ def test_get_entities_iterator(self): AssertionError("Should not be called"), ] entities = list(entity_api.get_entities_iterator("entity_type")) - self.assertEqual(1100, len(entities)) - self.assertSequenceEqual([entity] * 1100, entities) + assert 1100 == len(entities) + assert [entity] * 1100 == entities entity_api.list_entities.assert_has_calls( [ mock.call(entity_type="entity_type", page_token=None, page_size=1000), diff --git a/exabel/tests/client/api/test_error_handler.py b/exabel/tests/client/api/test_error_handler.py new file mode 100644 index 00000000..8942ffcd --- /dev/null +++ b/exabel/tests/client/api/test_error_handler.py @@ -0,0 +1,64 @@ +from unittest.mock import MagicMock + +import pytest +from grpc import RpcError, StatusCode + +from exabel.client.api.data_classes.request_error import ErrorType, RequestError +from exabel.client.api.error_handler import ( + grpc_status_to_error_type, + handle_grpc_error, + is_status_detail, +) + + +class TestHttpStatusToErrorType: + def test_is_status_detail(self): + status_detail = MagicMock(spec=["key", "value"]) + status_detail.key = "grpc-status-details-anything" + assert is_status_detail(status_detail) + status_detail.key = "not-grpc-status-details-anything" + assert not is_status_detail(status_detail) + status_detail = MagicMock(spec=["key"]) + assert not is_status_detail(status_detail) + status_detail = MagicMock(spec=["value"]) + assert not is_status_detail(status_detail) + + def test_grpc_status_to_error_type(self): + assert ErrorType.NOT_FOUND == grpc_status_to_error_type(StatusCode.NOT_FOUND) + assert ErrorType.ALREADY_EXISTS == grpc_status_to_error_type(StatusCode.ALREADY_EXISTS) + assert ErrorType.INVALID_ARGUMENT == grpc_status_to_error_type(StatusCode.INVALID_ARGUMENT) + assert ErrorType.PERMISSION_DENIED == grpc_status_to_error_type( + StatusCode.PERMISSION_DENIED + ) + assert ErrorType.UNAVAILABLE == grpc_status_to_error_type(StatusCode.UNAVAILABLE) + assert ErrorType.TIMEOUT == grpc_status_to_error_type(StatusCode.DEADLINE_EXCEEDED) + assert ErrorType.RESOURCE_EXHAUSTED == grpc_status_to_error_type( + StatusCode.RESOURCE_EXHAUSTED + ) + assert ErrorType.INTERNAL == grpc_status_to_error_type(StatusCode.INTERNAL) + assert ErrorType.INTERNAL == grpc_status_to_error_type(StatusCode.DATA_LOSS) + + def test_handle_grpc_error(self): + @handle_grpc_error + def raise_grpc_error(status_code: StatusCode): + error = RpcError() + error.code = MagicMock(return_value=status_code) + error.details = MagicMock(return_value="Error details") + error.trailing_metadata = MagicMock(return_value=[]) + raise error + + for status_code in StatusCode: + with pytest.raises(RequestError) as context: + raise_grpc_error(status_code) + assert grpc_status_to_error_type(status_code) == context.value.error_type + assert "Error details" == context.value.message + + def test_reraise_non_grpc_error_as_request_error(self): + @handle_grpc_error + def raise_value_error(): + raise ValueError("Not an RPC error") + + with pytest.raises(RequestError) as context: + raise_value_error() + assert ErrorType.INTERNAL == context.value.error_type + assert "Not an RPC error" == context.value.message diff --git a/exabel_data_sdk/tests/client/api/test_export_api.py b/exabel/tests/client/api/test_export_api.py similarity index 59% rename from exabel_data_sdk/tests/client/api/test_export_api.py rename to exabel/tests/client/api/test_export_api.py index ccbd1de5..d661de9a 100644 --- a/exabel_data_sdk/tests/client/api/test_export_api.py +++ b/exabel/tests/client/api/test_export_api.py @@ -1,16 +1,17 @@ import re -import unittest from unittest.mock import MagicMock import pandas as pd +import pytest -from exabel_data_sdk.client.api.export_api import ExportApi -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.query.column import Column -from exabel_data_sdk.query.signals import Signals +from exabel.client.api.data_classes.derived_signal import DerivedSignal +from exabel.client.api.export_api import ExportApi +from exabel.client.client_config import ClientConfig +from exabel.query.column import Column +from exabel.query.signals import Signals -class TestExportApi(unittest.TestCase): +class TestExportApi: def test_signal_query(self): export_api = ExportApi(ClientConfig(api_key="api-key")) mock = MagicMock(name="run_query") @@ -84,6 +85,55 @@ def test_signal_query(self): "WHERE factset_id IN ('QLGSL2-R', 'FOOBAR') AND version IN ('2019-01-01', '2019-02-02')" ) + def test_signal_query_with_derived_signal(self): + export_api = ExportApi(ClientConfig(api_key="api-key")) + mock = MagicMock(name="run_query") + export_api.run_query = mock + + # Test single DerivedSignal + export_api.signal_query( + DerivedSignal(name=None, label="EURUSD", expression="fx('EUR', 'USD')") + ) + mock.assert_called_with("SELECT time, 'fx(''EUR'', ''USD'')' AS EURUSD FROM signals") + + # Test DerivedSignal with entity filter + export_api.signal_query( + DerivedSignal(name=None, label="Sales", expression="sales_actual()"), + factset_id="QLGSL2-R", + ) + mock.assert_called_with( + "SELECT time, 'sales_actual()' AS Sales FROM signals WHERE factset_id = 'QLGSL2-R'" + ) + + # Test sequence of DerivedSignals + signals = [ + DerivedSignal(name=None, label="sig1", expression="expr1()"), + DerivedSignal(name=None, label="sig2", expression="expr2()"), + ] + export_api.signal_query(signals, factset_id="QLGSL2-R") + mock.assert_called_with( + "SELECT time, 'expr1()' AS sig1, 'expr2()' AS sig2 FROM signals " + "WHERE factset_id = 'QLGSL2-R'" + ) + + # Test mixed sequence of DerivedSignal and Column + mixed_signals = [ + DerivedSignal(name=None, label="derived", expression="derived_expr()"), + Column("col", "col_expr()"), + ] + export_api.signal_query(mixed_signals, factset_id="QLGSL2-R") + mock.assert_called_with( + "SELECT time, 'derived_expr()' AS derived, 'col_expr()' AS col FROM signals " + "WHERE factset_id = 'QLGSL2-R'" + ) + + def test_signal_query_with_invalid_derived_signal(self): + export_api = ExportApi(ClientConfig(api_key="api-key")) + with pytest.raises(ValueError, match="DerivedSignal must have both label and expression"): + export_api.signal_query(DerivedSignal(name=None, label="", expression="expr()")) + with pytest.raises(ValueError, match="DerivedSignal must have both label and expression"): + export_api.signal_query(DerivedSignal(name=None, label="label", expression="")) + def test_batched_signal_query(self): resource_name = list("ABCDEFGHIJ") data = pd.concat( @@ -102,7 +152,7 @@ def side_effect(query: str): assert m names = m.group(1) length = len(names.split(",")) - self.assertLessEqual(length, batch_size) + assert length <= batch_size return data.query(f"name in {names}") export_api = ExportApi(ClientConfig(api_key="api-key")) @@ -115,19 +165,12 @@ def side_effect(query: str): def test_batched_signal_query_error(self): export_api = ExportApi(ClientConfig(api_key="api-key")) - self.assertRaisesRegex( - ValueError, - "Need to specify an identification method", - export_api.batched_signal_query, - 3, - "Sales_Actual", - ) - self.assertRaisesRegex( - ValueError, - "At most one entity identification method", - export_api.batched_signal_query, - 3, - "Sales_Actual", - bloomberg_ticker=["A", "B"], - factset_id=["C", "D"], - ) + with pytest.raises(ValueError, match="Need to specify an identification method"): + export_api.batched_signal_query(3, "Sales_Actual") + with pytest.raises(ValueError, match="At most one entity identification method"): + export_api.batched_signal_query( + 3, + "Sales_Actual", + bloomberg_ticker=["A", "B"], + factset_id=["C", "D"], + ) diff --git a/exabel/tests/client/api/test_namespace_api.py b/exabel/tests/client/api/test_namespace_api.py new file mode 100644 index 00000000..08695980 --- /dev/null +++ b/exabel/tests/client/api/test_namespace_api.py @@ -0,0 +1,49 @@ +from unittest import mock + +import pytest + +from exabel.client.api.data_classes.namespace import Namespace +from exabel.client.api.namespace_api import NamespaceApi +from exabel.client.client_config import ClientConfig +from exabel.util.exceptions import NoWriteableNamespaceError + + +class TestNamespaceApi: + @mock.patch("exabel.client.api.namespace_api.NamespaceApi.list_namespaces") + def test_get_writeable_namespace(self, mock_list_namespaces): + namespace_api = NamespaceApi(ClientConfig(api_key="123")) + mock_list_namespaces.return_value = [ + Namespace(name="namespaces/ns1", writeable=True), + Namespace(name="namespaces/ns2", writeable=False), + ] + assert ( + Namespace(name="namespaces/ns1", writeable=True) + == namespace_api.get_writeable_namespace() + ) + + @mock.patch("exabel.client.api.namespace_api.NamespaceApi.list_namespaces") + def test_get_writeable_namespace__no_writable_namespace_should_fail(self, mock_list_namespaces): + namespace_api = NamespaceApi(ClientConfig(api_key="123")) + mock_list_namespaces.return_value = [ + Namespace(name="namespaces/ns1", writeable=False), + Namespace(name="namespaces/ns2", writeable=False), + ] + with pytest.raises(NoWriteableNamespaceError) as cm: + namespace_api.get_writeable_namespace() + assert "Current customer is not authorized to write to any namespace." == str(cm.value) + + @mock.patch("exabel.client.api.namespace_api.NamespaceApi.list_namespaces") + def test_get_writeable_namespace__multiple_writeable_namespaces_should_log_warning( + self, mock_list_namespaces, caplog + ): + namespace_api = NamespaceApi(ClientConfig(api_key="123")) + mock_list_namespaces.return_value = [ + Namespace(name="namespaces/ns1", writeable=True), + Namespace(name="namespaces/ns2", writeable=True), + ] + with caplog.at_level("WARNING", logger="exabel.client.api.namespace_api"): + namespace_api.get_writeable_namespace() + assert ( + "Current customer is authorized to write to 2 namespaces. Using the first lexicographical result: 'namespaces/ns1'." + in caplog.text + ) diff --git a/exabel_data_sdk/tests/client/api/test_pageable_resource.py b/exabel/tests/client/api/test_pageable_resource.py similarity index 81% rename from exabel_data_sdk/tests/client/api/test_pageable_resource.py rename to exabel/tests/client/api/test_pageable_resource.py index ee616015..389d566f 100644 --- a/exabel_data_sdk/tests/client/api/test_pageable_resource.py +++ b/exabel/tests/client/api/test_pageable_resource.py @@ -1,8 +1,7 @@ -import unittest from typing import Iterator, Sequence -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.pageable_resource import PageableResourceMixin +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.pageable_resource import PageableResourceMixin class _PageableApiMock(PageableResourceMixin): @@ -35,15 +34,15 @@ def get_resource_iterator(self) -> Iterator[str]: return self._get_resource_iterator(self.get_resource_page, page_size=1) -class TestPageableResourceMixin(unittest.TestCase): +class TestPageableResourceMixin: def test_get_resource_iterator(self): resources = ["a", "b", "c"] api = _PageableApiMock(resources) - self.assertListEqual(list(api.get_resource_iterator()), resources) + assert list(api.get_resource_iterator()) == resources def test_get_resource_iterator__with_varying_total_sizes(self): """Avoid infinite iteration if the item set is modified while iterating.""" resources = ["a", "b", "c"] total_sizes = [3, 4, 4] api = _PageableApiMock(resources, total_sizes) - self.assertListEqual(list(api.get_resource_iterator()), resources) + assert list(api.get_resource_iterator()) == resources diff --git a/exabel_data_sdk/tests/client/api/test_proto_utils.py b/exabel/tests/client/api/test_proto_utils.py similarity index 52% rename from exabel_data_sdk/tests/client/api/test_proto_utils.py rename to exabel/tests/client/api/test_proto_utils.py index c3af1439..cee1da28 100644 --- a/exabel_data_sdk/tests/client/api/test_proto_utils.py +++ b/exabel/tests/client/api/test_proto_utils.py @@ -1,9 +1,9 @@ import unittest -from exabel_data_sdk.client.api.proto_utils import from_struct, to_struct +from exabel.client.api.proto_utils import from_struct, to_struct class TestProtoUtils(unittest.TestCase): def test_struct_conversion(self): values = {"a": False, "b": 3.5, "c": "c_value"} - self.assertEqual(values, from_struct(to_struct(values))) + assert values == from_struct(to_struct(values)) diff --git a/exabel_data_sdk/tests/client/api/test_relationship_api.py b/exabel/tests/client/api/test_relationship_api.py similarity index 83% rename from exabel_data_sdk/tests/client/api/test_relationship_api.py rename to exabel/tests/client/api/test_relationship_api.py index e684059a..5ee3decd 100644 --- a/exabel_data_sdk/tests/client/api/test_relationship_api.py +++ b/exabel/tests/client/api/test_relationship_api.py @@ -1,18 +1,17 @@ -import unittest from unittest import mock -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.relationship_api import RelationshipApi -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.tests.client.api.mock_relationship_api import MockRelationshipApi +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.relationship_api import RelationshipApi +from exabel.client.client_config import ClientConfig +from exabel.tests.client.api.mock_relationship_api import MockRelationshipApi AMAZON = "entityTypes/company/entities/Amazon" USA = "entityTypes/country/entities/USA" RELATIONHIP_TYPE = "relationshipTypes/LOCATED_IN" -class TestRelationshipApi(unittest.TestCase): +class TestRelationshipApi: def test_upsert(self): relationship_api: RelationshipApi = MockRelationshipApi() expected = Relationship( @@ -21,9 +20,9 @@ def test_upsert(self): to_entity=USA, ) created_relationship = relationship_api.upsert_relationship(expected) - self.assertEqual(expected, created_relationship) + assert expected == created_relationship updated_relationship = relationship_api.upsert_relationship(expected) - self.assertEqual(expected, updated_relationship) + assert expected == updated_relationship def test_upsert_replaces_resource(self): relationship_api: RelationshipApi = MockRelationshipApi() @@ -45,7 +44,7 @@ def test_upsert_replaces_resource(self): actual_relationship = relationship_api.get_relationship( expected.relationship_type, expected.from_entity, expected.to_entity ) - self.assertEqual(expected, actual_relationship) + assert expected == actual_relationship def test_get_relationships_from_entity_iterator(self): relationship_api = RelationshipApi(ClientConfig("api-key")) @@ -59,8 +58,8 @@ def test_get_relationships_from_entity_iterator(self): relationships = list( relationship_api.get_relationships_from_entity_iterator("relationship_type", "entity") ) - self.assertEqual(1100, len(relationships)) - self.assertSequenceEqual([relationship] * 1100, relationships) + assert 1100 == len(relationships) + assert [relationship] * 1100 == relationships relationship_api.get_relationships_from_entity.assert_has_calls( [ mock.call( @@ -90,8 +89,8 @@ def test_get_relationships_to_entity_iterator(self): relationships = list( relationship_api.get_relationships_to_entity_iterator("relationship_type", "entity") ) - self.assertEqual(1100, len(relationships)) - self.assertSequenceEqual([relationship] * 1100, relationships) + assert 1100 == len(relationships) + assert [relationship] * 1100 == relationships relationship_api.get_relationships_to_entity.assert_has_calls( [ mock.call( @@ -119,8 +118,8 @@ def test_get_relationships_iterator(self): AssertionError("Should not be called"), ] relationships = list(relationship_api.get_relationships_iterator("relationship_type")) - self.assertEqual(1100, len(relationships)) - self.assertSequenceEqual([relationship] * 1100, relationships) + assert 1100 == len(relationships) + assert [relationship] * 1100 == relationships relationship_api.list_relationships.assert_has_calls( [ mock.call(relationship_type="relationship_type", page_token=None, page_size=1000), diff --git a/exabel_data_sdk/tests/client/api/test_resource_creation_result.py b/exabel/tests/client/api/test_resource_creation_result.py similarity index 66% rename from exabel_data_sdk/tests/client/api/test_resource_creation_result.py rename to exabel/tests/client/api/test_resource_creation_result.py index c7b23403..4ab2b164 100644 --- a/exabel_data_sdk/tests/client/api/test_resource_creation_result.py +++ b/exabel/tests/client/api/test_resource_creation_result.py @@ -3,9 +3,9 @@ import pandas as pd -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.resource_creation_result import ( +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.resource_creation_result import ( ResourceCreationResult, ResourceCreationResults, ResourceCreationStatus, @@ -23,17 +23,17 @@ def test_get_resource_name(self): relationship.to_entity = "to_entity" time_series = mock.Mock(pd.Series) time_series.name = "time_series_name" - self.assertEqual(get_resource_name(entity), "entity_name") - self.assertEqual(get_resource_name(relationship), "relationship_type/from_entity/to_entity") - self.assertEqual(get_resource_name(time_series), "time_series_name") + assert get_resource_name(entity) == "entity_name" + assert get_resource_name(relationship) == "relationship_type/from_entity/to_entity" + assert get_resource_name(time_series) == "time_series_name" def test_resource_creation_result(self): entity = mock.Mock(Entity) entity.name = "entity_name" result = ResourceCreationResult(status=ResourceCreationStatus.FAILED, resource=entity) - self.assertEqual(result.status, ResourceCreationStatus.FAILED) - self.assertEqual(result.resource, entity) - self.assertEqual(result.resource_name, "entity_name") + assert result.status == ResourceCreationStatus.FAILED + assert result.resource == entity + assert result.resource_name == "entity_name" def test_resource_creation_result__success_should_not_store_resource(self): entity = mock.Mock(Entity) @@ -41,25 +41,25 @@ def test_resource_creation_result__success_should_not_store_resource(self): for status in ResourceCreationStatus: if status != ResourceCreationStatus.FAILED: result = ResourceCreationResult(status=status, resource=entity) - self.assertEqual(result.status, status) - self.assertIsNone(result.resource) - self.assertEqual(result.resource_name, "entity_name") + assert result.status == status + assert result.resource is None + assert result.resource_name == "entity_name" def test_get_progress_checkpoints(self): total = 10 checkpoints = 5 expected = {2, 4, 6, 8, 10} actual = ResourceCreationResults._get_progress_checkpoints(total, checkpoints) - self.assertEqual(checkpoints, len(actual)) - self.assertEqual(expected, actual) + assert checkpoints == len(actual) + assert expected == actual def test_get_progress_checkpoints__total_is_zero(self): total = 0 checkpoints = 10 expected = {0} actual = ResourceCreationResults._get_progress_checkpoints(total, checkpoints) - self.assertEqual(1, len(actual)) - self.assertEqual(expected, actual) + assert 1 == len(actual) + assert expected == actual def test_update(self): total = 10 @@ -79,6 +79,6 @@ def test_update(self): ResourceCreationResult(status=ResourceCreationStatus.CREATED, resource=resource) ) results.update(other) - self.assertEqual(total + other_total, results.total_count) - self.assertEqual(total + other_total, len(results.results)) - self.assertEqual(0.3, results.abort_threshold) + assert total + other_total == results.total_count + assert total + other_total == len(results.results) + assert 0.3 == results.abort_threshold diff --git a/exabel_data_sdk/tests/client/api/test_signal_api.py b/exabel/tests/client/api/test_signal_api.py similarity index 64% rename from exabel_data_sdk/tests/client/api/test_signal_api.py rename to exabel/tests/client/api/test_signal_api.py index f2a14b45..7ff73ca7 100644 --- a/exabel_data_sdk/tests/client/api/test_signal_api.py +++ b/exabel/tests/client/api/test_signal_api.py @@ -1,13 +1,12 @@ -import unittest from unittest import mock -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.client.api.signal_api import SignalApi -from exabel_data_sdk.client.client_config import ClientConfig +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.signal import Signal +from exabel.client.api.signal_api import SignalApi +from exabel.client.client_config import ClientConfig -class TestSignalApi(unittest.TestCase): +class TestSignalApi: def test_get_signal_iterator(self): signal_api = SignalApi(ClientConfig("api-key")) signal = mock.create_autospec(Signal) @@ -18,8 +17,8 @@ def test_get_signal_iterator(self): AssertionError("Should not be called"), ] signals = list(signal_api.get_signal_iterator()) - self.assertEqual(1100, len(signals)) - self.assertSequenceEqual([signal] * 1100, signals) + assert 1100 == len(signals) + assert [signal] * 1100 == signals signal_api.list_signals.assert_has_calls( [ mock.call(page_token=None, page_size=1000), diff --git a/exabel_data_sdk/tests/client/api/test_time_series_api.py b/exabel/tests/client/api/test_time_series_api.py similarity index 78% rename from exabel_data_sdk/tests/client/api/test_time_series_api.py rename to exabel/tests/client/api/test_time_series_api.py index c9b71bce..3029457b 100644 --- a/exabel_data_sdk/tests/client/api/test_time_series_api.py +++ b/exabel/tests/client/api/test_time_series_api.py @@ -1,4 +1,3 @@ -import unittest from unittest import mock import pandas as pd @@ -6,19 +5,19 @@ from google.protobuf import timestamp_pb2 from google.protobuf.wrappers_pb2 import DoubleValue -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.time_series import TimeSeries -from exabel_data_sdk.client.api.time_series_api import TimeSeriesApi -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.time_series import TimeSeries +from exabel.client.api.time_series_api import TimeSeriesApi +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( ImportTimeSeriesRequest, TimeSeriesPoint, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import TimeSeries as ProtoTimeSeries -from exabel_data_sdk.util.import_ import estimate_size, get_batches_for_import +from exabel.stubs.exabel.api.data.v1.all_pb2 import TimeSeries as ProtoTimeSeries +from exabel.util.import_ import estimate_size, get_batches_for_import -class TestTimeSeriesApi(unittest.TestCase): +class TestTimeSeriesApi: def test_time_series_conversion(self): series = pd.Series( [1.0, 2.0, 3.0], @@ -46,7 +45,7 @@ def test_time_series_conversion_known_time(self): TimeSeries._time_series_points_to_series(points), ) base_time = pd.Timestamp("2021-01-01").value // 1000000000 - self.assertEqual(1609459200, base_time) + assert 1609459200 == base_time expected_points = [ TimeSeriesPoint( time=timestamp_pb2.Timestamp(seconds=base_time), @@ -59,7 +58,7 @@ def test_time_series_conversion_known_time(self): known_time=timestamp_pb2.Timestamp(seconds=base_time + 86400 * 4), ), ] - self.assertSequenceEqual(expected_points, points) + assert expected_points == points def test_time_series_conversion_without_time_zone(self): series = pd.Series( @@ -102,14 +101,14 @@ def test_estimate_size_constants(self): value=DoubleValue(value=2), time=TimeSeriesApi._pandas_timestamp_to_proto(pd.Timestamp("2022-01-01")), ) - self.assertEqual(19, point_without_known_time.ByteSize()) + assert 19 == point_without_known_time.ByteSize() point_with_known_time = TimeSeriesPoint( value=DoubleValue(value=2), time=TimeSeriesApi._pandas_timestamp_to_proto(pd.Timestamp("2022-01-01")), known_time=TimeSeriesApi._pandas_timestamp_to_proto(pd.Timestamp("2023-01-01")), ) - self.assertEqual(27, point_with_known_time.ByteSize()) + assert 27 == point_with_known_time.ByteSize() def test_estimate_size_calculation(self): series_without_known_time = pd.Series( @@ -118,13 +117,10 @@ def test_estimate_size_calculation(self): index=pd.DatetimeIndex(["2021-01-01", "2022-01-01"], tz=tz.tzutc()), ) - self.assertEqual( - ProtoTimeSeries( - name=str(series_without_known_time.name), - points=TimeSeries._series_to_time_series_points(series_without_known_time), - ).ByteSize(), - estimate_size(series_without_known_time), - ) + assert ProtoTimeSeries( + name=str(series_without_known_time.name), + points=TimeSeries._series_to_time_series_points(series_without_known_time), + ).ByteSize() == estimate_size(series_without_known_time) series_with_known_time = pd.Series( name=self._ts_name(), @@ -136,13 +132,10 @@ def test_estimate_size_calculation(self): ] ), ) - self.assertEqual( - ProtoTimeSeries( - name=str(series_with_known_time.name), - points=TimeSeries._series_to_time_series_points(series_with_known_time), - ).ByteSize(), - estimate_size(series_with_known_time), - ) + assert ProtoTimeSeries( + name=str(series_with_known_time.name), + points=TimeSeries._series_to_time_series_points(series_with_known_time), + ).ByteSize() == estimate_size(series_with_known_time) def test_get_batches_for_import(self): index = pd.DatetimeIndex(["2021-01-01", "2022-01-01"], tz=tz.tzutc()) @@ -153,10 +146,10 @@ def test_get_batches_for_import(self): # Each series has 365 points and adds 227 bytes to the request. # The maximum limit for a single request is 1.048.576 bytes (1MB). # 1.048.576 / 227 ~= 4619 series per request. - self.assertEqual(3, len(batches)) - self.assertEqual(4619, len(batches[0])) - self.assertEqual(4619, len(batches[1])) - self.assertEqual(762, len(batches[2])) + assert 3 == len(batches) + assert 4619 == len(batches[0]) + assert 4619 == len(batches[1]) + assert 762 == len(batches[2]) request = ImportTimeSeriesRequest( time_series=[ @@ -167,7 +160,7 @@ def test_get_batches_for_import(self): for series in batches[0] ] ) - self.assertEqual(1062370, request.ByteSize()) + assert 1062370 == request.ByteSize() def _ts_name(self) -> str: ns = "customer_namespace" @@ -187,8 +180,8 @@ def test_get_signal_time_series_iterator(self): AssertionError("Should not be called"), ] ts = list(ts_api.get_signal_time_series_iterator("signal")) - self.assertEqual(1100, len(ts)) - self.assertSequenceEqual([f"ts_{i}" for i in range(1100)], ts) + assert 1100 == len(ts) + assert [f"ts_{i}" for i in range(1100)] == ts ts_api.get_signal_time_series.assert_has_calls( [ mock.call(signal="signal", page_token=None, page_size=1000), @@ -207,8 +200,8 @@ def test_get_entity_time_series_iterator(self): AssertionError("Should not be called"), ] ts = list(ts_api.get_entity_time_series_iterator("entity")) - self.assertEqual(1100, len(ts)) - self.assertSequenceEqual([f"ts_{i}" for i in range(1100)], ts) + assert 1100 == len(ts) + assert [f"ts_{i}" for i in range(1100)] == ts ts_api.get_entity_time_series.assert_has_calls( [ mock.call(entity="entity", page_token=None, page_size=1000), diff --git a/exabel_data_sdk/tests/client/exabel_mock_client.py b/exabel/tests/client/exabel_mock_client.py similarity index 58% rename from exabel_data_sdk/tests/client/exabel_mock_client.py rename to exabel/tests/client/exabel_mock_client.py index e8828850..90e96bd3 100644 --- a/exabel_data_sdk/tests/client/exabel_mock_client.py +++ b/exabel/tests/client/exabel_mock_client.py @@ -1,10 +1,10 @@ from unittest import mock -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.time_series_api import TimeSeriesApi -from exabel_data_sdk.tests.client.api.mock_entity_api import MockEntityApi -from exabel_data_sdk.tests.client.api.mock_relationship_api import MockRelationshipApi -from exabel_data_sdk.tests.client.api.mock_signal_api import MockSignalApi +from exabel import ExabelClient +from exabel.client.api.time_series_api import TimeSeriesApi +from exabel.tests.client.api.mock_entity_api import MockEntityApi +from exabel.tests.client.api.mock_relationship_api import MockRelationshipApi +from exabel.tests.client.api.mock_signal_api import MockSignalApi class ExabelMockClient(ExabelClient): diff --git a/exabel_data_sdk/tests/client/query/__init__.py b/exabel/tests/client/query/__init__.py similarity index 100% rename from exabel_data_sdk/tests/client/query/__init__.py rename to exabel/tests/client/query/__init__.py diff --git a/exabel/tests/client/query/test_query.py b/exabel/tests/client/query/test_query.py new file mode 100644 index 00000000..058531a0 --- /dev/null +++ b/exabel/tests/client/query/test_query.py @@ -0,0 +1,54 @@ +import unittest + +import pandas as pd + +from exabel.query.column import Column +from exabel.query.dashboard import Dashboard +from exabel.query.literal import to_sql +from exabel.query.signals import Signals + + +class TestQuery(unittest.TestCase): + def test_escape(self): + assert "123" == to_sql(123) + assert "'foo'" == to_sql("foo") + assert "'foo'" == to_sql("foo") + assert "''''" == to_sql("'") + assert "'\"'" == to_sql('"') + assert "'\\\"'" == to_sql('\\"') + assert "'''\\'''''" == to_sql("'\\''") + + def test_dashboard_queries(self): + assert "SELECT * FROM dashboard WHERE dashboard_id = 123" == Dashboard.query(123).sql() + assert ( + "SELECT foo, bar FROM dashboard WHERE dashboard_id = 'dash:123' " + "AND widget_id = 'widget:123'" + == Dashboard.query("dash:123", ["foo", "bar"], "widget:123").sql() + ) + assert ( + "SELECT foo, bar FROM dashboard WHERE dashboard_id = 'dash''123' " + "AND widget_id = 'widget\"123'" + == Dashboard.query("dash'123", ["foo", "bar"], 'widget"123').sql() + ) + + def test_signals_queries(self): + assert "SELECT my_signal FROM signals" == Signals.query(["my_signal"]).sql() + assert ( + "SELECT a, b FROM signals WHERE factset_id IN ('FA', 'FB') " + "AND time >= '2020-01-01' AND time <= '2020-12-31'" + == Signals.query( + ["a", "b"], + start_time="2020-01-01", + end_time=pd.Timestamp("2020-12-31"), + predicates=[Signals.FACTSET_ID.in_list("FA", "FB")], + ).sql() + ) + assert ( + "SELECT 'a+b' AS total, 'get(''foo'')' AS myget FROM signals " + "WHERE has_tag('signal:dynamicTag:367') AND time >= '2020-01-01'" + == Signals.query( + [Column("total", "a+b"), Column("myget", "get('foo')")], + "signal:dynamicTag:367", + "2020-01-01", + ).sql() + ) diff --git a/exabel/tests/client/test_client_config.py b/exabel/tests/client/test_client_config.py new file mode 100644 index 00000000..edb104f9 --- /dev/null +++ b/exabel/tests/client/test_client_config.py @@ -0,0 +1,27 @@ +from exabel.client.client_config import ClientConfig + + +class TestExabelClient: + def test_default_config(self): + config = ClientConfig(api_key="123") + assert "123" == config.api_key + assert "Exabel Python SDK" == config.client_name + assert "data.api.exabel.com" == config.data_api_host + assert "analytics.api.exabel.com" == config.analytics_api_host + assert "management.api.exabel.com" == config.management_api_host + assert 21443 == config.data_api_port + assert 60 * 15 == config.timeout + + def test_non_default_values(self): + config = ClientConfig( + api_key="123", + client_name="my client", + data_api_host="foo.bar.com", + data_api_port=1234, + timeout=45, + ) + assert "123" == config.api_key + assert "my client" == config.client_name + assert "foo.bar.com" == config.data_api_host + assert 1234 == config.data_api_port + assert 45 == config.timeout diff --git a/exabel_data_sdk/tests/client/test_exabel_client.py b/exabel/tests/client/test_exabel_client.py similarity index 51% rename from exabel_data_sdk/tests/client/test_exabel_client.py rename to exabel/tests/client/test_exabel_client.py index b73b9d5f..e49fecda 100644 --- a/exabel_data_sdk/tests/client/test_exabel_client.py +++ b/exabel/tests/client/test_exabel_client.py @@ -1,17 +1,16 @@ -import unittest from unittest import mock -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.namespace import Namespace +from exabel import ExabelClient +from exabel.client.api.data_classes.namespace import Namespace -class TestExabelClient(unittest.TestCase): +class TestExabelClient: def test_initialize(self): client = ExabelClient(api_key="123") - self.assertIsNotNone(client.entity_api) - self.assertIsNotNone(client.time_series_api) - self.assertIsNotNone(client.relationship_api) - self.assertIsNotNone(client.signal_api) + assert client.entity_api is not None + assert client.time_series_api is not None + assert client.relationship_api is not None + assert client.signal_api is not None def test_namespace(self): client = ExabelClient(api_key="123") @@ -21,4 +20,4 @@ def test_namespace(self): ) actual_namespace = client.namespace - self.assertEqual("ns", actual_namespace) + assert "ns" == actual_namespace diff --git a/exabel/tests/decorators.py b/exabel/tests/decorators.py new file mode 100644 index 00000000..9b08b629 --- /dev/null +++ b/exabel/tests/decorators.py @@ -0,0 +1,53 @@ +import importlib.util +from typing import Callable, TypeVar + +import pytest + +T = TypeVar("T") + + +def requires_modules(*modules: str) -> Callable[[type[T]], type[T]]: + """ + Decorator for test classes requiring optional dependencies. + + If any module is not importable, all tests in the class are skipped. + Works with both plain classes and unittest.TestCase subclasses. + + Args: + *modules: Module names that must be importable (e.g., "openpyxl", "pandas") + + Example: + @requires_modules("openpyxl", "pandas") + class TestExcelFeatures: + def test_read_excel(self): ... + + # If openpyxl or pandas are missing, all tests in this class are skipped. + """ + not_importable = [m for m in modules if not _is_importable(m)] + reason = ( + f"Module(s): '{', '.join(not_importable)}' must be available to run these tests." + if not_importable + else "" + ) + skip_marker = pytest.mark.skipif( + bool(not_importable), + reason=reason, + ) + + def decorator(cls: type[T]) -> type[T]: + return skip_marker(cls) + + return decorator + + +def _is_importable(module: str) -> bool: + """ + Return True if a module or sub-module is importable. + + Args: + module: Module name, can be nested (e.g., "google.cloud.bigquery") + """ + parent_name = module.rpartition(".")[0] + if parent_name and not importlib.util.find_spec(parent_name): + return False + return importlib.util.find_spec(module) is not None diff --git a/exabel_data_sdk/tests/resources/data/column_with_number_name_1.xlsx b/exabel/tests/resources/data/column_with_number_name_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/column_with_number_name_1.xlsx rename to exabel/tests/resources/data/column_with_number_name_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/companies_in_columns_example_1.xlsx b/exabel/tests/resources/data/companies_in_columns_example_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/companies_in_columns_example_1.xlsx rename to exabel/tests/resources/data/companies_in_columns_example_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/corrupt_dates_1.xlsx b/exabel/tests/resources/data/corrupt_dates_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/corrupt_dates_1.xlsx rename to exabel/tests/resources/data/corrupt_dates_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/data_on_global_entity_1.xlsx b/exabel/tests/resources/data/data_on_global_entity_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/data_on_global_entity_1.xlsx rename to exabel/tests/resources/data/data_on_global_entity_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/duplicate_data_example_1.xlsx b/exabel/tests/resources/data/duplicate_data_example_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/duplicate_data_example_1.xlsx rename to exabel/tests/resources/data/duplicate_data_example_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/duplicate_data_example_2.xlsx b/exabel/tests/resources/data/duplicate_data_example_2.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/duplicate_data_example_2.xlsx rename to exabel/tests/resources/data/duplicate_data_example_2.xlsx diff --git a/exabel_data_sdk/tests/resources/data/entities.csv b/exabel/tests/resources/data/entities.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities.csv rename to exabel/tests/resources/data/entities.csv diff --git a/exabel_data_sdk/tests/resources/data/entities2.csv b/exabel/tests/resources/data/entities2.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities2.csv rename to exabel/tests/resources/data/entities2.csv diff --git a/exabel_data_sdk/tests/resources/data/entities_in_columns_example_1.xlsx b/exabel/tests/resources/data/entities_in_columns_example_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities_in_columns_example_1.xlsx rename to exabel/tests/resources/data/entities_in_columns_example_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/entities_in_columns_example_2.xlsx b/exabel/tests/resources/data/entities_in_columns_example_2.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities_in_columns_example_2.xlsx rename to exabel/tests/resources/data/entities_in_columns_example_2.xlsx diff --git a/exabel_data_sdk/tests/resources/data/entities_with_duplicated_brands.csv b/exabel/tests/resources/data/entities_with_duplicated_brands.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities_with_duplicated_brands.csv rename to exabel/tests/resources/data/entities_with_duplicated_brands.csv diff --git a/exabel_data_sdk/tests/resources/data/entities_with_integer_display_names.csv b/exabel/tests/resources/data/entities_with_integer_display_names.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities_with_integer_display_names.csv rename to exabel/tests/resources/data/entities_with_integer_display_names.csv diff --git a/exabel_data_sdk/tests/resources/data/entities_with_integer_identifiers.csv b/exabel/tests/resources/data/entities_with_integer_identifiers.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities_with_integer_identifiers.csv rename to exabel/tests/resources/data/entities_with_integer_identifiers.csv diff --git a/exabel_data_sdk/tests/resources/data/entities_with_properties.csv b/exabel/tests/resources/data/entities_with_properties.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities_with_properties.csv rename to exabel/tests/resources/data/entities_with_properties.csv diff --git a/exabel_data_sdk/tests/resources/data/entities_with_uppercase_columns.csv b/exabel/tests/resources/data/entities_with_uppercase_columns.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entities_with_uppercase_columns.csv rename to exabel/tests/resources/data/entities_with_uppercase_columns.csv diff --git a/exabel_data_sdk/tests/resources/data/entity_mapping.csv b/exabel/tests/resources/data/entity_mapping.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entity_mapping.csv rename to exabel/tests/resources/data/entity_mapping.csv diff --git a/exabel_data_sdk/tests/resources/data/entity_mapping.json b/exabel/tests/resources/data/entity_mapping.json similarity index 100% rename from exabel_data_sdk/tests/resources/data/entity_mapping.json rename to exabel/tests/resources/data/entity_mapping.json diff --git a/exabel_data_sdk/tests/resources/data/entity_mapping_invalid.csv b/exabel/tests/resources/data/entity_mapping_invalid.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/entity_mapping_invalid.csv rename to exabel/tests/resources/data/entity_mapping_invalid.csv diff --git a/exabel_data_sdk/tests/resources/data/entity_mapping_invalid_0.json b/exabel/tests/resources/data/entity_mapping_invalid_0.json similarity index 100% rename from exabel_data_sdk/tests/resources/data/entity_mapping_invalid_0.json rename to exabel/tests/resources/data/entity_mapping_invalid_0.json diff --git a/exabel_data_sdk/tests/resources/data/entity_mapping_invalid_1.json b/exabel/tests/resources/data/entity_mapping_invalid_1.json similarity index 100% rename from exabel_data_sdk/tests/resources/data/entity_mapping_invalid_1.json rename to exabel/tests/resources/data/entity_mapping_invalid_1.json diff --git a/exabel_data_sdk/tests/resources/data/mapping_bloomberg_ticker.csv b/exabel/tests/resources/data/mapping_bloomberg_ticker.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/mapping_bloomberg_ticker.csv rename to exabel/tests/resources/data/mapping_bloomberg_ticker.csv diff --git a/exabel_data_sdk/tests/resources/data/mapping_cusip.csv b/exabel/tests/resources/data/mapping_cusip.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/mapping_cusip.csv rename to exabel/tests/resources/data/mapping_cusip.csv diff --git a/exabel_data_sdk/tests/resources/data/mapping_factset_identifier.csv b/exabel/tests/resources/data/mapping_factset_identifier.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/mapping_factset_identifier.csv rename to exabel/tests/resources/data/mapping_factset_identifier.csv diff --git a/exabel_data_sdk/tests/resources/data/mapping_figi.csv b/exabel/tests/resources/data/mapping_figi.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/mapping_figi.csv rename to exabel/tests/resources/data/mapping_figi.csv diff --git a/exabel_data_sdk/tests/resources/data/mapping_format_error.csv b/exabel/tests/resources/data/mapping_format_error.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/mapping_format_error.csv rename to exabel/tests/resources/data/mapping_format_error.csv diff --git a/exabel_data_sdk/tests/resources/data/mapping_isin.csv b/exabel/tests/resources/data/mapping_isin.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/mapping_isin.csv rename to exabel/tests/resources/data/mapping_isin.csv diff --git a/exabel_data_sdk/tests/resources/data/mapping_ticker.csv b/exabel/tests/resources/data/mapping_ticker.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/mapping_ticker.csv rename to exabel/tests/resources/data/mapping_ticker.csv diff --git a/exabel_data_sdk/tests/resources/data/multiple_columns_same_name_1.xlsx b/exabel/tests/resources/data/multiple_columns_same_name_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/multiple_columns_same_name_1.xlsx rename to exabel/tests/resources/data/multiple_columns_same_name_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/multiple_sheets_example_1.xlsx b/exabel/tests/resources/data/multiple_sheets_example_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/multiple_sheets_example_1.xlsx rename to exabel/tests/resources/data/multiple_sheets_example_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/no_data_1.xlsx b/exabel/tests/resources/data/no_data_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/no_data_1.xlsx rename to exabel/tests/resources/data/no_data_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/no_data_2.xlsx b/exabel/tests/resources/data/no_data_2.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/no_data_2.xlsx rename to exabel/tests/resources/data/no_data_2.xlsx diff --git a/exabel_data_sdk/tests/resources/data/no_data_3.xlsx b/exabel/tests/resources/data/no_data_3.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/no_data_3.xlsx rename to exabel/tests/resources/data/no_data_3.xlsx diff --git a/exabel_data_sdk/tests/resources/data/no_data_4.xlsx b/exabel/tests/resources/data/no_data_4.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/no_data_4.xlsx rename to exabel/tests/resources/data/no_data_4.xlsx diff --git a/exabel_data_sdk/tests/resources/data/numbers_in_identifier_error_example.xlsx b/exabel/tests/resources/data/numbers_in_identifier_error_example.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/numbers_in_identifier_error_example.xlsx rename to exabel/tests/resources/data/numbers_in_identifier_error_example.xlsx diff --git a/exabel_data_sdk/tests/resources/data/relationships.csv b/exabel/tests/resources/data/relationships.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/relationships.csv rename to exabel/tests/resources/data/relationships.csv diff --git a/exabel_data_sdk/tests/resources/data/relationships_with_integer_identifiers.csv b/exabel/tests/resources/data/relationships_with_integer_identifiers.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/relationships_with_integer_identifiers.csv rename to exabel/tests/resources/data/relationships_with_integer_identifiers.csv diff --git a/exabel_data_sdk/tests/resources/data/relationships_with_properties.csv b/exabel/tests/resources/data/relationships_with_properties.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/relationships_with_properties.csv rename to exabel/tests/resources/data/relationships_with_properties.csv diff --git a/exabel_data_sdk/tests/resources/data/signal_in_column_example_1.xlsx b/exabel/tests/resources/data/signal_in_column_example_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_column_example_1.xlsx rename to exabel/tests/resources/data/signal_in_column_example_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_in_column_example_2.xlsx b/exabel/tests/resources/data/signal_in_column_example_2.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_column_example_2.xlsx rename to exabel/tests/resources/data/signal_in_column_example_2.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_in_column_example_3.xlsx b/exabel/tests/resources/data/signal_in_column_example_3.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_column_example_3.xlsx rename to exabel/tests/resources/data/signal_in_column_example_3.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_in_row_example_1.xlsx b/exabel/tests/resources/data/signal_in_row_example_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_row_example_1.xlsx rename to exabel/tests/resources/data/signal_in_row_example_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_in_row_example_2.xlsx b/exabel/tests/resources/data/signal_in_row_example_2.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_row_example_2.xlsx rename to exabel/tests/resources/data/signal_in_row_example_2.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_in_row_example_3.xlsx b/exabel/tests/resources/data/signal_in_row_example_3.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_row_example_3.xlsx rename to exabel/tests/resources/data/signal_in_row_example_3.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_in_row_example_4.xlsx b/exabel/tests/resources/data/signal_in_row_example_4.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_row_example_4.xlsx rename to exabel/tests/resources/data/signal_in_row_example_4.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_in_row_example_5.xlsx b/exabel/tests/resources/data/signal_in_row_example_5.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_row_example_5.xlsx rename to exabel/tests/resources/data/signal_in_row_example_5.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_in_row_example_6.xlsx b/exabel/tests/resources/data/signal_in_row_example_6.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_in_row_example_6.xlsx rename to exabel/tests/resources/data/signal_in_row_example_6.xlsx diff --git a/exabel_data_sdk/tests/resources/data/signal_with_uppercase_in_column.xlsx b/exabel/tests/resources/data/signal_with_uppercase_in_column.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/signal_with_uppercase_in_column.xlsx rename to exabel/tests/resources/data/signal_with_uppercase_in_column.xlsx diff --git a/exabel_data_sdk/tests/resources/data/time_series_with_invalid_data_points.csv b/exabel/tests/resources/data/time_series_with_invalid_data_points.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/time_series_with_invalid_data_points.csv rename to exabel/tests/resources/data/time_series_with_invalid_data_points.csv diff --git a/exabel_data_sdk/tests/resources/data/time_series_with_non_numeric_values.csv b/exabel/tests/resources/data/time_series_with_non_numeric_values.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/time_series_with_non_numeric_values.csv rename to exabel/tests/resources/data/time_series_with_non_numeric_values.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries.csv b/exabel/tests/resources/data/timeseries.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries.csv rename to exabel/tests/resources/data/timeseries.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_delete_points_long_format.csv b/exabel/tests/resources/data/timeseries_delete_points_long_format.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_delete_points_long_format.csv rename to exabel/tests/resources/data/timeseries_delete_points_long_format.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_delete_points_missing_known_time.csv b/exabel/tests/resources/data/timeseries_delete_points_missing_known_time.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_delete_points_missing_known_time.csv rename to exabel/tests/resources/data/timeseries_delete_points_missing_known_time.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_known_time.csv b/exabel/tests/resources/data/timeseries_known_time.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_known_time.csv rename to exabel/tests/resources/data/timeseries_known_time.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_long_format.csv b/exabel/tests/resources/data/timeseries_long_format.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_long_format.csv rename to exabel/tests/resources/data/timeseries_long_format.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_metadata_currency.csv b/exabel/tests/resources/data/timeseries_metadata_currency.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_metadata_currency.csv rename to exabel/tests/resources/data/timeseries_metadata_currency.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_metadata_description.csv b/exabel/tests/resources/data/timeseries_metadata_description.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_metadata_description.csv rename to exabel/tests/resources/data/timeseries_metadata_description.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_metadata_dimension_unit.csv b/exabel/tests/resources/data/timeseries_metadata_dimension_unit.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_metadata_dimension_unit.csv rename to exabel/tests/resources/data/timeseries_metadata_dimension_unit.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_metadata_invalid.csv b/exabel/tests/resources/data/timeseries_metadata_invalid.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_metadata_invalid.csv rename to exabel/tests/resources/data/timeseries_metadata_invalid.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_metadata_invalid2.csv b/exabel/tests/resources/data/timeseries_metadata_invalid2.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_metadata_invalid2.csv rename to exabel/tests/resources/data/timeseries_metadata_invalid2.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_metadata_unit.csv b/exabel/tests/resources/data/timeseries_metadata_unit.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_metadata_unit.csv rename to exabel/tests/resources/data/timeseries_metadata_unit.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_metadata_unit_and_currency.csv b/exabel/tests/resources/data/timeseries_metadata_unit_and_currency.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_metadata_unit_and_currency.csv rename to exabel/tests/resources/data/timeseries_metadata_unit_and_currency.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_multiple_signals.csv b/exabel/tests/resources/data/timeseries_multiple_signals.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_multiple_signals.csv rename to exabel/tests/resources/data/timeseries_multiple_signals.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_with_empty_identifiers.csv b/exabel/tests/resources/data/timeseries_with_empty_identifiers.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_with_empty_identifiers.csv rename to exabel/tests/resources/data/timeseries_with_empty_identifiers.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_with_integer_identifiers.csv b/exabel/tests/resources/data/timeseries_with_integer_identifiers.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_with_integer_identifiers.csv rename to exabel/tests/resources/data/timeseries_with_integer_identifiers.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_with_missing_date.csv b/exabel/tests/resources/data/timeseries_with_missing_date.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_with_missing_date.csv rename to exabel/tests/resources/data/timeseries_with_missing_date.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_with_missing_known_time.csv b/exabel/tests/resources/data/timeseries_with_missing_known_time.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_with_missing_known_time.csv rename to exabel/tests/resources/data/timeseries_with_missing_known_time.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_with_mixedcase_columns.csv b/exabel/tests/resources/data/timeseries_with_mixedcase_columns.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_with_mixedcase_columns.csv rename to exabel/tests/resources/data/timeseries_with_mixedcase_columns.csv diff --git a/exabel_data_sdk/tests/resources/data/timeseries_with_uppercase_columns.csv b/exabel/tests/resources/data/timeseries_with_uppercase_columns.csv similarity index 100% rename from exabel_data_sdk/tests/resources/data/timeseries_with_uppercase_columns.csv rename to exabel/tests/resources/data/timeseries_with_uppercase_columns.csv diff --git a/exabel_data_sdk/tests/resources/data/unsupported_format_1.xlsx b/exabel/tests/resources/data/unsupported_format_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/unsupported_format_1.xlsx rename to exabel/tests/resources/data/unsupported_format_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/unsupported_format_2.xlsx b/exabel/tests/resources/data/unsupported_format_2.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/unsupported_format_2.xlsx rename to exabel/tests/resources/data/unsupported_format_2.xlsx diff --git a/exabel_data_sdk/tests/resources/data/uppercased_columns_1.xlsx b/exabel/tests/resources/data/uppercased_columns_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/uppercased_columns_1.xlsx rename to exabel/tests/resources/data/uppercased_columns_1.xlsx diff --git a/exabel_data_sdk/tests/resources/data/with_empty_rows_1.xlsx b/exabel/tests/resources/data/with_empty_rows_1.xlsx similarity index 100% rename from exabel_data_sdk/tests/resources/data/with_empty_rows_1.xlsx rename to exabel/tests/resources/data/with_empty_rows_1.xlsx diff --git a/exabel_data_sdk/tests/scripts/__init__.py b/exabel/tests/scripts/__init__.py similarity index 100% rename from exabel_data_sdk/tests/scripts/__init__.py rename to exabel/tests/scripts/__init__.py diff --git a/exabel_data_sdk/tests/scripts/common_utils.py b/exabel/tests/scripts/common_utils.py similarity index 70% rename from exabel_data_sdk/tests/scripts/common_utils.py rename to exabel/tests/scripts/common_utils.py index eb5a0156..83cb4698 100644 --- a/exabel_data_sdk/tests/scripts/common_utils.py +++ b/exabel/tests/scripts/common_utils.py @@ -1,8 +1,8 @@ from typing import Sequence -from exabel_data_sdk.client.exabel_client import ExabelClient -from exabel_data_sdk.scripts.csv_script import CsvScript -from exabel_data_sdk.tests.client.exabel_mock_client import ExabelMockClient +from exabel.client.exabel_client import ExabelClient +from exabel.scripts.csv_script import CsvScript +from exabel.tests.client.exabel_mock_client import ExabelMockClient def load_test_data_from_csv( diff --git a/exabel_data_sdk/tests/scripts/sql/__init__.py b/exabel/tests/scripts/sql/__init__.py similarity index 100% rename from exabel_data_sdk/tests/scripts/sql/__init__.py rename to exabel/tests/scripts/sql/__init__.py diff --git a/exabel_data_sdk/tests/scripts/sql/test_read_snowflake.py b/exabel/tests/scripts/sql/test_read_snowflake.py similarity index 89% rename from exabel_data_sdk/tests/scripts/sql/test_read_snowflake.py rename to exabel/tests/scripts/sql/test_read_snowflake.py index 632e7faf..a1a9c870 100644 --- a/exabel_data_sdk/tests/scripts/sql/test_read_snowflake.py +++ b/exabel/tests/scripts/sql/test_read_snowflake.py @@ -1,8 +1,8 @@ import argparse import unittest -from exabel_data_sdk.scripts.sql.read_snowflake import ReadSnowflake -from exabel_data_sdk.tests.decorators import requires_modules +from exabel.scripts.sql.read_snowflake import ReadSnowflake +from exabel.tests.decorators import requires_modules @requires_modules("snowflake.connector") @@ -32,7 +32,7 @@ def test_read_snowflake_parse_args_password(self): "100", ] script = ReadSnowflake(args) - self.assertEqual( + assert ( argparse.Namespace( account="account", username="username", @@ -46,8 +46,8 @@ def test_read_snowflake_parse_args_password(self): query="SELECT 1 AS A", output_file="output_file", batch_size=100, - ), - script.parse_arguments(), + ) + == script.parse_arguments() ) def test_read_snowflake_parse_args_key_file(self): @@ -77,7 +77,7 @@ def test_read_snowflake_parse_args_key_file(self): "100", ] script = ReadSnowflake(args) - self.assertEqual( + assert ( argparse.Namespace( account="account", username="username", @@ -91,6 +91,6 @@ def test_read_snowflake_parse_args_key_file(self): query="SELECT 1 AS A", output_file="output_file", batch_size=100, - ), - script.parse_arguments(), + ) + == script.parse_arguments() ) diff --git a/exabel_data_sdk/tests/scripts/sql/test_sql_script.py b/exabel/tests/scripts/sql/test_sql_script.py similarity index 87% rename from exabel_data_sdk/tests/scripts/sql/test_sql_script.py rename to exabel/tests/scripts/sql/test_sql_script.py index 91e2a796..ccfbd9ec 100644 --- a/exabel_data_sdk/tests/scripts/sql/test_sql_script.py +++ b/exabel/tests/scripts/sql/test_sql_script.py @@ -2,9 +2,9 @@ import unittest from unittest import mock -from exabel_data_sdk.scripts.sql.sql_script import SqlScript -from exabel_data_sdk.services.sql.sql_reader_configuration import SqlReaderConfiguration -from exabel_data_sdk.tests.decorators import requires_modules +from exabel.scripts.sql.sql_script import SqlScript +from exabel.services.sql.sql_reader_configuration import SqlReaderConfiguration +from exabel.tests.decorators import requires_modules @requires_modules("sqlalchemy") @@ -19,7 +19,7 @@ def setUp(self) -> None: "SELECT 1 AS A", ] - @mock.patch("exabel_data_sdk.scripts.sql.sql_script.SQLAlchemyReader") + @mock.patch("exabel.scripts.sql.sql_script.SQLAlchemyReader") def test_sql_script_without_output_file(self, mock_reader): mock_config_instance = mock.create_autospec(SqlReaderConfiguration) mock_config_instance.get_connection_string_and_kwargs.return_value = ( @@ -42,7 +42,7 @@ def test_sql_script_without_output_file(self, mock_reader): "SELECT 1 AS A", None, batch_size=None ) - @mock.patch("exabel_data_sdk.scripts.sql.sql_script.SQLAlchemyReader") + @mock.patch("exabel.scripts.sql.sql_script.SQLAlchemyReader") def test_sql_script_with_output_file(self, mock_reader): mock_config_instance = mock.create_autospec(SqlReaderConfiguration) mock_config_instance.get_connection_string_and_kwargs.return_value = ( diff --git a/exabel_data_sdk/tests/scripts/test_actions.py b/exabel/tests/scripts/test_actions.py similarity index 65% rename from exabel_data_sdk/tests/scripts/test_actions.py rename to exabel/tests/scripts/test_actions.py index 0a96477e..abfc6aa0 100644 --- a/exabel_data_sdk/tests/scripts/test_actions.py +++ b/exabel/tests/scripts/test_actions.py @@ -1,65 +1,71 @@ import argparse -import unittest -from exabel_data_sdk.scripts.actions import CaseInsensitiveArgumentAction, DeprecatedArgumentAction -from exabel_data_sdk.util.warnings import ExabelDeprecationWarning +import pytest +from exabel.scripts.actions import CaseInsensitiveArgumentAction, DeprecatedArgumentAction +from exabel.util.warnings import ExabelDeprecationWarning -class TestActions(unittest.TestCase): + +class TestActions: def test_deprecated_argument_action(self): parser = argparse.ArgumentParser() parser.add_argument("--foo", action=DeprecatedArgumentAction) - args = parser.parse_args(["--foo", "bar"]) - self.assertEqual("bar", args.foo) + with pytest.warns(ExabelDeprecationWarning): + args = parser.parse_args(["--foo", "bar"]) + assert "bar" == args.foo def test_deprecated_argument_action__raises_warning(self): parser = argparse.ArgumentParser() parser.add_argument("--foo", action=DeprecatedArgumentAction) - with self.assertWarns(ExabelDeprecationWarning): + with pytest.warns(ExabelDeprecationWarning): parser.parse_args(["--foo", "bar"]) def test_deprecated_argument_action__override_dest(self): parser = argparse.ArgumentParser() parser.add_argument("--foo", dest="bar", action=DeprecatedArgumentAction) - args = parser.parse_args(["--foo", "baz"]) - self.assertEqual("baz", args.bar) + with pytest.warns(ExabelDeprecationWarning): + args = parser.parse_args(["--foo", "baz"]) + assert "baz" == args.bar def test_deprecated_argument_action__miscellaneous_types(self): parser = argparse.ArgumentParser() parser.add_argument("--int", type=int, action=DeprecatedArgumentAction) parser.add_argument("--floats", type=float, nargs="*", action=DeprecatedArgumentAction) - args = parser.parse_args(["--int", "1", "--floats", "2.0", "3"]) - self.assertEqual(1, args.int) - self.assertSequenceEqual([2.0, 3.0], args.floats) + with pytest.warns(ExabelDeprecationWarning): + args = parser.parse_args(["--int", "1", "--floats", "2.0", "3"]) + assert 1 == args.int + assert [2.0, 3.0] == args.floats def test_deprecated_argument_action__case_insensitive_value(self): parser = argparse.ArgumentParser() parser.add_argument("--foo", action=DeprecatedArgumentAction, case_insensitive=True) - args = parser.parse_args(["--foo", "BAR"]) - self.assertEqual("bar", args.foo) + with pytest.warns(ExabelDeprecationWarning): + args = parser.parse_args(["--foo", "BAR"]) + assert "bar" == args.foo def test_deprecated_argument_action__replace_with_none(self): parser = argparse.ArgumentParser() parser.add_argument("--foo", action=DeprecatedArgumentAction, replace_with_none=True) - args = parser.parse_args(["--foo", "BAR"]) - self.assertIsNone(args.foo) + with pytest.warns(ExabelDeprecationWarning): + args = parser.parse_args(["--foo", "BAR"]) + assert args.foo is None def test_case_insensitive_argument_action(self): parser = argparse.ArgumentParser() parser.add_argument("--foo", type=str, action=CaseInsensitiveArgumentAction) parser.add_argument("--bar", type=str, nargs="*", action=CaseInsensitiveArgumentAction) args = parser.parse_args(["--foo", "FOO", "--bar", "Bar1", "BAR2", "bar3"]) - self.assertEqual("foo", args.foo) - self.assertEqual(["bar1", "bar2", "bar3"], args.bar) + assert "foo" == args.foo + assert ["bar1", "bar2", "bar3"] == args.bar def test_case_insensitive_argument_action__type_not_string(self): parser = argparse.ArgumentParser() parser.add_argument("--foo", type=int, action=CaseInsensitiveArgumentAction) - with self.assertRaises(AssertionError): + with pytest.raises(AssertionError): parser.parse_args(["--foo", "1"]) def test_case_insensitive_argument_action__type_not_list_of_string(self): parser = argparse.ArgumentParser() parser.add_argument("--foo", type=float, nargs="*", action=CaseInsensitiveArgumentAction) - with self.assertRaises(AssertionError): + with pytest.raises(AssertionError): parser.parse_args(["--foo", "1", "2.0", "3"]) diff --git a/exabel_data_sdk/tests/scripts/test_command_line_script.py b/exabel/tests/scripts/test_command_line_script.py similarity index 69% rename from exabel_data_sdk/tests/scripts/test_command_line_script.py rename to exabel/tests/scripts/test_command_line_script.py index 4330d46c..3b730a8e 100644 --- a/exabel_data_sdk/tests/scripts/test_command_line_script.py +++ b/exabel/tests/scripts/test_command_line_script.py @@ -1,7 +1,7 @@ import argparse import unittest -from exabel_data_sdk.scripts.command_line_script import CommandLineScript +from exabel.scripts.command_line_script import CommandLineScript class TestCommandLineScript(unittest.TestCase): @@ -21,9 +21,9 @@ def setUp(self) -> None: ) def test_command_line_script(self): - self.assertEqual(["the-script-name", "--the-argument", "123"], self.script.argv) - self.assertEqual("The description.", self.script.parser.description) + assert ["the-script-name", "--the-argument", "123"] == self.script.argv + assert "The description." == self.script.parser.description def test_parse_arguments(self): args = self.script.parse_arguments() - self.assertEqual(argparse.Namespace(the_argument="123"), args) + assert argparse.Namespace(the_argument="123") == args diff --git a/exabel_data_sdk/tests/scripts/test_create_entity_mapping_from_csv.py b/exabel/tests/scripts/test_create_entity_mapping_from_csv.py similarity index 65% rename from exabel_data_sdk/tests/scripts/test_create_entity_mapping_from_csv.py rename to exabel/tests/scripts/test_create_entity_mapping_from_csv.py index 531f898a..2288201c 100644 --- a/exabel_data_sdk/tests/scripts/test_create_entity_mapping_from_csv.py +++ b/exabel/tests/scripts/test_create_entity_mapping_from_csv.py @@ -2,9 +2,9 @@ import unittest from unittest import mock -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.scripts.create_entity_mapping_from_csv import CreateEntityMappingFromCsv +from exabel import ExabelClient +from exabel.client.api.entity_api import EntityApi +from exabel.scripts.create_entity_mapping_from_csv import CreateEntityMappingFromCsv class TestCreateEntityMappingFromCsv(unittest.TestCase): @@ -20,7 +20,7 @@ def test_create_mapping_ticker(self): args = [ "script-name", "--filename-input", - "./exabel_data_sdk/tests/resources/data/mapping_ticker.csv", + "./exabel/tests/resources/data/mapping_ticker.csv", "--filename-output", self.temp_file.name, "--api-key", @@ -33,53 +33,43 @@ def test_create_mapping_ticker(self): # first call - entity = "entityType/company" ticker = "C" / market = "XNYS" call_args = self.client.entity_api.search_for_entities.call_args_list[0] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "mic": "XNAS", "ticker": "C"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "mic": "XNAS", "ticker": "C"} == kwargs, ( + "Arguments not as expected" ) # second call - entity = "entityType/company" ticker = "C" / market = "XNAS" call_args = self.client.entity_api.search_for_entities.call_args_list[1] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "mic": "XNYS", "ticker": "C"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "mic": "XNYS", "ticker": "C"} == kwargs, ( + "Arguments not as expected" ) # third call - entity = "entityType/company" ticker = "C" / market = "XASE" call_args = self.client.entity_api.search_for_entities.call_args_list[2] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "mic": "XASE", "ticker": "C"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "mic": "XASE", "ticker": "C"} == kwargs, ( + "Arguments not as expected" ) # fourth call - entity = "entityType/company" ticker = "M" / market = "XNYS" call_args = self.client.entity_api.search_for_entities.call_args_list[3] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "mic": "XNYS", "ticker": "M"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "mic": "XNYS", "ticker": "M"} == kwargs, ( + "Arguments not as expected" ) # fifth call - entity = "entityType/company" ticker = "001" / market = "XHKG" call_args = self.client.entity_api.search_for_entities.call_args_list[4] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "mic": "XHKG", "ticker": "001"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "mic": "XHKG", "ticker": "001"} == kwargs, ( + "Arguments not as expected" ) def test_create_mapping_isin(self): args = [ "script-name", "--filename-input", - "./exabel_data_sdk/tests/resources/data/mapping_isin.csv", + "./exabel/tests/resources/data/mapping_isin.csv", "--filename-output", self.temp_file.name, "--api-key", @@ -92,17 +82,15 @@ def test_create_mapping_isin(self): # first call - entity = "entityType/company" isin = 'NO12345678' call_args = self.client.entity_api.search_for_entities.call_args_list[0] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "isin": "NO0010096985"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "isin": "NO0010096985"} == kwargs, ( + "Arguments not as expected" ) def test_create_mapping_factset_identifier(self): args = [ "script-name", "--filename-input", - "./exabel_data_sdk/tests/resources/data/mapping_factset_identifier.csv", + "./exabel/tests/resources/data/mapping_factset_identifier.csv", "--filename-output", self.temp_file.name, "--api-key", @@ -115,26 +103,22 @@ def test_create_mapping_factset_identifier(self): # first call - entity = "entityType/company" factset_identifier = '0MXNWD-E' call_args = self.client.entity_api.search_for_entities.call_args_list[0] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "factset_identifier": "0MXNWD-E"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "factset_identifier": "0MXNWD-E"} == kwargs, ( + "Arguments not as expected" ) # second call - entity = "entityType/company" factset_identifier = 'DT699H-S' call_args = self.client.entity_api.search_for_entities.call_args_list[1] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "factset_identifier": "DT699H-S"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "factset_identifier": "DT699H-S"} == kwargs, ( + "Arguments not as expected" ) def test_create_mapping_bloomberg_ticker(self): args = [ "script-name", "--filename-input", - "./exabel_data_sdk/tests/resources/data/mapping_bloomberg_ticker.csv", + "./exabel/tests/resources/data/mapping_bloomberg_ticker.csv", "--filename-output", self.temp_file.name, "--api-key", @@ -147,26 +131,22 @@ def test_create_mapping_bloomberg_ticker(self): # first call - entity = "entityType/company" bloomberg_ticker = 'AAPL US' call_args = self.client.entity_api.search_for_entities.call_args_list[0] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "bloomberg_ticker": "AAPL US"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "bloomberg_ticker": "AAPL US"} == kwargs, ( + "Arguments not as expected" ) # second call - entity = "entityType/company" bloomberg_ticker = 'AMZN US' call_args = self.client.entity_api.search_for_entities.call_args_list[1] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "bloomberg_ticker": "AMZN US"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "bloomberg_ticker": "AMZN US"} == kwargs, ( + "Arguments not as expected" ) def test_create_mapping_figi(self): args = [ "script-name", "--filename-input", - "./exabel_data_sdk/tests/resources/data/mapping_figi.csv", + "./exabel/tests/resources/data/mapping_figi.csv", "--filename-output", self.temp_file.name, "--api-key", @@ -179,26 +159,22 @@ def test_create_mapping_figi(self): # first call - entity = "entityType/company" figi = 'BBG000B9Y5X2' call_args = self.client.entity_api.search_for_entities.call_args_list[0] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "figi": "BBG000B9Y5X2"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "figi": "BBG000B9Y5X2"} == kwargs, ( + "Arguments not as expected" ) # second call - entity = "entityType/company" figi = 'BBG001S5N8V8' call_args = self.client.entity_api.search_for_entities.call_args_list[1] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "figi": "BBG001S5N8V8"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "figi": "BBG001S5N8V8"} == kwargs, ( + "Arguments not as expected" ) def test_create_mapping_cusip(self): args = [ "script-name", "--filename-input", - "./exabel_data_sdk/tests/resources/data/mapping_cusip.csv", + "./exabel/tests/resources/data/mapping_cusip.csv", "--filename-output", self.temp_file.name, "--api-key", @@ -211,10 +187,8 @@ def test_create_mapping_cusip(self): # first call - entity = "entityType/company" cusip = 'Y01234567' call_args = self.client.entity_api.search_for_entities.call_args_list[0] _, kwargs = call_args - self.assertEqual( - {"entity_type": "entityTypes/company", "cusip": "Y01234567"}, - kwargs, - "Arguments not as expected", + assert {"entity_type": "entityTypes/company", "cusip": "Y01234567"} == kwargs, ( + "Arguments not as expected" ) diff --git a/exabel_data_sdk/tests/scripts/test_create_entity_type.py b/exabel/tests/scripts/test_create_entity_type.py similarity index 80% rename from exabel_data_sdk/tests/scripts/test_create_entity_type.py rename to exabel/tests/scripts/test_create_entity_type.py index b64936db..93a9176a 100644 --- a/exabel_data_sdk/tests/scripts/test_create_entity_type.py +++ b/exabel/tests/scripts/test_create_entity_type.py @@ -1,10 +1,12 @@ import unittest from unittest import mock -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.scripts.create_entity_type import CreateEntityType +import pytest + +from exabel import ExabelClient +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.entity_api import EntityApi +from exabel.scripts.create_entity_type import CreateEntityType common_args = [ "script-name", @@ -47,6 +49,6 @@ def test_create_entity_type_should_fail(self): "The description.", ] script = CreateEntityType(args, "Create an entity type.") - with self.assertRaises(SystemExit) as cm: + with pytest.raises(SystemExit) as exc_info: script.run_script(self.client, script.parse_arguments()) - self.assertEqual(2, cm.exception.code) + assert 2 == exc_info.value.code diff --git a/exabel_data_sdk/tests/scripts/test_create_relationship_type.py b/exabel/tests/scripts/test_create_relationship_type.py similarity index 71% rename from exabel_data_sdk/tests/scripts/test_create_relationship_type.py rename to exabel/tests/scripts/test_create_relationship_type.py index d84b9eb1..b444ede5 100644 --- a/exabel_data_sdk/tests/scripts/test_create_relationship_type.py +++ b/exabel/tests/scripts/test_create_relationship_type.py @@ -1,9 +1,11 @@ import unittest from unittest import mock -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.relationship_api import RelationshipApi -from exabel_data_sdk.scripts.create_relationship_type import CreateRelationshipType +import pytest + +from exabel import ExabelClient +from exabel.client.api.relationship_api import RelationshipApi +from exabel.scripts.create_relationship_type import CreateRelationshipType common_args = [ "script-name", @@ -28,8 +30,8 @@ def test_create_relationship_description_and_ownership(self): script = CreateRelationshipType(args, "Create a relationship type.") script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.relationship_api.create_relationship_type.call_args_list - self.assertEqual(call_args_list[0][0][0].description, "My description.") - self.assertEqual(call_args_list[0][0][0].is_ownership, True) + assert call_args_list[0][0][0].description == "My description." + assert call_args_list[0][0][0].is_ownership def test_create_relationship_no_ownership(self): args = common_args + [ @@ -38,15 +40,11 @@ def test_create_relationship_no_ownership(self): script = CreateRelationshipType(args, "Create a relationship type.") script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.relationship_api.create_relationship_type.call_args_list - self.assertEqual(call_args_list[0][0][0].description, None) - self.assertEqual(call_args_list[0][0][0].is_ownership, False) + assert call_args_list[0][0][0].description is None + assert not call_args_list[0][0][0].is_ownership def test_create_relationship_not_specified_ownership(self): args = common_args script = CreateRelationshipType(args, "Create a relationship type.") - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): script.run_script(self.client, script.parse_arguments()) - - -if __name__ == "__main__": - unittest.main() diff --git a/exabel/tests/scripts/test_csv_script.py b/exabel/tests/scripts/test_csv_script.py new file mode 100644 index 00000000..917ced86 --- /dev/null +++ b/exabel/tests/scripts/test_csv_script.py @@ -0,0 +1,18 @@ +from argparse import ArgumentTypeError + +import pytest + +from exabel.scripts.csv_script import abort_threshold + + +class TestCsvScript: + def test_abort_threshold_argument(self): + assert 0.0 == abort_threshold("0") + assert 0.5 == abort_threshold("0.5") + assert 1.0 == abort_threshold("1") + with pytest.raises(ArgumentTypeError): + abort_threshold("1.1") + with pytest.raises(ArgumentTypeError): + abort_threshold("-0.1") + with pytest.raises(ArgumentTypeError): + abort_threshold("foo") diff --git a/exabel_data_sdk/tests/scripts/test_delete_entity_type.py b/exabel/tests/scripts/test_delete_entity_type.py similarity index 78% rename from exabel_data_sdk/tests/scripts/test_delete_entity_type.py rename to exabel/tests/scripts/test_delete_entity_type.py index 7d9f9c04..06c66c88 100644 --- a/exabel_data_sdk/tests/scripts/test_delete_entity_type.py +++ b/exabel/tests/scripts/test_delete_entity_type.py @@ -1,9 +1,9 @@ import unittest from unittest import mock -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.scripts.delete_entity_type import DeleteEntityType +from exabel import ExabelClient +from exabel.client.api.entity_api import EntityApi +from exabel.scripts.delete_entity_type import DeleteEntityType common_args = [ "script-name", diff --git a/exabel_data_sdk/tests/scripts/test_delete_time_series_point.py b/exabel/tests/scripts/test_delete_time_series_point.py similarity index 81% rename from exabel_data_sdk/tests/scripts/test_delete_time_series_point.py rename to exabel/tests/scripts/test_delete_time_series_point.py index e477fe1e..db027991 100644 --- a/exabel_data_sdk/tests/scripts/test_delete_time_series_point.py +++ b/exabel/tests/scripts/test_delete_time_series_point.py @@ -3,9 +3,9 @@ import pandas as pd -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.time_series_api import TimeSeriesApi -from exabel_data_sdk.scripts.delete_time_series_point import DeleteTimeSeriesPoint +from exabel import ExabelClient +from exabel.client.api.time_series_api import TimeSeriesApi +from exabel.scripts.delete_time_series_point import DeleteTimeSeriesPoint common_args = [ "script-name", @@ -28,10 +28,10 @@ def test_delete_time_series_point(self): script.run_script(mock_client, script.parse_arguments()) call_args_list = mock_client.time_series_api.batch_delete_time_series_points.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = {series.name: series for series in call_args_list[0][1]["series"]} - self.assertEqual(1, len(series)) + assert 1 == len(series) pd.testing.assert_series_equal( pd.Series( diff --git a/exabel_data_sdk/tests/scripts/test_export_data.py b/exabel/tests/scripts/test_export_data.py similarity index 73% rename from exabel_data_sdk/tests/scripts/test_export_data.py rename to exabel/tests/scripts/test_export_data.py index 4bdbeea2..686dc1a2 100644 --- a/exabel_data_sdk/tests/scripts/test_export_data.py +++ b/exabel/tests/scripts/test_export_data.py @@ -1,7 +1,9 @@ import argparse import unittest -from exabel_data_sdk.scripts.export_data import ExportData +import pytest + +from exabel.scripts.export_data import ExportData class TestExportData(unittest.TestCase): @@ -19,26 +21,26 @@ def setUp(self): ] def _assert_common_args(self, args: argparse.Namespace): - self.assertEqual(args.query, "query") - self.assertEqual(args.filename, "filename") - self.assertEqual(args.format, "format") - self.assertEqual(args.retries, 2) + assert args.query == "query" + assert args.filename == "filename" + assert args.format == "format" + assert args.retries == 2 def test_args__api_key(self): script = ExportData(self.common_args + ["--api-key", "api-key"], "Export") args = script.parse_arguments() self._assert_common_args(args) - self.assertEqual(args.api_key, "api-key") + assert args.api_key == "api-key" def test_args__access_token(self): script = ExportData(self.common_args + ["--access-token", "access-token"], "Export") args = script.parse_arguments() self._assert_common_args(args) - self.assertEqual(args.access_token, "access-token") + assert args.access_token == "access-token" def test_args__neither_api_key_nor_access_token_should_fail(self): script = ExportData(self.common_args, "Export") - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): script.parse_arguments() def test_args__both_api_key_and_access_token_should_fail(self): @@ -46,5 +48,5 @@ def test_args__both_api_key_and_access_token_should_fail(self): self.common_args + ["--api-key", "api-key", "--access-token", "access-token"], "Export", ) - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): script.parse_arguments() diff --git a/exabel_data_sdk/tests/scripts/test_export_signals.py b/exabel/tests/scripts/test_export_signals.py similarity index 64% rename from exabel_data_sdk/tests/scripts/test_export_signals.py rename to exabel/tests/scripts/test_export_signals.py index 8254ed55..99335011 100644 --- a/exabel_data_sdk/tests/scripts/test_export_signals.py +++ b/exabel/tests/scripts/test_export_signals.py @@ -3,8 +3,9 @@ import unittest import pandas as pd +import pytest -from exabel_data_sdk.scripts.export_signals import ExportSignals +from exabel.scripts.export_signals import ExportSignals class TestExportSignals(unittest.TestCase): @@ -25,28 +26,28 @@ def setUp(self): ] def _assert_common_args(self, args: argparse.Namespace): - self.assertEqual(args.signal, ["signalA", "expression() AS signalB"]) - self.assertEqual(args.tag, ["rbics:5010", "rbics:5012"]) - self.assertEqual(args.start_date, pd.Timestamp("2023-01-31")) - self.assertEqual(args.end_date, pd.Timestamp("2024-02-29")) + assert args.signal == ["signalA", "expression() AS signalB"] + assert args.tag == ["rbics:5010", "rbics:5012"] + assert args.start_date == pd.Timestamp("2023-01-31") + assert args.end_date == pd.Timestamp("2024-02-29") def test_args_api_key(self): script = ExportSignals(self.common_args + ["foo.csv", "--api-key", "api-key"], "desc") - self.assertEqual(script.parser.description, "desc") + assert script.parser.description == "desc" args = script.parse_arguments() self._assert_common_args(args) - self.assertEqual(args.filename, "foo.csv") - self.assertEqual(args.api_key, "api-key") + assert args.filename == "foo.csv" + assert args.api_key == "api-key" def test_args_env_variable(self): os.environ["EXABEL_API_KEY"] = "env_key" try: script = ExportSignals(self.common_args + ["foo.csv"], "desc") - self.assertEqual(script.parser.description, "desc") + assert script.parser.description == "desc" args = script.parse_arguments() self._assert_common_args(args) - self.assertIsNone(args.api_key) - self.assertEqual(args.filename, "foo.csv") + assert args.api_key is None + assert args.filename == "foo.csv" finally: del os.environ["EXABEL_API_KEY"] @@ -55,22 +56,25 @@ def test_args_known_time(self): self.common_args + ["foo.csv", "--api-key", "api-key", "--known-time", "2024-01-03"], "desc", ) - self.assertEqual(script.parser.description, "desc") + assert script.parser.description == "desc" args = script.parse_arguments() self._assert_common_args(args) - self.assertEqual(args.known_time, pd.Timestamp("2024-01-03")) + assert args.known_time == pd.Timestamp("2024-01-03") def test_args_missing_api_key(self): script = ExportSignals(self.common_args + ["foo.csv"], "desc") - self.assertRaises(SystemExit, script.parse_arguments) + with pytest.raises(SystemExit): + script.parse_arguments() def test_args_unknown_file_extension(self): script = ExportSignals(self.common_args + ["foo.pdf", "--api-key", "api-key"], "desc") - self.assertRaises(SystemExit, script.parse_arguments) + with pytest.raises(SystemExit): + script.parse_arguments() def test_args_unknown_date_format(self): script = ExportSignals( self.common_args + ["foo.pickle", "--api-key", "api-key", "--known-time", "Monday"], "desc", ) - self.assertRaises(SystemExit, script.parse_arguments) + with pytest.raises(SystemExit): + script.parse_arguments() diff --git a/exabel_data_sdk/tests/scripts/test_load_entities_from_csv.py b/exabel/tests/scripts/test_load_entities_from_csv.py similarity index 78% rename from exabel_data_sdk/tests/scripts/test_load_entities_from_csv.py rename to exabel/tests/scripts/test_load_entities_from_csv.py index bbee5d26..10010844 100644 --- a/exabel_data_sdk/tests/scripts/test_load_entities_from_csv.py +++ b/exabel/tests/scripts/test_load_entities_from_csv.py @@ -1,28 +1,27 @@ import random -import unittest from unittest.mock import MagicMock, patch -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.scripts.load_entities_from_csv import LoadEntitiesFromCsv -from exabel_data_sdk.tests.client.exabel_mock_client import ExabelMockClient -from exabel_data_sdk.tests.scripts.common_utils import load_test_data_from_csv +import pytest + +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.scripts.load_entities_from_csv import LoadEntitiesFromCsv +from exabel.tests.client.exabel_mock_client import ExabelMockClient +from exabel.tests.scripts.common_utils import load_test_data_from_csv common_args = [ "script-name", - "--namespace", - "test", "--api-key", "123", ] -class TestLoadEntities(unittest.TestCase): +class TestLoadEntities: def test_read_file_with_uppercased_entity_type_in_column_non_existing(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/entities.csv", - "--name-column", + "./exabel/tests/resources/data/entities.csv", + "--entity-column", "brand", "--display-name-column", "brand", @@ -47,25 +46,25 @@ def test_read_file_with_uppercased_entity_type_in_column_non_existing(self): def test_read_file__non_existent_entity_column_should_fail(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/entities.csv", + "./exabel/tests/resources/data/entities.csv", "--description-column", "description", - "--name-column", + "--entity-column", "COMPANY", ] - with self.assertRaises(KeyError) as context: + with pytest.raises(KeyError) as context: load_test_data_from_csv(LoadEntitiesFromCsv, args) - self.assertEqual("company", context.exception.args[0]) + assert "company" == context.value.args[0] def test_read_file_with_uppercased_entity_type_in_argument_existing(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/entities.csv", + "./exabel/tests/resources/data/entities.csv", "--description-column", "description", "--entity-type", "ANOTHER_BRAND", - "--name-column", + "--entity-column", "BRAND", "--display-name-column", "BRAND", @@ -100,7 +99,7 @@ def test_read_file_with_uppercased_entity_type_in_argument_existing(self): def test_read_file_with_integer_identifier(self): file_args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/entities_with_integer_identifiers.csv", + "./exabel/tests/resources/data/entities_with_integer_identifiers.csv", ] extra_args = [[], ["--entity-column", "brand"]] expected_entities = [ @@ -125,30 +124,27 @@ def check_entities( ): """Check expected entities against actual entities retrieved from the client""" all_entities = client.entity_api.list_entities(expected_entity_type).results - self.assertListEqual(sorted(expected_entities), sorted(all_entities)) + assert sorted(expected_entities) == sorted(all_entities) for expected_entity in expected_entities: entity = client.entity_api.get_entity(expected_entity.name) - self.assertEqual(expected_entity, entity) + assert expected_entity == entity def test_read_file_with_duplicated_entity_identifiers_should_fail(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/entities_with_duplicated_brands.csv", + "./exabel/tests/resources/data/entities_with_duplicated_brands.csv", "--description-column", "description", ] - with self.assertRaises(ValueError) as context: + with pytest.raises(ValueError) as context: load_test_data_from_csv(LoadEntitiesFromCsv, args) - self.assertEqual( - "Duplicate entities detected", - str(context.exception), - ) + assert "Duplicate entities detected" == str(context.value) def test_read_file_random_errors(self): random.seed(1) args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/entities2.csv", + "./exabel/tests/resources/data/entities2.csv", ] client = load_test_data_from_csv(LoadEntitiesFromCsv, args) client.entity_api.entities.failure_rate = 0.3 @@ -164,7 +160,7 @@ def test_read_file_random_errors(self): def test_read_file_with_upsert(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/entities.csv", + "./exabel/tests/resources/data/entities.csv", "--display-name-column", "brand", "--description-column", @@ -188,7 +184,7 @@ def test_read_file_with_upsert(self): client = load_test_data_from_csv(LoadEntitiesFromCsv, args, client) self.check_entities(client, expected_entities) - @patch("exabel_data_sdk.scripts.load_entities_from_csv.parse_property_columns") + @patch("exabel.scripts.load_entities_from_csv.parse_property_columns") def test_property_columns(self, mock_parser): args = common_args + [ "--filename", @@ -198,7 +194,7 @@ def test_property_columns(self, mock_parser): "the-other-property-column", ] client = MagicMock() - with patch("exabel_data_sdk.scripts.load_entities_from_csv.CsvEntityLoader"): + with patch("exabel.scripts.load_entities_from_csv.CsvEntityLoader"): csv_loader = LoadEntitiesFromCsv(args, "the-description") parsed_args = csv_loader.parse_arguments() csv_loader.run_script(client, parsed_args) diff --git a/exabel_data_sdk/tests/scripts/test_load_relationships_from_csv.py b/exabel/tests/scripts/test_load_relationships_from_csv.py similarity index 73% rename from exabel_data_sdk/tests/scripts/test_load_relationships_from_csv.py rename to exabel/tests/scripts/test_load_relationships_from_csv.py index ccdd9e88..4c3b365c 100644 --- a/exabel_data_sdk/tests/scripts/test_load_relationships_from_csv.py +++ b/exabel/tests/scripts/test_load_relationships_from_csv.py @@ -1,9 +1,9 @@ -import unittest from unittest.mock import MagicMock, patch -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.scripts.load_relationships_from_csv import LoadRelationshipsFromCsv -from exabel_data_sdk.tests.scripts.common_utils import load_test_data_from_csv +from exabel import ExabelClient +from exabel.client.api.data_classes.relationship import Relationship +from exabel.scripts.load_relationships_from_csv import LoadRelationshipsFromCsv +from exabel.tests.scripts.common_utils import load_test_data_from_csv common_args = [ "script-name", @@ -13,17 +13,35 @@ "PART_OF", ] common_args_with_entity_to_column = common_args + [ - "--entity-to-column", + "--to-entity-type", + "acme.brand", + "--to-entity-column", "BRAND", ] -class TestLoadRelationships(unittest.TestCase): +class TestLoadRelationships: + def check_relationships(self, client: ExabelClient, expected_relationships: list[Relationship]): + """Check expected entities against actual entities retrieved from the client""" + relationship_type = expected_relationships[0].relationship_type + all_relationships = client.relationship_api.list_relationships(relationship_type) + + assert expected_relationships == all_relationships.results + for expected_relationship in expected_relationships: + relationship = client.relationship_api.get_relationship( + expected_relationship.relationship_type, + expected_relationship.from_entity, + expected_relationship.to_entity, + ) + assert expected_relationship == relationship + def test_read_file(self): args = common_args_with_entity_to_column + [ "--filename", - "./exabel_data_sdk/tests/resources/data/relationships.csv", - "--entity-from-column", + "./exabel/tests/resources/data/relationships.csv", + "--from-entity-type", + "company", + "--from-entity-column", "entity_from", "--description-column", "description", @@ -33,13 +51,13 @@ def test_read_file(self): Relationship( relationship_type="relationshipTypes/acme.PART_OF", from_entity="entityTypes/company/company_x", - to_entity="entityTypes/brand/entities/acme.Spring_Vine", + to_entity="entityTypes/acme.brand/entities/acme.Spring_Vine", description="Owned since 2019", ), Relationship( relationship_type="relationshipTypes/acme.PART_OF", from_entity="entityTypes/company/company_y", - to_entity="entityTypes/brand/entities/acme.The_Coconut_Tree", + to_entity="entityTypes/acme.brand/entities/acme.The_Coconut_Tree", description="Acquired for $200M", ), ] @@ -48,10 +66,14 @@ def test_read_file(self): def test_read_file_opposite_from_to_relationship(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/relationships.csv", - "--entity-from-column", + "./exabel/tests/resources/data/relationships.csv", + "--from-entity-type", + "acme.brand", + "--from-entity-column", "BRAND", - "--entity-to-column", + "--to-entity-type", + "company", + "--to-entity-column", "entity_from", "--description-column", "description", @@ -60,13 +82,13 @@ def test_read_file_opposite_from_to_relationship(self): expected_relationships = [ Relationship( relationship_type="relationshipTypes/acme.PART_OF", - from_entity="entityTypes/brand/entities/acme.Spring_Vine", + from_entity="entityTypes/acme.brand/entities/acme.Spring_Vine", to_entity="entityTypes/company/company_x", description="Owned since 2019", ), Relationship( relationship_type="relationshipTypes/acme.PART_OF", - from_entity="entityTypes/brand/entities/acme.The_Coconut_Tree", + from_entity="entityTypes/acme.brand/entities/acme.The_Coconut_Tree", to_entity="entityTypes/company/company_y", description="Acquired for $200M", ), @@ -76,7 +98,7 @@ def test_read_file_opposite_from_to_relationship(self): def test_read_file_with_default_entity_from_to_columns(self): args_default_from_to_columns = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/relationships.csv", + "./exabel/tests/resources/data/relationships.csv", "--description-column", "description", ] @@ -102,10 +124,10 @@ def test_read_file_with_default_entity_from_to_columns(self): def test_read_file_with_integer_identifiers(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/relationships_with_integer_identifiers.csv", - "--entity-from-column", + "./exabel/tests/resources/data/relationships_with_integer_identifiers.csv", + "--from-entity-column", "company", - "--entity-to-column", + "--to-entity-column", "brand", ] client = load_test_data_from_csv(LoadRelationshipsFromCsv, args, namespace="acme") @@ -123,24 +145,13 @@ def test_read_file_with_integer_identifiers(self): ] self.check_relationships(client, expected_relationships) - def check_relationships(self, client, expected_relationships): - """Check expected entities against actual entities retrieved from the client""" - relationship_type = expected_relationships[0].relationship_type - all_relationships = client.relationship_api.list_relationships(relationship_type) - self.assertCountEqual(expected_relationships, all_relationships) - for expected_relationship in expected_relationships: - relationship = client.relationship_api.get_relationship( - expected_relationship.relationship_type, - expected_relationship.from_entity, - expected_relationship.to_entity, - ) - self.assertEqual(expected_relationship, relationship) - def test_read_file_with_upsert(self): args = common_args_with_entity_to_column + [ "--filename", - "./exabel_data_sdk/tests/resources/data/relationships.csv", - "--entity-from-column", + "./exabel/tests/resources/data/relationships.csv", + "--from-entity-type", + "company", + "--from-entity-column", "entity_from", "--description-column", "DESCRIPTION", @@ -151,13 +162,13 @@ def test_read_file_with_upsert(self): Relationship( relationship_type="relationshipTypes/acme.PART_OF", from_entity="entityTypes/company/company_x", - to_entity="entityTypes/brand/entities/acme.Spring_Vine", + to_entity="entityTypes/acme.brand/entities/acme.Spring_Vine", description="This entry might be ignored because it's a duplicate", ), Relationship( relationship_type="relationshipTypes/acme.PART_OF", from_entity="entityTypes/company/company_y", - to_entity="entityTypes/brand/entities/acme.The_Coconut_Tree", + to_entity="entityTypes/acme.brand/entities/acme.The_Coconut_Tree", description="Acquired for $200M", ), ] @@ -165,21 +176,21 @@ def test_read_file_with_upsert(self): client = load_test_data_from_csv(LoadRelationshipsFromCsv, args, client) self.check_relationships(client, expected_relationships) - @patch("exabel_data_sdk.scripts.load_relationships_from_csv.parse_property_columns") + @patch("exabel.scripts.load_relationships_from_csv.parse_property_columns") def test_property_columns(self, mock_parser): args = common_args + [ "--filename", "the-filename", - "--entity-from-column", - "the-entity-from-column", - "--entity-to-column", - "the-entity-to-column", + "--from-entity-column", + "the-from-entity-column", + "--to-entity-column", + "the-to-entity-column", "--property-columns", "THE-PROPERTY-COLUMN", "THE-OTHER-PROPERTY-COLUMN", ] client = MagicMock() - with patch("exabel_data_sdk.scripts.load_relationships_from_csv.CsvRelationshipLoader"): + with patch("exabel.scripts.load_relationships_from_csv.CsvRelationshipLoader"): csv_loader = LoadRelationshipsFromCsv(args, "the-description") parsed_args = csv_loader.parse_arguments() csv_loader.run_script(client, parsed_args) diff --git a/exabel/tests/scripts/test_load_scripts.py b/exabel/tests/scripts/test_load_scripts.py new file mode 100644 index 00000000..8ef33d3d --- /dev/null +++ b/exabel/tests/scripts/test_load_scripts.py @@ -0,0 +1,11 @@ +# ruff: noqa: F401 +from exabel.scripts.create_relationship_type import CreateRelationshipType +from exabel.scripts.create_signal import CreateSignal +from exabel.scripts.delete_entities import DeleteEntities +from exabel.scripts.delete_signal import DeleteSignal +from exabel.scripts.delete_time_series import DeleteTimeSeries +from exabel.scripts.list_entities import ListEntities +from exabel.scripts.list_entity_types import ListEntityTypes +from exabel.scripts.list_relationship_types import ListRelationshipTypes +from exabel.scripts.list_signals import ListSignals +from exabel.scripts.load_time_series_from_file import LoadTimeSeriesFromFile diff --git a/exabel_data_sdk/tests/scripts/test_load_time_series_from_csv.py b/exabel/tests/scripts/test_load_time_series_from_csv.py similarity index 81% rename from exabel_data_sdk/tests/scripts/test_load_time_series_from_csv.py rename to exabel/tests/scripts/test_load_time_series_from_csv.py index 66c09bf9..a8489c07 100644 --- a/exabel_data_sdk/tests/scripts/test_load_time_series_from_csv.py +++ b/exabel/tests/scripts/test_load_time_series_from_csv.py @@ -6,25 +6,26 @@ import numpy as np import pandas as pd +import pytest from dateutil import tz -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.data_classes.paging_result import PagingResult -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.api.resource_creation_result import ResourceCreationResults -from exabel_data_sdk.client.api.signal_api import SignalApi -from exabel_data_sdk.client.api.time_series_api import TimeSeriesApi -from exabel_data_sdk.scripts.load_time_series_from_file import LoadTimeSeriesFromFile -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_time_series_loader import FileTimeSeriesLoader -from exabel_data_sdk.services.file_time_series_parser import ( +from exabel import ExabelClient +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.data_classes.paging_result import PagingResult +from exabel.client.api.data_classes.signal import Signal +from exabel.client.api.entity_api import EntityApi +from exabel.client.api.resource_creation_result import ResourceCreationResults +from exabel.client.api.signal_api import SignalApi +from exabel.client.api.time_series_api import TimeSeriesApi +from exabel.scripts.load_time_series_from_file import LoadTimeSeriesFromFile +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_time_series_loader import FileTimeSeriesLoader +from exabel.services.file_time_series_parser import ( SignalNamesInColumns, SignalNamesInRows, TimeSeriesFileParser, ) -from exabel_data_sdk.util.resource_name_normalization import validate_signal_name +from exabel.util.resource_name_normalization import validate_signal_name common_args = ["script-name", "--sep", ";", "--api-key", "123"] @@ -166,8 +167,8 @@ def test_get_series(self): ts_data = pd.DataFrame(data, columns=["entity", "date", "signal1"]) parser = SignalNamesInColumns.from_data_frame(ts_data, self.client.entity_api, "") time_series = parser.get_series("signals/acme.") - self.assertEqual(1, len(time_series.failures)) - self.assertEqual(1, len(time_series.valid_series)) + assert 1 == len(time_series.failures) + assert 1 == len(time_series.valid_series) pd.testing.assert_series_equal( pd.Series( [1, 2], @@ -196,8 +197,8 @@ def test_get_series__skip_validation(self): ts_data = pd.DataFrame(data, columns=["entity", "date", "signal1"]) parser = SignalNamesInColumns.from_data_frame(ts_data, self.client.entity_api, "") time_series = parser.get_series("signals/acme.", skip_validation=True) - self.assertSequenceEqual([], time_series.failures) - self.assertEqual(2, len(time_series.valid_series)) + assert [] == time_series.failures + assert 2 == len(time_series.valid_series) pd.testing.assert_series_equal( pd.Series( [1, 2], @@ -218,16 +219,16 @@ def test_get_series__skip_validation(self): def test_read_file_without_pit(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries.csv", + "./exabel/tests/resources/data/timeseries.csv", ] script = LoadTimeSeriesFromFile(args) - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): script.run_script(self.client, script.parse_arguments()) def test_read_file_use_header_for_signal(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries.csv", + "./exabel/tests/resources/data/timeseries.csv", "--pit-current-time", ] @@ -235,9 +236,9 @@ def test_read_file_use_header_for_signal(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = {s.name: s for s in call_args_list[0][0][0]} - self.assertEqual(2, len(series)) + assert 2 == len(series) pd.testing.assert_series_equal( pd.Series( @@ -261,7 +262,7 @@ def test_read_file_use_header_for_signal(self): def test_read_file_with_multiple_signals(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_multiple_signals.csv", + "./exabel/tests/resources/data/timeseries_multiple_signals.csv", "--pit-offset", "0", ] @@ -269,9 +270,9 @@ def test_read_file_with_multiple_signals(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series_by_key = {s.name: s for s in call_args_list[0][0][0]} - self.assertEqual(4, len(series_by_key)) + assert 4 == len(series_by_key) pd.testing.assert_series_equal( pd.Series( [1, 2], @@ -308,7 +309,7 @@ def test_read_file_with_multiple_signals(self): def test_read_file_in_long_format(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_long_format.csv", + "./exabel/tests/resources/data/timeseries_long_format.csv", "--pit-offset", "0", ] @@ -316,9 +317,9 @@ def test_read_file_in_long_format(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(4, len(series)) + assert 4 == len(series) series_by_name = {s.name: s for s in series} pd.testing.assert_series_equal( pd.Series( @@ -356,15 +357,15 @@ def test_read_file_in_long_format(self): def test_read_file_with_known_time(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_known_time.csv", + "./exabel/tests/resources/data/timeseries_known_time.csv", ] script = LoadTimeSeriesFromFile(args) script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series_by_name = {s.name: s for s in call_args_list[0][0][0]} - self.assertEqual(4, len(series_by_name)) + assert 4 == len(series_by_name) index_a = pd.MultiIndex.from_arrays( [ @@ -414,7 +415,7 @@ def test_read_file_with_known_time(self): def test_read_file_with_integer_identifiers(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_integer_identifiers.csv", + "./exabel/tests/resources/data/timeseries_with_integer_identifiers.csv", "--pit-offset", "30", ] @@ -423,9 +424,9 @@ def test_read_file_with_integer_identifiers(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(2, len(series)) + assert 2 == len(series) pd.testing.assert_series_equal( pd.Series( @@ -449,11 +450,11 @@ def test_read_file_with_integer_identifiers(self): def test_read_file_with_nan_identifiers(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_empty_identifiers.csv", + "./exabel/tests/resources/data/timeseries_with_empty_identifiers.csv", "--pit-offset", "30", ] - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): script = LoadTimeSeriesFromFile(args) script.run_script(self.client, script.parse_arguments()) @@ -472,9 +473,9 @@ def test_should_fail_with_invalid_signal_names(self): } for signal, error in signals_errors.items(): - with self.assertRaises(ValueError) as cm: + with pytest.raises(ValueError) as exc_info: validate_signal_name(signal) - self.assertEqual(str(cm.exception), error) + assert str(exc_info.value) == error def test_valid_signal_names(self): valid_signals = [ @@ -492,49 +493,49 @@ def test_valid_signal_names(self): def test_should_fail_with_invalid_data_points(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/time_series_with_invalid_data_points.csv", + "./exabel/tests/resources/data/time_series_with_invalid_data_points.csv", ] script = LoadTimeSeriesFromFile(args) - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): script.run_script(self.client, script.parse_arguments()) def test_should_fail_with_missing_date(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_missing_date.csv", + "./exabel/tests/resources/data/timeseries_with_missing_date.csv", "--pit-offset", "1", ] script = LoadTimeSeriesFromFile(args) - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): with mock.patch("sys.stdout", new_callable=io.StringIO) as fake_stdout: script.run_script(self.client, script.parse_arguments()) - self.assertIn( - "The 'date' column has missing values, which is not permitted.", - fake_stdout.getvalue(), + assert ( + "The 'date' column has missing values, which is not permitted." + in fake_stdout.getvalue() ) def test_should_fail_with_missing_known_time(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_missing_known_time.csv", + "./exabel/tests/resources/data/timeseries_with_missing_known_time.csv", ] script = LoadTimeSeriesFromFile(args) - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): with mock.patch("sys.stdout", new_callable=io.StringIO) as fake_stdout: script.run_script(self.client, script.parse_arguments()) - self.assertIn( - "The 'known_time' column has missing values, which is not permitted.", - fake_stdout.getvalue(), + assert ( + "The 'known_time' column has missing values, which is not permitted." + in fake_stdout.getvalue() ) def test_valid_no_create_library_signal(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_known_time.csv", + "./exabel/tests/resources/data/timeseries_known_time.csv", "--create-missing-signals", "--no-create-library-signal", ] @@ -544,12 +545,12 @@ def test_valid_no_create_library_signal(self): call_args_list = self.client.signal_api.update_signal.call_args_list create_library_signal_status = call_args_list[0][1]["create_library_signal"] - self.assertFalse(create_library_signal_status) + assert not create_library_signal_status def test_valid_create_library_signal(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_known_time.csv", + "./exabel/tests/resources/data/timeseries_known_time.csv", "--create-missing-signals", ] script = LoadTimeSeriesFromFile(args) @@ -558,12 +559,12 @@ def test_valid_create_library_signal(self): call_args_list = self.client.signal_api.update_signal.call_args_list create_library_signal_status = call_args_list[0][1]["create_library_signal"] - self.assertTrue(create_library_signal_status) + assert create_library_signal_status def test_valid_replace_existing_time_series(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_known_time.csv", + "./exabel/tests/resources/data/timeseries_known_time.csv", "--create-missing-signals", "--replace-existing-time-series", ] @@ -573,12 +574,12 @@ def test_valid_replace_existing_time_series(self): call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list replace_existing_time_series_status = call_args_list[0][1]["replace_existing_time_series"] - self.assertTrue(replace_existing_time_series_status) + assert replace_existing_time_series_status def test_replace_existing_time_series_across_batches(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries.csv", + "./exabel/tests/resources/data/timeseries.csv", "--create-missing-signals", "--pit-offset", "0", @@ -591,32 +592,32 @@ def test_replace_existing_time_series_across_batches(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(4, len(call_args_list)) - self.assertTrue(call_args_list[0][1]["replace_existing_time_series"]) - self.assertEqual( - "entityTypes/company/entities/company_A/signals/acme.signal1", - call_args_list[0][0][0][0].name, + assert 4 == len(call_args_list) + assert call_args_list[0][1]["replace_existing_time_series"] + assert ( + "entityTypes/company/entities/company_A/signals/acme.signal1" + == call_args_list[0][0][0][0].name ) - self.assertFalse("replace_existing_time_series" in call_args_list[1][1]) - self.assertEqual( - "entityTypes/company/entities/company_A/signals/acme.signal1", - call_args_list[1][0][0][0].name, + assert "replace_existing_time_series" not in call_args_list[1][1] + assert ( + "entityTypes/company/entities/company_A/signals/acme.signal1" + == call_args_list[1][0][0][0].name ) - self.assertTrue(call_args_list[2][1]["replace_existing_time_series"]) - self.assertEqual( - "entityTypes/company/entities/company_B/signals/acme.signal1", - call_args_list[2][0][0][0].name, + assert call_args_list[2][1]["replace_existing_time_series"] + assert ( + "entityTypes/company/entities/company_B/signals/acme.signal1" + == call_args_list[2][0][0][0].name ) - self.assertFalse("replace_existing_time_series" in call_args_list[3][1]) - self.assertEqual( - "entityTypes/company/entities/company_B/signals/acme.signal1", - call_args_list[3][0][0][0].name, + assert "replace_existing_time_series" not in call_args_list[3][1] + assert ( + "entityTypes/company/entities/company_B/signals/acme.signal1" + == call_args_list[3][0][0][0].name ) def test_replace_existing_data_points_across_batches(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries.csv", + "./exabel/tests/resources/data/timeseries.csv", "--create-missing-signals", "--pit-offset", "0", @@ -629,16 +630,16 @@ def test_replace_existing_data_points_across_batches(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(3, len(call_args_list)) - self.assertTrue(call_args_list[0][1]["replace_existing_data_points"]) - self.assertEqual( - "entityTypes/company/entities/company_A/signals/acme.signal1", - call_args_list[0][0][0][0].name, + assert 3 == len(call_args_list) + assert call_args_list[0][1]["replace_existing_data_points"] + assert ( + "entityTypes/company/entities/company_A/signals/acme.signal1" + == call_args_list[0][0][0][0].name ) - self.assertTrue(call_args_list[2][1]["replace_existing_data_points"]) - self.assertEqual( - "entityTypes/company/entities/company_B/signals/acme.signal1", - call_args_list[2][0][0][0].name, + assert call_args_list[2][1]["replace_existing_data_points"] + assert ( + "entityTypes/company/entities/company_B/signals/acme.signal1" + == call_args_list[2][0][0][0].name ) @property @@ -666,21 +667,21 @@ def _partial_load_time_series(self) -> Callable: ) def test_load_time_series_with_duplicate_indexes_should_fail(self): - with self.assertRaises(FileLoadingException) as cm: + with pytest.raises(FileLoadingException) as exc_info: self._partial_load_time_series() - self.assertEqual(1, len(cm.exception.failures)) - self.assertEqual([1.0, 2.0], cm.exception.failures[0].resource.to_list()) + assert 1 == len(exc_info.value.failures) + assert [1.0, 2.0] == exc_info.value.failures[0].resource.to_list() def test_load_time_series_with_duplicate_indexes_with_dry_run_should_fail(self): - with self.assertRaises(FileLoadingException) as cm: + with pytest.raises(FileLoadingException) as exc_info: self._partial_load_time_series(dry_run=True) - self.assertEqual(1, len(cm.exception.failures)) - self.assertEqual([1.0, 2.0], cm.exception.failures[0].resource.to_list()) + assert 1 == len(exc_info.value.failures) + assert [1.0, 2.0] == exc_info.value.failures[0].resource.to_list() def test_load_time_series_with_uppercase_signals_not_existing(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_uppercase_columns.csv", + "./exabel/tests/resources/data/timeseries_with_uppercase_columns.csv", "--create-missing-signals", ] script = LoadTimeSeriesFromFile(args) @@ -693,13 +694,13 @@ def test_load_time_series_with_uppercase_signals_not_existing(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(1, len(series)) + assert 1 == len(series) call_args_list_update_signal = self.client.signal_api.update_signal.call_args_list - self.assertEqual(1, len(call_args_list_update_signal)) + assert 1 == len(call_args_list_update_signal) signal = call_args_list_update_signal[0][0][0] - self.assertEqual("signals/ns.signal1", signal.name) + assert "signals/ns.signal1" == signal.name pd.testing.assert_series_equal( pd.Series( @@ -719,7 +720,7 @@ def test_load_time_series_with_uppercase_signals_not_existing(self): def test_load_time_series_with_uppercase_signals_existing(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_uppercase_columns.csv", + "./exabel/tests/resources/data/timeseries_with_uppercase_columns.csv", "--create-missing-signals", ] script = LoadTimeSeriesFromFile(args) @@ -730,10 +731,10 @@ def test_load_time_series_with_uppercase_signals_existing(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) - self.assertEqual(0, len(self.client.signal_api.update_signal.call_args_list)) + assert 1 == len(call_args_list) + assert 0 == len(self.client.signal_api.update_signal.call_args_list) series = call_args_list[0][0][0] - self.assertEqual(1, len(series)) + assert 1 == len(series) pd.testing.assert_series_equal( pd.Series( @@ -755,7 +756,7 @@ def test_load_time_series_with_uppercase_signals_existing_and_uppercase_entity_t ): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_uppercase_columns.csv", + "./exabel/tests/resources/data/timeseries_with_uppercase_columns.csv", "--create-missing-signals", ] script = LoadTimeSeriesFromFile(args) @@ -765,10 +766,10 @@ def test_load_time_series_with_uppercase_signals_existing_and_uppercase_entity_t script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) - self.assertEqual(0, len(self.client.signal_api.update_signal.call_args_list)) + assert 1 == len(call_args_list) + assert 0 == len(self.client.signal_api.update_signal.call_args_list) series = call_args_list[0][0][0] - self.assertEqual(1, len(series)) + assert 1 == len(series) pd.testing.assert_series_equal( pd.Series( @@ -788,7 +789,7 @@ def test_load_time_series_with_uppercase_signals_existing_and_uppercase_entity_t def test_load_time_series_with_uppercase_signals_not_existing_case_sensitive(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_mixedcase_columns.csv", + "./exabel/tests/resources/data/timeseries_with_mixedcase_columns.csv", "--create-missing-signals", "--case-sensitive-signals", ] @@ -802,13 +803,13 @@ def test_load_time_series_with_uppercase_signals_not_existing_case_sensitive(sel script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(1, len(series)) + assert 1 == len(series) call_args_list_update_signal = self.client.signal_api.update_signal.call_args_list - self.assertEqual(1, len(call_args_list_update_signal)) + assert 1 == len(call_args_list_update_signal) signal = call_args_list_update_signal[0][0][0] - self.assertEqual("signals/ns.Signal1", signal.name) + assert "signals/ns.Signal1" == signal.name pd.testing.assert_series_equal( pd.Series( @@ -828,7 +829,7 @@ def test_load_time_series_with_uppercase_signals_not_existing_case_sensitive(sel def test_load_time_series_with_uppercase_signals_and_lower_case_existing_case_sensitive(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_mixedcase_columns.csv", + "./exabel/tests/resources/data/timeseries_with_mixedcase_columns.csv", "--create-missing-signals", "--case-sensitive-signals", ] @@ -843,13 +844,13 @@ def test_load_time_series_with_uppercase_signals_and_lower_case_existing_case_se script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(1, len(series)) + assert 1 == len(series) call_args_list_update_signal = self.client.signal_api.update_signal.call_args_list - self.assertEqual(1, len(call_args_list_update_signal)) + assert 1 == len(call_args_list_update_signal) signal = call_args_list_update_signal[0][0][0] - self.assertEqual("signals/ns.Signal1", signal.name) + assert "signals/ns.Signal1" == signal.name pd.testing.assert_series_equal( pd.Series( @@ -869,7 +870,7 @@ def test_load_time_series_with_uppercase_signals_and_lower_case_existing_case_se def test_load_time_series_with_uppercase_signals_existing_case_sensitive(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_mixedcase_columns.csv", + "./exabel/tests/resources/data/timeseries_with_mixedcase_columns.csv", "--create-missing-signals", "--case-sensitive-signals", ] @@ -879,10 +880,10 @@ def test_load_time_series_with_uppercase_signals_existing_case_sensitive(self): script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) - self.assertEqual(0, len(self.client.signal_api.update_signal.call_args_list)) + assert 1 == len(call_args_list) + assert 0 == len(self.client.signal_api.update_signal.call_args_list) series = call_args_list[0][0][0] - self.assertEqual(1, len(series)) + assert 1 == len(series) pd.testing.assert_series_equal( pd.Series( @@ -904,7 +905,7 @@ def test_load_time_series_with_mixedcase_signals_existing_and_entity_type_nonexi ): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_with_mixedcase_columns.csv", + "./exabel/tests/resources/data/timeseries_with_mixedcase_columns.csv", "--create-missing-signals", "--case-sensitive", ] @@ -915,10 +916,10 @@ def test_load_time_series_with_mixedcase_signals_existing_and_entity_type_nonexi script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) - self.assertEqual(0, len(self.client.signal_api.update_signal.call_args_list)) + assert 1 == len(call_args_list) + assert 0 == len(self.client.signal_api.update_signal.call_args_list) series = call_args_list[0][0][0] - self.assertEqual(1, len(series)) + assert 1 == len(series) pd.testing.assert_series_equal( pd.Series( @@ -940,21 +941,21 @@ def test_load_time_series_default_optimise( ): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_known_time.csv", + "./exabel/tests/resources/data/timeseries_known_time.csv", ] script = LoadTimeSeriesFromFile(args) script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertIsNone(call_args_list[0][1]["should_optimise"]) + assert call_args_list[0][1]["should_optimise"] is None def test_load_time_series_optimise( self, ): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_known_time.csv", + "./exabel/tests/resources/data/timeseries_known_time.csv", "--optimise", ] script = LoadTimeSeriesFromFile(args) @@ -962,14 +963,14 @@ def test_load_time_series_optimise( script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertTrue(call_args_list[0][1]["should_optimise"]) + assert call_args_list[0][1]["should_optimise"] def test_load_time_series_no_optimise( self, ): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_known_time.csv", + "./exabel/tests/resources/data/timeseries_known_time.csv", "--no-optimise", ] script = LoadTimeSeriesFromFile(args) @@ -977,7 +978,7 @@ def test_load_time_series_no_optimise( script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertFalse(call_args_list[0][1]["should_optimise"]) + assert not call_args_list[0][1]["should_optimise"] def _list_signal(self): return iter( @@ -998,7 +999,3 @@ def _list_entity_types(self): def _list_entity_types_uppercase(self): return iter([EntityType("entityTypes/BRAND", "", "", False)]) - - -if __name__ == "__main__": - unittest.main() diff --git a/exabel_data_sdk/tests/scripts/test_load_time_series_from_excel.py b/exabel/tests/scripts/test_load_time_series_from_excel.py similarity index 87% rename from exabel_data_sdk/tests/scripts/test_load_time_series_from_excel.py rename to exabel/tests/scripts/test_load_time_series_from_excel.py index ec126908..e86f0103 100644 --- a/exabel_data_sdk/tests/scripts/test_load_time_series_from_excel.py +++ b/exabel/tests/scripts/test_load_time_series_from_excel.py @@ -2,14 +2,15 @@ import unittest import pandas as pd +import pytest from dateutil import tz -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.scripts.load_time_series_from_file import LoadTimeSeriesFromFile -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import SearchEntitiesResponse, SearchTerm -from exabel_data_sdk.tests.client.exabel_mock_client import ExabelMockClient -from exabel_data_sdk.tests.decorators import requires_modules +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.scripts.load_time_series_from_file import LoadTimeSeriesFromFile +from exabel.stubs.exabel.api.data.v1.all_pb2 import SearchEntitiesResponse, SearchTerm +from exabel.tests.client.exabel_mock_client import ExabelMockClient +from exabel.tests.decorators import requires_modules common_args = ["script-name", "--sep", ";", "--api-key", "123"] @@ -31,8 +32,6 @@ def check_import( args = common_args + [ "--filename", filename, - "--namespace", - "ns", "--no-create-library-signal", "--create-missing-signals", ] @@ -49,10 +48,10 @@ def check_import( call_args_list = ( self.client.time_series_api.bulk_upsert_time_series.call_args_list # type: ignore ) - self.assertEqual(len(expected_calls), len(call_args_list)) + assert len(expected_calls) == len(call_args_list) for call, expected_series in enumerate(expected_calls): series = {s.name: s for s in call_args_list[call][0][0]} - self.assertEqual(len(expected_series), len(series)) + assert len(expected_series) == len(series) for expected in expected_series: pd.testing.assert_series_equal( @@ -64,7 +63,7 @@ def check_import( def test_read_excel__entities_in_columns_1(self): self.check_import( - "./exabel_data_sdk/tests/resources/data/entities_in_columns_example_1.xlsx", + "./exabel/tests/resources/data/entities_in_columns_example_1.xlsx", [ pd.Series( [1, 2, 3], @@ -85,16 +84,16 @@ def test_read_excel__entities_in_columns_1(self): ) def test_read_excel__entities_in_columns_1__override_entity_type_should_fail(self): - with self.assertRaises(SystemExit) as cm: + with pytest.raises(SystemExit) as exc_info: self.check_import( - "./exabel_data_sdk/tests/resources/data/entities_in_columns_example_1.xlsx", + "./exabel/tests/resources/data/entities_in_columns_example_1.xlsx", entity_type="anything_should_fail", ) - self.assertEqual(cm.exception.code, 1) + assert exc_info.value.code == 1 def test_read_excel__entities_in_columns_2(self): self.check_import( - "./exabel_data_sdk/tests/resources/data/entities_in_columns_example_2.xlsx", + "./exabel/tests/resources/data/entities_in_columns_example_2.xlsx", [ pd.Series( [1, 2], @@ -130,7 +129,7 @@ def test_read_excel__companies_in_columns_1(self): SearchEntitiesResponse.SearchResult(entities=[company2.to_proto()]), ] self.check_import( - "./exabel_data_sdk/tests/resources/data/companies_in_columns_example_1.xlsx", + "./exabel/tests/resources/data/companies_in_columns_example_1.xlsx", [ pd.Series( [1, 2, 3], @@ -155,7 +154,7 @@ def test_read_excel__companies_in_columns_unmappable(self): SearchEntitiesResponse.SearchResult(entities=[company1.to_proto()]), ] self.check_import( - "./exabel_data_sdk/tests/resources/data/companies_in_columns_example_1.xlsx", + "./exabel/tests/resources/data/companies_in_columns_example_1.xlsx", [ pd.Series( [1, 2, 3], @@ -181,7 +180,7 @@ def test_read_excel__signal_in_row_1(self): SearchEntitiesResponse.SearchResult(entities=[company2.to_proto()]), ] self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_row_example_1.xlsx", + "./exabel/tests/resources/data/signal_in_row_example_1.xlsx", [ pd.Series( [1, 1.1, 1.2, math.nan, 1.4], @@ -212,7 +211,7 @@ def test_read_excel__signal_in_row_1__override_entity_type__with_identifier_type SearchEntitiesResponse.SearchResult(entities=[company2.to_proto()]), ] self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_row_example_1.xlsx", + "./exabel/tests/resources/data/signal_in_row_example_1.xlsx", [ pd.Series( [1, 1.1, 1.2, math.nan, 1.4], @@ -229,7 +228,7 @@ def test_read_excel__signal_in_row_1__override_entity_type__with_identifier_type identifier_type="bloomberg_symbol", ) search_kwargs = self.client.entity_api.search.entities_by_terms.call_args[1] - self.assertEqual("entityTypes/company", search_kwargs.get("entity_type")) + assert "entityTypes/company" == search_kwargs.get("entity_type") self.assertCountEqual( [ SearchTerm(field="bloomberg_symbol", query="AAPL US"), @@ -248,7 +247,7 @@ def test_read_excel__signal_in_row_1__unmappable_entity(self): SearchEntitiesResponse.SearchResult(entities=[company1.to_proto()]), ] self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_row_example_1.xlsx", + "./exabel/tests/resources/data/signal_in_row_example_1.xlsx", [ pd.Series( [1, 1.1, 1.2, math.nan, 1.4], @@ -263,7 +262,7 @@ def timestamp(t: str): return pd.Timestamp(t, tz=tz.tzutc()) self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_row_example_2.xlsx", + "./exabel/tests/resources/data/signal_in_row_example_2.xlsx", [ pd.Series( [1, 1.1, 1.2, math.nan, 1.4], @@ -294,7 +293,7 @@ def timestamp(t: str): def test_read_excel__signal_in_row_3(self): self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_row_example_3.xlsx", + "./exabel/tests/resources/data/signal_in_row_example_3.xlsx", [ pd.Series( [1], @@ -311,7 +310,7 @@ def test_read_excel__signal_in_row_3(self): def test_read_excel__signal_in_row_3__override_entity_type(self): self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_row_example_3.xlsx", + "./exabel/tests/resources/data/signal_in_row_example_3.xlsx", [ pd.Series( [1], @@ -332,7 +331,7 @@ def timestamp(t: str): return pd.Timestamp(t, tz=tz.tzutc()) self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_row_example_4.xlsx", + "./exabel/tests/resources/data/signal_in_row_example_4.xlsx", [ pd.Series( [1, 1.1, 1.2, math.nan, 1.4], @@ -370,7 +369,7 @@ def timestamp(t: str): return pd.Timestamp(t, tz=tz.tzutc()) self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_row_example_6.xlsx", + "./exabel/tests/resources/data/signal_in_row_example_6.xlsx", [ pd.Series( [1, 1.1, 1.4], @@ -408,7 +407,7 @@ def test_read_excel__signal_in_column_example_1(self): SearchEntitiesResponse.SearchResult(entities=[company2.to_proto()]), ] self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_column_example_1.xlsx", + "./exabel/tests/resources/data/signal_in_column_example_1.xlsx", [ pd.Series( [1.2, 1.3, 1.4, 1.5], @@ -443,7 +442,7 @@ def test_read_excel__signal_in_column_example_1__unmappable_entity(self): SearchEntitiesResponse.SearchResult(entities=[company1.to_proto()]), ] self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_column_example_1.xlsx", + "./exabel/tests/resources/data/signal_in_column_example_1.xlsx", [ pd.Series( [1.2, 1.3, 1.4, 1.5], @@ -460,7 +459,7 @@ def test_read_excel__signal_in_column_example_1__unmappable_entity(self): def test_read_excel__signal_in_column_example_3__global_entity(self): self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_column_example_3.xlsx", + "./exabel/tests/resources/data/signal_in_column_example_3.xlsx", [ pd.Series( [1.3, 1.4, 1.5, math.nan], @@ -476,12 +475,12 @@ def test_read_excel__signal_in_column_example_3__global_entity(self): ) def test_read_excel__signal_in_column_example_3__override_entity_type_should_fail(self): - with self.assertRaises(SystemExit) as cm: + with pytest.raises(SystemExit) as exc_info: self.check_import( - "./exabel_data_sdk/tests/resources/data/signal_in_column_example_3.xlsx", + "./exabel/tests/resources/data/signal_in_column_example_3.xlsx", entity_type="anything_should_fail", ) - self.assertEqual(cm.exception.code, 1) + assert exc_info.value.code == 1 def test_read_excel__multiple_sheets_1(self): company1 = Entity(name="entityTypes/company/entities/ENT-1", display_name="ENT 1") @@ -499,7 +498,7 @@ def test_read_excel__multiple_sheets_1(self): SearchEntitiesResponse.SearchResult(entities=[company2.to_proto()]), ] self.check_import( - "./exabel_data_sdk/tests/resources/data/multiple_sheets_example_1.xlsx", + "./exabel/tests/resources/data/multiple_sheets_example_1.xlsx", [ pd.Series( [1.0, 1.1, 1.2, math.nan, 1.4], @@ -527,31 +526,27 @@ def test_read_excel__multiple_sheets_1(self): ) def test_read_excel__no_data_rows_1(self): - self.check_import("./exabel_data_sdk/tests/resources/data/no_data_1.xlsx", []) + self.check_import("./exabel/tests/resources/data/no_data_1.xlsx", []) result = self.client.signal_api.list_signals() self.assertCountEqual( ["signals/ns.signal1", "signals/ns.signal2"], [s.name for s in result] ) def test_read_excel__no_data_rows_2(self): - self.check_import("./exabel_data_sdk/tests/resources/data/no_data_2.xlsx", []) + self.check_import("./exabel/tests/resources/data/no_data_2.xlsx", []) result = self.client.signal_api.list_signals() self.assertCountEqual( ["signals/ns.signal1", "signals/ns.signal2"], [s.name for s in result] ) def test_read_excel__no_data_rows_3(self): - self.check_import("./exabel_data_sdk/tests/resources/data/no_data_3.xlsx", []) + self.check_import("./exabel/tests/resources/data/no_data_3.xlsx", []) result = self.client.signal_api.list_signals() self.assertCountEqual( ["signals/ns.signal1", "signals/ns.signal2"], [s.name for s in result] ) def test_read_excel__no_data_rows_4(self): - self.check_import("./exabel_data_sdk/tests/resources/data/no_data_4.xlsx", []) + self.check_import("./exabel/tests/resources/data/no_data_4.xlsx", []) result = self.client.signal_api.list_signals() - self.assertEqual(0, result.total_size) - - -if __name__ == "__main__": - unittest.main() + assert 0 == result.total_size diff --git a/exabel_data_sdk/tests/scripts/test_load_time_series_metadata_from_csv.py b/exabel/tests/scripts/test_load_time_series_metadata_from_csv.py similarity index 67% rename from exabel_data_sdk/tests/scripts/test_load_time_series_metadata_from_csv.py rename to exabel/tests/scripts/test_load_time_series_metadata_from_csv.py index c5f7268d..a1af7856 100644 --- a/exabel_data_sdk/tests/scripts/test_load_time_series_metadata_from_csv.py +++ b/exabel/tests/scripts/test_load_time_series_metadata_from_csv.py @@ -3,18 +3,19 @@ import numpy as np import pandas as pd - -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.client.api.data_classes.time_series import Dimension, TimeSeries, Unit, Units -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.api.signal_api import SignalApi -from exabel_data_sdk.client.api.time_series_api import TimeSeriesApi -from exabel_data_sdk.scripts.load_time_series_metadata_from_file import ( +import pytest + +from exabel import ExabelClient +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.data_classes.signal import Signal +from exabel.client.api.data_classes.time_series import Dimension, TimeSeries, Unit, Units +from exabel.client.api.entity_api import EntityApi +from exabel.client.api.signal_api import SignalApi +from exabel.client.api.time_series_api import TimeSeriesApi +from exabel.scripts.load_time_series_metadata_from_file import ( LoadTimeSeriesMetaDataFromFile, ) -from exabel_data_sdk.services.file_time_series_parser import MetaDataSignalNamesInRows +from exabel.services.file_time_series_parser import MetaDataSignalNamesInRows common_args = ["script-name", "--sep", ";", "--api-key", "123"] @@ -42,36 +43,34 @@ def test_get_series(self): parsed_file = MetaDataSignalNamesInRows.from_data_frame(ts_data, self.client.entity_api, "") time_series = parsed_file.get_series(prefix="signals/acme.") - self.assertEqual(2, len(time_series.failures)) - self.assertEqual(2, len(time_series.valid_series)) + assert 2 == len(time_series.failures) + assert 2 == len(time_series.valid_series) - self.assertEqual( + assert ( TimeSeries( series=pd.Series([], name="b/signals/acme.signal1", dtype=object), units=Units(units=[Unit(dimension=Dimension.DIMENSION_CURRENCY, unit="NOK")]), - ), - time_series.failures[0].resource, + ) + == time_series.failures[0].resource ) - self.assertEqual( - TimeSeries( - series=pd.Series([], name="b/signals/acme.signal1", dtype=object), - ), - time_series.failures[1].resource, + assert ( + TimeSeries(series=pd.Series([], name="b/signals/acme.signal1", dtype=object)) + == time_series.failures[1].resource ) - self.assertEqual( + assert ( TimeSeries( series=pd.Series([], name="a/signals/acme.signal1", dtype=object), units=Units(units=[Unit(dimension=Dimension.DIMENSION_CURRENCY, unit="USD")]), - ), - time_series.valid_series[0], + ) + == time_series.valid_series[0] ) - self.assertEqual( + assert ( TimeSeries( series=pd.Series([], name="a/signals/acme.signal2", dtype=object), units=Units(units=[Unit(dimension=Dimension.DIMENSION_CURRENCY, unit="EUR")]), - ), - time_series.valid_series[1], + ) + == time_series.valid_series[1] ) def test_get_series__skip_validation(self): @@ -85,26 +84,26 @@ def test_get_series__skip_validation(self): ts_data = pd.DataFrame(data, columns=["entity", "signal", "currency"]) parsed_file = MetaDataSignalNamesInRows.from_data_frame(ts_data, self.client.entity_api, "") time_series = parsed_file.get_series("signals/acme.", skip_validation=True) - self.assertSequenceEqual([], time_series.failures) - self.assertEqual(4, len(time_series.valid_series)) + assert [] == time_series.failures + assert 4 == len(time_series.valid_series) - self.assertEqual( - TimeSeries(series=pd.Series([], name="b/signals/acme.signal1", dtype=object)), - time_series.valid_series[3], + assert ( + TimeSeries(series=pd.Series([], name="b/signals/acme.signal1", dtype=object)) + == time_series.valid_series[3] ) def test_read_file__description(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_metadata_description.csv", + "./exabel/tests/resources/data/timeseries_metadata_description.csv", ] script = LoadTimeSeriesMetaDataFromFile(args) script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(2, len(series)) + assert 2 == len(series) series_by_name = {s.name: s for s in series} ts = TimeSeries( @@ -113,33 +112,27 @@ def test_read_file__description(self): ), units=Units(description="percent"), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal1"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal1"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_A/signals/ns.signal2", dtype=object ), units=Units(description="ratio"), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal2"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal2"] def test_read_file__currency(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_metadata_currency.csv", + "./exabel/tests/resources/data/timeseries_metadata_currency.csv", ] script = LoadTimeSeriesMetaDataFromFile(args) script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(3, len(series)) + assert 3 == len(series) series_by_name = {s.name: s for s in series} ts = TimeSeries( @@ -150,10 +143,7 @@ def test_read_file__currency(self): units=[Unit(dimension=Dimension.DIMENSION_CURRENCY, unit="USD")], ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal1"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal1"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_A/signals/ns.signal2", dtype=object @@ -163,33 +153,27 @@ def test_read_file__currency(self): description="millions", ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal2"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal2"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_B/signals/ns.signal1", dtype=object ), units=Units(units=[Unit(dimension=Dimension.DIMENSION_CURRENCY, unit="NOK")]), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_B/signals/ns.signal1"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_B/signals/ns.signal1"] def test_read_file__unit(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_metadata_unit.csv", + "./exabel/tests/resources/data/timeseries_metadata_unit.csv", ] script = LoadTimeSeriesMetaDataFromFile(args) script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(5, len(series)) + assert 5 == len(series) series_by_name = {s.name: s for s in series} ts = TimeSeries( @@ -200,10 +184,7 @@ def test_read_file__unit(self): units=[Unit(dimension=Dimension.DIMENSION_RATIO, unit="percent")], ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal1"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal1"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_A/signals/ns.signal2", dtype=object @@ -212,10 +193,7 @@ def test_read_file__unit(self): units=[Unit(dimension=Dimension.DIMENSION_UNKNOWN, unit="bps")], ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal2"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal2"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_B/signals/ns.signal1", dtype=object @@ -224,10 +202,7 @@ def test_read_file__unit(self): units=[Unit(dimension=Dimension.DIMENSION_RATIO, unit="ratio")], ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_B/signals/ns.signal1"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_B/signals/ns.signal1"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_B/signals/ns.signal2", dtype=object @@ -236,32 +211,26 @@ def test_read_file__unit(self): units=[Unit(dimension=Dimension.DIMENSION_RATIO, unit="%")], ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_B/signals/ns.signal2"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_B/signals/ns.signal2"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_A/signals/ns.signal3", dtype=object ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal3"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal3"] def test_read_file__unit_and_currency(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_metadata_unit_and_currency.csv", + "./exabel/tests/resources/data/timeseries_metadata_unit_and_currency.csv", ] script = LoadTimeSeriesMetaDataFromFile(args) script.run_script(self.client, script.parse_arguments()) call_args_list = self.client.time_series_api.bulk_upsert_time_series.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) series = call_args_list[0][0][0] - self.assertEqual(3, len(series)) + assert 3 == len(series) series_by_name = {s.name: s for s in series} ts = TimeSeries( @@ -272,10 +241,7 @@ def test_read_file__unit_and_currency(self): units=[Unit(dimension=Dimension.DIMENSION_CURRENCY, unit="NOK")], ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal1"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal1"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_B/signals/ns.signal1", dtype=object @@ -284,10 +250,7 @@ def test_read_file__unit_and_currency(self): units=[Unit(dimension=Dimension.DIMENSION_CURRENCY, unit="USD")], ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_B/signals/ns.signal1"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_B/signals/ns.signal1"] ts = TimeSeries( series=pd.Series( [], name="entityTypes/company/entities/company_A/signals/ns.signal2", dtype=object @@ -296,29 +259,26 @@ def test_read_file__unit_and_currency(self): units=[Unit(dimension=Dimension.DIMENSION_RATIO, unit="percent")], ), ) - self.assertEqual( - ts, - series_by_name["entityTypes/company/entities/company_A/signals/ns.signal2"], - ) + assert ts == series_by_name["entityTypes/company/entities/company_A/signals/ns.signal2"] def test_read_file__invalid(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_metadata_invalid.csv", + "./exabel/tests/resources/data/timeseries_metadata_invalid.csv", ] script = LoadTimeSeriesMetaDataFromFile(args) - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): script.run_script(self.client, script.parse_arguments()) def test_read_file__invalid2(self): args = common_args + [ "--filename", - "./exabel_data_sdk/tests/resources/data/timeseries_metadata_invalid2.csv", + "./exabel/tests/resources/data/timeseries_metadata_invalid2.csv", ] script = LoadTimeSeriesMetaDataFromFile(args) - with self.assertRaises(SystemExit): + with pytest.raises(SystemExit): script.run_script(self.client, script.parse_arguments()) def _list_signal(self): @@ -332,7 +292,3 @@ def _list_signal(self): def _list_entity_types(self): return iter([EntityType("entityTypes/brand", "", "", False)]) - - -if __name__ == "__main__": - unittest.main() diff --git a/exabel_data_sdk/tests/scripts/test_update_entity_type.py b/exabel/tests/scripts/test_update_entity_type.py similarity index 88% rename from exabel_data_sdk/tests/scripts/test_update_entity_type.py rename to exabel/tests/scripts/test_update_entity_type.py index 6ad4a85e..11c34e37 100644 --- a/exabel_data_sdk/tests/scripts/test_update_entity_type.py +++ b/exabel/tests/scripts/test_update_entity_type.py @@ -3,10 +3,10 @@ from google.protobuf.field_mask_pb2 import FieldMask -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.scripts.update_entity_type import UpdateEntityType +from exabel import ExabelClient +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.entity_api import EntityApi +from exabel.scripts.update_entity_type import UpdateEntityType common_args = [ "script-name", diff --git a/exabel_data_sdk/tests/scripts/test_update_relationship_type.py b/exabel/tests/scripts/test_update_relationship_type.py similarity index 71% rename from exabel_data_sdk/tests/scripts/test_update_relationship_type.py rename to exabel/tests/scripts/test_update_relationship_type.py index 0fa45a2d..cb3eee3d 100644 --- a/exabel_data_sdk/tests/scripts/test_update_relationship_type.py +++ b/exabel/tests/scripts/test_update_relationship_type.py @@ -1,9 +1,10 @@ -import unittest from unittest import mock -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.relationship_api import RelationshipApi -from exabel_data_sdk.scripts.update_relationship_type import UpdateRelationshipType +import pytest + +from exabel import ExabelClient +from exabel.client.api.relationship_api import RelationshipApi +from exabel.scripts.update_relationship_type import UpdateRelationshipType common_args = [ "script-name", @@ -14,8 +15,9 @@ ] -class TestUpdateRelationshipType(unittest.TestCase): - def setUp(self) -> None: +class TestUpdateRelationshipType: + @pytest.fixture(autouse=True) + def setup(self) -> None: self.client = mock.create_autospec(ExabelClient) self.client.relationship_api = mock.create_autospec(RelationshipApi) @@ -29,8 +31,8 @@ def test_update_description(self): call_args_list = self.client.relationship_api.update_relationship_type.call_args_list update_mask = call_args_list[0][1]["update_mask"].paths - self.assertEqual(call_args_list[0][0][0].description, "My updated description.") - self.assertSetEqual({"description"}, set(update_mask)) + assert call_args_list[0][0][0].description == "My updated description." + assert set({"description"}) == set(set(update_mask)) def test_update_is_ownership(self): args = common_args + [ @@ -41,8 +43,8 @@ def test_update_is_ownership(self): call_args_list = self.client.relationship_api.update_relationship_type.call_args_list update_mask = call_args_list[0][1]["update_mask"].paths - self.assertEqual(call_args_list[0][0][0].is_ownership, True) - self.assertSetEqual({"is_ownership"}, set(update_mask)) + assert call_args_list[0][0][0].is_ownership + assert set({"is_ownership"}) == set(set(update_mask)) def test_update_no_is_ownership(self): args = common_args + [ @@ -53,8 +55,8 @@ def test_update_no_is_ownership(self): call_args_list = self.client.relationship_api.update_relationship_type.call_args_list update_mask = call_args_list[0][1]["update_mask"].paths - self.assertEqual(call_args_list[0][0][0].is_ownership, False) - self.assertSetEqual({"is_ownership"}, set(update_mask)) + assert not call_args_list[0][0][0].is_ownership + assert set({"is_ownership"}) == set(set(update_mask)) def test_allow_missing(self): args = common_args + [ @@ -65,8 +67,4 @@ def test_allow_missing(self): call_args_list = self.client.relationship_api.update_relationship_type.call_args_list allow_missing = call_args_list[0][1]["allow_missing"] - self.assertEqual(allow_missing, True) - - -if __name__ == "__main__": - unittest.main() + assert allow_missing diff --git a/exabel_data_sdk/tests/services/__init__.py b/exabel/tests/services/__init__.py similarity index 100% rename from exabel_data_sdk/tests/services/__init__.py rename to exabel/tests/services/__init__.py diff --git a/exabel_data_sdk/tests/services/sql/__init__.py b/exabel/tests/services/sql/__init__.py similarity index 100% rename from exabel_data_sdk/tests/services/sql/__init__.py rename to exabel/tests/services/sql/__init__.py diff --git a/exabel_data_sdk/tests/services/sql/test_athena_reader_configuration.py b/exabel/tests/services/sql/test_athena_reader_configuration.py similarity index 81% rename from exabel_data_sdk/tests/services/sql/test_athena_reader_configuration.py rename to exabel/tests/services/sql/test_athena_reader_configuration.py index 4d22d012..c1078279 100644 --- a/exabel_data_sdk/tests/services/sql/test_athena_reader_configuration.py +++ b/exabel/tests/services/sql/test_athena_reader_configuration.py @@ -1,7 +1,9 @@ import argparse import unittest -from exabel_data_sdk.services.sql.athena_reader_configuration import ( +import pytest + +from exabel.services.sql.athena_reader_configuration import ( AthenaReaderConfiguration, AwsAccessKeyId, AwsSecretAccessKey, @@ -30,7 +32,7 @@ def setUp(self) -> None: ) def test_athena_reader_configuration__key_without_secret_should_fail(self): - with self.assertRaises(ValueError): + with pytest.raises(ValueError): AthenaReaderConfiguration( region="region", s3_staging_dir="staging/dir", @@ -38,7 +40,7 @@ def test_athena_reader_configuration__key_without_secret_should_fail(self): ) def test_athena_reader_configuration__secret_without_key_should_fail(self): - with self.assertRaises(ValueError): + with pytest.raises(ValueError): AthenaReaderConfiguration( region="region", s3_staging_dir="staging/dir", @@ -46,7 +48,7 @@ def test_athena_reader_configuration__secret_without_key_should_fail(self): ) def test_athena_reader_configuration__key_and_profile_should_fail(self): - with self.assertRaises(ValueError): + with pytest.raises(ValueError): AthenaReaderConfiguration( region="region", s3_staging_dir="staging/dir", @@ -66,37 +68,32 @@ def test_from_args(self): profile=None, ) athena_reader_configuration = AthenaReaderConfiguration.from_args(args) - self.assertEqual( - self.config, - athena_reader_configuration, - ) + assert self.config == athena_reader_configuration def test_from_args__missing_arg(self): args = argparse.Namespace() - with self.assertRaises(AttributeError): + with pytest.raises(AttributeError): AthenaReaderConfiguration.from_args(args) def test_get_connection_string(self): - self.assertSequenceEqual( + assert ( "awsathena+arrow://" "aws_access_key_id:aws_secret_access_key@athena.region.amazonaws.com:443/schema" - "?unload=true&s3_staging_dir=staging%2Fdir&work_group=workgroup&catalog_name=catalog", - self.config.get_connection_string(), + "?unload=true&s3_staging_dir=staging%2Fdir&work_group=workgroup&catalog_name=catalog" + == self.config.get_connection_string() ) def test_get_connection_string__minimal(self): - self.assertEqual( + assert ( "awsathena+arrow://:@athena.region.amazonaws.com:443/?unload=true" - "&s3_staging_dir=staging%2Fdir", - self.config_minimal.get_connection_string(), + "&s3_staging_dir=staging%2Fdir" == self.config_minimal.get_connection_string() ) def test_get_connection_string__with_profile(self): config = AthenaReaderConfiguration( region="region", s3_staging_dir="staging/dir", profile="profile" ) - self.assertEqual( + assert ( "awsathena+arrow://:@athena.region.amazonaws.com:443/?unload=true" - "&s3_staging_dir=staging%2Fdir&profile_name=profile", - config.get_connection_string(), + "&s3_staging_dir=staging%2Fdir&profile_name=profile" == config.get_connection_string() ) diff --git a/exabel_data_sdk/tests/services/sql/test_bigquery_reader_configuration.py b/exabel/tests/services/sql/test_bigquery_reader_configuration.py similarity index 65% rename from exabel_data_sdk/tests/services/sql/test_bigquery_reader_configuration.py rename to exabel/tests/services/sql/test_bigquery_reader_configuration.py index 4abffe1d..bd9b1f2e 100644 --- a/exabel_data_sdk/tests/services/sql/test_bigquery_reader_configuration.py +++ b/exabel/tests/services/sql/test_bigquery_reader_configuration.py @@ -3,15 +3,17 @@ import unittest from unittest import mock -from exabel_data_sdk.services.sql.bigquery_reader_configuration import ( +import pytest + +from exabel.services.sql.bigquery_reader_configuration import ( BigQueryReaderConfiguration, Credentials, CredentialsPath, Dataset, Project, ) -from exabel_data_sdk.services.sql.exceptions import InvalidServiceAccountCredentialsError, SqlError -from exabel_data_sdk.tests.decorators import requires_modules +from exabel.services.sql.exceptions import InvalidServiceAccountCredentialsError, SqlError +from exabel.tests.decorators import requires_modules @requires_modules("google.cloud.bigquery") @@ -29,7 +31,7 @@ def setUp(self) -> None: ) def test_bigquery_reader_configuration__credentials_path_and_string_should_fail(self): - with self.assertRaises(ValueError): + with pytest.raises(ValueError): BigQueryReaderConfiguration( credentials_path="/path/to/credentials", credentials="credentials", @@ -37,7 +39,7 @@ def test_bigquery_reader_configuration__credentials_path_and_string_should_fail( def test_bigquery_reader_configuration_missing_required_arg(self): args = argparse.Namespace() - with self.assertRaises(AttributeError): + with pytest.raises(AttributeError): BigQueryReaderConfiguration.from_args(args) def test_bigquery_reader_configuration_from_all_args__credentials_path(self): @@ -48,10 +50,7 @@ def test_bigquery_reader_configuration_from_all_args__credentials_path(self): credentials_string=None, ) bigquery_reader_configuration = BigQueryReaderConfiguration.from_args(args) - self.assertEqual( - self.config_with_credentials_path, - bigquery_reader_configuration, - ) + assert self.config_with_credentials_path == bigquery_reader_configuration def test_bigquery_reader_configuration_from_all_args__credentials_string(self): args = argparse.Namespace( @@ -61,16 +60,10 @@ def test_bigquery_reader_configuration_from_all_args__credentials_string(self): credentials_string="credentials", ) bigquery_reader_configuration = BigQueryReaderConfiguration.from_args(args) - self.assertEqual( - self.config_with_credentials_string, - bigquery_reader_configuration, - ) + assert self.config_with_credentials_string == bigquery_reader_configuration def test_bigquery_reader_configuration_get_connection_minimal(self): - self.assertEqual( - "bigquery:///", - BigQueryReaderConfiguration().get_connection_string(), - ) + assert "bigquery:///" == BigQueryReaderConfiguration().get_connection_string() def test_bigquery_reader_configuration_get_connection_string(self): config = BigQueryReaderConfiguration( @@ -78,15 +71,13 @@ def test_bigquery_reader_configuration_get_connection_string(self): dataset="dataset-123", credentials_path="/path/to/credentials", ) - self.assertSequenceEqual( - ("bigquery://project/dataset-123?credentials_path=%2Fpath%2Fto%2Fcredentials", {}), - config.get_connection_string_and_kwargs(), - ) + assert ( + "bigquery://project/dataset-123?credentials_path=%2Fpath%2Fto%2Fcredentials", + {}, + ) == config.get_connection_string_and_kwargs() - @mock.patch( - "exabel_data_sdk.services.sql.bigquery_reader_configuration.ServiceAccountCredentials" - ) - @mock.patch("exabel_data_sdk.services.sql.bigquery_reader_configuration.BigQueryClient") + @mock.patch("exabel.services.sql.bigquery_reader_configuration.ServiceAccountCredentials") + @mock.patch("exabel.services.sql.bigquery_reader_configuration.BigQueryClient") def test_bigquery_reader_configuration_get_connection_string__with_credentials_string( self, mock_bq_client, mock_sa_credentials ): @@ -97,13 +88,10 @@ def test_bigquery_reader_configuration_get_connection_string__with_credentials_s dataset="dataset-123", credentials='{"credentials": "string"}', ) - self.assertSequenceEqual( - ( - "bigquery://project/dataset-123?user_supplied_client=true", - {"connect_args": {"client": "bq_client"}}, - ), - config.get_connection_string_and_kwargs(), - ) + assert ( + "bigquery://project/dataset-123?user_supplied_client=true", + {"connect_args": {"client": "bq_client"}}, + ) == config.get_connection_string_and_kwargs() mock_sa_credentials.from_service_account_info.assert_called_once_with( {"credentials": "string"} ) @@ -112,10 +100,8 @@ def test_bigquery_reader_configuration_get_connection_string__with_credentials_s project="project", ) - @mock.patch( - "exabel_data_sdk.services.sql.bigquery_reader_configuration.ServiceAccountCredentials" - ) - @mock.patch("exabel_data_sdk.services.sql.bigquery_reader_configuration.BigQueryClient") + @mock.patch("exabel.services.sql.bigquery_reader_configuration.ServiceAccountCredentials") + @mock.patch("exabel.services.sql.bigquery_reader_configuration.BigQueryClient") def test_bigquery_reader_configuration_get_connection_string__with_invalid_credentials_string( self, mock_bq_client, mock_sa_credentials ): @@ -125,11 +111,11 @@ def test_bigquery_reader_configuration_get_connection_string__with_invalid_crede dataset="dataset-123", credentials="invalid json", ) - with self.assertRaises(InvalidServiceAccountCredentialsError) as cm: + with pytest.raises(InvalidServiceAccountCredentialsError) as exc_info: config.get_connection_string_and_kwargs() - self.assertIsInstance(cm.exception.__cause__, json.JSONDecodeError) - self.assertIsInstance(cm.exception, SqlError) - self.assertFalse(mock_sa_credentials.from_service_account_info.called) + assert isinstance(exc_info.value.__cause__, json.JSONDecodeError) + assert isinstance(exc_info.value, SqlError) + assert not mock_sa_credentials.from_service_account_info.called mock_sa_credentials.from_service_account_info.side_effect = ValueError() config = BigQueryReaderConfiguration( @@ -137,9 +123,9 @@ def test_bigquery_reader_configuration_get_connection_string__with_invalid_crede dataset="dataset-123", credentials='{"invalid": "credentials"}', ) - with self.assertRaises(InvalidServiceAccountCredentialsError): + with pytest.raises(InvalidServiceAccountCredentialsError): config.get_connection_string_and_kwargs() - self.assertIsInstance(cm.exception, SqlError) + assert isinstance(exc_info.value, SqlError) mock_sa_credentials.from_service_account_info.assert_called_once_with( {"invalid": "credentials"} ) diff --git a/exabel_data_sdk/tests/services/sql/test_snowflake_reader.py b/exabel/tests/services/sql/test_snowflake_reader.py similarity index 90% rename from exabel_data_sdk/tests/services/sql/test_snowflake_reader.py rename to exabel/tests/services/sql/test_snowflake_reader.py index c1609016..eab093e2 100644 --- a/exabel_data_sdk/tests/services/sql/test_snowflake_reader.py +++ b/exabel/tests/services/sql/test_snowflake_reader.py @@ -1,6 +1,6 @@ import unittest -from exabel_data_sdk.services.sql.snowflake_reader import SnowflakeReader +from exabel.services.sql.snowflake_reader import SnowflakeReader class TestSnowflakeReader(unittest.TestCase): diff --git a/exabel_data_sdk/tests/services/sql/test_snowflake_reader_configuration.py b/exabel/tests/services/sql/test_snowflake_reader_configuration.py similarity index 53% rename from exabel_data_sdk/tests/services/sql/test_snowflake_reader_configuration.py rename to exabel/tests/services/sql/test_snowflake_reader_configuration.py index 9ba3405b..6e162ba8 100644 --- a/exabel_data_sdk/tests/services/sql/test_snowflake_reader_configuration.py +++ b/exabel/tests/services/sql/test_snowflake_reader_configuration.py @@ -1,7 +1,9 @@ import argparse import unittest -from exabel_data_sdk.services.sql.snowflake_reader_configuration import ( +import pytest + +from exabel.services.sql.snowflake_reader_configuration import ( Account, Database, Password, @@ -12,7 +14,7 @@ Username, Warehouse, ) -from exabel_data_sdk.tests.decorators import requires_modules +from exabel.tests.decorators import requires_modules @requires_modules("snowflake.sqlalchemy") @@ -30,7 +32,7 @@ def setUp(self) -> None: ) def test_snowflake_reader_configuration_should_fail(self): - with self.assertRaises(ValueError): + with pytest.raises(ValueError): SnowflakeReaderConfiguration( account=Account("account"), user=Username("username"), @@ -51,41 +53,30 @@ def test_snowflake_reader_configuration_from_args(self): ignored="ignored", ) snowflake_reader_configuration = SnowflakeReaderConfiguration.from_args(args) - self.assertEqual( - self.config, - snowflake_reader_configuration, - ) + assert self.config == snowflake_reader_configuration def test_snowflake_reader_configuration_get_connection_string_and_kwargs(self): - self.assertEqual( - ( - "snowflake://username:password@account/database/schema" - "?login_timeout=15&role=role&warehouse=warehouse", - {"connect_args": {"private_key": "private_key".encode()}}, - ), - self.config.get_connection_string_and_kwargs(), - ) - self.assertEqual( - ("snowflake://username:password@account/?login_timeout=15", {}), - SnowflakeReaderConfiguration( - account=Account("account"), - user=Username("username"), - password=Password("password"), - ).get_connection_string_and_kwargs(), - ) + assert ( + "snowflake://username:password@account/database/schema" + "?login_timeout=15&role=role&warehouse=warehouse", + {"connect_args": {"private_key": "private_key".encode()}}, + ) == self.config.get_connection_string_and_kwargs() + assert ( + "snowflake://username:password@account/?login_timeout=15", + {}, + ) == SnowflakeReaderConfiguration( + account=Account("account"), user=Username("username"), password=Password("password") + ).get_connection_string_and_kwargs() def test_snowflake_reader_configuration_get_connection_args(self): - self.assertEqual( - { - "account": "account", - "user": "username", - "password": "password", - "private_key": "private_key".encode(), - "warehouse": "warehouse", - "database": "database", - "schema": "schema", - "role": "role", - "login_timeout": 15, - }, - self.config.get_connection_args(), - ) + assert { + "account": "account", + "user": "username", + "password": "password", + "private_key": "private_key".encode(), + "warehouse": "warehouse", + "database": "database", + "schema": "schema", + "role": "role", + "login_timeout": 15, + } == self.config.get_connection_args() diff --git a/exabel_data_sdk/tests/services/sql/test_sql_reader_configuration.py b/exabel/tests/services/sql/test_sql_reader_configuration.py similarity index 75% rename from exabel_data_sdk/tests/services/sql/test_sql_reader_configuration.py rename to exabel/tests/services/sql/test_sql_reader_configuration.py index 61894ca3..16acf563 100644 --- a/exabel_data_sdk/tests/services/sql/test_sql_reader_configuration.py +++ b/exabel/tests/services/sql/test_sql_reader_configuration.py @@ -1,7 +1,7 @@ import argparse import unittest -from exabel_data_sdk.services.sql.sql_reader_configuration import EngineArgs, SqlReaderConfiguration +from exabel.services.sql.sql_reader_configuration import EngineArgs, SqlReaderConfiguration class MockSqlReaderConfiguration(SqlReaderConfiguration): @@ -22,7 +22,4 @@ def test_get_connection_string_and_kwargs(self): ("connection-string", {}), engine_args, ) - self.assertEqual( - EngineArgs("connection-string", {}), - engine_args, - ) + assert EngineArgs("connection-string", {}) == engine_args diff --git a/exabel_data_sdk/tests/services/sql/test_sqlalchemy_reader.py b/exabel/tests/services/sql/test_sqlalchemy_reader.py similarity index 72% rename from exabel_data_sdk/tests/services/sql/test_sqlalchemy_reader.py rename to exabel/tests/services/sql/test_sqlalchemy_reader.py index 0c851036..bbd31c31 100644 --- a/exabel_data_sdk/tests/services/sql/test_sqlalchemy_reader.py +++ b/exabel/tests/services/sql/test_sqlalchemy_reader.py @@ -4,11 +4,11 @@ import pandas as pd import pandas.testing as pdt -from exabel_data_sdk.services.file_writer import FileWriter, FileWritingResult -from exabel_data_sdk.services.sql.sql_reader_configuration import ConnectionString -from exabel_data_sdk.services.sql.sqlalchemy_reader import SQLAlchemyReader -from exabel_data_sdk.tests.decorators import requires_modules -from exabel_data_sdk.util.handle_missing_imports import handle_missing_imports +from exabel.services.file_writer import FileWriter, FileWritingResult +from exabel.services.sql.sql_reader_configuration import ConnectionString +from exabel.services.sql.sqlalchemy_reader import SQLAlchemyReader +from exabel.tests.decorators import requires_modules +from exabel.util.handle_missing_imports import handle_missing_imports with handle_missing_imports(): from sqlalchemy.engine import Engine @@ -24,7 +24,7 @@ def write_file(df: pd.DataFrame, filepath: str) -> FileWritingResult: def setUp(self) -> None: self.reader = SQLAlchemyReader(ConnectionString("sqlite:///:memory:")) - @mock.patch("exabel_data_sdk.services.sql.sqlalchemy_reader.create_engine") + @mock.patch("exabel.services.sql.sqlalchemy_reader.create_engine") def test_sqlalchemy_reader_constructor(self, mock_create_engine): mock_create_engine.return_value = None SQLAlchemyReader( @@ -35,8 +35,8 @@ def test_sqlalchemy_reader_constructor(self, mock_create_engine): ) def test_engine(self): - self.assertIsInstance(self.reader.engine, Engine) - self.assertEqual("sqlite:///:memory:", str(self.reader.engine.url)) + assert isinstance(self.reader.engine, Engine) + assert "sqlite:///:memory:" == str(self.reader.engine.url) def test_read_sql_query(self): df = self.reader.read_sql_query("SELECT 1 as a UNION SELECT 2") @@ -53,12 +53,12 @@ def test_read_sql_query_in_batches(self): row, ) - @mock.patch("exabel_data_sdk.services.sql.sql_reader.FileWriterProvider") + @mock.patch("exabel.services.sql.sql_reader.FileWriterProvider") def test_read_sql_query_and_write_result_without_output_file(self, mock_provider): self.reader.read_sql_query_and_write_result("SELECT 1 as a UNION SELECT 2") mock_provider.get_file_writer.assert_not_called() - @mock.patch("exabel_data_sdk.services.sql.sql_reader.FileWriterProvider") + @mock.patch("exabel.services.sql.sql_reader.FileWriterProvider") def test_read_sql_query_and_write_result_with_output_file(self, mock_provider): mock_writer = mock.create_autospec(self._MockFileWriter) mock_provider.get_file_writer.return_value = mock_writer @@ -69,7 +69,4 @@ def test_read_sql_query_and_write_result_with_output_file(self, mock_provider): pd.DataFrame({"a": [1, 2]}), call_args[0], ) - self.assertEqual( - "output-file", - call_args[1], - ) + assert "output-file" == call_args[1] diff --git a/exabel_data_sdk/tests/services/test_csv_entity_loader.py b/exabel/tests/services/test_csv_entity_loader.py similarity index 75% rename from exabel_data_sdk/tests/services/test_csv_entity_loader.py rename to exabel/tests/services/test_csv_entity_loader.py index bbd76aa6..09f329cb 100644 --- a/exabel_data_sdk/tests/services/test_csv_entity_loader.py +++ b/exabel/tests/services/test_csv_entity_loader.py @@ -1,21 +1,20 @@ -import unittest from unittest import mock import pandas as pd +import pytest -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.exabel_client import ExabelClient -from exabel_data_sdk.services.csv_entity_loader import CsvEntityLoader -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.tests.client.exabel_mock_client import ExabelMockClient +from exabel.client.api.data_classes.entity import Entity +from exabel.client.exabel_client import ExabelClient +from exabel.services.csv_entity_loader import CsvEntityLoader +from exabel.services.file_loading_exception import FileLoadingException +from exabel.tests.client.exabel_mock_client import ExabelMockClient -class TestCsvEntityLoader(unittest.TestCase): +class TestCsvEntityLoader: def test_load_entities_with_properties(self): client: ExabelClient = ExabelMockClient() CsvEntityLoader(client).load_entities( - filename="exabel_data_sdk/tests/resources/data/entities_with_properties.csv", - namespace="test", + filename="exabel/tests/resources/data/entities_with_properties.csv", entity_column="brand", display_name_column="brand", property_columns={ @@ -73,12 +72,12 @@ def test_load_entities_with_properties(self): ), ] actual_entities = client.entity_api.list_entities("entityTypes/brand").results - self.assertCountEqual(expected_entities, actual_entities) + assert sorted(expected_entities) == sorted(actual_entities) def test_load_entities_with_integer_display_names(self): client: ExabelClient = ExabelMockClient() CsvEntityLoader(client).load_entities( - filename="exabel_data_sdk/tests/resources/data/entities_with_integer_display_names.csv", + filename="exabel/tests/resources/data/entities_with_integer_display_names.csv", entity_type="brand", upsert=False, ) @@ -94,14 +93,13 @@ def test_load_entities_with_integer_display_names(self): ), ] actual_entities = client.entity_api.list_entities("entityTypes/brand").results - self.assertCountEqual(expected_entities, actual_entities) + assert sorted(expected_entities) == sorted(actual_entities) def test_load_entities_with_non_existent_property(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException): + with pytest.raises(FileLoadingException): CsvEntityLoader(client).load_entities( - filename="exabel_data_sdk/tests/resources/data/entities_with_properties.csv", - namespace="test", + filename="exabel/tests/resources/data/entities_with_properties.csv", entity_column="brand", property_columns={"non_existent_prop": str}, upsert=False, @@ -110,8 +108,7 @@ def test_load_entities_with_non_existent_property(self): def test_load_entities_with_uppercase_columns(self): client: ExabelClient = ExabelMockClient() CsvEntityLoader(client).load_entities( - filename="exabel_data_sdk/tests/resources/data/entities_with_uppercase_columns.csv", - namespace="test", + filename="exabel/tests/resources/data/entities_with_uppercase_columns.csv", entity_column="brand", display_name_column="display_name", description_column="description", @@ -157,25 +154,22 @@ def test_load_entities_with_uppercase_columns(self): read_only=False, ), ] - self.maxDiff = 2000 actual_entities = client.entity_api.list_entities("entityTypes/brand").results - self.assertCountEqual(expected_entities, actual_entities) + assert sorted(expected_entities) == sorted(actual_entities) - @mock.patch("exabel_data_sdk.services.csv_reader.CsvReader.read_file") + @mock.patch("exabel.services.csv_reader.CsvReader.read_file") def test_load_entities__display_name_with_only_one_column(self, mock_read_file): mock_read_file.return_value = pd.DataFrame([{"brand": "brand1"}]) client: ExabelClient = ExabelMockClient() CsvEntityLoader(client).load_entities( filename="filename", - namespace="test", upsert=False, ) - self.assertCountEqual( - [Entity(name="entityTypes/brand/entities/test.brand1", display_name="brand1")], - client.entity_api.list_entities("entityTypes/brand").results, - ) + expected = [Entity(name="entityTypes/brand/entities/test.brand1", display_name="brand1")] + actual = client.entity_api.list_entities("entityTypes/brand").results + assert sorted(expected) == sorted(actual) - @mock.patch("exabel_data_sdk.services.csv_reader.CsvReader.read_file") + @mock.patch("exabel.services.csv_reader.CsvReader.read_file") def test_load_entities__with_batch_size(self, mock_read_file: mock.MagicMock): df = pd.DataFrame([{"brand": "brand"}]) mock_read_file.side_effect = [df, (df for _ in range(2))] @@ -186,6 +180,6 @@ def test_load_entities__with_batch_size(self, mock_read_file: mock.MagicMock): filename="file", batch_size=1, ) - self.assertIsNone(mock_read_file.call_args_list[0][1].get("chunksize")) - self.assertEqual(mock_read_file.call_args_list[1][1]["chunksize"], 1) - self.assertEqual(mock_load.call_count, 2) + assert mock_read_file.call_args_list[0][1].get("chunksize") is None + assert mock_read_file.call_args_list[1][1]["chunksize"] == 1 + assert mock_load.call_count == 2 diff --git a/exabel_data_sdk/tests/services/test_csv_reader.py b/exabel/tests/services/test_csv_reader.py similarity index 95% rename from exabel_data_sdk/tests/services/test_csv_reader.py rename to exabel/tests/services/test_csv_reader.py index 5e69ac5e..df4a6b06 100644 --- a/exabel_data_sdk/tests/services/test_csv_reader.py +++ b/exabel/tests/services/test_csv_reader.py @@ -1,13 +1,13 @@ import tempfile -import unittest from typing import Iterable import pandas as pd +import pytest -from exabel_data_sdk.services.csv_reader import CsvReader +from exabel.services.csv_reader import CsvReader -class TestCsvReader(unittest.TestCase): +class TestCsvReader: def _read_csv( self, content: str, @@ -70,5 +70,5 @@ def test_read_csv_in_chunks(self): pd.testing.assert_frame_equal(expected, next(result)) expected = pd.DataFrame({"Column A": ["b1"], "Column B": ["b2"]}, index=[1]) pd.testing.assert_frame_equal(expected, next(result)) - with self.assertRaises(StopIteration): + with pytest.raises(StopIteration): next(result) diff --git a/exabel_data_sdk/tests/services/test_csv_relationship_loader.py b/exabel/tests/services/test_csv_relationship_loader.py similarity index 80% rename from exabel_data_sdk/tests/services/test_csv_relationship_loader.py rename to exabel/tests/services/test_csv_relationship_loader.py index d859aadc..e3a95c8a 100644 --- a/exabel_data_sdk/tests/services/test_csv_relationship_loader.py +++ b/exabel/tests/services/test_csv_relationship_loader.py @@ -3,31 +3,32 @@ from unittest import mock import pandas as pd - -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.api.relationship_api import RelationshipApi -from exabel_data_sdk.client.api.search_service import SearchService -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.client.exabel_client import ExabelClient -from exabel_data_sdk.services.csv_loading_constants import ( +import pytest + +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.entity_api import EntityApi +from exabel.client.api.relationship_api import RelationshipApi +from exabel.client.api.search_service import SearchService +from exabel.client.client_config import ClientConfig +from exabel.client.exabel_client import ExabelClient +from exabel.services.csv_loading_constants import ( DEFAULT_NUMBER_OF_RETRIES, DEFAULT_NUMBER_OF_THREADS, ) -from exabel_data_sdk.services.csv_loading_result import CsvLoadingResult -from exabel_data_sdk.services.csv_relationship_loader import ( +from exabel.services.csv_loading_result import CsvLoadingResult +from exabel.services.csv_relationship_loader import ( CsvRelationshipLoader, RelationshipLoaderColumnConfiguration, ) -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_loading_result import FileLoadingResult -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import SearchEntitiesResponse, SearchTerm -from exabel_data_sdk.stubs.exabel.api.data.v1.entity_messages_pb2 import Entity -from exabel_data_sdk.tests.client.exabel_mock_client import ExabelMockClient +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_loading_result import FileLoadingResult +from exabel.stubs.exabel.api.data.v1.all_pb2 import SearchEntitiesResponse, SearchTerm +from exabel.stubs.exabel.api.data.v1.entity_messages_pb2 import Entity +from exabel.tests.client.exabel_mock_client import ExabelMockClient -class TestRelationshipLoaderColumnConfiguration(unittest.TestCase): +class TestRelationshipLoaderColumnConfiguration: def test_validate_argument_combination(self): RelationshipLoaderColumnConfiguration._validate_argument_combination() RelationshipLoaderColumnConfiguration._validate_argument_combination( @@ -73,48 +74,48 @@ def test_validate_argument_combination(self): ) def test_validate_argument_combination__invalid_combinations(self): - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( from_entity_type="from_entity_type" ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( to_entity_type="to_entity_type" ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( from_entity_column="from_entity_column" ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( to_entity_column="to_entity_column" ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( from_identifier_type="from_identifier_type", ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( to_identifier_type="to_identifier_type", ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( from_entity_type="neither_company_nor_security", from_identifier_type="from_identifier_type", to_entity_type="to_entity_type", ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( from_entity_type="from_entity_type", to_entity_type="neither_company_nor_security", to_identifier_type="to_identifier_type", ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( from_entity_type="company", from_identifier_type="telephone_number", ) - with self.assertRaises(ValueError): + with pytest.raises(ValueError): RelationshipLoaderColumnConfiguration._validate_argument_combination( from_entity_type="security", from_identifier_type="figi", @@ -122,19 +123,19 @@ def test_validate_argument_combination__invalid_combinations(self): def test_from_default_values(self): config = RelationshipLoaderColumnConfiguration._from_default_values() - self.assertIsNone(config.from_column.entity_type) - self.assertEqual(0, config.from_column.index) - self.assertIsNone(config.to_column.entity_type) - self.assertEqual(1, config.to_column.index) + assert config.from_column.entity_type is None + assert 0 == config.from_column.index + assert config.to_column.entity_type is None + assert 1 == config.to_column.index def test_from_entity_types(self): config = RelationshipLoaderColumnConfiguration._from_entity_types( from_entity_type="from_entity_type", to_entity_type="to_entity_type" ) - self.assertEqual("from_entity_type", config.from_column.entity_type) - self.assertEqual(0, config.from_column.index) - self.assertEqual("to_entity_type", config.to_column.entity_type) - self.assertEqual(1, config.to_column.index) + assert "from_entity_type" == config.from_column.entity_type + assert 0 == config.from_column.index + assert "to_entity_type" == config.to_column.entity_type + assert 1 == config.to_column.index def test_from_entity_types__with_entity_columns(self): config = RelationshipLoaderColumnConfiguration._from_entity_types( @@ -143,10 +144,10 @@ def test_from_entity_types__with_entity_columns(self): from_entity_column="from_entity_column", to_entity_column="to_entity_column", ) - self.assertEqual("from_entity_type", config.from_column.entity_type) - self.assertEqual("from_entity_column", config.from_column.name) - self.assertEqual("to_entity_type", config.to_column.entity_type) - self.assertEqual("to_entity_column", config.to_column.name) + assert "from_entity_type" == config.from_column.entity_type + assert "from_entity_column" == config.from_column.name + assert "to_entity_type" == config.to_column.entity_type + assert "to_entity_column" == config.to_column.name def test_from_entity_types__with_identifiers(self): config = RelationshipLoaderColumnConfiguration._from_entity_types( @@ -155,21 +156,21 @@ def test_from_entity_types__with_identifiers(self): to_entity_type="company", to_identifier_type="isin", ) - self.assertEqual("company", config.from_column.entity_type) - self.assertEqual("isin", config.from_column.identifier_type) - self.assertEqual(0, config.from_column.index) - self.assertEqual("company", config.to_column.entity_type) - self.assertEqual("isin", config.to_column.identifier_type) - self.assertEqual(1, config.to_column.index) + assert "company" == config.from_column.entity_type + assert "isin" == config.from_column.identifier_type + assert 0 == config.from_column.index + assert "company" == config.to_column.entity_type + assert "isin" == config.to_column.identifier_type + assert 1 == config.to_column.index def test_from_specified_columns(self): config = RelationshipLoaderColumnConfiguration._from_specified_columns( from_entity_column="from_entity_column", to_entity_column="to_entity_column" ) - self.assertIsNone(config.from_column.entity_type) - self.assertEqual("from_entity_column", config.from_column.name) - self.assertIsNone(config.to_column.entity_type) - self.assertEqual("to_entity_column", config.to_column.name) + assert config.from_column.entity_type is None + assert "from_entity_column" == config.from_column.name + assert config.to_column.entity_type is None + assert "to_entity_column" == config.to_column.name def test_from_arguments(self): config = RelationshipLoaderColumnConfiguration.from_arguments( @@ -180,19 +181,19 @@ def test_from_arguments(self): to_entity_column="to_entity_column", to_identifier_type="isin", ) - self.assertEqual("company", config.from_column.entity_type) - self.assertEqual("isin", config.from_column.identifier_type) - self.assertEqual("from_entity_column", config.from_column.name) - self.assertEqual("company", config.to_column.entity_type) - self.assertEqual("isin", config.to_column.identifier_type) - self.assertEqual("to_entity_column", config.to_column.name) + assert "company" == config.from_column.entity_type + assert "isin" == config.from_column.identifier_type + assert "from_entity_column" == config.from_column.name + assert "company" == config.to_column.entity_type + assert "isin" == config.to_column.identifier_type + assert "to_entity_column" == config.to_column.name class TestCsvRelationshipLoader(unittest.TestCase): def test_load_relationships_with_properties(self): client: ExabelClient = ExabelMockClient() CsvRelationshipLoader(client).load_relationships( - filename="exabel_data_sdk/tests/resources/data/relationships_with_properties.csv", + filename="exabel/tests/resources/data/relationships_with_properties.csv", relationship_type="HAS_BRAND", from_entity_column="company", to_entity_column="brand", @@ -261,9 +262,9 @@ def test_load_relationships_with_properties(self): def test_load_relationships_with_non_existent_property(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException): + with pytest.raises(FileLoadingException): CsvRelationshipLoader(client).load_relationships( - filename="exabel_data_sdk/tests/resources/data/relationships_with_properties.csv", + filename="exabel/tests/resources/data/relationships_with_properties.csv", relationship_type="HAS_BRAND", from_entity_column="company", to_entity_column="brand", @@ -273,9 +274,9 @@ def test_load_relationships_with_non_existent_property(self): def test_load_relationships_with_non_existent_relationship_type(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException): + with pytest.raises(FileLoadingException): CsvRelationshipLoader(client).load_relationships( - filename="exabel_data_sdk/tests/resources/data/relationships.csv", + filename="exabel/tests/resources/data/relationships.csv", relationship_type="NON_EXISTENT_RELATIONSHIPTYPE", from_entity_column="entity_from", to_entity_column="brand", @@ -289,10 +290,10 @@ def test_load_relationships_with_existent_relationship_type_existent_uppercase_e client.entity_api = mock.create_autospec(EntityApi(ClientConfig(api_key="123"))) client.entity_api.get_entity_type_iterator.side_effect = self._list_entity_types result = CsvRelationshipLoader(client).load_relationships( - filename="exabel_data_sdk/tests/resources/data/relationships.csv", + filename="exabel/tests/resources/data/relationships.csv", relationship_type="HAS_BRAND", - entity_from_column="entity_from", - entity_to_column="brand", + from_entity_column="entity_from", + to_entity_column="brand", upsert=False, ) expected_relationships = [ @@ -313,15 +314,15 @@ def test_load_relationships_with_existent_relationship_type_existent_uppercase_e "relationshipTypes/test.HAS_BRAND" ) self.assertCountEqual(expected_relationships, actual_relationships) - self.assertIsInstance(result, FileLoadingResult) - self.assertIsInstance(result, CsvLoadingResult) + assert isinstance(result, FileLoadingResult) + assert isinstance(result, CsvLoadingResult) def test_load_relationships_with_existent_relationship_type_non_existent_uppercase_entity_type( self, ): client: ExabelClient = ExabelMockClient() result = CsvRelationshipLoader(client).load_relationships( - filename="exabel_data_sdk/tests/resources/data/relationships.csv", + filename="exabel/tests/resources/data/relationships.csv", relationship_type="HAS_BRAND", from_entity_column="entity_from", to_entity_column="brand", @@ -345,43 +346,43 @@ def test_load_relationships_with_existent_relationship_type_non_existent_upperca "relationshipTypes/test.HAS_BRAND" ) self.assertCountEqual(expected_relationships, actual_relationships) - self.assertIsInstance(result, FileLoadingResult) - self.assertIsInstance(result, CsvLoadingResult) + assert isinstance(result, FileLoadingResult) + assert isinstance(result, CsvLoadingResult) def test_load_relationships_only_entity_from_column_specified(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as exception_context: + with pytest.raises(FileLoadingException) as exception_context: CsvRelationshipLoader(client).load_relationships( - filename="exabel_data_sdk/tests/resources/data/relationships.csv", + filename="exabel/tests/resources/data/relationships.csv", relationship_type="NON_EXISTENT_RELATIONSHIPTYPE", from_entity_column="entity_from", upsert=False, ) - self.assertEqual( + assert ( "Invalid combination of arguments provided: Either both from_entity_column and " - "to_entity_column must be specified, or neither of them.", - str(exception_context.exception), + "to_entity_column must be specified, or neither of them." + == str(exception_context.value) ) def test_load_relationships_only_entity_to_column_specified(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as exception_context: + with pytest.raises(FileLoadingException) as exception_context: CsvRelationshipLoader(client).load_relationships( - filename="exabel_data_sdk/tests/resources/data/relationships.csv", + filename="exabel/tests/resources/data/relationships.csv", relationship_type="NON_EXISTENT_RELATIONSHIPTYPE", to_entity_column="BRAND", upsert=False, ) - self.assertEqual( + assert ( "Invalid combination of arguments provided: Either both from_entity_column and " - "to_entity_column must be specified, or neither of them.", - str(exception_context.exception), + "to_entity_column must be specified, or neither of them." + == str(exception_context.value) ) def test_load_relationships_default_entity_from_to_columns(self): client: ExabelClient = ExabelMockClient() CsvRelationshipLoader(client).load_relationships( - filename="exabel_data_sdk/tests/resources/data/relationships_with_properties.csv", + filename="exabel/tests/resources/data/relationships_with_properties.csv", relationship_type="HAS_BRAND", upsert=False, ) @@ -442,6 +443,11 @@ def _check_load_with_entity_types( client.entity_api.get_entity_type_iterator.side_effect = self._list_entity_types client.relationship_api = mock.create_autospec(RelationshipApi) client.relationship_api.get_relationship_type.return_value = True + + namespace = csv_loader_kwargs.pop("namespace", None) + if namespace: + client.namespace = namespace + if "from_identifier_type" in csv_loader_kwargs: client.entity_api.search.entities_by_terms.return_value = [ SearchEntitiesResponse.SearchResult( @@ -470,7 +476,7 @@ def _check_load_with_entity_types( abort_threshold=0.5, ) - @mock.patch("exabel_data_sdk.services.csv_relationship_loader.CsvReader") + @mock.patch("exabel.services.csv_relationship_loader.CsvReader") def test_load_relationships__with_entity_types(self, mock_reader): csv_df = pd.DataFrame([{"from": "entity", "to": "brand"}]) expected_relationships = [ @@ -491,7 +497,7 @@ def test_load_relationships__with_entity_types(self, mock_reader): to_entity_type="ns.brand", ) - @mock.patch("exabel_data_sdk.services.csv_relationship_loader.CsvReader") + @mock.patch("exabel.services.csv_relationship_loader.CsvReader") def test_load_relationships__with_entity_types__from_global_entity_type(self, mock_reader): csv_df = pd.DataFrame([{"from": "otherns.entity", "to": "brand"}]) expected_relationships = [ @@ -512,7 +518,7 @@ def test_load_relationships__with_entity_types__from_global_entity_type(self, mo to_entity_type="ns.brand", ) - @mock.patch("exabel_data_sdk.services.csv_relationship_loader.CsvReader") + @mock.patch("exabel.services.csv_relationship_loader.CsvReader") def test_load_relationships__with_entity_types__to_entity_type_in_accessible_namespace( self, mock_reader ): @@ -535,7 +541,7 @@ def test_load_relationships__with_entity_types__to_entity_type_in_accessible_nam to_entity_type="ns.brand", ) - @mock.patch("exabel_data_sdk.services.csv_relationship_loader.CsvReader") + @mock.patch("exabel.services.csv_relationship_loader.CsvReader") def test_load_relationships__with_entity_types__identifier_mappings(self, mock_reader): csv_df = pd.DataFrame([{"from": "identifier", "to": "brand"}]) expected_relationships = [ @@ -557,7 +563,7 @@ def test_load_relationships__with_entity_types__identifier_mappings(self, mock_r to_entity_type="ns.brand", ) - @mock.patch("exabel_data_sdk.services.csv_relationship_loader.CsvReader") + @mock.patch("exabel.services.csv_relationship_loader.CsvReader") def test_load_relationships__with_entity_types__security_identifier_mappings(self, mock_reader): csv_df = pd.DataFrame([{"from": "identifier", "to": "brand"}]) expected_relationships = [ @@ -579,7 +585,7 @@ def test_load_relationships__with_entity_types__security_identifier_mappings(sel to_entity_type="ns.brand", ) - @mock.patch("exabel_data_sdk.services.csv_relationship_loader.CsvReader") + @mock.patch("exabel.services.csv_relationship_loader.CsvReader") def test_load_relationships__with_entity_types__same_type(self, mock_reader): csv_df = pd.DataFrame([{"from": "a_brand", "to": "another_brand"}]) expected_relationships = [ @@ -600,7 +606,7 @@ def test_load_relationships__with_entity_types__same_type(self, mock_reader): to_entity_type="ns.brand", ) - @mock.patch("exabel_data_sdk.services.csv_relationship_loader.CsvReader") + @mock.patch("exabel.services.csv_relationship_loader.CsvReader") def test_load_relationships__with_entity_types__same_global_type(self, mock_reader): csv_df = pd.DataFrame([{"from": "a_company", "to": "another_company"}]) expected_relationships = [ @@ -621,7 +627,7 @@ def test_load_relationships__with_entity_types__same_global_type(self, mock_read to_entity_type="company", ) - @mock.patch("exabel_data_sdk.services.csv_relationship_loader.CsvReader") + @mock.patch("exabel.services.csv_relationship_loader.CsvReader") def test_load_relationships__with_entity_types__same_identifier_type(self, mock_reader): csv_df = pd.DataFrame([{"from": "identifier", "to": "identifier"}]) expected_relationships = [ @@ -644,7 +650,7 @@ def test_load_relationships__with_entity_types__same_identifier_type(self, mock_ to_identifier_type="isin", ) - @mock.patch("exabel_data_sdk.services.csv_reader.CsvReader.read_file") + @mock.patch("exabel.services.csv_reader.CsvReader.read_file") def test_load_relationships__with_batch_size(self, mock_read_file: mock.MagicMock): df = pd.DataFrame([{"column": "value"}]) mock_read_file.side_effect = [df, (df for _ in range(2))] @@ -657,6 +663,6 @@ def test_load_relationships__with_batch_size(self, mock_read_file: mock.MagicMoc relationship_type="relationship_type", batch_size=1, ) - self.assertIsNone(mock_read_file.call_args_list[0][1].get("chunksize")) - self.assertEqual(mock_read_file.call_args_list[1][1]["chunksize"], 1) - self.assertEqual(mock_load.call_count, 2) + assert mock_read_file.call_args_list[0][1].get("chunksize") is None + assert mock_read_file.call_args_list[1][1]["chunksize"] == 1 + assert mock_load.call_count == 2 diff --git a/exabel/tests/services/test_csv_time_series_loader.py b/exabel/tests/services/test_csv_time_series_loader.py new file mode 100644 index 00000000..733fb4df --- /dev/null +++ b/exabel/tests/services/test_csv_time_series_loader.py @@ -0,0 +1,34 @@ +import pytest + +from exabel import ExabelClient +from exabel.services.csv_exception import CsvLoadingException +from exabel.services.csv_time_series_loader import CsvTimeSeriesLoader +from exabel.services.file_loading_exception import FileLoadingException +from exabel.tests.client.exabel_mock_client import ExabelMockClient + + +class TestCsvTimeSeriesLoader: + def test_read_csv_should_failed_by_non_numeric_signal_values(self): + client: ExabelClient = ExabelMockClient() + with pytest.raises(FileLoadingException) as context: + CsvTimeSeriesLoader(client).load_time_series( + filename="exabel/tests/resources/data/time_series_with_non_numeric_values.csv", + ) + exception = context.value + actual = str(exception) + assert ( + "2 signal(s) contain non-numeric values. " + "Please ensure all values can be parsed to numeric values" in actual + ) + assert ( + "Signal 'production' contains 6 non-numeric values, check the first five as examples:" + in actual + ) + assert "Signal 'price' contains 3 non-numeric values" in actual + + def test_exeption_alias(self): + client: ExabelClient = ExabelMockClient() + with pytest.raises(CsvLoadingException): + CsvTimeSeriesLoader(client).load_time_series( + filename="exabel/tests/resources/data/time_series_with_non_numeric_values.csv", + ) diff --git a/exabel_data_sdk/tests/services/test_csv_writer.py b/exabel/tests/services/test_csv_writer.py similarity index 76% rename from exabel_data_sdk/tests/services/test_csv_writer.py rename to exabel/tests/services/test_csv_writer.py index 07125964..b595dd30 100644 --- a/exabel_data_sdk/tests/services/test_csv_writer.py +++ b/exabel/tests/services/test_csv_writer.py @@ -4,7 +4,7 @@ import pandas as pd -from exabel_data_sdk.services.csv_writer import CsvWriter +from exabel.services.csv_writer import CsvWriter class TestCsvWriter(unittest.TestCase): @@ -14,7 +14,7 @@ def test_csv_writer(self): CsvWriter.write_file(test_df, file.name) file.seek(0) file_content = file.read() - self.assertEqual("a,b\n1,4\n2,5\n3,6\n", file_content.decode("utf-8")) + assert "a,b\n1,4\n2,5\n3,6\n" == file_content.decode("utf-8") def test_csv_writer__with_compression(self): test_df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}) @@ -22,7 +22,7 @@ def test_csv_writer__with_compression(self): CsvWriter.write_file(test_df, file.name) file.seek(0) file_content = file.read() - self.assertEqual("a,b\n1,4\n2,5\n3,6\n", gzip.decompress(file_content).decode("utf-8")) + assert "a,b\n1,4\n2,5\n3,6\n" == gzip.decompress(file_content).decode("utf-8") def test_csv_writer__iterable(self): test_df = [pd.DataFrame({"a": [1, 2], "b": [4, 5]}), pd.DataFrame({"a": [3], "b": [6]})] @@ -30,7 +30,7 @@ def test_csv_writer__iterable(self): CsvWriter.write_file(test_df, file.name) file.seek(0) file_content = file.read() - self.assertEqual("a,b\n1,4\n2,5\n3,6\n", file_content.decode("utf-8")) + assert "a,b\n1,4\n2,5\n3,6\n" == file_content.decode("utf-8") def test_csv_writer__iterable__with_compression(self): test_df = [pd.DataFrame({"a": [1, 2], "b": [4, 5]}), pd.DataFrame({"a": [3], "b": [6]})] @@ -38,4 +38,4 @@ def test_csv_writer__iterable__with_compression(self): CsvWriter.write_file(test_df, file.name) file.seek(0) file_content = file.read() - self.assertEqual("a,b\n1,4\n2,5\n3,6\n", gzip.decompress(file_content).decode("utf-8")) + assert "a,b\n1,4\n2,5\n3,6\n" == gzip.decompress(file_content).decode("utf-8") diff --git a/exabel_data_sdk/tests/services/test_entity_mapping_file_reader.py b/exabel/tests/services/test_entity_mapping_file_reader.py similarity index 56% rename from exabel_data_sdk/tests/services/test_entity_mapping_file_reader.py rename to exabel/tests/services/test_entity_mapping_file_reader.py index 7ba824e0..31a4ecde 100644 --- a/exabel_data_sdk/tests/services/test_entity_mapping_file_reader.py +++ b/exabel/tests/services/test_entity_mapping_file_reader.py @@ -1,47 +1,40 @@ -import unittest +import pytest -from exabel_data_sdk.services.entity_mapping_file_reader import EntityMappingFileReader -from exabel_data_sdk.services.file_loading_exception import FileLoadingException +from exabel.services.entity_mapping_file_reader import EntityMappingFileReader +from exabel.services.file_loading_exception import FileLoadingException -class TestEntityMappingFileReader(unittest.TestCase): +class TestEntityMappingFileReader: def test_read_entity_mapping_file_json(self): expected_entity_mapping = { "isin": {"do_not_search_for": "entityTypes/company/entities/was_not_searched_for"} } - self.assertDictEqual( - EntityMappingFileReader.read_entity_mapping_file( - "./exabel_data_sdk/tests/resources/data/entity_mapping.json" - ), - expected_entity_mapping, + assert expected_entity_mapping == EntityMappingFileReader.read_entity_mapping_file( + "./exabel/tests/resources/data/entity_mapping.json" ) def test_read_entity_mapping_file_csv(self): expected_entity_mapping = { "isin": {"do_not_search_for": "entityTypes/company/entities/was_not_searched_for"} } - self.assertDictEqual( - EntityMappingFileReader.read_entity_mapping_file( - "./exabel_data_sdk/tests/resources/data/entity_mapping.csv" - ), - expected_entity_mapping, + assert expected_entity_mapping == EntityMappingFileReader.read_entity_mapping_file( + "./exabel/tests/resources/data/entity_mapping.csv" ) def test_should_fail_read_entity_mapping_file_invalid_csv(self): - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: EntityMappingFileReader.read_entity_mapping_file( - "./exabel_data_sdk/tests/resources/data/entity_mapping_invalid.csv" + "./exabel/tests/resources/data/entity_mapping_invalid.csv" ) - self.assertEqual( + assert ( "The entity mapping CSV file is missing one or more entity columns: " - "['extra_col_entity']", - str(context.exception), + "['extra_col_entity']" == str(context.value) ) def test_should_fail_read_entity_mapping_file_invalid_json(self): files = [ - "./exabel_data_sdk/tests/resources/data/entity_mapping_invalid_0.json", - "./exabel_data_sdk/tests/resources/data/entity_mapping_invalid_1.json", + "./exabel/tests/resources/data/entity_mapping_invalid_0.json", + "./exabel/tests/resources/data/entity_mapping_invalid_1.json", ] expected_errors = [ "Expected all values of the JSON object to be objects as well, " @@ -52,9 +45,9 @@ def test_should_fail_read_entity_mapping_file_invalid_json(self): ] for file, expected in zip(files, expected_errors): - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: EntityMappingFileReader.read_entity_mapping_file(file) - self.assertEqual(expected, str(context.exception)) + assert expected == str(context.value) def test_should_fail_read_entity_mapping_file_invalid_extension(self): files = [ @@ -63,10 +56,9 @@ def test_should_fail_read_entity_mapping_file_invalid_extension(self): "./file/does/not/exist/entity_mapping.xlsx", ] for file in files: - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: EntityMappingFileReader.read_entity_mapping_file(file) - self.assertEqual( + assert ( "Expected the entity mapping file to be a *.json or *.csv file, " - f"but got: '{file}'.", - str(context.exception), + f"but got: '{file}'." == str(context.value) ) diff --git a/exabel_data_sdk/tests/services/test_excel_writer.py b/exabel/tests/services/test_excel_writer.py similarity index 72% rename from exabel_data_sdk/tests/services/test_excel_writer.py rename to exabel/tests/services/test_excel_writer.py index bde9f0e7..20089cce 100644 --- a/exabel_data_sdk/tests/services/test_excel_writer.py +++ b/exabel/tests/services/test_excel_writer.py @@ -1,15 +1,15 @@ import tempfile -import unittest import pandas as pd +import pytest from pandas.testing import assert_frame_equal -from exabel_data_sdk.services.excel_writer import ExcelWriter -from exabel_data_sdk.tests.decorators import requires_modules +from exabel.services.excel_writer import ExcelWriter +from exabel.tests.decorators import requires_modules @requires_modules("openpyxl") -class TestExcelWriter(unittest.TestCase): +class TestExcelWriter: def test_excel_writer(self): test_df = pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]}) with tempfile.NamedTemporaryFile(suffix=".xlsx") as file: @@ -19,5 +19,5 @@ def test_excel_writer(self): def test_excel_writer__iterable_should_fail(self): with tempfile.NamedTemporaryFile(suffix=".xlsx") as file: - with self.assertRaises(NotImplementedError): + with pytest.raises(NotImplementedError): ExcelWriter.write_file([], file.name) diff --git a/exabel_data_sdk/tests/services/test_feather_reader.py b/exabel/tests/services/test_feather_reader.py similarity index 87% rename from exabel_data_sdk/tests/services/test_feather_reader.py rename to exabel/tests/services/test_feather_reader.py index 4cce9a51..4c79453c 100644 --- a/exabel_data_sdk/tests/services/test_feather_reader.py +++ b/exabel/tests/services/test_feather_reader.py @@ -1,21 +1,20 @@ import tempfile -import unittest -from typing import Iterable +from typing import Any, Iterable import pandas as pd -from exabel_data_sdk.tests.decorators import requires_modules +from exabel.tests.decorators import requires_modules @requires_modules("pyarrow") -class TestFeatherReader(unittest.TestCase): +class TestFeatherReader: def _read_feather( self, - content: str, + content: Any, string_columns: Iterable[int], ): with tempfile.TemporaryDirectory() as tmp: - from exabel_data_sdk.services.feather_reader import FeatherReader + from exabel.services.feather_reader import FeatherReader file = f"{tmp}/file.feather" pd.DataFrame(content[1:], columns=content[0]).to_feather(file) @@ -48,7 +47,7 @@ def test_read_feather_with_empty_value(self): def test_read_feather_in_batches(self): df = pd.DataFrame({"A": range(100000), "B": range(100000)}) with tempfile.TemporaryDirectory() as tmp: - from exabel_data_sdk.services.feather_reader import FeatherReader + from exabel.services.feather_reader import FeatherReader file = f"{tmp}/file_for_batch_reading.feather" df.to_feather(file) diff --git a/exabel_data_sdk/tests/services/test_file_loading_result.py b/exabel/tests/services/test_file_loading_result.py similarity index 68% rename from exabel_data_sdk/tests/services/test_file_loading_result.py rename to exabel/tests/services/test_file_loading_result.py index 4fcc9b47..1bd111af 100644 --- a/exabel_data_sdk/tests/services/test_file_loading_result.py +++ b/exabel/tests/services/test_file_loading_result.py @@ -1,8 +1,10 @@ import unittest from unittest import mock -from exabel_data_sdk.client.api.resource_creation_result import ResourceCreationResults -from exabel_data_sdk.services.file_loading_result import ( +import pytest + +from exabel.client.api.resource_creation_result import ResourceCreationResults +from exabel.services.file_loading_result import ( EntityMappingResult, FileLoadingResult, TimeSeriesFileLoadingResult, @@ -17,18 +19,18 @@ def test_update_result(self): other = FileLoadingResult(other_results) result.update(other) results.update.assert_called_once_with(other_results) - self.assertEqual(result.results, results) - self.assertSequenceEqual(result.warnings, []) - self.assertFalse(result.aborted) + assert result.results == results + assert list(result.warnings) == [] + assert not result.aborted def test_update_result__empty_self_results(self): result = FileLoadingResult() other_results = mock.create_autospec(ResourceCreationResults) other = FileLoadingResult(other_results) result.update(other) - self.assertEqual(result.results, other_results) - self.assertSequenceEqual(result.warnings, []) - self.assertFalse(result.aborted) + assert result.results == other_results + assert list(result.warnings) == [] + assert not result.aborted def test_update_result__aborted(self): results = mock.create_autospec(ResourceCreationResults) @@ -38,9 +40,9 @@ def test_update_result__aborted(self): other.aborted = True result.update(other) results.update.assert_called_once_with(other_results) - self.assertEqual(result.results, results) - self.assertSequenceEqual(result.warnings, []) - self.assertTrue(result.aborted) + assert result.results == results + assert list(result.warnings) == [] + assert result.aborted def test_update_result__warnings(self): results = mock.create_autospec(ResourceCreationResults) @@ -51,17 +53,17 @@ def test_update_result__warnings(self): other.warnings = ["other_warning"] result.update(other) results.update.assert_called_once_with(other_results) - self.assertEqual(result.results, results) - self.assertSequenceEqual(result.warnings, ["warning", "other_warning"]) - self.assertFalse(result.aborted) + assert result.results == results + assert list(result.warnings) == ["warning", "other_warning"] + assert not result.aborted def test_update_result__empty(self): result = FileLoadingResult() other = FileLoadingResult() result.update(other) - self.assertEqual(result.results, None) - self.assertSequenceEqual(result.warnings, []) - self.assertFalse(result.aborted) + assert result.results is None + assert list(result.warnings) == [] + assert not result.aborted def test_update_time_series_result__should_fail(self): entity_mapping_result = mock.create_autospec(EntityMappingResult) @@ -69,5 +71,5 @@ def test_update_time_series_result__should_fail(self): entity_mapping_result=entity_mapping_result, created_data_signals=[] ) other = mock.create_autospec(TimeSeriesFileLoadingResult) - with self.assertRaises(NotImplementedError): + with pytest.raises(NotImplementedError): result.update(other) diff --git a/exabel_data_sdk/tests/services/test_file_time_series_loader.py b/exabel/tests/services/test_file_time_series_loader.py similarity index 61% rename from exabel_data_sdk/tests/services/test_file_time_series_loader.py rename to exabel/tests/services/test_file_time_series_loader.py index 85cb862a..079606a0 100644 --- a/exabel_data_sdk/tests/services/test_file_time_series_loader.py +++ b/exabel/tests/services/test_file_time_series_loader.py @@ -1,44 +1,41 @@ -import unittest from unittest import mock import pandas as pd +import pytest from dateutil import tz -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.data_classes.signal import Signal -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.services.file_loading_result import FileLoadingResult -from exabel_data_sdk.services.file_time_series_loader import FileTimeSeriesLoader -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import SearchEntitiesResponse, SearchTerm -from exabel_data_sdk.tests.client.exabel_mock_client import ExabelMockClient -from exabel_data_sdk.tests.decorators import requires_modules -from exabel_data_sdk.util.warnings import ExabelDeprecationWarning +from exabel import ExabelClient +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.data_classes.signal import Signal +from exabel.services.file_loading_exception import FileLoadingException +from exabel.services.file_loading_result import FileLoadingResult +from exabel.services.file_time_series_loader import FileTimeSeriesLoader +from exabel.stubs.exabel.api.data.v1.all_pb2 import SearchEntitiesResponse, SearchTerm +from exabel.tests.client.exabel_mock_client import ExabelMockClient +from exabel.tests.decorators import requires_modules -class TestFileTimeSeriesLoader(unittest.TestCase): +class TestFileTimeSeriesLoader: def test_read_csv_should_failed_by_non_numeric_signal_values(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="exabel_data_sdk/tests/resources/" - "data/time_series_with_non_numeric_values.csv", + filename="exabel/tests/resources/data/time_series_with_non_numeric_values.csv", ) - exception = context.exception + exception = context.value actual = str(exception) - self.assertIn( + assert ( "2 signal(s) contain non-numeric values. " - "Please ensure all values can be parsed to numeric values", - actual, + "Please ensure all values can be parsed to numeric values" in actual ) - self.assertIn( - "Signal 'production' contains 6 non-numeric values, check the first five as examples:", - actual, + assert ( + "Signal 'production' contains 6 non-numeric values, check the first five as examples:" + in actual ) - self.assertIn("Signal 'price' contains 3 non-numeric values", actual) + assert "Signal 'price' contains 3 non-numeric values" in actual - @mock.patch("exabel_data_sdk.services.file_time_series_parser.TimeSeriesFileParser.parse_file") + @mock.patch("exabel.services.file_time_series_parser.TimeSeriesFileParser.parse_file") def test_override_entity_type(self, mock_parse_file): mock_parse_file.return_value = pd.DataFrame( [{"arbitrary_column_name": "entity", "date": "2022-01-01", "my_signal": 9001}] @@ -62,7 +59,7 @@ def test_override_entity_type(self, mock_parse_file): create_ts_args[0][0], ) - @mock.patch("exabel_data_sdk.services.file_time_series_parser.TimeSeriesFileParser.parse_file") + @mock.patch("exabel.services.file_time_series_parser.TimeSeriesFileParser.parse_file") def test_override_entity_type__with_identifier_type(self, mock_parse_file): mock_parse_file.return_value = pd.DataFrame( [{"arbitrary_column_name": "identifier", "date": "2022-01-01", "my_signal": 9001}] @@ -84,10 +81,9 @@ def test_override_entity_type__with_identifier_type(self, mock_parse_file): pit_current_time=True, ) search_kwargs = client.entity_api.search.entities_by_terms.call_args[1] - self.assertCountEqual( - [SearchTerm(field="isin", query="identifier")], - search_kwargs.get("terms"), - ) + expected_terms = [SearchTerm(field="isin", query="identifier")] + actual_terms = search_kwargs.get("terms") + assert sorted(expected_terms) == sorted(actual_terms) create_ts_args = client.time_series_api.bulk_upsert_time_series.call_args[0] pd.testing.assert_series_equal( @@ -99,7 +95,7 @@ def test_override_entity_type__with_identifier_type(self, mock_parse_file): create_ts_args[0][0], ) - @mock.patch("exabel_data_sdk.services.file_time_series_parser.TimeSeriesFileParser.parse_file") + @mock.patch("exabel.services.file_time_series_parser.TimeSeriesFileParser.parse_file") def test_override_entity_type__security_with_identifier_type(self, mock_parse_file): mock_parse_file.return_value = pd.DataFrame( [{"arbitrary_column_name": "identifier", "date": "2022-01-01", "my_signal": 9001}] @@ -121,10 +117,11 @@ def test_override_entity_type__security_with_identifier_type(self, mock_parse_fi pit_current_time=True, ) search_kwargs = client.entity_api.search.entities_by_terms.call_args[1] - self.assertCountEqual( - [SearchTerm(field="cusip", query="identifier")], - search_kwargs.get("terms"), - ) + expected_terms = [SearchTerm(field="cusip", query="identifier")] + actual_terms = search_kwargs.get("terms") + assert len(expected_terms) == len(actual_terms) + for expected in expected_terms: + assert expected in actual_terms create_ts_args = client.time_series_api.bulk_upsert_time_series.call_args[0] pd.testing.assert_series_equal( @@ -136,7 +133,7 @@ def test_override_entity_type__security_with_identifier_type(self, mock_parse_fi create_ts_args[0][0], ) - @mock.patch("exabel_data_sdk.services.file_time_series_parser.TimeSeriesFileParser.parse_file") + @mock.patch("exabel.services.file_time_series_parser.TimeSeriesFileParser.parse_file") def test_override_entity_type__with_global_entity(self, mock_parse_file): mock_parse_file.return_value = pd.DataFrame([{"date": "2022-01-01", "my_signal": 9001}]) @@ -158,7 +155,7 @@ def test_override_entity_type__with_global_entity(self, mock_parse_file): create_ts_args[0][0], ) - @mock.patch("exabel_data_sdk.services.file_time_series_parser.TimeSeriesFileParser.parse_file") + @mock.patch("exabel.services.file_time_series_parser.TimeSeriesFileParser.parse_file") def test_override_entity_type__with_global_entity__wrong_entity_type_should_fail( self, mock_parse_file ): @@ -166,19 +163,19 @@ def test_override_entity_type__with_global_entity__wrong_entity_type_should_fail client: ExabelClient = ExabelMockClient(namespace="ns") client.signal_api.create_signal(Signal("signals/ns.my_signal", "")) - with self.assertRaises(FileLoadingException) as cm: + with pytest.raises(FileLoadingException) as cm: FileTimeSeriesLoader(client).load_time_series( filename="filename", entity_type="not_global", global_time_series=True, pit_current_time=True, ) - self.assertEqual( - "Entity type must be set to 'global' when loading time series to the global entity.", - cm.exception.args[0], + assert ( + "Entity type must be set to 'global' when loading time series to the global entity." + == cm.value.args[0] ) - @mock.patch("exabel_data_sdk.services.file_time_series_parser.TimeSeriesFileParser.parse_file") + @mock.patch("exabel.services.file_time_series_parser.TimeSeriesFileParser.parse_file") def test_override_entity_type__with_security_entity__unsupported_identifier_type_should_fail( self, mock_parse_file ): @@ -188,19 +185,16 @@ def test_override_entity_type__with_security_entity__unsupported_identifier_type client: ExabelClient = ExabelMockClient(namespace="ns") client.signal_api.create_signal(Signal("signals/ns.my_signal", "")) - with self.assertRaises(FileLoadingException) as cm: + with pytest.raises(FileLoadingException) as cm: FileTimeSeriesLoader(client).load_time_series( filename="filename", entity_type="security", identifier_type="figi", pit_current_time=True, ) - self.assertEqual( - "Unsupported identifier_type (figi) for security.", - cm.exception.args[0], - ) + assert "Unsupported identifier_type (figi) for security." == cm.value.args[0] - @mock.patch("exabel_data_sdk.services.file_time_series_loader.TimeSeriesFileParser.from_file") + @mock.patch("exabel.services.file_time_series_loader.TimeSeriesFileParser.from_file") def test_batch_size(self, mock_from_file): batch_size = 1 no_batches = 2 @@ -216,23 +210,23 @@ def test_batch_size(self, mock_from_file): filename="filename", batch_size=batch_size, ) - self.assertEqual(batch_size, mock_from_file.call_args[0][2]) - self.assertEqual(no_batches, mock_load.call_count) - self.assertEqual(no_batches, len(results)) + assert batch_size == mock_from_file.call_args[0][2] + assert no_batches == mock_load.call_count + assert no_batches == len(results) def test_missing_known_time_in_file(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).batch_delete_time_series_points( - filename="exabel_data_sdk/tests/resources/" + filename="exabel/tests/resources/" "data/timeseries_delete_points_missing_known_time.csv", separator=";", ) - exception = context.exception + exception = context.value actual = str(exception) - self.assertIn("To delete data points the 'known_time' must be specified in file.", actual) + assert "To delete data points the 'known_time' must be specified in file." in actual - @mock.patch("exabel_data_sdk.services.file_time_series_parser.TimeSeriesFileParser.parse_file") + @mock.patch("exabel.services.file_time_series_parser.TimeSeriesFileParser.parse_file") def test_read_file(self, mock_parse_file): def timestamp(t: str): return pd.Timestamp(t, tz=tz.tzutc()) @@ -269,108 +263,88 @@ def timestamp(t: str): @requires_modules("openpyxl") -class TestFileTimeSeriesLoaderExcelFiles(unittest.TestCase): +class TestFileTimeSeriesLoaderExcelFiles: def test_read_excel__signal_in_column_example_2(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/signal_in_column_example_2.xlsx", + filename="./exabel/tests/resources/data/signal_in_column_example_2.xlsx", pit_current_time=True, ) - self.assertIn("1 signal(s) contain non-numeric values.", str(context.exception)) + assert "1 signal(s) contain non-numeric values." in str(context.value) def test_read_excel__numbers_in_identifiers_error(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/" - "numbers_in_identifier_error_example.xlsx", + filename="./exabel/tests/resources/data/numbers_in_identifier_error_example.xlsx", ) - self.assertIn("Entity identifiers were not strings.", str(context.exception)) + assert "Entity identifiers were not strings." in str(context.value) def test_read_excel__global_time_series_with_wrong_option_true(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/signal_in_row_example_2.xlsx", + filename="./exabel/tests/resources/data/signal_in_row_example_2.xlsx", create_missing_signals=True, global_time_series=True, ) - self.assertIn("The global time series option was set", str(context.exception)) + assert "The global time series option was set" in str(context.value) def test_read_excel__global_time_series_with_wrong_option_false(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/signal_in_row_example_4.xlsx", + filename="./exabel/tests/resources/data/signal_in_row_example_4.xlsx", create_missing_signals=True, global_time_series=False, ) - self.assertIn("The global time series option was not set", str(context.exception)) + assert "The global time series option was not set" in str(context.value) def test_read_excel__unsupported_format_1(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/unsupported_format_1.xlsx", + filename="./exabel/tests/resources/data/unsupported_format_1.xlsx", ) - self.assertIn("Column and row setup not recognized.", str(context.exception)) + assert "Column and row setup not recognized." in str(context.value) def test_read_excel__unsupported_format_2(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/unsupported_format_2.xlsx", + filename="./exabel/tests/resources/data/unsupported_format_2.xlsx", ) - self.assertIn("Column with empty header found.", str(context.exception)) + assert "Column with empty header found." in str(context.value) def test_read_excel__invalid_date_columns(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/corrupt_dates_1.xlsx", + filename="./exabel/tests/resources/data/corrupt_dates_1.xlsx", ) - self.assertIn("Failed parsing 'date' column as dates.", str(context.exception)) + assert "Failed parsing 'date' column as dates." in str(context.value) def test_read_excel__column_with_number_name(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/column_with_number_name_1.xlsx", + filename="./exabel/tests/resources/data/column_with_number_name_1.xlsx", ) - self.assertIn("invalid column(s) found: 1sales.", str(context.exception)) + assert "invalid column(s) found: 1sales." in str(context.value) def test_read_excel__empty_rows_inbetween(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/with_empty_rows_1.xlsx", + filename="./exabel/tests/resources/data/with_empty_rows_1.xlsx", ) - self.assertIn( - "The 'date' column has missing values, which is not permitted.", str(context.exception) - ) + assert "The 'date' column has missing values, which is not permitted." in str(context.value) def test_read_excel__duplicate_columns(self): client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: - FileTimeSeriesLoader(client).load_time_series( - filename="./exabel_data_sdk/tests/resources/data/multiple_columns_same_name_1.xlsx", - ) - self.assertIn("File contains duplicate columns: rocks, water.", str(context.exception)) - - @mock.patch("exabel_data_sdk.services.file_time_series_parser.TimeSeriesFileParser.parse_file") - def test_create_tag_argument_deprecated(self, mock_parse_file): - with self.assertWarns(ExabelDeprecationWarning) as cm: - mock_parse_file.return_value = pd.DataFrame( - [{"arbitrary_column_name": "entity", "date": "2022-01-01", "my_signal": 9001}] - ) - client: ExabelClient = ExabelMockClient(namespace="ns") - client.entity_api.create_entity_type(EntityType("entityTypes/ns.brand", "", "")) - client.signal_api.create_signal(Signal("signals/ns.my_signal", "")) + with pytest.raises(FileLoadingException) as context: FileTimeSeriesLoader(client).load_time_series( - filename="filename", - entity_type="ns.brand", - pit_current_time=True, - create_tag=True, + filename="./exabel/tests/resources/data/multiple_columns_same_name_1.xlsx", ) - self.assertIn("Argument 'create_tag' is deprecated", str(cm.warning)) + assert "File contains duplicate columns: rocks, water." in str(context.value) diff --git a/exabel_data_sdk/tests/services/test_file_time_series_parser.py b/exabel/tests/services/test_file_time_series_parser.py similarity index 68% rename from exabel_data_sdk/tests/services/test_file_time_series_parser.py rename to exabel/tests/services/test_file_time_series_parser.py index e0d4e0d1..f95fce5b 100644 --- a/exabel_data_sdk/tests/services/test_file_time_series_parser.py +++ b/exabel/tests/services/test_file_time_series_parser.py @@ -1,18 +1,18 @@ import math -import unittest from itertools import zip_longest from typing import Sequence from unittest import mock import pandas as pd import pandas.testing as pdt +import pytest from dateutil import tz -from exabel_data_sdk.client.api.data_classes.time_series import Dimension, TimeSeries, Unit, Units -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.api.search_service import SearchService -from exabel_data_sdk.client.exabel_client import ExabelClient -from exabel_data_sdk.services.file_time_series_parser import ( +from exabel.client.api.data_classes.time_series import Dimension, TimeSeries, Unit, Units +from exabel.client.api.entity_api import EntityApi +from exabel.client.api.search_service import SearchService +from exabel.client.exabel_client import ExabelClient +from exabel.services.file_time_series_parser import ( MetaDataSignalNamesInRows, ParsedTimeSeriesFile, SignalNamesInColumns, @@ -20,12 +20,12 @@ TimeSeriesFileParser, _remove_dot_int, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( +from exabel.stubs.exabel.api.data.v1.all_pb2 import ( Entity, SearchEntitiesResponse, SearchTerm, ) -from exabel_data_sdk.util.resource_name_normalization import ( +from exabel.util.resource_name_normalization import ( EntityResourceNames, EntitySearchResultWarning, ) @@ -33,19 +33,16 @@ BLOOMBERG_TICKER_MAPPING = {"AAPL US": "F_000C7F-E", "MSFT US": "F_000Q07-E"} -class TestTimeSeriesFileParser(unittest.TestCase): +class TestTimeSeriesFileParser: def test_from_file__excel_with_batch_size_should_fail(self): - with self.assertRaises(ValueError) as cm: + with pytest.raises(ValueError) as cm: TimeSeriesFileParser.from_file( "file.xlsx", batch_size=100, ) - self.assertEqual( - "Cannot specify batch size when uploading Excel files.", - str(cm.exception), - ) + assert "Cannot specify batch size when uploading Excel files." == str(cm.value) - @mock.patch("exabel_data_sdk.services.file_time_series_parser.CsvReader.read_file") + @mock.patch("exabel.services.file_time_series_parser.CsvReader.read_file") def test_from_file__with_batch_size(self, mock_read_file): mock_read_file.return_value = (pd.DataFrame() for _ in range(2)) parsers = TimeSeriesFileParser.from_file( @@ -60,9 +57,9 @@ def test_from_file__with_batch_size(self, mock_read_file): keep_default_na=True, chunksize=100, ) - self.assertEqual(2, len(dfs)) + assert 2 == len(dfs) for df in dfs: - self.assertTrue(df.empty) + assert df.empty def test_parse_file__with_data_frame(self): df = pd.DataFrame( @@ -76,15 +73,12 @@ def test_parse_file__with_data_frame(self): def test_parse_file__with_data_frame__with_header_should_fail(self): parser = TimeSeriesFileParser("file", None, None, pd.DataFrame()) - with self.assertRaises(ValueError) as cm: + with pytest.raises(ValueError) as cm: parser.parse_file(header=True) - self.assertEqual( - "Cannot specify header when uploading in batches.", - str(cm.exception), - ) + assert "Cannot specify header when uploading in batches." == str(cm.value) -class TestParsedTimeSeriesFile(unittest.TestCase): +class TestParsedTimeSeriesFile: def test_drop_duplicate_data_points(self): series = pd.Series( [0, 1, 1], @@ -123,82 +117,71 @@ def test_drop_duplicate_data_points__ignores_different_values_for_same_index(sel actual = ParsedTimeSeriesFile._drop_duplicate_data_points(series) pdt.assert_series_equal(expected, actual) - def test_drop_duplicate_data_points__logs_warnings(self): + def test_drop_duplicate_data_points__logs_warnings(self, caplog): series = pd.Series( [0, 1, 1], index=[0, 1, 1], name="time_series", ) - logger = "exabel_data_sdk.services.file_time_series_parser" - with self.assertLogs(logger, level="WARNING") as log: + logger = "exabel.services.file_time_series_parser" + with caplog.at_level("WARNING", logger=logger): ParsedTimeSeriesFile._drop_duplicate_data_points(series) - self.assertEqual(len(log.output), 1) + assert len(caplog.records) == 1 expected_message = ( "Dropping 1 duplicate data point(s) from time series with name: 'time_series'" ) - self.assertEqual( - expected_message, - log.output[0][-len(expected_message) :], - ) + assert expected_message in caplog.text - def test_drop_time_series_with_duplicates_in_index(self): + def test_drop_time_series_with_duplicates_in_index(self, caplog): valid_series = [pd.Series([0, 1], index=[0, 1], name="time_series")] invalid_series = [pd.Series([0, 1], index=[0, 0], name="time_series")] - logger = "exabel_data_sdk.services.file_time_series_parser" - with self.assertLogs(logger, level="ERROR") as log: + logger = "exabel.services.file_time_series_parser" + with caplog.at_level("ERROR", logger=logger): actual = list( ParsedTimeSeriesFile._get_time_series_with_duplicates_in_index( valid_series + invalid_series ) ) - self.assertIn( - "1 duplicate data point(s) detected in time series with name: 'time_series'.", - log.output[0], + assert ( + "1 duplicate data point(s) detected in time series with name: 'time_series'." + in caplog.text ) for e, a in zip_longest(invalid_series, actual): pdt.assert_series_equal(e, a) def test_validate_long_format_columns(self): - self.assertTrue( - SignalNamesInRows.is_valid( - pd.DataFrame(columns=["mic:ticker", "signal", "value", "date"]) - ) + assert SignalNamesInRows.is_valid( + pd.DataFrame(columns=["mic:ticker", "signal", "value", "date"]) ) - self.assertTrue( - SignalNamesInRows.is_valid(pd.DataFrame(columns=["1brand", "signal", "value", "date"])) + assert SignalNamesInRows.is_valid( + pd.DataFrame(columns=["1brand", "signal", "value", "date"]) ) - self.assertFalse( - SignalNamesInRows.is_valid( - pd.DataFrame(columns=["mic:ticker", "signal", "brand", "value", "date"]) - ) + assert not SignalNamesInRows.is_valid( + pd.DataFrame(columns=["mic:ticker", "signal", "brand", "value", "date"]) ) - self.assertFalse( - SignalNamesInRows.is_valid(pd.DataFrame(columns=["mic:ticker", "signal", "value"])) + assert not SignalNamesInRows.is_valid( + pd.DataFrame(columns=["mic:ticker", "signal", "value"]) ) def test_validate_medium_format_columns(self): - self.assertTrue( - SignalNamesInColumns.is_valid(pd.DataFrame(columns=["mic:ticker", "date", "signal1"])) - ) - self.assertFalse( - SignalNamesInColumns.is_valid( - pd.DataFrame(columns=["mic:ticker", "date", "signal1", "1thing"]) - ) + assert SignalNamesInColumns.is_valid( + pd.DataFrame(columns=["mic:ticker", "date", "signal1"]) ) - self.assertTrue( - SignalNamesInColumns.is_valid(pd.DataFrame(columns=["1thing", "date", "signal1"])) + assert not SignalNamesInColumns.is_valid( + pd.DataFrame(columns=["mic:ticker", "date", "signal1", "1thing"]) ) - self.assertFalse( - SignalNamesInColumns.is_valid(pd.DataFrame(columns=["date", "signal1", "1thing"])) + assert SignalNamesInColumns.is_valid(pd.DataFrame(columns=["1thing", "date", "signal1"])) + assert not SignalNamesInColumns.is_valid( + pd.DataFrame(columns=["date", "signal1", "1thing"]) ) def test_remove_dot_int(self): - self.assertEqual("asdf.fefe", _remove_dot_int("asdf.fefe")) - self.assertEqual("asdf.", _remove_dot_int("asdf.")) - self.assertEqual(".asdf", _remove_dot_int(".asdf")) - self.assertEqual("asdf", _remove_dot_int("asdf.1")) - self.assertEqual("asdf", _remove_dot_int("asdf.10000")) - self.assertEqual("asdf.1", _remove_dot_int("asdf.1.100")) + assert "asdf.fefe" == _remove_dot_int("asdf.fefe") + assert "asdf." == _remove_dot_int("asdf.") + assert ".asdf" == _remove_dot_int(".asdf") + assert "asdf" == _remove_dot_int("asdf.1") + assert "asdf" == _remove_dot_int("asdf.10000") + assert "asdf.1" == _remove_dot_int("asdf.1.100") def test_get_series(self): names = mock.create_autospec(EntityResourceNames) @@ -298,25 +281,18 @@ def test_from_data_frame_long_and_medium_format(self): pdt.assert_frame_equal(parsed_file.data, expected_data) lookup_result = parsed_file.get_entity_lookup_result() - self.assertDictEqual( - lookup_result.mapping, - { - k: f"entityTypes/company/entities/{v}" - for k, v in BLOOMBERG_TICKER_MAPPING.items() - }, - ) - self.assertListEqual( - lookup_result.warnings, - [ - EntitySearchResultWarning( - field="bloomberg_ticker", query="unmapped", matched_entity_names=[] - ) - ], - ) + assert lookup_result.mapping == { + k: f"entityTypes/company/entities/{v}" for k, v in BLOOMBERG_TICKER_MAPPING.items() + } + assert lookup_result.warnings == [ + EntitySearchResultWarning( + field="bloomberg_ticker", query="unmapped", matched_entity_names=[] + ) + ] -class TestMetaDataSignalNamesInRows(unittest.TestCase): - def test_get_deduplicated_series(self): +class TestMetaDataSignalNamesInRows: + def test_get_deduplicated_series(self, caplog): series = [ TimeSeries( pd.Series([], name="time_series_1", dtype=object), @@ -335,14 +311,14 @@ def test_get_deduplicated_series(self): units=Units(units=[Unit(Dimension.DIMENSION_CURRENCY, unit="GBP")]), ), ] - logger = "exabel_data_sdk.services.file_time_series_parser" - with self.assertLogs(logger, level="ERROR") as log: + logger = "exabel.services.file_time_series_parser" + with caplog.at_level("ERROR", logger=logger): series_deduplicated, series_with_duplicate_names = ( MetaDataSignalNamesInRows._get_deduplicated_series(series) ) - self.assertIn( - "Time series time_series_2 detected with the following different metadata", - log.output[0], + assert ( + "Time series time_series_2 detected with the following different metadata" + in caplog.text ) - self.assertListEqual([series[0]], series_deduplicated) - self.assertListEqual(series[2:], series_with_duplicate_names) + assert [series[0]] == series_deduplicated + assert series[2:] == series_with_duplicate_names diff --git a/exabel/tests/services/test_file_writer_provider.py b/exabel/tests/services/test_file_writer_provider.py new file mode 100644 index 00000000..528780ee --- /dev/null +++ b/exabel/tests/services/test_file_writer_provider.py @@ -0,0 +1,45 @@ +import pytest + +from exabel.services.csv_writer import CsvWriter +from exabel.services.excel_writer import ExcelWriter +from exabel.services.file_constants import EXCEL_EXTENSIONS, FULL_CSV_EXTENSIONS +from exabel.services.file_writer_provider import FileWriterProvider + + +class TestFileWriterProvider: + def test_full_csv_extensions(self): + assert { + ".csv.gz", + ".csv.bz2", + ".csv.zip", + ".csv.xz", + ".csv.zst", + ".csv", + } == FULL_CSV_EXTENSIONS + + def test_get_extension(self): + assert ".csv" == FileWriterProvider.get_file_extension("test.csv") + assert ".csv.gz" == FileWriterProvider.get_file_extension("test.csv.gz") + assert "" == FileWriterProvider.get_file_extension(".a") + assert ".b" == FileWriterProvider.get_file_extension(".a.b") + assert ".b.c" == FileWriterProvider.get_file_extension(".a.b.c") + assert ".b.c.d" == FileWriterProvider.get_file_extension(".a.b.c.d") + assert ".d" == FileWriterProvider.get_file_extension("a.b/c.d") + + def test_provide_csv_writer(self): + for extension in FULL_CSV_EXTENSIONS: + assert CsvWriter == FileWriterProvider.get_file_writer(f"test{extension}") + + def test_provide_excel_writer(self): + for extension in EXCEL_EXTENSIONS: + assert ExcelWriter == FileWriterProvider.get_file_writer(f"test{extension}") + + def test_provide_file_writer_should_fail(self): + with pytest.raises(ValueError): + FileWriterProvider.get_file_writer("test.a") + with pytest.raises(ValueError): + FileWriterProvider.get_file_writer(".csv") + with pytest.raises(ValueError): + FileWriterProvider.get_file_writer("test.parquet") + with pytest.raises(ValueError): + FileWriterProvider.get_file_writer("test.csv.a") diff --git a/exabel_data_sdk/tests/test_decorators.py b/exabel/tests/test_decorators.py similarity index 77% rename from exabel_data_sdk/tests/test_decorators.py rename to exabel/tests/test_decorators.py index 7f74c733..f9b7622f 100644 --- a/exabel_data_sdk/tests/test_decorators.py +++ b/exabel/tests/test_decorators.py @@ -1,19 +1,19 @@ import sys import unittest -from exabel_data_sdk.tests.decorators import requires_modules +from exabel.tests.decorators import requires_modules @requires_modules("unittest") class TestDecoratorsShouldBeRun(unittest.TestCase): def test_should_be_run(self): - self.assertTrue("unittest" in sys.modules) + assert "unittest" in sys.modules @requires_modules("unittest", "sys") class TestDecoratorsShouldBeRunAsWell(unittest.TestCase): def test_should_be_run(self): - self.assertTrue({"unittest", "sys"}.issubset(sys.modules)) + assert {"unittest", "sys"}.issubset(sys.modules) @requires_modules("invalid module name") diff --git a/exabel_data_sdk/tests/util/__init__.py b/exabel/tests/util/__init__.py similarity index 100% rename from exabel_data_sdk/tests/util/__init__.py rename to exabel/tests/util/__init__.py diff --git a/exabel_data_sdk/tests/util/test_batcher.py b/exabel/tests/util/test_batcher.py similarity index 61% rename from exabel_data_sdk/tests/util/test_batcher.py rename to exabel/tests/util/test_batcher.py index ad276e84..67b2b9c1 100644 --- a/exabel_data_sdk/tests/util/test_batcher.py +++ b/exabel/tests/util/test_batcher.py @@ -1,16 +1,14 @@ -import unittest +from exabel.util.batcher import batcher -from exabel_data_sdk.util.batcher import batcher - -class TestBatcher(unittest.TestCase): +class TestBatcher: def test_batcher(self): expected = [ (0, 1, 2), (3, 4, 5), ] result = list(batcher(range(6), 3)) - self.assertListEqual(expected, result) + assert expected == result def test_batcher_indivisible_batch(self): expected = [ @@ -18,4 +16,4 @@ def test_batcher_indivisible_batch(self): (3,), ] result = list(batcher(range(4), 3)) - self.assertListEqual(expected, result) + assert expected == result diff --git a/exabel_data_sdk/tests/util/test_deprecate_arguments.py b/exabel/tests/util/test_deprecate_arguments.py similarity index 58% rename from exabel_data_sdk/tests/util/test_deprecate_arguments.py rename to exabel/tests/util/test_deprecate_arguments.py index 523a7117..f4c83495 100644 --- a/exabel_data_sdk/tests/util/test_deprecate_arguments.py +++ b/exabel/tests/util/test_deprecate_arguments.py @@ -1,7 +1,9 @@ -import unittest +import re -from exabel_data_sdk.util.deprecate_arguments import deprecate_argument_value, deprecate_arguments -from exabel_data_sdk.util.warnings import ExabelDeprecationWarning +import pytest + +from exabel.util.deprecate_arguments import deprecate_argument_value, deprecate_arguments +from exabel.util.warnings import ExabelDeprecationWarning @deprecate_arguments(old_arg="new_arg") @@ -14,45 +16,47 @@ def _test_func_2(*, new_arg: str | None = None, old_arg: str | None = None) -> s return new_arg or old_arg -class TestDeprecateArguments(unittest.TestCase): +class TestDeprecateArguments: @deprecate_arguments(old_arg="new_arg") def _test_method(self, *, new_arg: str | None = None, old_arg: str | None = None) -> str | None: return new_arg or old_arg def test_deprecate_arguments(self): - self.assertEqual(_test_func(new_arg="test"), "test") - self.assertEqual(_test_func(old_arg="test"), "test") - self.assertIsNone(_test_func()) + assert _test_func(new_arg="test") == "test" + with pytest.warns(ExabelDeprecationWarning): + assert _test_func(old_arg="test") == "test" + assert _test_func() is None - self.assertEqual(self._test_method(new_arg="test"), "test") - self.assertEqual(self._test_method(old_arg="test"), "test") - self.assertIsNone(self._test_method()) + assert self._test_method(new_arg="test") == "test" + with pytest.warns(ExabelDeprecationWarning): + assert self._test_method(old_arg="test") == "test" + assert self._test_method() is None def test_deprecate_argument__raises_warning(self): - with self.assertWarns(ExabelDeprecationWarning) as cm: + with pytest.warns(ExabelDeprecationWarning) as record: _test_func(old_arg="test") - self.assertRegex( - str(cm.warning), + assert re.search( r"Argument 'old_arg' is deprecated in '.*_test_func' and will be removed in a future " r"release. Use 'new_arg' instead.", + str(record[0].message), ) - with self.assertWarns(ExabelDeprecationWarning) as cm: + with pytest.warns(ExabelDeprecationWarning) as record: self._test_method(old_arg="test") - self.assertRegex( - str(cm.warning), + assert re.search( r"Argument 'old_arg' is deprecated in '.*TestDeprecateArguments._test_method' and will " r"be removed in a future release. Use 'new_arg' instead.", + str(record[0].message), ) def test_deprecate_argument__both_arguments_provided_should_fail(self): - with self.assertRaises(ValueError): + with pytest.raises(ValueError): _test_func(new_arg="test", old_arg="test") - with self.assertRaises(ValueError): + with pytest.raises(ValueError): self._test_method(new_arg="test", old_arg="test") def test_deprecate_argument__no_deprecations_provided_should_fail(self): - with self.assertRaises(ValueError): + with pytest.raises(ValueError): @deprecate_arguments() def _no_deprecation() -> None: ... @@ -62,42 +66,45 @@ def test_deprecate_argument__removed_argument(self): def _test_func(*, deprecated_arg: str | None = None) -> str | None: return deprecated_arg - self.assertIsNone(_test_func(deprecated_arg="test")) + with pytest.warns(ExabelDeprecationWarning): + assert _test_func(deprecated_arg="test") is None def test_deprecate_argument__with_function_as_arg(self): def _test_func(new_arg: str | None = None, old_arg: str | None = None) -> str | None: return new_arg or old_arg wrapped_local_func = deprecate_arguments(_test_func, old_arg="new_arg") - self.assertEqual(wrapped_local_func(new_arg="test"), "test") + assert wrapped_local_func(new_arg="test") == "test" -class TestDeprecateArgumentValue(unittest.TestCase): +class TestDeprecateArgumentValue: @deprecate_argument_value(old_arg="illegal") def _test_method(self, *, new_arg: str | None = None, old_arg: str | None = None) -> str | None: return new_arg or old_arg def test_deprecate_argument_value(self): - self.assertEqual(_test_func_2(new_arg="test"), "test") - self.assertEqual(_test_func_2(old_arg="illegal"), "illegal") + assert _test_func_2(new_arg="test") == "test" + with pytest.warns(ExabelDeprecationWarning): + assert _test_func_2(old_arg="illegal") == "illegal" - self.assertEqual(self._test_method(new_arg="test"), "test") - self.assertEqual(self._test_method(old_arg="illegal"), "illegal") - self.assertIsNone(self._test_method()) + assert self._test_method(new_arg="test") == "test" + with pytest.warns(ExabelDeprecationWarning): + assert self._test_method(old_arg="illegal") == "illegal" + assert self._test_method() is None def test_deprecate_argument_value__raises_warning(self): - with self.assertWarns(ExabelDeprecationWarning) as cm: + with pytest.warns(ExabelDeprecationWarning) as record: _test_func_2(old_arg="illegal") - self.assertRegex( - str(cm.warning), + assert re.search( r"Option 'old_arg=illegal' is deprecated in '.*_test_func_2' and will be removed in a " r"future release.", + str(record[0].message), ) - with self.assertWarns(ExabelDeprecationWarning) as cm: + with pytest.warns(ExabelDeprecationWarning) as record: self._test_method(old_arg="illegal") - self.assertRegex( - str(cm.warning), + assert re.search( r"Option 'old_arg=illegal' is deprecated in '.*TestDeprecateArgumentValue._test_method'" r" and will be removed in a future release.", + str(record[0].message), ) diff --git a/exabel/tests/util/test_handle_missing_imports.py b/exabel/tests/util/test_handle_missing_imports.py new file mode 100644 index 00000000..022c6935 --- /dev/null +++ b/exabel/tests/util/test_handle_missing_imports.py @@ -0,0 +1,37 @@ +import pytest + +from exabel.util.handle_missing_imports import handle_missing_imports + +# ruff: noqa: F401 + + +class TestHandleMissingImports: + def test_handle_missing_imports(self): + with pytest.warns(UserWarning) as cm: + with handle_missing_imports({"exabel.might_not_exist": "library-name"}): + import exabel.might_not_exist + assert str(cm[0].message).startswith("Module 'exabel.might_not_exist'") + + def test_handle_missing_imports_custom_warning(self): + with pytest.warns(UserWarning) as cm: + with handle_missing_imports( + {"exabel.might_not_exist": "library-name"}, warning="custom warning" + ): + import exabel.might_not_exist + assert str(cm[0].message).startswith("custom warning") + + def test_handle_missing_imports_reraise(self): + with pytest.raises(ImportError) as cm: + with handle_missing_imports( + {"exabel.might_not_exist": "library-name"}, + warning="custom exception", + reraise=True, + ): + import exabel.might_not_exist + assert str(cm.value).startswith("custom exception") + + def test_handle_missing_imports_should_fail(self): + with pytest.raises(ImportError) as cm: + with handle_missing_imports({}): + import exabel.does_not_exist + assert "exabel.does_not_exist" == str(cm.value.name) diff --git a/exabel_data_sdk/tests/util/test_logging_thread_pool_executor.py b/exabel/tests/util/test_logging_thread_pool_executor.py similarity index 70% rename from exabel_data_sdk/tests/util/test_logging_thread_pool_executor.py rename to exabel/tests/util/test_logging_thread_pool_executor.py index 72d8cc0d..81965ccb 100644 --- a/exabel_data_sdk/tests/util/test_logging_thread_pool_executor.py +++ b/exabel/tests/util/test_logging_thread_pool_executor.py @@ -1,10 +1,9 @@ import threading -import unittest -from exabel_data_sdk.util.logging_thread_pool_executor import LoggingThreadPoolExecutor +from exabel.util.logging_thread_pool_executor import LoggingThreadPoolExecutor -class TestLoggingThreadPoolExecutor(unittest.TestCase): +class TestLoggingThreadPoolExecutor: def test_thread_count_with_multiple_tasks(self): """Test that the running thread count is correctly managed.""" executor = LoggingThreadPoolExecutor(max_workers=2) @@ -21,10 +20,10 @@ def task(): for _ in range(2): start_semaphore.acquire() - self.assertEqual(executor.running_threads, 2) + assert executor.running_threads == 2 start_barrier.wait() result = [future.result() for future in futures] - self.assertEqual(executor.running_threads, 0) - self.assertListEqual(result, ["result"] * 2) + assert executor.running_threads == 0 + assert result == ["result"] * 2 diff --git a/exabel/tests/util/test_parse_property_columns.py b/exabel/tests/util/test_parse_property_columns.py new file mode 100644 index 00000000..3f7b9055 --- /dev/null +++ b/exabel/tests/util/test_parse_property_columns.py @@ -0,0 +1,25 @@ +import pytest + +from exabel.util.exceptions import ParsePropertyColumnsError +from exabel.util.parse_property_columns import parse_property_columns + + +class TestParsePropertyColumns: + def test_parse_property_columns(self): + assert { + "boolean_prop": bool, + "string_prop": str, + "integer_prop": int, + "float_prop": float, + } == parse_property_columns( + "boolean_prop:bool", "string_prop:str", "integer_prop:int", "float_prop:float" + ) + + def test_parse_property_columns_with_no_input(self): + assert {} == parse_property_columns(*[]) + + def test_parse_property_columns_should_fail(self): + with pytest.raises(ParsePropertyColumnsError): + parse_property_columns("prop:not_a_type") + with pytest.raises(ParsePropertyColumnsError): + parse_property_columns("missing_type") diff --git a/exabel_data_sdk/tests/util/test_resource_name_normalization.py b/exabel/tests/util/test_resource_name_normalization.py similarity index 83% rename from exabel_data_sdk/tests/util/test_resource_name_normalization.py rename to exabel/tests/util/test_resource_name_normalization.py index 5f609998..9445cc93 100644 --- a/exabel_data_sdk/tests/util/test_resource_name_normalization.py +++ b/exabel/tests/util/test_resource_name_normalization.py @@ -1,14 +1,14 @@ -import unittest from unittest import mock import pandas as pd +import pytest -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import SearchEntitiesResponse, SearchTerm -from exabel_data_sdk.util.resource_name_normalization import ( +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.entity_api import EntityApi +from exabel.client.client_config import ClientConfig +from exabel.stubs.exabel.api.data.v1.all_pb2 import SearchEntitiesResponse, SearchTerm +from exabel.util.resource_name_normalization import ( _assert_no_collision, _validate_mic_ticker, get_namespace_from_resource_identifier, @@ -17,14 +17,15 @@ ) -class TestResourceNameNormalization(unittest.TestCase): +class TestResourceNameNormalization: def test_basic(self): - self.assertEqual("abc_Inc_", normalize_resource_name("abc, Inc.")) - self.assertEqual("abcXYZ0189-_", normalize_resource_name("abcXYZ0189-_")) - self.assertEqual("_l_", normalize_resource_name("-Øl?.")) + assert "abc_Inc_" == normalize_resource_name("abc, Inc.") + assert "abcXYZ0189-_" == normalize_resource_name("abcXYZ0189-_") + assert "_l_" == normalize_resource_name("-Øl?.") long_name = "".join(str(i) for i in range(50)) - self.assertEqual(long_name[:64], normalize_resource_name(long_name)) - self.assertRaises(ValueError, normalize_resource_name, "") + assert long_name[:64] == normalize_resource_name(long_name) + with pytest.raises(ValueError): + normalize_resource_name("") def test_entity_type_uppercase_existing_mapping(self): data = pd.Series(["abc, Inc.", "abcXYZ0189-_", "", "-Øl?."], name="BRAND") @@ -75,13 +76,13 @@ def test_global_entity_type_mapping(self): pd.testing.assert_series_equal(expected, result) def test_validate_mic_ticker(self): - self.assertTrue(_validate_mic_ticker("A:A")) + assert _validate_mic_ticker("A:A") - self.assertFalse(_validate_mic_ticker(":A")) - self.assertFalse(_validate_mic_ticker("A:")) - self.assertFalse(_validate_mic_ticker("A:A:A")) - self.assertFalse(_validate_mic_ticker("A::A")) - self.assertFalse(_validate_mic_ticker("A")) + assert not _validate_mic_ticker(":A") + assert not _validate_mic_ticker("A:") + assert not _validate_mic_ticker("A:A:A") + assert not _validate_mic_ticker("A::A") + assert not _validate_mic_ticker("A") def test_isin_mapping(self): data = pd.Series(["US87612E1064", "DE000A1EWWW0", "US87612E1064"], name="isin") @@ -114,18 +115,12 @@ def test_isin_mapping(self): ] result = to_entity_resource_names(entity_api, data, namespace="acme").names call_args_list = entity_api.search.entities_by_terms.call_args_list - self.assertEqual(1, len(call_args_list)) + assert 1 == len(call_args_list) - self.assertEqual( - "entityTypes/company", - call_args_list[0][1]["entity_type"], - "Arguments not as expected", - ) - self.assertSequenceEqual( - search_terms, - call_args_list[0][1]["terms"], - "Arguments not as expected", + assert "entityTypes/company" == call_args_list[0][1]["entity_type"], ( + "Arguments not as expected" ) + assert list(search_terms) == list(call_args_list[0][1]["terms"]) pd.testing.assert_series_equal(expected, result) def test_isin_mapping_with_entity_mapping(self): @@ -156,17 +151,11 @@ def test_isin_mapping_with_entity_mapping(self): entity_api, data, namespace="acme", entity_mapping=entity_mapping ).names call_args_list = entity_api.search.entities_by_terms.call_args_list - self.assertEqual(1, len(call_args_list)) - self.assertEqual( - "entityTypes/company", - call_args_list[0][1]["entity_type"], - "Arguments not as expected", - ) - self.assertSequenceEqual( - search_terms, - call_args_list[0][1]["terms"], - "Arguments not as expected", + assert 1 == len(call_args_list) + assert "entityTypes/company" == call_args_list[0][1]["entity_type"], ( + "Arguments not as expected" ) + assert list(search_terms) == list(call_args_list[0][1]["terms"]) pd.testing.assert_series_equal(expected, result) def test_entity_mapping(self): @@ -207,7 +196,7 @@ def test_entity_mapping(self): company_result = to_entity_resource_names( entity_api, company_data, namespace="acme", entity_mapping=entity_mapping ).names - self.assertFalse(entity_api.search_for_entities.called) + assert not entity_api.search_for_entities.called pd.testing.assert_series_equal(expected_companies, company_result) brand_result = to_entity_resource_names( @@ -288,21 +277,16 @@ def test_micticker_mapping(self): # Check that the expected searches were performed call_args_list = entity_api.search.entities_by_terms.call_args_list - self.assertEqual(1, len(call_args_list)) - self.assertEqual( - "entityTypes/company", - call_args_list[0][1]["entity_type"], - "Arguments not as expected", - ) - self.assertSequenceEqual( - search_terms, - call_args_list[0][1]["terms"], - "Arguments not as expected", + assert 1 == len(call_args_list) + assert "entityTypes/company" == call_args_list[0][1]["entity_type"], ( + "Arguments not as expected" ) + assert list(search_terms) == list(call_args_list[0][1]["terms"]) def test_name_collision(self): bad_mapping = {"Abc!": "Abc_", "Abcd": "Abcd", "Abc?": "Abc_"} - self.assertRaises(ValueError, _assert_no_collision, bad_mapping) + with pytest.raises(ValueError): + _assert_no_collision(bad_mapping) good_mapping = {"Abc!": "Abc_1", "Abcd": "Abcd", "Abc?": "Abc_2"} _assert_no_collision(good_mapping) @@ -395,12 +379,9 @@ def test_preserve_namespace__infer_namespace(self): pd.testing.assert_series_equal(expected, normalized) def test_get_namespace_from_entity_type_name(self): - self.assertEqual("ns", get_namespace_from_resource_identifier("ns.entity_type")) - self.assertEqual(None, get_namespace_from_resource_identifier("entity_type")) + assert "ns" == get_namespace_from_resource_identifier("ns.entity_type") + assert get_namespace_from_resource_identifier("entity_type") is None def test_get_namespace_from_entity_type_name__invalid_name_should_fail(self): - self.assertRaises( - ValueError, - get_namespace_from_resource_identifier, - "ns.ns2.entity_type", - ) + with pytest.raises(ValueError): + get_namespace_from_resource_identifier("ns.ns2.entity_type") diff --git a/exabel/tests/util/test_type_converter.py b/exabel/tests/util/test_type_converter.py new file mode 100644 index 00000000..d338bf39 --- /dev/null +++ b/exabel/tests/util/test_type_converter.py @@ -0,0 +1,43 @@ +from math import isinf, isnan + +import pytest + +from exabel.util.exceptions import TypeConversionError +from exabel.util.type_converter import type_converter + + +class TestTypeConverter: + def test_type_converter_with_string(self): + assert type_converter("string", str) == "string" + + def test_type_converter_with_int(self): + assert type_converter("1", int) == 1 + + def test_type_converter_with_float(self): + assert type_converter("1.0", float) == 1.0 + assert type_converter("1", float) == 1.0 + assert isnan(type_converter("nan", float)) + assert isinf(type_converter("inf", float)) + assert isinf(type_converter("-inf", float)) + + def test_type_converter_with_bool(self): + assert type_converter("true", bool) + assert type_converter("TRUE", bool) + assert not type_converter("false", bool) + assert not type_converter("FALSE", bool) + + def test_type_converter_with_int_should_fail(self): + with pytest.raises(TypeConversionError): + type_converter("1.0", int) + + def test_type_converter_with_float_should_fail(self): + with pytest.raises(TypeConversionError): + type_converter("not-a-float", float) + + def test_type_converter_with_bool_should_fail(self): + with pytest.raises(TypeConversionError): + type_converter("not-a-bool", bool) + + def test_type_converter_with_invalid_type_should_fail(self): + with pytest.raises(TypeConversionError): + type_converter("string", list) diff --git a/exabel_data_sdk/util/__init__.py b/exabel/util/__init__.py similarity index 100% rename from exabel_data_sdk/util/__init__.py rename to exabel/util/__init__.py diff --git a/exabel_data_sdk/util/batcher.py b/exabel/util/batcher.py similarity index 100% rename from exabel_data_sdk/util/batcher.py rename to exabel/util/batcher.py diff --git a/exabel_data_sdk/util/case_insensitive_column.py b/exabel/util/case_insensitive_column.py similarity index 100% rename from exabel_data_sdk/util/case_insensitive_column.py rename to exabel/util/case_insensitive_column.py diff --git a/exabel_data_sdk/util/deprecate_arguments.py b/exabel/util/deprecate_arguments.py similarity index 91% rename from exabel_data_sdk/util/deprecate_arguments.py rename to exabel/util/deprecate_arguments.py index 93b79b3c..cef007bd 100644 --- a/exabel_data_sdk/util/deprecate_arguments.py +++ b/exabel/util/deprecate_arguments.py @@ -2,7 +2,7 @@ import warnings from typing import Any, Callable, TypeVar, overload -from exabel_data_sdk.util.warnings import ExabelDeprecationWarning +from exabel.util.warnings import ExabelDeprecationWarning FunctionT = TypeVar("FunctionT", bound=Callable[..., Any]) @@ -27,8 +27,6 @@ def deprecate_arguments( ) -> FunctionT: ... -# Pylint flags '__func' as an invalid argument name, but we want the '__' prefix to make Mypy -# interpret it as a positional-only argument. Therefore, we disable the check for this argument. def deprecate_arguments( __func: FunctionT | None = None, **deprecation_replacements: str | None, @@ -85,8 +83,6 @@ def wrapper(*args: Any, **kwargs: Any) -> Any: return decorator # type: ignore[return-value] -# Pylint flags '__func' as an invalid argument name, but we want the '__' prefix to make Mypy -# interpret it as a positional-only argument. Therefore, we disable the check for this argument. @overload def deprecate_argument_value( **deprecated_values: object, diff --git a/exabel_data_sdk/util/exceptions.py b/exabel/util/exceptions.py similarity index 100% rename from exabel_data_sdk/util/exceptions.py rename to exabel/util/exceptions.py diff --git a/exabel_data_sdk/util/handle_missing_imports.py b/exabel/util/handle_missing_imports.py similarity index 100% rename from exabel_data_sdk/util/handle_missing_imports.py rename to exabel/util/handle_missing_imports.py diff --git a/exabel_data_sdk/util/import_.py b/exabel/util/import_.py similarity index 84% rename from exabel_data_sdk/util/import_.py rename to exabel/util/import_.py index d6f27744..2af33a97 100644 --- a/exabel_data_sdk/util/import_.py +++ b/exabel/util/import_.py @@ -2,10 +2,10 @@ import pandas as pd -from exabel_data_sdk.client.api.data_classes.entity import Entity -from exabel_data_sdk.client.api.data_classes.relationship import Relationship -from exabel_data_sdk.client.api.data_classes.time_series import TimeSeries -from exabel_data_sdk.client.api.resource_creation_result import ResourceT +from exabel.client.api.data_classes.entity import Entity +from exabel.client.api.data_classes.relationship import Relationship +from exabel.client.api.data_classes.time_series import TimeSeries +from exabel.client.api.resource_creation_result import ResourceT def get_batches_for_import(resources: Sequence[ResourceT]) -> Sequence[Sequence[ResourceT]]: diff --git a/exabel_data_sdk/util/logging_thread_pool_executor.py b/exabel/util/logging_thread_pool_executor.py similarity index 94% rename from exabel_data_sdk/util/logging_thread_pool_executor.py rename to exabel/util/logging_thread_pool_executor.py index 2309d313..ed8b5ccc 100644 --- a/exabel_data_sdk/util/logging_thread_pool_executor.py +++ b/exabel/util/logging_thread_pool_executor.py @@ -8,7 +8,7 @@ class LoggingThreadPoolExecutor(ThreadPoolExecutor): """ - A thread pool executor logs the number of active threads + A thread pool executor that logs the number of active threads. """ def __init__(self, *args: Any, **kwargs: Any) -> None: diff --git a/exabel_data_sdk/util/parse_property_columns.py b/exabel/util/parse_property_columns.py similarity index 94% rename from exabel_data_sdk/util/parse_property_columns.py rename to exabel/util/parse_property_columns.py index 8d638b0f..9825626b 100644 --- a/exabel_data_sdk/util/parse_property_columns.py +++ b/exabel/util/parse_property_columns.py @@ -1,6 +1,6 @@ from typing import Mapping, MutableMapping -from exabel_data_sdk.util.exceptions import ParsePropertyColumnsError +from exabel.util.exceptions import ParsePropertyColumnsError def parse_property_columns(*property_columns: str) -> Mapping[str, type]: diff --git a/exabel_data_sdk/util/resource_name_normalization.py b/exabel/util/resource_name_normalization.py similarity index 97% rename from exabel_data_sdk/util/resource_name_normalization.py rename to exabel/util/resource_name_normalization.py index 9812bf1b..6a6fe369 100644 --- a/exabel_data_sdk/util/resource_name_normalization.py +++ b/exabel/util/resource_name_normalization.py @@ -7,15 +7,15 @@ import pandas as pd -from exabel_data_sdk.client.api.data_classes.entity_type import EntityType -from exabel_data_sdk.client.api.entity_api import EntityApi -from exabel_data_sdk.client.api.search_service import ( +from exabel.client.api.data_classes.entity_type import EntityType +from exabel.client.api.entity_api import EntityApi +from exabel.client.api.search_service import ( COMPANY_SEARCH_TERM_FIELDS, SECURITY_SEARCH_TERM_FIELDS, ) -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import SearchTerm -from exabel_data_sdk.util.batcher import batcher -from exabel_data_sdk.util.warnings import ExabelDeprecationWarning +from exabel.stubs.exabel.api.data.v1.all_pb2 import SearchTerm +from exabel.util.batcher import batcher +from exabel.util.warnings import ExabelDeprecationWarning logger = logging.getLogger(__name__) @@ -73,7 +73,7 @@ def _assert_no_collision(mapping: Mapping[str, str]) -> None: Raises: SystemExit if there are two identifiers that map to the same resource name """ - series = pd.Series(mapping) + series = pd.Series(mapping, dtype=object) duplicates = series[series.duplicated(keep=False)] if duplicates.empty: # No duplicates, all good diff --git a/exabel_data_sdk/util/type_converter.py b/exabel/util/type_converter.py similarity index 92% rename from exabel_data_sdk/util/type_converter.py rename to exabel/util/type_converter.py index 376377ab..ed5a8bf3 100644 --- a/exabel_data_sdk/util/type_converter.py +++ b/exabel/util/type_converter.py @@ -1,4 +1,4 @@ -from exabel_data_sdk.util.exceptions import TypeConversionError +from exabel.util.exceptions import TypeConversionError def type_converter(value: str, type_: type) -> str | int | float | bool: diff --git a/exabel_data_sdk/util/warnings.py b/exabel/util/warnings.py similarity index 100% rename from exabel_data_sdk/util/warnings.py rename to exabel/util/warnings.py diff --git a/exabel_data_sdk/client/api/data_classes/entity.py b/exabel_data_sdk/client/api/data_classes/entity.py deleted file mode 100644 index 53be733d..00000000 --- a/exabel_data_sdk/client/api/data_classes/entity.py +++ /dev/null @@ -1,105 +0,0 @@ -import re -from typing import Mapping - -from exabel_data_sdk.client.api.proto_utils import from_struct, to_struct -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import Entity as ProtoEntity - - -class Entity: - r""" - An entity resource in the Data API. - - Attributes: - name (str): The resource name of the entity, for example - "entityTypes/entityTypeIdentifier/entities/entityIdentifier" or - "entityTypes/namespace1.entityTypeIdentifier/entities/ - namespace2.entityIdentifier". The namespaces must be empty (being - global) or one of the predetermined namespaces the customer has access - to. If namespace1 is not empty, it must be equal to namespace2. The - entity identifier must match the regex [a-zA-Z][\w-]{0,63}. - display_name (str): The display name of the entity. - description (str): One or more paragraphs of text description. - properties (Dict): The properties of this entity. - read_only (bool): Whether this resource is read only. - """ - - def __init__( - self, - name: str, - display_name: str, - description: str = "", - properties: Mapping[str, str | bool | int | float] | None = None, - read_only: bool = False, - ): - r""" - Create an entity resource in the Data API. - - Args: - name: The resource name of the entity, for example - "entityTypes/entityTypeIdentifier/entities/entityIdentifier" or - "entityTypes/namespace1.entityTypeIdentifier/entities/ - namespace2.entityIdentifier". The namespaces must be empty (being - global) or one of the predetermined namespaces the customer has access - to. If namespace1 is not empty, it must be equal to namespace2. The - entity identifier must match the regex [a-zA-Z][\w-]{0,63}. - display_name: The display name of the entity. - description: One or more paragraphs of text description. - properties: The properties of this entity. - read_only: Whether this resource is read only. - """ - self.name = name - self.display_name = display_name - self.description = description - self.properties = {} if properties is None else properties - self.read_only = read_only - - @staticmethod - def from_proto(entity: ProtoEntity) -> "Entity": - """Create an Entity from the given protobuf Entity.""" - return Entity( - name=entity.name, - display_name=entity.display_name, - description=entity.description, - read_only=entity.read_only, - properties=from_struct(entity.properties), - ) - - def to_proto(self) -> ProtoEntity: - """Create a protobuf Entity from this Entity.""" - return ProtoEntity( - name=self.name, - display_name=self.display_name, - description=self.description, - properties=to_struct(self.properties), - ) - - def __eq__(self, other: object) -> bool: - if not isinstance(other, Entity): - return False - return ( - self.name == other.name - and self.display_name == other.display_name - and self.description == other.description - and self.properties == other.properties - and self.read_only == other.read_only - ) - - def __repr__(self) -> str: - return ( - f"Entity(name='{self.name}', display_name='{self.display_name}', " - f"description='{self.description}', properties={self.properties}, " - f"read_only={self.read_only})" - ) - - def __lt__(self, other: object) -> bool: - if not isinstance(other, Entity): - raise ValueError(f"Cannot compare Entity to non-Entity: {other}") - return self.name < other.name - - def get_entity_type(self) -> str: - """Extracts the entity type name from the entity's resource name.""" - p = re.compile(r"(entityTypes/[a-zA-Z0-9_\-.]+)/entities/[a-zA-Z0-9_\-.]+") - m = p.match(self.name) - if m: - return m.group(1) - raise ValueError(f"Could not parse entity resource name: {self.name}") diff --git a/exabel_data_sdk/client/api/data_classes/entity_type.py b/exabel_data_sdk/client/api/data_classes/entity_type.py deleted file mode 100644 index 1efcc9fb..00000000 --- a/exabel_data_sdk/client/api/data_classes/entity_type.py +++ /dev/null @@ -1,86 +0,0 @@ -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import EntityType as ProtoEntityType - - -class EntityType: - r""" - An entity type resource in the Data API. - - Attributes: - name (str): The resource name of the entity type, for example - "entityTypes/entityTypeIdentifier" or - "entityTypes/namespace.entityTypeIdentifier". The namespace must be - empty (being global) or one of the predetermined namespaces the - customer has access to. The entity type identifier must match the - regex [a-zA-Z][\w-]{0,63}. - display_name (str): The display name of the entity type. - description (str): One or more paragraphs of text description. - read_only (bool): Whether this resource is read only. - is_associative (bool): Whether this entity type is associative. - """ - - def __init__( - self, - name: str, - display_name: str, - description: str, - read_only: bool = False, - is_associative: bool = False, - ): - r""" - Create an entity type resource in the Data API. - - Args: - name: The resource name of the entity type, for example - "entityTypes/entityTypeIdentifier" or - "entityTypes/namespace.entityTypeIdentifier". The namespace must be - empty (being global) or one of the predetermined namespaces the - customer has access to. The entity type identifier must match the - regex [a-zA-Z][\w-]{0,63}. - display_name: The display name of the entity type. - description: One or more paragraphs of text description. - read_only: Whether this resource is read only. - """ - self.name = name - self.display_name = display_name - self.description = description - self.read_only = read_only - self.is_associative = is_associative - - @staticmethod - def from_proto(entity_type: ProtoEntityType) -> "EntityType": - """Create an EntityType from a protobuf EntityType.""" - return EntityType( - name=entity_type.name, - display_name=entity_type.display_name, - description=entity_type.description, - read_only=entity_type.read_only, - is_associative=entity_type.is_associative, - ) - - def to_proto(self) -> ProtoEntityType: - """Create a protobuf EntityType from an EntityType.""" - return ProtoEntityType( - name=self.name, - display_name=self.display_name, - description=self.description, - read_only=self.read_only, - is_associative=self.is_associative, - ) - - def __eq__(self, other: object) -> bool: - if not isinstance(other, EntityType): - return False - return ( - self.name == other.name - and self.display_name == other.display_name - and self.description == other.description - and self.read_only == other.read_only - and self.is_associative == other.is_associative - ) - - def __repr__(self) -> str: - return ( - f"EntityType(name='{self.name}', display_name='{self.display_name}', " - f"description='{self.description}', read_only={self.read_only}, " - f"is_associative={self.is_associative})" - ) diff --git a/exabel_data_sdk/client/api/data_classes/relationship.py b/exabel_data_sdk/client/api/data_classes/relationship.py deleted file mode 100644 index 75c690b9..00000000 --- a/exabel_data_sdk/client/api/data_classes/relationship.py +++ /dev/null @@ -1,100 +0,0 @@ -from typing import Mapping - -from exabel_data_sdk.client.api.proto_utils import from_struct, to_struct -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import Relationship as ProtoRelationship - - -class Relationship: - """ - A relationship resource in the Data API. - - Attributes: - relationship_type (str): The resource name of the relationship type, for example - "relationshipTypes/namespace.relationshipTypeIdentifier". The - namespace must be empty (being global) or one of the - predetermined namespaces the customer has access to. The - relationship type identifier must match the regex - [A-Z][A-Z0-9_]{0,63}. - from_entity (str): The resource name of the start point of the relationship, - for example "entityTypes/ns.type1/entities/ns.entity1". - to_entity (str): The resource name of the end point of the relationship, - for example "entityTypes/ns.type2/entities/ns.entity2". - description (str): One or more paragraphs of text description. - properties (dict): The properties of this entity. - read_only (bool): Whether this resource is read only. - """ - - def __init__( - self, - relationship_type: str, - from_entity: str, - to_entity: str, - description: str = "", - properties: Mapping[str, str | bool | int | float] | None = None, - read_only: bool = False, - ): - """ - Create a relationship resource in the Data API. - - Args: - relationship_type: The resource name of the relationship type, for example - "relationshipTypes/namespace.relationshipTypeIdentifier". The - namespace must be empty (being global) or one of the predetermined - namespaces the customer has access to. The relationship type - identifier must match the regex [A-Z][A-Z0-9_]{0,63}. - from_entity: The resource name of the start point of the relationship, for example - "entityTypes/ns.type1/entities/ns.entity1". - to_entity: The resource name of the end point of the relationship, for example - "entityTypes/ns.type2/entities/ns.entity2". - description: One or more paragraphs of text description. - properties: The properties of this entity. - read_only: Whether this resource is read only. - """ - self.relationship_type = relationship_type - self.from_entity = from_entity - self.to_entity = to_entity - self.description = description - self.properties = {} if properties is None else properties - self.read_only = read_only - - @staticmethod - def from_proto(relationship: ProtoRelationship) -> "Relationship": - """Create a Relationship from the given protobuf Relationship.""" - return Relationship( - relationship_type=relationship.parent, - from_entity=relationship.from_entity, - to_entity=relationship.to_entity, - description=relationship.description, - properties=from_struct(relationship.properties), - read_only=relationship.read_only, - ) - - def to_proto(self) -> ProtoRelationship: - """Create a protobuf Relationship from this Relationship.""" - return ProtoRelationship( - parent=self.relationship_type, - from_entity=self.from_entity, - to_entity=self.to_entity, - description=self.description, - properties=to_struct(self.properties), - ) - - def __eq__(self, other: object) -> bool: - if not isinstance(other, Relationship): - return False - return ( - self.relationship_type == other.relationship_type - and self.from_entity == other.from_entity - and self.to_entity == other.to_entity - and self.description == other.description - and self.properties == other.properties - and self.read_only == other.read_only - ) - - def __repr__(self) -> str: - return ( - f"Relationship(relationship_type='{self.relationship_type}', " - f"from_entity='{self.from_entity}', to_entity='{self.to_entity}', " - f"description='{self.description}', properties={self.properties}, " - f"read_only={self.read_only})" - ) diff --git a/exabel_data_sdk/client/api/data_classes/relationship_type.py b/exabel_data_sdk/client/api/data_classes/relationship_type.py deleted file mode 100644 index c2d1f559..00000000 --- a/exabel_data_sdk/client/api/data_classes/relationship_type.py +++ /dev/null @@ -1,90 +0,0 @@ -from typing import Mapping - -from exabel_data_sdk.client.api.proto_utils import from_struct, to_struct -from exabel_data_sdk.stubs.exabel.api.data.v1.all_pb2 import ( - RelationshipType as ProtoRelationshipType, -) - - -class RelationshipType: - """ - A relationship type resource in the Data API. - - Attributes: - name (str): The resource name of the relationship type, for example - "relationshipTypes/namespace.relationshipTypeIdentifier". - The namespace must be empty (being global) or one of the - predetermined namespaces the customer has access to. The - relationship type identifier must match the regex - [A-Z][A-Z0-9_]{0,63}. - description (str): One or more paragraphs of text description. - properties (dict): The properties of this entity. - read_only (bool): Whether this resource is read only. - is_ownership (bool): Whether this relationship type is a data set ownership. - """ - - def __init__( - self, - name: str, - description: str = "", - properties: Mapping[str, str | bool | int | float] | None = None, - read_only: bool = False, - is_ownership: bool = False, - ): - """ - Create a relationship type resource in the Data API. - - Args: - name: The resource name of the relationship type, for example - "relationshipTypes/namespace.relationshipTypeIdentifier". The namespace - must be empty (being global) or one of the predetermined namespaces the - customer has access to. The relationship type identifier must match the - regex [A-Z][A-Z0-9_]{0,63}. - description: One or more paragraphs of text description. - properties: The properties of this entity. - read_only: Whether this resource is read only. - read_only: Whether this relationship type is a data set ownership. - """ - self.name = name - self.description = description - self.properties = {} if properties is None else properties - self.read_only = read_only - self.is_ownership = is_ownership - - @staticmethod - def from_proto(relationship_type: ProtoRelationshipType) -> "RelationshipType": - """Create a RelationshipType from the given protobuf RelationshipType.""" - return RelationshipType( - name=relationship_type.name, - description=relationship_type.description, - properties=from_struct(relationship_type.properties), - read_only=relationship_type.read_only, - is_ownership=relationship_type.is_ownership, - ) - - def to_proto(self) -> ProtoRelationshipType: - """Create a protobuf RelationshipType from this RelationshipType.""" - return ProtoRelationshipType( - name=self.name, - description=self.description, - properties=to_struct(self.properties), - is_ownership=self.is_ownership, - ) - - def __eq__(self, other: object) -> bool: - if not isinstance(other, RelationshipType): - return False - return ( - self.name == other.name - and self.description == other.description - and self.properties == other.properties - and self.read_only == other.read_only - and self.is_ownership == other.is_ownership - ) - - def __repr__(self) -> str: - return ( - f"RelationshipType(name='{self.name}', description='{self.description}', " - f"properties={self.properties}, read_only={self.read_only}, " - f"is_ownership={self.is_ownership})" - ) diff --git a/exabel_data_sdk/scripts/load_time_series_from_csv.py b/exabel_data_sdk/scripts/load_time_series_from_csv.py deleted file mode 100644 index d112f3fa..00000000 --- a/exabel_data_sdk/scripts/load_time_series_from_csv.py +++ /dev/null @@ -1,10 +0,0 @@ -""" -This file is here to keep backwards capability with the old name of the time series import script. -""" - -import sys - -from exabel_data_sdk.scripts.load_time_series_from_file import LoadTimeSeriesFromFile - -if __name__ == "__main__": - LoadTimeSeriesFromFile(sys.argv).run() diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2.py deleted file mode 100644 index 9c9fba34..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/common_messages.proto') -_sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-exabel/api/analytics/v1/common_messages.proto\x12\x17exabel.api.analytics.v1"+\n\tEntitySet\x12\x10\n\x08entities\x18\x01 \x03(\t\x12\x0c\n\x04tags\x18\x02 \x03(\tBT\n\x1bcom.exabel.api.analytics.v1B\x16EntitySetMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.common_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x16EntitySetMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_ENTITYSET']._serialized_start = 74 - _globals['_ENTITYSET']._serialized_end = 117 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2_grpc.py deleted file mode 100644 index 9da03ccb..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/common_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/common_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.py deleted file mode 100644 index 4127648f..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/derived_signal_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import common_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_common__messages__pb2 -from .....exabel.api.math import aggregation_pb2 as exabel_dot_api_dot_math_dot_aggregation__pb2 -from .....exabel.api.math import change_pb2 as exabel_dot_api_dot_math_dot_change__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n5exabel/api/analytics/v1/derived_signal_messages.proto\x12\x17exabel.api.analytics.v1\x1a(exabel/api/data/v1/common_messages.proto\x1a!exabel/api/math/aggregation.proto\x1a\x1cexabel/api/math/change.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\xe1\x02\n\rDerivedSignal\x12A\n\x04name\x18\x01 \x01(\tB3\x92A-J\x14"derivedSignals/123"\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x05\x12;\n\x05label\x18\x02 \x01(\tB,\x92A)J\x11"close_price_ma7"\x8a\x01\x13^[a-zA-Z_]\\w{0,99}$\x12:\n\nexpression\x18\x03 \x01(\tB&\x92A#J!"close_price().moving_average(7)"\x12<\n\x0bdescription\x18\x04 \x01(\tB\'\x92A$J""Close price 7 day moving average"\x12\x14\n\x0cdisplay_name\x18\x06 \x01(\t\x12@\n\x08metadata\x18\x05 \x01(\x0b2..exabel.api.analytics.v1.DerivedSignalMetadata"\xd6\x02\n\x15DerivedSignalMetadata\x12-\n\x08decimals\x18\x01 \x01(\x0b2\x1b.google.protobuf.Int32Value\x128\n\x04unit\x18\x02 \x01(\x0e2*.exabel.api.analytics.v1.DerivedSignalUnit\x12=\n\x04type\x18\x03 \x01(\x0e2*.exabel.api.analytics.v1.DerivedSignalTypeB\x03\xe0A\x03\x129\n\x13downsampling_method\x18\x04 \x01(\x0e2\x1c.exabel.api.math.Aggregation\x12\'\n\x06change\x18\x05 \x01(\x0e2\x17.exabel.api.math.Change\x121\n\nentity_set\x18\x06 \x01(\x0b2\x1d.exabel.api.data.v1.EntitySet*a\n\x11DerivedSignalUnit\x12\x1f\n\x1bDERIVED_SIGNAL_UNIT_INVALID\x10\x00\x12\n\n\x06NUMBER\x10\x01\x12\t\n\x05RATIO\x10\x02\x12\x14\n\x10RATIO_DIFFERENCE\x10\x03*\x9a\x01\n\x11DerivedSignalType\x12\x1f\n\x1bDERIVED_SIGNAL_TYPE_INVALID\x10\x00\x12\x12\n\x0eDERIVED_SIGNAL\x10\x01\x12\x18\n\x14FILE_UPLOADED_SIGNAL\x10\x02\x12 \n\x1cFILE_UPLOADED_COMPANY_SIGNAL\x10\x03\x12\x14\n\x10PERSISTED_SIGNAL\x10\x04BX\n\x1bcom.exabel.api.analytics.v1B\x1aDerivedSignalMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.derived_signal_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x1aDerivedSignalMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_DERIVEDSIGNAL'].fields_by_name['name']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['name']._serialized_options = b'\x92A-J\x14"derivedSignals/123"\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x05' - _globals['_DERIVEDSIGNAL'].fields_by_name['label']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['label']._serialized_options = b'\x92A)J\x11"close_price_ma7"\x8a\x01\x13^[a-zA-Z_]\\w{0,99}$' - _globals['_DERIVEDSIGNAL'].fields_by_name['expression']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['expression']._serialized_options = b'\x92A#J!"close_price().moving_average(7)"' - _globals['_DERIVEDSIGNAL'].fields_by_name['description']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['description']._serialized_options = b'\x92A$J""Close price 7 day moving average"' - _globals['_DERIVEDSIGNALMETADATA'].fields_by_name['type']._loaded_options = None - _globals['_DERIVEDSIGNALMETADATA'].fields_by_name['type']._serialized_options = b'\xe0A\x03' - _globals['_DERIVEDSIGNALUNIT']._serialized_start = 1003 - _globals['_DERIVEDSIGNALUNIT']._serialized_end = 1100 - _globals['_DERIVEDSIGNALTYPE']._serialized_start = 1103 - _globals['_DERIVEDSIGNALTYPE']._serialized_end = 1257 - _globals['_DERIVEDSIGNAL']._serialized_start = 303 - _globals['_DERIVEDSIGNAL']._serialized_end = 656 - _globals['_DERIVEDSIGNALMETADATA']._serialized_start = 659 - _globals['_DERIVEDSIGNALMETADATA']._serialized_end = 1001 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.pyi deleted file mode 100644 index b5513ce6..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2.pyi +++ /dev/null @@ -1,156 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2022-2024 Exabel AS. All rights reserved.""" -import builtins -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message -import google.protobuf.wrappers_pb2 -import sys -import typing -if sys.version_info >= (3, 10): - import typing as typing_extensions -else: - import typing_extensions -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _DerivedSignalUnit: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _DerivedSignalUnitEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DerivedSignalUnit.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - DERIVED_SIGNAL_UNIT_INVALID: _DerivedSignalUnit.ValueType - 'Signal unit was not specified.' - NUMBER: _DerivedSignalUnit.ValueType - 'Signal represents normal floating point numbers. This is the default value.' - RATIO: _DerivedSignalUnit.ValueType - 'Signal represents a ratio, typically with values in the interval [0, 1]. Values will be\n displayed as a percentage.\n ' - RATIO_DIFFERENCE: _DerivedSignalUnit.ValueType - 'Signal represents a difference in a ratio. Values will be displayed as percentage points.' - -class DerivedSignalUnit(_DerivedSignalUnit, metaclass=_DerivedSignalUnitEnumTypeWrapper): - """Unit of the signal.""" -DERIVED_SIGNAL_UNIT_INVALID: DerivedSignalUnit.ValueType -'Signal unit was not specified.' -NUMBER: DerivedSignalUnit.ValueType -'Signal represents normal floating point numbers. This is the default value.' -RATIO: DerivedSignalUnit.ValueType -'Signal represents a ratio, typically with values in the interval [0, 1]. Values will be\ndisplayed as a percentage.\n' -RATIO_DIFFERENCE: DerivedSignalUnit.ValueType -'Signal represents a difference in a ratio. Values will be displayed as percentage points.' -global___DerivedSignalUnit = DerivedSignalUnit - -class _DerivedSignalType: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _DerivedSignalTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DerivedSignalType.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - DERIVED_SIGNAL_TYPE_INVALID: _DerivedSignalType.ValueType - 'Signal type was not specified.' - DERIVED_SIGNAL: _DerivedSignalType.ValueType - 'Signal is a derived signal, with an editable label and expression. This is the default value.' - FILE_UPLOADED_SIGNAL: _DerivedSignalType.ValueType - 'Signal uploaded through the legacy File Uploader. The expression refers to a raw signal and\n cannot be modified.\n ' - FILE_UPLOADED_COMPANY_SIGNAL: _DerivedSignalType.ValueType - 'Signal uploaded through the legacy File Uploader. The expression refers to a raw signal and\n cannot be modified.\n ' - PERSISTED_SIGNAL: _DerivedSignalType.ValueType - 'A persisted signal that is evaluated and cached daily.\n The expression refers to a raw signal and cannot be modified.\n ' - -class DerivedSignalType(_DerivedSignalType, metaclass=_DerivedSignalTypeEnumTypeWrapper): - """Type of the signal. Not relevant for external use.""" -DERIVED_SIGNAL_TYPE_INVALID: DerivedSignalType.ValueType -'Signal type was not specified.' -DERIVED_SIGNAL: DerivedSignalType.ValueType -'Signal is a derived signal, with an editable label and expression. This is the default value.' -FILE_UPLOADED_SIGNAL: DerivedSignalType.ValueType -'Signal uploaded through the legacy File Uploader. The expression refers to a raw signal and\ncannot be modified.\n' -FILE_UPLOADED_COMPANY_SIGNAL: DerivedSignalType.ValueType -'Signal uploaded through the legacy File Uploader. The expression refers to a raw signal and\ncannot be modified.\n' -PERSISTED_SIGNAL: DerivedSignalType.ValueType -'A persisted signal that is evaluated and cached daily.\nThe expression refers to a raw signal and cannot be modified.\n' -global___DerivedSignalType = DerivedSignalType - -@typing.final -class DerivedSignal(google.protobuf.message.Message): - """A derived signal. - - As opposed to raw signals which represents time series on entities, a derived signal - represents a calculation through a DSL expression. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - LABEL_FIELD_NUMBER: builtins.int - EXPRESSION_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - METADATA_FIELD_NUMBER: builtins.int - name: builtins.str - 'Unique resource name of the derived signal, e.g. `derivedSignals/123`. In the "Create derived\n signal" method, this is ignored and may be left empty.\n ' - label: builtins.str - 'Label of the derived signal. This appears in the Library when browsing for derived signals,\n and when a derived signal is used in any Exabel feature (e.g. chart, dashboard). It can also\n be used to reference this derived signal in a second derived signal.\n\n This is required when creating a derived signal. Must be a valid Python identifier between\n 1-100 characters, match the regex `^[a-zA-Z_]\\w{0,99}$`, and cannot be a Python keyword.\n ' - expression: builtins.str - 'A DSL expression describing the signal transformations to apply. For more information, see the\n DSL reference.\n ' - description: builtins.str - 'Appears in the Exabel Library, when browsing for derived signals.' - display_name: builtins.str - 'The human readable name of the signal.' - - @property - def metadata(self) -> global___DerivedSignalMetadata: - """Additional metadata to control formatting (decimals and units).""" - - def __init__(self, *, name: builtins.str | None=..., label: builtins.str | None=..., expression: builtins.str | None=..., description: builtins.str | None=..., display_name: builtins.str | None=..., metadata: global___DerivedSignalMetadata | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['metadata', b'metadata']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'display_name', b'display_name', 'expression', b'expression', 'label', b'label', 'metadata', b'metadata', 'name', b'name']) -> None: - ... -global___DerivedSignal = DerivedSignal - -@typing.final -class DerivedSignalMetadata(google.protobuf.message.Message): - """Additional metadata to control formatting (decimals and units). - - Note: this is only used today when a signal is added to a dashboard table. This will be phased - out in favour of providing formatting controls in the Exabel features (charts, dashboards, etc.) - where signals are used. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - DECIMALS_FIELD_NUMBER: builtins.int - UNIT_FIELD_NUMBER: builtins.int - TYPE_FIELD_NUMBER: builtins.int - DOWNSAMPLING_METHOD_FIELD_NUMBER: builtins.int - CHANGE_FIELD_NUMBER: builtins.int - ENTITY_SET_FIELD_NUMBER: builtins.int - unit: global___DerivedSignalUnit.ValueType - 'Unit of the signal.' - type: global___DerivedSignalType.ValueType - 'Type of the signal. Not relevant for external use.' - downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType - 'The default downsampling method to use when this signal is re-sampled into larger intervals.\n When two or more values in an interval needs to be aggregated into a single value, specifies\n how they are combined.\n ' - change: exabel.api.math.change_pb2.Change.ValueType - 'The method used to calculate changes in this signal.' - - @property - def decimals(self) -> google.protobuf.wrappers_pb2.Int32Value: - """Number of decimals to use when displaying numeric values.""" - - @property - def entity_set(self) -> exabel.api.data.v1.common_messages_pb2.EntitySet: - """The set of entities that this signal is valid for.""" - - def __init__(self, *, decimals: google.protobuf.wrappers_pb2.Int32Value | None=..., unit: global___DerivedSignalUnit.ValueType | None=..., type: global___DerivedSignalType.ValueType | None=..., downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType | None=..., change: exabel.api.math.change_pb2.Change.ValueType | None=..., entity_set: exabel.api.data.v1.common_messages_pb2.EntitySet | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['decimals', b'decimals', 'entity_set', b'entity_set']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['change', b'change', 'decimals', b'decimals', 'downsampling_method', b'downsampling_method', 'entity_set', b'entity_set', 'type', b'type', 'unit', b'unit']) -> None: - ... -global___DerivedSignalMetadata = DerivedSignalMetadata \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2_grpc.py deleted file mode 100644 index 0863007c..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/derived_signal_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.py deleted file mode 100644 index 62257c05..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/derived_signal_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.analytics.v1 import derived_signal_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n4exabel/api/analytics/v1/derived_signal_service.proto\x12\x17exabel.api.analytics.v1\x1a5exabel/api/analytics/v1/derived_signal_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"F\n\x17GetDerivedSignalRequest\x12+\n\x04name\x18\x01 \x01(\tB\x1d\x92A\x17\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x02"i\n\x1aCreateDerivedSignalRequest\x12;\n\x06signal\x18\x01 \x01(\x0b2&.exabel.api.analytics.v1.DerivedSignalB\x03\xe0A\x02\x12\x0e\n\x06folder\x18\x02 \x01(\t"\x8a\x01\n\x1aUpdateDerivedSignalRequest\x12;\n\x06signal\x18\x01 \x01(\x0b2&.exabel.api.analytics.v1.DerivedSignalB\x03\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask"I\n\x1aDeleteDerivedSignalRequest\x12+\n\x04name\x18\x01 \x01(\tB\x1d\x92A\x17\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x022\xdb\x05\n\x14DerivedSignalService\x12\xa8\x01\n\x10GetDerivedSignal\x120.exabel.api.analytics.v1.GetDerivedSignalRequest\x1a&.exabel.api.analytics.v1.DerivedSignal":\x92A\x14\x12\x12Get derived signal\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/{name=derivedSignals/*}\x12\xb0\x01\n\x13CreateDerivedSignal\x123.exabel.api.analytics.v1.CreateDerivedSignalRequest\x1a&.exabel.api.analytics.v1.DerivedSignal"<\x92A\x17\x12\x15Create derived signal\x82\xd3\xe4\x93\x02\x1c"\x12/v1/derivedSignals:\x06signal\x12\xc0\x01\n\x13UpdateDerivedSignal\x123.exabel.api.analytics.v1.UpdateDerivedSignalRequest\x1a&.exabel.api.analytics.v1.DerivedSignal"L\x92A\x17\x12\x15Update derived signal\x82\xd3\xe4\x93\x02,2"/v1/{signal.name=derivedSignals/*}:\x06signal\x12\xa1\x01\n\x13DeleteDerivedSignal\x123.exabel.api.analytics.v1.DeleteDerivedSignalRequest\x1a\x16.google.protobuf.Empty"=\x92A\x17\x12\x15Delete derived signal\x82\xd3\xe4\x93\x02\x1d*\x1b/v1/{name=derivedSignals/*}BW\n\x1bcom.exabel.api.analytics.v1B\x19DerivedSignalServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.derived_signal_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x19DerivedSignalServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_GETDERIVEDSIGNALREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETDERIVEDSIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x17\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x02' - _globals['_CREATEDERIVEDSIGNALREQUEST'].fields_by_name['signal']._loaded_options = None - _globals['_CREATEDERIVEDSIGNALREQUEST'].fields_by_name['signal']._serialized_options = b'\xe0A\x02' - _globals['_UPDATEDERIVEDSIGNALREQUEST'].fields_by_name['signal']._loaded_options = None - _globals['_UPDATEDERIVEDSIGNALREQUEST'].fields_by_name['signal']._serialized_options = b'\xe0A\x02' - _globals['_DELETEDERIVEDSIGNALREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETEDERIVEDSIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x17\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x02' - _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['GetDerivedSignal']._loaded_options = None - _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['GetDerivedSignal']._serialized_options = b'\x92A\x14\x12\x12Get derived signal\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/{name=derivedSignals/*}' - _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['CreateDerivedSignal']._loaded_options = None - _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['CreateDerivedSignal']._serialized_options = b'\x92A\x17\x12\x15Create derived signal\x82\xd3\xe4\x93\x02\x1c"\x12/v1/derivedSignals:\x06signal' - _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['UpdateDerivedSignal']._loaded_options = None - _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['UpdateDerivedSignal']._serialized_options = b'\x92A\x17\x12\x15Update derived signal\x82\xd3\xe4\x93\x02,2"/v1/{signal.name=derivedSignals/*}:\x06signal' - _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['DeleteDerivedSignal']._loaded_options = None - _globals['_DERIVEDSIGNALSERVICE'].methods_by_name['DeleteDerivedSignal']._serialized_options = b'\x92A\x17\x12\x15Delete derived signal\x82\xd3\xe4\x93\x02\x1d*\x1b/v1/{name=derivedSignals/*}' - _globals['_GETDERIVEDSIGNALREQUEST']._serialized_start = 310 - _globals['_GETDERIVEDSIGNALREQUEST']._serialized_end = 380 - _globals['_CREATEDERIVEDSIGNALREQUEST']._serialized_start = 382 - _globals['_CREATEDERIVEDSIGNALREQUEST']._serialized_end = 487 - _globals['_UPDATEDERIVEDSIGNALREQUEST']._serialized_start = 490 - _globals['_UPDATEDERIVEDSIGNALREQUEST']._serialized_end = 628 - _globals['_DELETEDERIVEDSIGNALREQUEST']._serialized_start = 630 - _globals['_DELETEDERIVEDSIGNALREQUEST']._serialized_end = 703 - _globals['_DERIVEDSIGNALSERVICE']._serialized_start = 706 - _globals['_DERIVEDSIGNALSERVICE']._serialized_end = 1437 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2_grpc.py deleted file mode 100644 index d065dc15..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/derived_signal_service_pb2_grpc.py +++ /dev/null @@ -1,127 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.analytics.v1 import derived_signal_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2 -from .....exabel.api.analytics.v1 import derived_signal_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/derived_signal_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class DerivedSignalServiceStub(object): - """Service to manage derived signals. - - A derived signal is a DSL expression with a unique label. The label must be unique to the - customer. - - Derived signals are stored in Library folders and shared across users through folder sharing. - - Requests to the DerivedSignalService are executed in the context of the customer's service - account (SA). The SA is a special user that is a member of the customer user group, giving - it access to all folders that are shared with this user group, but not to private folders. - Hence, only derived signals that are in folders shared to the SA, via the customer user group, - will be accessible via the DerivedSignalService. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GetDerivedSignal = channel.unary_unary('/exabel.api.analytics.v1.DerivedSignalService/GetDerivedSignal', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.GetDerivedSignalRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, _registered_method=True) - self.CreateDerivedSignal = channel.unary_unary('/exabel.api.analytics.v1.DerivedSignalService/CreateDerivedSignal', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.CreateDerivedSignalRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, _registered_method=True) - self.UpdateDerivedSignal = channel.unary_unary('/exabel.api.analytics.v1.DerivedSignalService/UpdateDerivedSignal', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.UpdateDerivedSignalRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, _registered_method=True) - self.DeleteDerivedSignal = channel.unary_unary('/exabel.api.analytics.v1.DerivedSignalService/DeleteDerivedSignal', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.DeleteDerivedSignalRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - -class DerivedSignalServiceServicer(object): - """Service to manage derived signals. - - A derived signal is a DSL expression with a unique label. The label must be unique to the - customer. - - Derived signals are stored in Library folders and shared across users through folder sharing. - - Requests to the DerivedSignalService are executed in the context of the customer's service - account (SA). The SA is a special user that is a member of the customer user group, giving - it access to all folders that are shared with this user group, but not to private folders. - Hence, only derived signals that are in folders shared to the SA, via the customer user group, - will be accessible via the DerivedSignalService. - """ - - def GetDerivedSignal(self, request, context): - """Gets a derived signal. - - The derived signal must be in a folder that is shared to your service account (which is always - in your main customer user group). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateDerivedSignal(self, request, context): - """Creates a derived signal. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateDerivedSignal(self, request, context): - """Updates a derived signal. - - Note that this method will update all fields unless `update_mask` is set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteDerivedSignal(self, request, context): - """Deletes a derived signal. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_DerivedSignalServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'GetDerivedSignal': grpc.unary_unary_rpc_method_handler(servicer.GetDerivedSignal, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.GetDerivedSignalRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.SerializeToString), 'CreateDerivedSignal': grpc.unary_unary_rpc_method_handler(servicer.CreateDerivedSignal, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.CreateDerivedSignalRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.SerializeToString), 'UpdateDerivedSignal': grpc.unary_unary_rpc_method_handler(servicer.UpdateDerivedSignal, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.UpdateDerivedSignalRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.SerializeToString), 'DeleteDerivedSignal': grpc.unary_unary_rpc_method_handler(servicer.DeleteDerivedSignal, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.DeleteDerivedSignalRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.analytics.v1.DerivedSignalService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.analytics.v1.DerivedSignalService', rpc_method_handlers) - -class DerivedSignalService(object): - """Service to manage derived signals. - - A derived signal is a DSL expression with a unique label. The label must be unique to the - customer. - - Derived signals are stored in Library folders and shared across users through folder sharing. - - Requests to the DerivedSignalService are executed in the context of the customer's service - account (SA). The SA is a special user that is a member of the customer user group, giving - it access to all folders that are shared with this user group, but not to private folders. - Hence, only derived signals that are in folders shared to the SA, via the customer user group, - will be accessible via the DerivedSignalService. - """ - - @staticmethod - def GetDerivedSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.DerivedSignalService/GetDerivedSignal', exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.GetDerivedSignalRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateDerivedSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.DerivedSignalService/CreateDerivedSignal', exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.CreateDerivedSignalRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateDerivedSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.DerivedSignalService/UpdateDerivedSignal', exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.UpdateDerivedSignalRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2.DerivedSignal.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteDerivedSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.DerivedSignalService/DeleteDerivedSignal', exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__service__pb2.DeleteDerivedSignalRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2.py deleted file mode 100644 index db7391c6..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/item_messages.proto') -_sym_db = _symbol_database.Default() -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+exabel/api/analytics/v1/item_messages.proto\x12\x17exabel.api.analytics.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xdd\x01\n\x0cItemMetadata\x124\n\x0bcreate_time\x18\x01 \x01(\x0b2\x1a.google.protobuf.TimestampB\x03\xe0A\x03\x124\n\x0bupdate_time\x18\x02 \x01(\x0b2\x1a.google.protobuf.TimestampB\x03\xe0A\x03\x12\x17\n\ncreated_by\x18\x03 \x01(\tB\x03\xe0A\x03\x12\x17\n\nupdated_by\x18\x04 \x01(\tB\x03\xe0A\x03\x12\x1e\n\x0cwrite_access\x18\x05 \x01(\x08B\x03\xe0A\x03H\x00\x88\x01\x01B\x0f\n\r_write_accessBO\n\x1bcom.exabel.api.analytics.v1B\x11ItemMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.item_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x11ItemMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_ITEMMETADATA'].fields_by_name['create_time']._loaded_options = None - _globals['_ITEMMETADATA'].fields_by_name['create_time']._serialized_options = b'\xe0A\x03' - _globals['_ITEMMETADATA'].fields_by_name['update_time']._loaded_options = None - _globals['_ITEMMETADATA'].fields_by_name['update_time']._serialized_options = b'\xe0A\x03' - _globals['_ITEMMETADATA'].fields_by_name['created_by']._loaded_options = None - _globals['_ITEMMETADATA'].fields_by_name['created_by']._serialized_options = b'\xe0A\x03' - _globals['_ITEMMETADATA'].fields_by_name['updated_by']._loaded_options = None - _globals['_ITEMMETADATA'].fields_by_name['updated_by']._serialized_options = b'\xe0A\x03' - _globals['_ITEMMETADATA'].fields_by_name['write_access']._loaded_options = None - _globals['_ITEMMETADATA'].fields_by_name['write_access']._serialized_options = b'\xe0A\x03' - _globals['_ITEMMETADATA']._serialized_start = 139 - _globals['_ITEMMETADATA']._serialized_end = 360 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2.pyi deleted file mode 100644 index d6e90e70..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2.pyi +++ /dev/null @@ -1,47 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -""" -import builtins -import google.protobuf.descriptor -import google.protobuf.message -import google.protobuf.timestamp_pb2 -import typing -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class ItemMetadata(google.protobuf.message.Message): - """Metadata about an item.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - CREATE_TIME_FIELD_NUMBER: builtins.int - UPDATE_TIME_FIELD_NUMBER: builtins.int - CREATED_BY_FIELD_NUMBER: builtins.int - UPDATED_BY_FIELD_NUMBER: builtins.int - WRITE_ACCESS_FIELD_NUMBER: builtins.int - created_by: builtins.str - 'Resource name of the user who created the item.' - updated_by: builtins.str - 'Resource name of the user who last updated the item.' - write_access: builtins.bool - 'Whether the API caller has write access to the item.\n May not always be populated.\n ' - - @property - def create_time(self) -> google.protobuf.timestamp_pb2.Timestamp: - """When the item was created.""" - - @property - def update_time(self) -> google.protobuf.timestamp_pb2.Timestamp: - """When the item was last updated.""" - - def __init__(self, *, create_time: google.protobuf.timestamp_pb2.Timestamp | None=..., update_time: google.protobuf.timestamp_pb2.Timestamp | None=..., created_by: builtins.str | None=..., updated_by: builtins.str | None=..., write_access: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_write_access', b'_write_access', 'create_time', b'create_time', 'update_time', b'update_time', 'write_access', b'write_access']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_write_access', b'_write_access', 'create_time', b'create_time', 'created_by', b'created_by', 'update_time', b'update_time', 'updated_by', b'updated_by', 'write_access', b'write_access']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_write_access', b'_write_access']) -> typing.Literal['write_access'] | None: - ... -global___ItemMetadata = ItemMetadata \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2_grpc.py deleted file mode 100644 index 0c5ac38a..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/item_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/item_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.py deleted file mode 100644 index 7dc70432..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/kpi_mapping_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.analytics.v1 import common_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_common__messages__pb2 -from .....exabel.api.analytics.v1 import derived_signal_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_derived__signal__messages__pb2 -from .....exabel.api.analytics.v1 import kpi_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__messages__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2exabel/api/analytics/v1/kpi_mapping_messages.proto\x12\x17exabel.api.analytics.v1\x1a-exabel/api/analytics/v1/common_messages.proto\x1a5exabel/api/analytics/v1/derived_signal_messages.proto\x1a*exabel/api/analytics/v1/kpi_messages.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\xa4\x04\n\x0fKpiMappingGroup\x12I\n\x04name\x18\x01 \x01(\tB;\x92A5J\x1a"kpiMappings/123/groups/4"\xca>\x16\xfa\x02\x13kpiMappingGroupName\xe0A\x05\x12\x14\n\x0cdisplay_name\x18\x02 \x01(\t\x12)\n\x03kpi\x18\x03 \x01(\x0b2\x1c.exabel.api.analytics.v1.Kpi\x12<\n\x0cproxy_signal\x18\x04 \x01(\x0b2&.exabel.api.analytics.v1.DerivedSignal\x12?\n\x04type\x18\x05 \x01(\x0e2,.exabel.api.analytics.v1.KpiMappingGroupTypeB\x03\xe0A\x05\x126\n\nentity_set\x18\x06 \x01(\x0b2".exabel.api.analytics.v1.EntitySet\x12F\n\x15proxy_resample_method\x18\x07 \x01(\x0e2\'.exabel.api.analytics.v1.ResampleMethod\x12H\n\x13forecasting_options\x18\x08 \x01(\x0b2+.exabel.api.analytics.v1.ForecastingOptions\x12<\n\rmodel_options\x18\t \x01(\x0b2%.exabel.api.analytics.v1.ModelOptions"\xc4\x01\n\x12ForecastingOptions\x12U\n\nmodel_type\x18\x01 \x01(\tBA\x92A>\xf2\x02\x04auto\xf2\x02\x07prophet\xf2\x02\x06sarima\xf2\x02\x05theta\xf2\x02\nunobserved\xf2\x02\x0cholt_winters\x12+\n\nparameters\x18\x02 \x01(\x0b2\x17.google.protobuf.Struct\x12\x18\n\x10country_holidays\x18\x03 \x01(\t\x12\x10\n\x08holidays\x18\x04 \x01(\t"\xa0\x02\n\x0cModelOptions\x12\xca\x01\n\nmodel_type\x18\x01 \x01(\tB\xb5\x01\x92A\xb1\x01\xf2\x02\x0eard_regression\xf2\x02\x0belastic_net\xf2\x02\x0eelastic_net_cv\xf2\x02\x10huber_regression\xf2\x02\x11linear_regression\xf2\x02\x10ratio_prediction\xf2\x02\x13ratio_prediction_ml\xf2\x02\x07sarimax\xf2\x02\x0cspread_model\xf2\x02\x15unobserved_components\x12+\n\nparameters\x18\x02 \x01(\x0b2\x17.google.protobuf.Struct\x12\x16\n\x0eyear_over_year\x18\x03 \x01(\x08*]\n\x13KpiMappingGroupType\x12&\n"KPI_MAPPING_GROUP_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04BULK\x10\x01\x12\x14\n\x10COMPANY_SPECIFIC\x10\x02*\xad\x01\n\x0eResampleMethod\x12\x1f\n\x1bRESAMPLE_METHOD_UNSPECIFIED\x10\x00\x12\x0f\n\x0bNO_RESAMPLE\x10\x01\x12\x11\n\rRESAMPLE_MEAN\x10\x02\x12\x10\n\x0cRESAMPLE_SUM\x10\x03\x12\x13\n\x0fRESAMPLE_MEDIAN\x10\x04\x12\x1c\n\x18RESAMPLE_MEAN_TIMES_DAYS\x10\x05\x12\x11\n\rRESAMPLE_LAST\x10\x06BZ\n\x1bcom.exabel.api.analytics.v1B\x1cKpiMappingGroupMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.kpi_mapping_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x1cKpiMappingGroupMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_KPIMAPPINGGROUP'].fields_by_name['name']._loaded_options = None - _globals['_KPIMAPPINGGROUP'].fields_by_name['name']._serialized_options = b'\x92A5J\x1a"kpiMappings/123/groups/4"\xca>\x16\xfa\x02\x13kpiMappingGroupName\xe0A\x05' - _globals['_KPIMAPPINGGROUP'].fields_by_name['type']._loaded_options = None - _globals['_KPIMAPPINGGROUP'].fields_by_name['type']._serialized_options = b'\xe0A\x05' - _globals['_FORECASTINGOPTIONS'].fields_by_name['model_type']._loaded_options = None - _globals['_FORECASTINGOPTIONS'].fields_by_name['model_type']._serialized_options = b'\x92A>\xf2\x02\x04auto\xf2\x02\x07prophet\xf2\x02\x06sarima\xf2\x02\x05theta\xf2\x02\nunobserved\xf2\x02\x0cholt_winters' - _globals['_MODELOPTIONS'].fields_by_name['model_type']._loaded_options = None - _globals['_MODELOPTIONS'].fields_by_name['model_type']._serialized_options = b'\x92A\xb1\x01\xf2\x02\x0eard_regression\xf2\x02\x0belastic_net\xf2\x02\x0eelastic_net_cv\xf2\x02\x10huber_regression\xf2\x02\x11linear_regression\xf2\x02\x10ratio_prediction\xf2\x02\x13ratio_prediction_ml\xf2\x02\x07sarimax\xf2\x02\x0cspread_model\xf2\x02\x15unobserved_components' - _globals['_KPIMAPPINGGROUPTYPE']._serialized_start = 1377 - _globals['_KPIMAPPINGGROUPTYPE']._serialized_end = 1470 - _globals['_RESAMPLEMETHOD']._serialized_start = 1473 - _globals['_RESAMPLEMETHOD']._serialized_end = 1646 - _globals['_KPIMAPPINGGROUP']._serialized_start = 337 - _globals['_KPIMAPPINGGROUP']._serialized_end = 885 - _globals['_FORECASTINGOPTIONS']._serialized_start = 888 - _globals['_FORECASTINGOPTIONS']._serialized_end = 1084 - _globals['_MODELOPTIONS']._serialized_start = 1087 - _globals['_MODELOPTIONS']._serialized_end = 1375 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.pyi deleted file mode 100644 index 30e624e4..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2.pyi +++ /dev/null @@ -1,188 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2025 Exabel AS. All rights reserved.""" -import builtins -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message -import google.protobuf.struct_pb2 -import sys -import typing -if sys.version_info >= (3, 10): - import typing as typing_extensions -else: - import typing_extensions -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _KpiMappingGroupType: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _KpiMappingGroupTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_KpiMappingGroupType.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - KPI_MAPPING_GROUP_TYPE_UNSPECIFIED: _KpiMappingGroupType.ValueType - 'Unspecified.' - BULK: _KpiMappingGroupType.ValueType - 'Bulk mapping groups.' - COMPANY_SPECIFIC: _KpiMappingGroupType.ValueType - 'Company specific mapping groups.' - -class KpiMappingGroupType(_KpiMappingGroupType, metaclass=_KpiMappingGroupTypeEnumTypeWrapper): - """Specifies KPI mapping group types.""" -KPI_MAPPING_GROUP_TYPE_UNSPECIFIED: KpiMappingGroupType.ValueType -'Unspecified.' -BULK: KpiMappingGroupType.ValueType -'Bulk mapping groups.' -COMPANY_SPECIFIC: KpiMappingGroupType.ValueType -'Company specific mapping groups.' -global___KpiMappingGroupType = KpiMappingGroupType - -class _ResampleMethod: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _ResampleMethodEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ResampleMethod.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - RESAMPLE_METHOD_UNSPECIFIED: _ResampleMethod.ValueType - 'Unspecified.' - NO_RESAMPLE: _ResampleMethod.ValueType - 'No resampling.' - RESAMPLE_MEAN: _ResampleMethod.ValueType - 'Mean.' - RESAMPLE_SUM: _ResampleMethod.ValueType - 'Sum.' - RESAMPLE_MEDIAN: _ResampleMethod.ValueType - 'Median.' - RESAMPLE_MEAN_TIMES_DAYS: _ResampleMethod.ValueType - 'Mean times days.' - RESAMPLE_LAST: _ResampleMethod.ValueType - 'Last.' - -class ResampleMethod(_ResampleMethod, metaclass=_ResampleMethodEnumTypeWrapper): - """Specifies how to resample a signal.""" -RESAMPLE_METHOD_UNSPECIFIED: ResampleMethod.ValueType -'Unspecified.' -NO_RESAMPLE: ResampleMethod.ValueType -'No resampling.' -RESAMPLE_MEAN: ResampleMethod.ValueType -'Mean.' -RESAMPLE_SUM: ResampleMethod.ValueType -'Sum.' -RESAMPLE_MEDIAN: ResampleMethod.ValueType -'Median.' -RESAMPLE_MEAN_TIMES_DAYS: ResampleMethod.ValueType -'Mean times days.' -RESAMPLE_LAST: ResampleMethod.ValueType -'Last.' -global___ResampleMethod = ResampleMethod - -@typing.final -class KpiMappingGroup(google.protobuf.message.Message): - """A KPI mapping group.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - KPI_FIELD_NUMBER: builtins.int - PROXY_SIGNAL_FIELD_NUMBER: builtins.int - TYPE_FIELD_NUMBER: builtins.int - ENTITY_SET_FIELD_NUMBER: builtins.int - PROXY_RESAMPLE_METHOD_FIELD_NUMBER: builtins.int - FORECASTING_OPTIONS_FIELD_NUMBER: builtins.int - MODEL_OPTIONS_FIELD_NUMBER: builtins.int - name: builtins.str - 'Resource name. E.g "kpiMappings/123/groups/4".' - display_name: builtins.str - 'Display name.' - type: global___KpiMappingGroupType.ValueType - 'Type of KPI mapping group.' - proxy_resample_method: global___ResampleMethod.ValueType - 'Specifies how to resample the proxy signal.' - - @property - def kpi(self) -> exabel.api.analytics.v1.kpi_messages_pb2.Kpi: - """The KPI for the group.""" - - @property - def proxy_signal(self) -> exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal: - """Proxy signal.""" - - @property - def entity_set(self) -> exabel.api.analytics.v1.common_messages_pb2.EntitySet: - """The entities for which this group defines KPI mappings. - All the entities must be companies. - """ - - @property - def forecasting_options(self) -> global___ForecastingOptions: - """Specifies how proxy signal forecasting should be performed.""" - - @property - def model_options(self) -> global___ModelOptions: - """Configuration for the single-predictor models that are built for this group.""" - - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., kpi: exabel.api.analytics.v1.kpi_messages_pb2.Kpi | None=..., proxy_signal: exabel.api.analytics.v1.derived_signal_messages_pb2.DerivedSignal | None=..., type: global___KpiMappingGroupType.ValueType | None=..., entity_set: exabel.api.analytics.v1.common_messages_pb2.EntitySet | None=..., proxy_resample_method: global___ResampleMethod.ValueType | None=..., forecasting_options: global___ForecastingOptions | None=..., model_options: global___ModelOptions | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['entity_set', b'entity_set', 'forecasting_options', b'forecasting_options', 'kpi', b'kpi', 'model_options', b'model_options', 'proxy_signal', b'proxy_signal']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['display_name', b'display_name', 'entity_set', b'entity_set', 'forecasting_options', b'forecasting_options', 'kpi', b'kpi', 'model_options', b'model_options', 'name', b'name', 'proxy_resample_method', b'proxy_resample_method', 'proxy_signal', b'proxy_signal', 'type', b'type']) -> None: - ... -global___KpiMappingGroup = KpiMappingGroup - -@typing.final -class ForecastingOptions(google.protobuf.message.Message): - """Forecasting options for Prophet and other forecasting models.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - MODEL_TYPE_FIELD_NUMBER: builtins.int - PARAMETERS_FIELD_NUMBER: builtins.int - COUNTRY_HOLIDAYS_FIELD_NUMBER: builtins.int - HOLIDAYS_FIELD_NUMBER: builtins.int - model_type: builtins.str - 'Forecasting model type.\n\n Supported values: `auto`, `prophet`, `sarima`, `theta`, `unobserved`, `holt_winters`.\n\n Default: `auto`.\n\n For information about forecasting, see https://doc.exabel.com/dsl/modelling/forecasting.html\n ' - country_holidays: builtins.str - "Country code for standard country holidays (e.g., 'US', 'UK').\n Only used when model_type='prophet'.\n " - holidays: builtins.str - 'Resource name of the holiday specification to use for Prophet forecasting.\n Only used when model_type=\'prophet\'.\n Example: "holidaySpecifications/123"\n ' - - @property - def parameters(self) -> google.protobuf.struct_pb2.Struct: - """Model-specific parameters passed to the forecasting function.""" - - def __init__(self, *, model_type: builtins.str | None=..., parameters: google.protobuf.struct_pb2.Struct | None=..., country_holidays: builtins.str | None=..., holidays: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['parameters', b'parameters']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['country_holidays', b'country_holidays', 'holidays', b'holidays', 'model_type', b'model_type', 'parameters', b'parameters']) -> None: - ... -global___ForecastingOptions = ForecastingOptions - -@typing.final -class ModelOptions(google.protobuf.message.Message): - """Options for the KPI prediction models.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - MODEL_TYPE_FIELD_NUMBER: builtins.int - PARAMETERS_FIELD_NUMBER: builtins.int - YEAR_OVER_YEAR_FIELD_NUMBER: builtins.int - model_type: builtins.str - 'The type of the model.\n\n Supported values: `ard_regression`, `elastic_net`, `elastic_net_cv`, `huber_regression`,\n `linear_regression`, `ratio_prediction`, `ratio_prediction_ml`, `sarimax`, `spread_model`,\n and `unobserved_components`.\n\n Default: `sarimax` is used for ratio KPIs and `ratio_prediction` for other KPIs.\n\n For information about model types, see https://doc.exabel.com/dsl/modelling/models.html\n ' - year_over_year: builtins.bool - 'Whether to apply year-over-year transformation.\n When enabled, both predictors and targets are transformed to year-over-year changes during training,\n and predictions are transformed back to absolute values during inference.\n ' - - @property - def parameters(self) -> google.protobuf.struct_pb2.Struct: - """Model-specific parameters. Only takes effect if `model_type` is set.""" - - def __init__(self, *, model_type: builtins.str | None=..., parameters: google.protobuf.struct_pb2.Struct | None=..., year_over_year: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['parameters', b'parameters']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['model_type', b'model_type', 'parameters', b'parameters', 'year_over_year', b'year_over_year']) -> None: - ... -global___ModelOptions = ModelOptions \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2_grpc.py deleted file mode 100644 index 28ff0b12..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/kpi_mapping_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.py deleted file mode 100644 index 616d61d2..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/kpi_mapping_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.analytics.v1 import kpi_mapping_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n1exabel/api/analytics/v1/kpi_mapping_service.proto\x12\x17exabel.api.analytics.v1\x1a2exabel/api/analytics/v1/kpi_mapping_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x94\x01\n\x1cCreateKpiMappingGroupRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0ekpiMappingName\xe0A\x02\x12H\n\x11kpi_mapping_group\x18\x02 \x01(\x0b2(.exabel.api.analytics.v1.KpiMappingGroupB\x03\xe0A\x02"J\n\x19GetKpiMappingGroupRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\x92A\x19\xca>\x16\xfa\x02\x13kpiMappingGroupName\xe0A\x02"\xcd\x01\n\x1bListKpiMappingGroupsRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0ekpiMappingName\xe0A\x02\x12:\n\x04type\x18\x02 \x01(\x0e2,.exabel.api.analytics.v1.KpiMappingGroupType\x12\x11\n\tcompanies\x18\x03 \x03(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x0c\n\x04skip\x18\x06 \x01(\x05"\x85\x01\n\x1cListKpiMappingGroupsResponse\x128\n\x06groups\x18\x01 \x03(\x0b2(.exabel.api.analytics.v1.KpiMappingGroup\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"\x99\x01\n\x1cUpdateKpiMappingGroupRequest\x12H\n\x11kpi_mapping_group\x18\x01 \x01(\x0b2(.exabel.api.analytics.v1.KpiMappingGroupB\x03\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask2\xd8\x06\n\x11KpiMappingService\x12\xd3\x01\n\x15CreateKpiMappingGroup\x125.exabel.api.analytics.v1.CreateKpiMappingGroupRequest\x1a(.exabel.api.analytics.v1.KpiMappingGroup"Y\x92A\x1a\x12\x18Create KPI mapping group\x82\xd3\xe4\x93\x026"!/v1/{parent=kpiMappings/*}/groups:\x11kpi_mapping_group\x12\xb7\x01\n\x12GetKpiMappingGroup\x122.exabel.api.analytics.v1.GetKpiMappingGroupRequest\x1a(.exabel.api.analytics.v1.KpiMappingGroup"C\x92A\x17\x12\x15Get KPI mapping group\x82\xd3\xe4\x93\x02#\x12!/v1/{name=kpiMappings/*/groups/*}\x12\xca\x01\n\x14ListKpiMappingGroups\x124.exabel.api.analytics.v1.ListKpiMappingGroupsRequest\x1a5.exabel.api.analytics.v1.ListKpiMappingGroupsResponse"E\x92A\x19\x12\x17List KPI mapping groups\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=kpiMappings/*}/groups\x12\xe5\x01\n\x15UpdateKpiMappingGroup\x125.exabel.api.analytics.v1.UpdateKpiMappingGroupRequest\x1a(.exabel.api.analytics.v1.KpiMappingGroup"k\x92A\x1a\x12\x18Update KPI mapping group\x82\xd3\xe4\x93\x02H23/v1/{kpi_mapping_group.name=kpiMappings/*/groups/*}:\x11kpi_mapping_groupBY\n\x1bcom.exabel.api.analytics.v1B\x1bKpiMappingGroupServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.kpi_mapping_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x1bKpiMappingGroupServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_CREATEKPIMAPPINGGROUPREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_CREATEKPIMAPPINGGROUPREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0ekpiMappingName\xe0A\x02' - _globals['_CREATEKPIMAPPINGGROUPREQUEST'].fields_by_name['kpi_mapping_group']._loaded_options = None - _globals['_CREATEKPIMAPPINGGROUPREQUEST'].fields_by_name['kpi_mapping_group']._serialized_options = b'\xe0A\x02' - _globals['_GETKPIMAPPINGGROUPREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETKPIMAPPINGGROUPREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x19\xca>\x16\xfa\x02\x13kpiMappingGroupName\xe0A\x02' - _globals['_LISTKPIMAPPINGGROUPSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTKPIMAPPINGGROUPSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0ekpiMappingName\xe0A\x02' - _globals['_UPDATEKPIMAPPINGGROUPREQUEST'].fields_by_name['kpi_mapping_group']._loaded_options = None - _globals['_UPDATEKPIMAPPINGGROUPREQUEST'].fields_by_name['kpi_mapping_group']._serialized_options = b'\xe0A\x02' - _globals['_KPIMAPPINGSERVICE'].methods_by_name['CreateKpiMappingGroup']._loaded_options = None - _globals['_KPIMAPPINGSERVICE'].methods_by_name['CreateKpiMappingGroup']._serialized_options = b'\x92A\x1a\x12\x18Create KPI mapping group\x82\xd3\xe4\x93\x026"!/v1/{parent=kpiMappings/*}/groups:\x11kpi_mapping_group' - _globals['_KPIMAPPINGSERVICE'].methods_by_name['GetKpiMappingGroup']._loaded_options = None - _globals['_KPIMAPPINGSERVICE'].methods_by_name['GetKpiMappingGroup']._serialized_options = b'\x92A\x17\x12\x15Get KPI mapping group\x82\xd3\xe4\x93\x02#\x12!/v1/{name=kpiMappings/*/groups/*}' - _globals['_KPIMAPPINGSERVICE'].methods_by_name['ListKpiMappingGroups']._loaded_options = None - _globals['_KPIMAPPINGSERVICE'].methods_by_name['ListKpiMappingGroups']._serialized_options = b'\x92A\x19\x12\x17List KPI mapping groups\x82\xd3\xe4\x93\x02#\x12!/v1/{parent=kpiMappings/*}/groups' - _globals['_KPIMAPPINGSERVICE'].methods_by_name['UpdateKpiMappingGroup']._loaded_options = None - _globals['_KPIMAPPINGSERVICE'].methods_by_name['UpdateKpiMappingGroup']._serialized_options = b'\x92A\x1a\x12\x18Update KPI mapping group\x82\xd3\xe4\x93\x02H23/v1/{kpi_mapping_group.name=kpiMappings/*/groups/*}:\x11kpi_mapping_group' - _globals['_CREATEKPIMAPPINGGROUPREQUEST']._serialized_start = 276 - _globals['_CREATEKPIMAPPINGGROUPREQUEST']._serialized_end = 424 - _globals['_GETKPIMAPPINGGROUPREQUEST']._serialized_start = 426 - _globals['_GETKPIMAPPINGGROUPREQUEST']._serialized_end = 500 - _globals['_LISTKPIMAPPINGGROUPSREQUEST']._serialized_start = 503 - _globals['_LISTKPIMAPPINGGROUPSREQUEST']._serialized_end = 708 - _globals['_LISTKPIMAPPINGGROUPSRESPONSE']._serialized_start = 711 - _globals['_LISTKPIMAPPINGGROUPSRESPONSE']._serialized_end = 844 - _globals['_UPDATEKPIMAPPINGGROUPREQUEST']._serialized_start = 847 - _globals['_UPDATEKPIMAPPINGGROUPREQUEST']._serialized_end = 1000 - _globals['_KPIMAPPINGSERVICE']._serialized_start = 1003 - _globals['_KPIMAPPINGSERVICE']._serialized_end = 1859 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2_grpc.py deleted file mode 100644 index c8adc98b..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_mapping_service_pb2_grpc.py +++ /dev/null @@ -1,88 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.analytics.v1 import kpi_mapping_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2 -from .....exabel.api.analytics.v1 import kpi_mapping_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/kpi_mapping_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class KpiMappingServiceStub(object): - """Service for managing KPI mapping groups. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateKpiMappingGroup = channel.unary_unary('/exabel.api.analytics.v1.KpiMappingService/CreateKpiMappingGroup', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.CreateKpiMappingGroupRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, _registered_method=True) - self.GetKpiMappingGroup = channel.unary_unary('/exabel.api.analytics.v1.KpiMappingService/GetKpiMappingGroup', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.GetKpiMappingGroupRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, _registered_method=True) - self.ListKpiMappingGroups = channel.unary_unary('/exabel.api.analytics.v1.KpiMappingService/ListKpiMappingGroups', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsResponse.FromString, _registered_method=True) - self.UpdateKpiMappingGroup = channel.unary_unary('/exabel.api.analytics.v1.KpiMappingService/UpdateKpiMappingGroup', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.UpdateKpiMappingGroupRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, _registered_method=True) - -class KpiMappingServiceServicer(object): - """Service for managing KPI mapping groups. - """ - - def CreateKpiMappingGroup(self, request, context): - """Create a KPI mapping group. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetKpiMappingGroup(self, request, context): - """Retrieve a KPI mapping group. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListKpiMappingGroups(self, request, context): - """List KPI mapping groups for a KPI mapping. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateKpiMappingGroup(self, request, context): - """Update a KPI mapping group. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_KpiMappingServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'CreateKpiMappingGroup': grpc.unary_unary_rpc_method_handler(servicer.CreateKpiMappingGroup, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.CreateKpiMappingGroupRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.SerializeToString), 'GetKpiMappingGroup': grpc.unary_unary_rpc_method_handler(servicer.GetKpiMappingGroup, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.GetKpiMappingGroupRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.SerializeToString), 'ListKpiMappingGroups': grpc.unary_unary_rpc_method_handler(servicer.ListKpiMappingGroups, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsResponse.SerializeToString), 'UpdateKpiMappingGroup': grpc.unary_unary_rpc_method_handler(servicer.UpdateKpiMappingGroup, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.UpdateKpiMappingGroupRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.analytics.v1.KpiMappingService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.analytics.v1.KpiMappingService', rpc_method_handlers) - -class KpiMappingService(object): - """Service for managing KPI mapping groups. - """ - - @staticmethod - def CreateKpiMappingGroup(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiMappingService/CreateKpiMappingGroup', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.CreateKpiMappingGroupRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetKpiMappingGroup(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiMappingService/GetKpiMappingGroup', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.GetKpiMappingGroupRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListKpiMappingGroups(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiMappingService/ListKpiMappingGroups', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.ListKpiMappingGroupsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateKpiMappingGroup(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiMappingService/UpdateKpiMappingGroup', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__service__pb2.UpdateKpiMappingGroupRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__mapping__messages__pb2.KpiMappingGroup.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2.py deleted file mode 100644 index 8ba1b42d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2.py +++ /dev/null @@ -1,71 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/kpi_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.time import date_pb2 as exabel_dot_api_dot_time_dot_date__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/analytics/v1/kpi_messages.proto\x12\x17exabel.api.analytics.v1\x1a\x1aexabel/api/time/date.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x9a\x01\n\x18CompanyKpiMappingResults\x120\n\x06entity\x18\x01 \x01(\x0b2 .exabel.api.analytics.v1.Company\x12L\n\x0bkpi_results\x18\x02 \x03(\x0b27.exabel.api.analytics.v1.SingleCompanyKpiMappingResults"G\n\x07Company\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cdisplay_name\x18\x02 \x01(\t\x12\x18\n\x10bloomberg_ticker\x18\x03 \x01(\t"\x88\x01\n\x1eSingleCompanyKpiMappingResults\x12)\n\x03kpi\x18\x01 \x01(\x0b2\x1c.exabel.api.analytics.v1.Kpi\x12;\n\x04data\x18\x02 \x03(\x0b2-.exabel.api.analytics.v1.KpiMappingResultData"\x87\x01\n\x03Kpi\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x12\n\x05value\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0cdisplay_name\x18\x03 \x01(\t\x12\x11\n\x04freq\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x15\n\x08is_ratio\x18\x05 \x01(\x08H\x02\x88\x01\x01B\x08\n\x06_valueB\x07\n\x05_freqB\x0b\n\t_is_ratio"\x8b\x07\n\x14KpiMappingResultData\x12A\n\x06source\x18\x01 \x01(\x0b21.exabel.api.analytics.v1.KpiMappingGroupReference\x12\x17\n\nmodel_mape\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x16\n\tmodel_mae\x18\x03 \x01(\x01H\x01\x88\x01\x01\x12\x1b\n\x0emodel_hit_rate\x18\x04 \x01(\x01H\x02\x88\x01\x01\x12<\n\rmodel_quality\x18\x0f \x01(\x0e2%.exabel.api.analytics.v1.ModelQuality\x12.\n\x0flast_value_date\x18\x05 \x01(\x0b2\x15.exabel.api.time.Date\x12"\n\x15number_of_data_points\x18\x06 \x01(\x05H\x03\x88\x01\x01\x12#\n\x16period_over_period_mae\x18\x07 \x01(\x01H\x04\x88\x01\x01\x12\x1f\n\x12year_over_year_mae\x18\x08 \x01(\x01H\x05\x88\x01\x01\x12!\n\x14absolute_correlation\x18\t \x01(\x01H\x06\x88\x01\x01\x12+\n\x1eperiod_over_period_correlation\x18\n \x01(\x01H\x07\x88\x01\x01\x12\'\n\x1ayear_over_year_correlation\x18\x0b \x01(\x01H\x08\x88\x01\x01\x12\x1d\n\x10absolute_p_value\x18\x0c \x01(\x01H\t\x88\x01\x01\x12\'\n\x1aperiod_over_period_p_value\x18\r \x01(\x01H\n\x88\x01\x01\x12#\n\x16year_over_year_p_value\x18\x0e \x01(\x01H\x0b\x88\x01\x01B\r\n\x0b_model_mapeB\x0c\n\n_model_maeB\x11\n\x0f_model_hit_rateB\x18\n\x16_number_of_data_pointsB\x19\n\x17_period_over_period_maeB\x15\n\x13_year_over_year_maeB\x17\n\x15_absolute_correlationB!\n\x1f_period_over_period_correlationB\x1d\n\x1b_year_over_year_correlationB\x13\n\x11_absolute_p_valueB\x1d\n\x1b_period_over_period_p_valueB\x19\n\x17_year_over_year_p_value"[\n\x18KpiMappingGroupReference\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cdisplay_name\x18\x02 \x01(\t\x12\x1b\n\x13vendor_display_name\x18\x03 \x01(\t"\xcb\x01\n\x15CompanyKpiModelResult\x12)\n\x03kpi\x18\x01 \x01(\x0b2\x1c.exabel.api.analytics.v1.Kpi\x120\n\x05model\x18\x02 \x01(\x0b2!.exabel.api.analytics.v1.KpiModel\x12!\n\x19accessible_mappings_count\x18\x03 \x01(\x05\x12\x1c\n\x14total_mappings_count\x18\x04 \x01(\x05\x12\x14\n\x0cmodels_count\x18\x05 \x01(\x05"\xc6\x02\n\x08KpiModel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x05\x12\x14\n\x0cdisplay_name\x18\x03 \x01(\t\x123\n\x04data\x18\x04 \x01(\x0b2%.exabel.api.analytics.v1.KpiModelData\x12>\n\x07weights\x18\x05 \x01(\x0b2-.exabel.api.analytics.v1.KpiModelWeightGroups\x129\n\nmodel_runs\x18\x06 \x01(\x0b2%.exabel.api.analytics.v1.KpiModelRuns\x12Z\n\x1dhierarchical_model_kpi_source\x18\x07 \x01(\x0b23.exabel.api.analytics.v1.HierarchicalModelKpiSource"\xed\x01\n\x1aHierarchicalModelKpiSource\x12`\n\x04type\x18\x01 \x01(\x0e2R.exabel.api.analytics.v1.HierarchicalModelKpiSource.HierarchicalModelKpiSourceType\x12\r\n\x05model\x18\x02 \x01(\t"^\n\x1eHierarchicalModelKpiSourceType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\t\n\x05MODEL\x10\x01\x12\r\n\tCONSENSUS\x10\x02\x12\x11\n\rFREE_VARIABLE\x10\x03"\xc2\x01\n\x0cKpiModelRuns\x129\n\x0binitial_run\x18\x01 \x01(\x0b2$.exabel.api.analytics.v1.KpiModelRun\x127\n\tdaily_run\x18\x02 \x01(\x0b2$.exabel.api.analytics.v1.KpiModelRun\x12>\n\x10pit_backtest_run\x18\x03 \x01(\x0b2$.exabel.api.analytics.v1.KpiModelRun"\xbc\x01\n\x0bKpiModelRun\x12.\n\ncreated_at\x18\x01 \x01(\x0b2\x1a.google.protobuf.Timestamp\x12.\n\nstarted_at\x18\x02 \x01(\x0b2\x1a.google.protobuf.Timestamp\x12/\n\x0bfinished_at\x18\x03 \x01(\x0b2\x1a.google.protobuf.Timestamp\x12\x12\n\x05error\x18\x04 \x01(\tH\x00\x88\x01\x01B\x08\n\x06_error"\x93\x01\n\x0fKpiMappingModel\x12A\n\x06source\x18\x01 \x01(\x0b21.exabel.api.analytics.v1.KpiMappingGroupReference\x12=\n\x0ekpi_model_data\x18\x02 \x01(\x0b2%.exabel.api.analytics.v1.KpiModelData"\x8a\x07\n\x0cKpiModelData\x12\x17\n\nprediction\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x1f\n\x12prediction_yoy_rel\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x1f\n\x12prediction_yoy_abs\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x16\n\tconsensus\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x1e\n\x11consensus_yoy_rel\x18\x05 \x01(\x01H\x04\x88\x01\x01\x12\x1e\n\x11consensus_yoy_abs\x18\x06 \x01(\x01H\x05\x88\x01\x01\x12\x16\n\tdelta_abs\x18\x07 \x01(\x01H\x06\x88\x01\x01\x12\x16\n\tdelta_rel\x18\x08 \x01(\x01H\x07\x88\x01\x01\x12\x1b\n\x0edelta_by_error\x18\t \x01(\x01H\x08\x88\x01\x01\x12<\n\rmodel_quality\x18\n \x01(\x0e2%.exabel.api.analytics.v1.ModelQuality\x12\x11\n\x04mape\x18\x0b \x01(\x01H\t\x88\x01\x01\x12\x15\n\x08mape_pit\x18\x0c \x01(\x01H\n\x88\x01\x01\x12\x10\n\x03mae\x18\r \x01(\x01H\x0b\x88\x01\x01\x12\x14\n\x07mae_pit\x18\x0e \x01(\x01H\x0c\x88\x01\x01\x12\x18\n\x0berror_count\x18\x13 \x01(\x05H\r\x88\x01\x01\x12\x15\n\x08hit_rate\x18\x0f \x01(\x01H\x0e\x88\x01\x01\x12\x1b\n\x0ehit_rate_count\x18\x14 \x01(\x05H\x0f\x88\x01\x01\x12\x1c\n\x0frevision_1_week\x18\x10 \x01(\x01H\x10\x88\x01\x01\x12\x1d\n\x10revision_1_month\x18\x11 \x01(\x01H\x11\x88\x01\x01\x12\'\n\x04date\x18\x12 \x01(\x0b2\x15.exabel.api.time.DateB\x02\x18\x01\x12\r\n\x05error\x18d \x01(\tB\r\n\x0b_predictionB\x15\n\x13_prediction_yoy_relB\x15\n\x13_prediction_yoy_absB\x0c\n\n_consensusB\x14\n\x12_consensus_yoy_relB\x14\n\x12_consensus_yoy_absB\x0c\n\n_delta_absB\x0c\n\n_delta_relB\x11\n\x0f_delta_by_errorB\x07\n\x05_mapeB\x0b\n\t_mape_pitB\x06\n\x04_maeB\n\n\x08_mae_pitB\x0e\n\x0c_error_countB\x0b\n\t_hit_rateB\x11\n\x0f_hit_rate_countB\x12\n\x10_revision_1_weekB\x13\n\x11_revision_1_month"t\n\x14KpiModelWeightGroups\x12C\n\rweight_groups\x18\x01 \x03(\x0b2,.exabel.api.analytics.v1.KpiModelWeightGroup\x12\x17\n\x0fis_coefficients\x18\x02 \x01(\x08"\xb6\x01\n\x13KpiModelWeightGroup\x12\x14\n\x0cdisplay_name\x18\x01 \x01(\t\x12@\n\x05group\x18\x02 \x01(\x0b21.exabel.api.analytics.v1.KpiMappingGroupReference\x12G\n\x0ffeature_weights\x18\x03 \x03(\x0b2..exabel.api.analytics.v1.KpiModelFeatureWeight"M\n\x15KpiModelFeatureWeight\x12\x13\n\x06weight\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x14\n\x0cdisplay_name\x18\x02 \x01(\tB\t\n\x07_weight"\x81\x01\n\x0cFiscalPeriod\x12\'\n\x08end_date\x18\x01 \x01(\x0b2\x15.exabel.api.time.Date\x12\x12\n\x05label\x18\x02 \x01(\tH\x00\x88\x01\x01\x12*\n\x0breport_date\x18\x03 \x01(\x0b2\x15.exabel.api.time.DateB\x08\n\x06_label"\xa1\x01\n\x14FiscalPeriodSelector\x12P\n\x11relative_selector\x18\x01 \x01(\x0e25.exabel.api.analytics.v1.RelativeFiscalPeriodSelector\x12)\n\nperiod_end\x18\x02 \x01(\x0b2\x15.exabel.api.time.Date\x12\x0c\n\x04freq\x18\x03 \x01(\t"d\n\x0cKpiHierarchy\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04freq\x18\x02 \x01(\t\x128\n\tbreakdown\x18\x03 \x01(\x0b2%.exabel.api.analytics.v1.KpiBreakdown"G\n\x0cKpiBreakdown\x127\n\x04kpis\x18\x01 \x03(\x0b2).exabel.api.analytics.v1.KpiBreakdownNode"\x99\x01\n\x10KpiBreakdownNode\x12+\n\x03kpi\x18\x01 \x01(\x0b2\x1c.exabel.api.analytics.v1.KpiH\x00\x12\x10\n\x06header\x18\x02 \x01(\tH\x00\x12;\n\x08children\x18\x03 \x03(\x0b2).exabel.api.analytics.v1.KpiBreakdownNodeB\t\n\x07content"\xca\x01\n\x16KpiScreenCompanyResult\x121\n\x07company\x18\x01 \x01(\x0b2 .exabel.api.analytics.v1.Company\x12<\n\rfiscal_period\x18\x02 \x01(\x0b2%.exabel.api.analytics.v1.FiscalPeriod\x12?\n\x07results\x18\x03 \x03(\x0b2..exabel.api.analytics.v1.CompanyKpiModelResult*x\n\tKpiSource\x12\x1a\n\x16KPI_SOURCE_UNSPECIFIED\x10\x00\x12\x1c\n\x18KPI_SOURCE_VISIBLE_ALPHA\x10\x01\x12\x16\n\x12KPI_SOURCE_FACTSET\x10\x02\x12\x19\n\x15KPI_SOURCE_CUSTOM_KPI\x10\x03*\x93\x01\n\x0cModelQuality\x12\x1d\n\x19MODEL_QUALITY_UNSPECIFIED\x10\x00\x12\x15\n\x11MODEL_QUALITY_LOW\x10\n\x12\x18\n\x14MODEL_QUALITY_MEDIUM\x10\x14\x12\x16\n\x12MODEL_QUALITY_HIGH\x10\x1e\x12\x1b\n\x17MODEL_QUALITY_VERY_HIGH\x10(*t\n\x1cRelativeFiscalPeriodSelector\x12/\n+RELATIVE_FISCAL_PERIOD_SELECTOR_UNSPECIFIED\x10\x00\x12\x0c\n\x08PREVIOUS\x10\x01\x12\x0b\n\x07CURRENT\x10\x02\x12\x08\n\x04NEXT\x10\x03BN\n\x1bcom.exabel.api.analytics.v1B\x10KpiMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.kpi_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x10KpiMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_KPIMODELDATA'].fields_by_name['date']._loaded_options = None - _globals['_KPIMODELDATA'].fields_by_name['date']._serialized_options = b'\x18\x01' - _globals['_KPISOURCE']._serialized_start = 5078 - _globals['_KPISOURCE']._serialized_end = 5198 - _globals['_MODELQUALITY']._serialized_start = 5201 - _globals['_MODELQUALITY']._serialized_end = 5348 - _globals['_RELATIVEFISCALPERIODSELECTOR']._serialized_start = 5350 - _globals['_RELATIVEFISCALPERIODSELECTOR']._serialized_end = 5466 - _globals['_COMPANYKPIMAPPINGRESULTS']._serialized_start = 133 - _globals['_COMPANYKPIMAPPINGRESULTS']._serialized_end = 287 - _globals['_COMPANY']._serialized_start = 289 - _globals['_COMPANY']._serialized_end = 360 - _globals['_SINGLECOMPANYKPIMAPPINGRESULTS']._serialized_start = 363 - _globals['_SINGLECOMPANYKPIMAPPINGRESULTS']._serialized_end = 499 - _globals['_KPI']._serialized_start = 502 - _globals['_KPI']._serialized_end = 637 - _globals['_KPIMAPPINGRESULTDATA']._serialized_start = 640 - _globals['_KPIMAPPINGRESULTDATA']._serialized_end = 1547 - _globals['_KPIMAPPINGGROUPREFERENCE']._serialized_start = 1549 - _globals['_KPIMAPPINGGROUPREFERENCE']._serialized_end = 1640 - _globals['_COMPANYKPIMODELRESULT']._serialized_start = 1643 - _globals['_COMPANYKPIMODELRESULT']._serialized_end = 1846 - _globals['_KPIMODEL']._serialized_start = 1849 - _globals['_KPIMODEL']._serialized_end = 2175 - _globals['_HIERARCHICALMODELKPISOURCE']._serialized_start = 2178 - _globals['_HIERARCHICALMODELKPISOURCE']._serialized_end = 2415 - _globals['_HIERARCHICALMODELKPISOURCE_HIERARCHICALMODELKPISOURCETYPE']._serialized_start = 2321 - _globals['_HIERARCHICALMODELKPISOURCE_HIERARCHICALMODELKPISOURCETYPE']._serialized_end = 2415 - _globals['_KPIMODELRUNS']._serialized_start = 2418 - _globals['_KPIMODELRUNS']._serialized_end = 2612 - _globals['_KPIMODELRUN']._serialized_start = 2615 - _globals['_KPIMODELRUN']._serialized_end = 2803 - _globals['_KPIMAPPINGMODEL']._serialized_start = 2806 - _globals['_KPIMAPPINGMODEL']._serialized_end = 2953 - _globals['_KPIMODELDATA']._serialized_start = 2956 - _globals['_KPIMODELDATA']._serialized_end = 3862 - _globals['_KPIMODELWEIGHTGROUPS']._serialized_start = 3864 - _globals['_KPIMODELWEIGHTGROUPS']._serialized_end = 3980 - _globals['_KPIMODELWEIGHTGROUP']._serialized_start = 3983 - _globals['_KPIMODELWEIGHTGROUP']._serialized_end = 4165 - _globals['_KPIMODELFEATUREWEIGHT']._serialized_start = 4167 - _globals['_KPIMODELFEATUREWEIGHT']._serialized_end = 4244 - _globals['_FISCALPERIOD']._serialized_start = 4247 - _globals['_FISCALPERIOD']._serialized_end = 4376 - _globals['_FISCALPERIODSELECTOR']._serialized_start = 4379 - _globals['_FISCALPERIODSELECTOR']._serialized_end = 4540 - _globals['_KPIHIERARCHY']._serialized_start = 4542 - _globals['_KPIHIERARCHY']._serialized_end = 4642 - _globals['_KPIBREAKDOWN']._serialized_start = 4644 - _globals['_KPIBREAKDOWN']._serialized_end = 4715 - _globals['_KPIBREAKDOWNNODE']._serialized_start = 4718 - _globals['_KPIBREAKDOWNNODE']._serialized_end = 4871 - _globals['_KPISCREENCOMPANYRESULT']._serialized_start = 4874 - _globals['_KPISCREENCOMPANYRESULT']._serialized_end = 5076 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2.pyi deleted file mode 100644 index d2dd11b9..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2.pyi +++ /dev/null @@ -1,964 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2025 Exabel AS. All rights reserved.""" -import builtins -import collections.abc -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message -import google.protobuf.timestamp_pb2 -import sys -import typing -if sys.version_info >= (3, 10): - import typing as typing_extensions -else: - import typing_extensions -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _KpiSource: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _KpiSourceEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_KpiSource.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - KPI_SOURCE_UNSPECIFIED: _KpiSource.ValueType - 'Unspecified.' - KPI_SOURCE_VISIBLE_ALPHA: _KpiSource.ValueType - 'Visible Alpha.' - KPI_SOURCE_FACTSET: _KpiSource.ValueType - 'FactSet.' - KPI_SOURCE_CUSTOM_KPI: _KpiSource.ValueType - 'Custom KPI.' - -class KpiSource(_KpiSource, metaclass=_KpiSourceEnumTypeWrapper): - """KPI source.""" -KPI_SOURCE_UNSPECIFIED: KpiSource.ValueType -'Unspecified.' -KPI_SOURCE_VISIBLE_ALPHA: KpiSource.ValueType -'Visible Alpha.' -KPI_SOURCE_FACTSET: KpiSource.ValueType -'FactSet.' -KPI_SOURCE_CUSTOM_KPI: KpiSource.ValueType -'Custom KPI.' -global___KpiSource = KpiSource - -class _ModelQuality: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _ModelQualityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ModelQuality.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - MODEL_QUALITY_UNSPECIFIED: _ModelQuality.ValueType - 'Unspecified.' - MODEL_QUALITY_LOW: _ModelQuality.ValueType - 'Low quality.' - MODEL_QUALITY_MEDIUM: _ModelQuality.ValueType - 'Medium quality.' - MODEL_QUALITY_HIGH: _ModelQuality.ValueType - 'High quality.' - MODEL_QUALITY_VERY_HIGH: _ModelQuality.ValueType - 'Very high quality.' - -class ModelQuality(_ModelQuality, metaclass=_ModelQualityEnumTypeWrapper): - """Model quality.""" -MODEL_QUALITY_UNSPECIFIED: ModelQuality.ValueType -'Unspecified.' -MODEL_QUALITY_LOW: ModelQuality.ValueType -'Low quality.' -MODEL_QUALITY_MEDIUM: ModelQuality.ValueType -'Medium quality.' -MODEL_QUALITY_HIGH: ModelQuality.ValueType -'High quality.' -MODEL_QUALITY_VERY_HIGH: ModelQuality.ValueType -'Very high quality.' -global___ModelQuality = ModelQuality - -class _RelativeFiscalPeriodSelector: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _RelativeFiscalPeriodSelectorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_RelativeFiscalPeriodSelector.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - RELATIVE_FISCAL_PERIOD_SELECTOR_UNSPECIFIED: _RelativeFiscalPeriodSelector.ValueType - 'Unspecified.' - PREVIOUS: _RelativeFiscalPeriodSelector.ValueType - 'Last reported fiscal period.' - CURRENT: _RelativeFiscalPeriodSelector.ValueType - 'Current unreported fiscal period.' - NEXT: _RelativeFiscalPeriodSelector.ValueType - 'Next unreported fiscal period.' - -class RelativeFiscalPeriodSelector(_RelativeFiscalPeriodSelector, metaclass=_RelativeFiscalPeriodSelectorEnumTypeWrapper): - """Selector for a relative fiscal period.""" -RELATIVE_FISCAL_PERIOD_SELECTOR_UNSPECIFIED: RelativeFiscalPeriodSelector.ValueType -'Unspecified.' -PREVIOUS: RelativeFiscalPeriodSelector.ValueType -'Last reported fiscal period.' -CURRENT: RelativeFiscalPeriodSelector.ValueType -'Current unreported fiscal period.' -NEXT: RelativeFiscalPeriodSelector.ValueType -'Next unreported fiscal period.' -global___RelativeFiscalPeriodSelector = RelativeFiscalPeriodSelector - -@typing.final -class CompanyKpiMappingResults(google.protobuf.message.Message): - """KPI mapping results for a single company.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - ENTITY_FIELD_NUMBER: builtins.int - KPI_RESULTS_FIELD_NUMBER: builtins.int - - @property - def entity(self) -> global___Company: - """The company these results apply to.""" - - @property - def kpi_results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SingleCompanyKpiMappingResults]: - """The results for each KPI.""" - - def __init__(self, *, entity: global___Company | None=..., kpi_results: collections.abc.Iterable[global___SingleCompanyKpiMappingResults] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['entity', b'entity']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['entity', b'entity', 'kpi_results', b'kpi_results']) -> None: - ... -global___CompanyKpiMappingResults = CompanyKpiMappingResults - -@typing.final -class Company(google.protobuf.message.Message): - """A company.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - BLOOMBERG_TICKER_FIELD_NUMBER: builtins.int - name: builtins.str - 'The resource name of the company.' - display_name: builtins.str - 'The display name of the company.' - bloomberg_ticker: builtins.str - 'The bloomberg ticker of the company.' - - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., bloomberg_ticker: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['bloomberg_ticker', b'bloomberg_ticker', 'display_name', b'display_name', 'name', b'name']) -> None: - ... -global___Company = Company - -@typing.final -class SingleCompanyKpiMappingResults(google.protobuf.message.Message): - """KPI mapping results for a single company KPI.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KPI_FIELD_NUMBER: builtins.int - DATA_FIELD_NUMBER: builtins.int - - @property - def kpi(self) -> global___Kpi: - """The KPI.""" - - @property - def data(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiMappingResultData]: - """The KPI mapping results for this KPI.""" - - def __init__(self, *, kpi: global___Kpi | None=..., data: collections.abc.Iterable[global___KpiMappingResultData] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['kpi', b'kpi']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['data', b'data', 'kpi', b'kpi']) -> None: - ... -global___SingleCompanyKpiMappingResults = SingleCompanyKpiMappingResults - -@typing.final -class Kpi(google.protobuf.message.Message): - """A KPI.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - TYPE_FIELD_NUMBER: builtins.int - VALUE_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - FREQ_FIELD_NUMBER: builtins.int - IS_RATIO_FIELD_NUMBER: builtins.int - type: builtins.str - 'The type of the KPI. A KPI is one of the following types:\n - `FACTSET_ESTIMATES`: FactSet actuals/estimates.\n - `FACTSET_FUNDAMENTALS`: FactSet fundamentals.\n - `FACTSET_SEGMENTS`: FactSet segments.\n - `VISIBLE_ALPHA_STANDARD_KPI`: Visible Alpha standard KPI.\n - `CUSTOM_KPI`: Custom KPI.\n ' - value: builtins.str - 'A value which is dependent on the type:\n - `FACTSET_ESTIMATES`: Reporting number, e.g. `SALES`.\n - `FACTSET_FUNDAMENTALS`: Reporting number, e.g. `SALES`.\n - `FACTSET_SEGMENTS`: Factset segment resource name, e.g. `entityTypes/geo_segment/entities/factset.segment_123`.\n - `VISIBLE_ALPHA_STANDARD_KPI`: Line item parameter id. For example, the "Total revenue" parameter has a parameter id of `190`.\n - `CUSTOM_KPI`: Custom KPI id. For example, `1234`.\n ' - display_name: builtins.str - 'The display name of the KPI.' - freq: builtins.str - 'A textual representation of the KPI frequency. Either `FQ`, `FS` or `FY`.' - is_ratio: builtins.bool - 'Whether this KPI is a ratio or not.' - - def __init__(self, *, type: builtins.str | None=..., value: builtins.str | None=..., display_name: builtins.str | None=..., freq: builtins.str | None=..., is_ratio: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_freq', b'_freq', '_is_ratio', b'_is_ratio', '_value', b'_value', 'freq', b'freq', 'is_ratio', b'is_ratio', 'value', b'value']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_freq', b'_freq', '_is_ratio', b'_is_ratio', '_value', b'_value', 'display_name', b'display_name', 'freq', b'freq', 'is_ratio', b'is_ratio', 'type', b'type', 'value', b'value']) -> None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_freq', b'_freq']) -> typing.Literal['freq'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_is_ratio', b'_is_ratio']) -> typing.Literal['is_ratio'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_value', b'_value']) -> typing.Literal['value'] | None: - ... -global___Kpi = Kpi - -@typing.final -class KpiMappingResultData(google.protobuf.message.Message): - """Data for a KPI mapping result.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - SOURCE_FIELD_NUMBER: builtins.int - MODEL_MAPE_FIELD_NUMBER: builtins.int - MODEL_MAE_FIELD_NUMBER: builtins.int - MODEL_HIT_RATE_FIELD_NUMBER: builtins.int - MODEL_QUALITY_FIELD_NUMBER: builtins.int - LAST_VALUE_DATE_FIELD_NUMBER: builtins.int - NUMBER_OF_DATA_POINTS_FIELD_NUMBER: builtins.int - PERIOD_OVER_PERIOD_MAE_FIELD_NUMBER: builtins.int - YEAR_OVER_YEAR_MAE_FIELD_NUMBER: builtins.int - ABSOLUTE_CORRELATION_FIELD_NUMBER: builtins.int - PERIOD_OVER_PERIOD_CORRELATION_FIELD_NUMBER: builtins.int - YEAR_OVER_YEAR_CORRELATION_FIELD_NUMBER: builtins.int - ABSOLUTE_P_VALUE_FIELD_NUMBER: builtins.int - PERIOD_OVER_PERIOD_P_VALUE_FIELD_NUMBER: builtins.int - YEAR_OVER_YEAR_P_VALUE_FIELD_NUMBER: builtins.int - model_mape: builtins.float - 'Mean absolute percentage error for a model built using this proxy.' - model_mae: builtins.float - 'Mean absolute error for a model built using this proxy.' - model_hit_rate: builtins.float - 'Hit rate for a model built using this proxy.' - model_quality: global___ModelQuality.ValueType - 'Model quality for a model built using this proxy.' - number_of_data_points: builtins.int - 'Number of data points (after resampling).\n This is the number of data points where both the KPI and the proxy have data.\n ' - period_over_period_mae: builtins.float - 'Period-over-period mean absolute error.' - year_over_year_mae: builtins.float - 'Year-over-year mean absolute error.' - absolute_correlation: builtins.float - 'Absolute correlation.' - period_over_period_correlation: builtins.float - 'Period-over-period correlation.' - year_over_year_correlation: builtins.float - 'Year-over-year correlation.' - absolute_p_value: builtins.float - 'Absolute P-value.' - period_over_period_p_value: builtins.float - 'Period-over-period P-value.' - year_over_year_p_value: builtins.float - 'Year-over-year P-value.' - - @property - def source(self) -> global___KpiMappingGroupReference: - """The KPI mapping group from which this result originates""" - - @property - def last_value_date(self) -> exabel.api.time.date_pb2.Date: - """The date of the last observed proxy value.""" - - def __init__(self, *, source: global___KpiMappingGroupReference | None=..., model_mape: builtins.float | None=..., model_mae: builtins.float | None=..., model_hit_rate: builtins.float | None=..., model_quality: global___ModelQuality.ValueType | None=..., last_value_date: exabel.api.time.date_pb2.Date | None=..., number_of_data_points: builtins.int | None=..., period_over_period_mae: builtins.float | None=..., year_over_year_mae: builtins.float | None=..., absolute_correlation: builtins.float | None=..., period_over_period_correlation: builtins.float | None=..., year_over_year_correlation: builtins.float | None=..., absolute_p_value: builtins.float | None=..., period_over_period_p_value: builtins.float | None=..., year_over_year_p_value: builtins.float | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_absolute_correlation', b'_absolute_correlation', '_absolute_p_value', b'_absolute_p_value', '_model_hit_rate', b'_model_hit_rate', '_model_mae', b'_model_mae', '_model_mape', b'_model_mape', '_number_of_data_points', b'_number_of_data_points', '_period_over_period_correlation', b'_period_over_period_correlation', '_period_over_period_mae', b'_period_over_period_mae', '_period_over_period_p_value', b'_period_over_period_p_value', '_year_over_year_correlation', b'_year_over_year_correlation', '_year_over_year_mae', b'_year_over_year_mae', '_year_over_year_p_value', b'_year_over_year_p_value', 'absolute_correlation', b'absolute_correlation', 'absolute_p_value', b'absolute_p_value', 'last_value_date', b'last_value_date', 'model_hit_rate', b'model_hit_rate', 'model_mae', b'model_mae', 'model_mape', b'model_mape', 'number_of_data_points', b'number_of_data_points', 'period_over_period_correlation', b'period_over_period_correlation', 'period_over_period_mae', b'period_over_period_mae', 'period_over_period_p_value', b'period_over_period_p_value', 'source', b'source', 'year_over_year_correlation', b'year_over_year_correlation', 'year_over_year_mae', b'year_over_year_mae', 'year_over_year_p_value', b'year_over_year_p_value']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_absolute_correlation', b'_absolute_correlation', '_absolute_p_value', b'_absolute_p_value', '_model_hit_rate', b'_model_hit_rate', '_model_mae', b'_model_mae', '_model_mape', b'_model_mape', '_number_of_data_points', b'_number_of_data_points', '_period_over_period_correlation', b'_period_over_period_correlation', '_period_over_period_mae', b'_period_over_period_mae', '_period_over_period_p_value', b'_period_over_period_p_value', '_year_over_year_correlation', b'_year_over_year_correlation', '_year_over_year_mae', b'_year_over_year_mae', '_year_over_year_p_value', b'_year_over_year_p_value', 'absolute_correlation', b'absolute_correlation', 'absolute_p_value', b'absolute_p_value', 'last_value_date', b'last_value_date', 'model_hit_rate', b'model_hit_rate', 'model_mae', b'model_mae', 'model_mape', b'model_mape', 'model_quality', b'model_quality', 'number_of_data_points', b'number_of_data_points', 'period_over_period_correlation', b'period_over_period_correlation', 'period_over_period_mae', b'period_over_period_mae', 'period_over_period_p_value', b'period_over_period_p_value', 'source', b'source', 'year_over_year_correlation', b'year_over_year_correlation', 'year_over_year_mae', b'year_over_year_mae', 'year_over_year_p_value', b'year_over_year_p_value']) -> None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_absolute_correlation', b'_absolute_correlation']) -> typing.Literal['absolute_correlation'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_absolute_p_value', b'_absolute_p_value']) -> typing.Literal['absolute_p_value'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_model_hit_rate', b'_model_hit_rate']) -> typing.Literal['model_hit_rate'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_model_mae', b'_model_mae']) -> typing.Literal['model_mae'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_model_mape', b'_model_mape']) -> typing.Literal['model_mape'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_number_of_data_points', b'_number_of_data_points']) -> typing.Literal['number_of_data_points'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_period_over_period_correlation', b'_period_over_period_correlation']) -> typing.Literal['period_over_period_correlation'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_period_over_period_mae', b'_period_over_period_mae']) -> typing.Literal['period_over_period_mae'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_period_over_period_p_value', b'_period_over_period_p_value']) -> typing.Literal['period_over_period_p_value'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_year_over_year_correlation', b'_year_over_year_correlation']) -> typing.Literal['year_over_year_correlation'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_year_over_year_mae', b'_year_over_year_mae']) -> typing.Literal['year_over_year_mae'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_year_over_year_p_value', b'_year_over_year_p_value']) -> typing.Literal['year_over_year_p_value'] | None: - ... -global___KpiMappingResultData = KpiMappingResultData - -@typing.final -class KpiMappingGroupReference(google.protobuf.message.Message): - """KPI mapping group minimal set of fields.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - VENDOR_DISPLAY_NAME_FIELD_NUMBER: builtins.int - name: builtins.str - 'Resource name.' - display_name: builtins.str - 'Display name.' - vendor_display_name: builtins.str - 'Vendor display name.' - - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., vendor_display_name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['display_name', b'display_name', 'name', b'name', 'vendor_display_name', b'vendor_display_name']) -> None: - ... -global___KpiMappingGroupReference = KpiMappingGroupReference - -@typing.final -class CompanyKpiModelResult(google.protobuf.message.Message): - """Result for a single company KPI.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KPI_FIELD_NUMBER: builtins.int - MODEL_FIELD_NUMBER: builtins.int - ACCESSIBLE_MAPPINGS_COUNT_FIELD_NUMBER: builtins.int - TOTAL_MAPPINGS_COUNT_FIELD_NUMBER: builtins.int - MODELS_COUNT_FIELD_NUMBER: builtins.int - accessible_mappings_count: builtins.int - 'Number of KPI mappings for this company KPI that the current user has access to.' - total_mappings_count: builtins.int - 'Total number of KPI mappings for this company KPI, including both accessible\n KPI mappings and public KPI mappings.\n ' - models_count: builtins.int - 'Number of models for this company KPI.' - - @property - def kpi(self) -> global___Kpi: - """KPI.""" - - @property - def model(self) -> global___KpiModel: - """KPI model.""" - - def __init__(self, *, kpi: global___Kpi | None=..., model: global___KpiModel | None=..., accessible_mappings_count: builtins.int | None=..., total_mappings_count: builtins.int | None=..., models_count: builtins.int | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['kpi', b'kpi', 'model', b'model']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['accessible_mappings_count', b'accessible_mappings_count', 'kpi', b'kpi', 'model', b'model', 'models_count', b'models_count', 'total_mappings_count', b'total_mappings_count']) -> None: - ... -global___CompanyKpiModelResult = CompanyKpiModelResult - -@typing.final -class KpiModel(google.protobuf.message.Message): - """A KPI model.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - ID_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - DATA_FIELD_NUMBER: builtins.int - WEIGHTS_FIELD_NUMBER: builtins.int - MODEL_RUNS_FIELD_NUMBER: builtins.int - HIERARCHICAL_MODEL_KPI_SOURCE_FIELD_NUMBER: builtins.int - name: builtins.str - 'Resource name.' - id: builtins.int - 'Integer id.' - display_name: builtins.str - 'Display name.' - - @property - def data(self) -> global___KpiModelData: - """Model data.""" - - @property - def weights(self) -> global___KpiModelWeightGroups: - """Model weights.""" - - @property - def model_runs(self) -> global___KpiModelRuns: - """Model runs.""" - - @property - def hierarchical_model_kpi_source(self) -> global___HierarchicalModelKpiSource: - """Hierarchical model KPI source data. - This field specifies what was used as input for the KPI in the hierarchical model. - The field is only set for hierarchical models. - """ - - def __init__(self, *, name: builtins.str | None=..., id: builtins.int | None=..., display_name: builtins.str | None=..., data: global___KpiModelData | None=..., weights: global___KpiModelWeightGroups | None=..., model_runs: global___KpiModelRuns | None=..., hierarchical_model_kpi_source: global___HierarchicalModelKpiSource | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['data', b'data', 'hierarchical_model_kpi_source', b'hierarchical_model_kpi_source', 'model_runs', b'model_runs', 'weights', b'weights']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['data', b'data', 'display_name', b'display_name', 'hierarchical_model_kpi_source', b'hierarchical_model_kpi_source', 'id', b'id', 'model_runs', b'model_runs', 'name', b'name', 'weights', b'weights']) -> None: - ... -global___KpiModel = KpiModel - -@typing.final -class HierarchicalModelKpiSource(google.protobuf.message.Message): - """Hierarchical model KPI source data.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - class _HierarchicalModelKpiSourceType: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - - class _HierarchicalModelKpiSourceTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - UNSPECIFIED: HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType - 'Unspecified.' - MODEL: HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType - 'Model.' - CONSENSUS: HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType - 'Consensus.' - FREE_VARIABLE: HierarchicalModelKpiSource._HierarchicalModelKpiSourceType.ValueType - 'Free variable.' - - class HierarchicalModelKpiSourceType(_HierarchicalModelKpiSourceType, metaclass=_HierarchicalModelKpiSourceTypeEnumTypeWrapper): - """Hierarchical model KPI source types.""" - UNSPECIFIED: HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType - 'Unspecified.' - MODEL: HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType - 'Model.' - CONSENSUS: HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType - 'Consensus.' - FREE_VARIABLE: HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType - 'Free variable.' - TYPE_FIELD_NUMBER: builtins.int - MODEL_FIELD_NUMBER: builtins.int - type: global___HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType - 'The type of the hierarchical model KPI source.' - model: builtins.str - 'Optional model resource name.\n Only set if the type is MODEL.\n ' - - def __init__(self, *, type: global___HierarchicalModelKpiSource.HierarchicalModelKpiSourceType.ValueType | None=..., model: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['model', b'model', 'type', b'type']) -> None: - ... -global___HierarchicalModelKpiSource = HierarchicalModelKpiSource - -@typing.final -class KpiModelRuns(google.protobuf.message.Message): - """Information about the runs for this model.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - INITIAL_RUN_FIELD_NUMBER: builtins.int - DAILY_RUN_FIELD_NUMBER: builtins.int - PIT_BACKTEST_RUN_FIELD_NUMBER: builtins.int - - @property - def initial_run(self) -> global___KpiModelRun: - """Initial run. - The initial run performs backtesting and the initial prediction. - It runs when the model is first created. - """ - - @property - def daily_run(self) -> global___KpiModelRun: - """Latest daily run. - The daily run updates the model prediction based on the latest available data. - """ - - @property - def pit_backtest_run(self) -> global___KpiModelRun: - """Point-in-time backtest run. - This run performs point-in-time backtesting of the model. - The point-in-time backtests can be used to estimate the model error based on when we are in a quarter. - It runs when the model is first created. - """ - - def __init__(self, *, initial_run: global___KpiModelRun | None=..., daily_run: global___KpiModelRun | None=..., pit_backtest_run: global___KpiModelRun | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['daily_run', b'daily_run', 'initial_run', b'initial_run', 'pit_backtest_run', b'pit_backtest_run']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['daily_run', b'daily_run', 'initial_run', b'initial_run', 'pit_backtest_run', b'pit_backtest_run']) -> None: - ... -global___KpiModelRuns = KpiModelRuns - -@typing.final -class KpiModelRun(google.protobuf.message.Message): - """Information about a single KPI model run.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - CREATED_AT_FIELD_NUMBER: builtins.int - STARTED_AT_FIELD_NUMBER: builtins.int - FINISHED_AT_FIELD_NUMBER: builtins.int - ERROR_FIELD_NUMBER: builtins.int - error: builtins.str - 'An optional error message if the run failed.' - - @property - def created_at(self) -> google.protobuf.timestamp_pb2.Timestamp: - """The time the run was created.""" - - @property - def started_at(self) -> google.protobuf.timestamp_pb2.Timestamp: - """The time the run was started.""" - - @property - def finished_at(self) -> google.protobuf.timestamp_pb2.Timestamp: - """The time the run finished.""" - - def __init__(self, *, created_at: google.protobuf.timestamp_pb2.Timestamp | None=..., started_at: google.protobuf.timestamp_pb2.Timestamp | None=..., finished_at: google.protobuf.timestamp_pb2.Timestamp | None=..., error: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_error', b'_error', 'created_at', b'created_at', 'error', b'error', 'finished_at', b'finished_at', 'started_at', b'started_at']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_error', b'_error', 'created_at', b'created_at', 'error', b'error', 'finished_at', b'finished_at', 'started_at', b'started_at']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_error', b'_error']) -> typing.Literal['error'] | None: - ... -global___KpiModelRun = KpiModelRun - -@typing.final -class KpiMappingModel(google.protobuf.message.Message): - """Single-predictor KPI mapping model.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - SOURCE_FIELD_NUMBER: builtins.int - KPI_MODEL_DATA_FIELD_NUMBER: builtins.int - - @property - def source(self) -> global___KpiMappingGroupReference: - """The KPI mapping group from which the model originates""" - - @property - def kpi_model_data(self) -> global___KpiModelData: - """Model data.""" - - def __init__(self, *, source: global___KpiMappingGroupReference | None=..., kpi_model_data: global___KpiModelData | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['kpi_model_data', b'kpi_model_data', 'source', b'source']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['kpi_model_data', b'kpi_model_data', 'source', b'source']) -> None: - ... -global___KpiMappingModel = KpiMappingModel - -@typing.final -class KpiModelData(google.protobuf.message.Message): - """Data for a KPI model.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PREDICTION_FIELD_NUMBER: builtins.int - PREDICTION_YOY_REL_FIELD_NUMBER: builtins.int - PREDICTION_YOY_ABS_FIELD_NUMBER: builtins.int - CONSENSUS_FIELD_NUMBER: builtins.int - CONSENSUS_YOY_REL_FIELD_NUMBER: builtins.int - CONSENSUS_YOY_ABS_FIELD_NUMBER: builtins.int - DELTA_ABS_FIELD_NUMBER: builtins.int - DELTA_REL_FIELD_NUMBER: builtins.int - DELTA_BY_ERROR_FIELD_NUMBER: builtins.int - MODEL_QUALITY_FIELD_NUMBER: builtins.int - MAPE_FIELD_NUMBER: builtins.int - MAPE_PIT_FIELD_NUMBER: builtins.int - MAE_FIELD_NUMBER: builtins.int - MAE_PIT_FIELD_NUMBER: builtins.int - ERROR_COUNT_FIELD_NUMBER: builtins.int - HIT_RATE_FIELD_NUMBER: builtins.int - HIT_RATE_COUNT_FIELD_NUMBER: builtins.int - REVISION_1_WEEK_FIELD_NUMBER: builtins.int - REVISION_1_MONTH_FIELD_NUMBER: builtins.int - DATE_FIELD_NUMBER: builtins.int - ERROR_FIELD_NUMBER: builtins.int - prediction: builtins.float - 'Absolute prediction.' - prediction_yoy_rel: builtins.float - 'Year-over-year prediction relative change.\n This is the absolute prediction compared to the observed value for the\n same period one year ago.\n ' - prediction_yoy_abs: builtins.float - 'Year-over-year prediction absolute change.\n This is the absolute prediction compared to the observed value for the\n same period one year ago.\n ' - consensus: builtins.float - 'Consensus.\n Only available for Visible Alpha KPIs for users with a subscription with export allowed.\n ' - consensus_yoy_rel: builtins.float - 'Year-over-year consensus relative change.\n This is the consensus compared to the observed value for the\n same period one year ago.\n ' - consensus_yoy_abs: builtins.float - 'Year-over-year consensus absolute change.\n This is the consensus compared to the observed value for the\n same period one year ago.\n ' - delta_abs: builtins.float - 'Absolute difference between the prediction and the consensus.\n This is calculated as prediction - consensus.\n Only available for Visible Alpha KPIs for users with a subscription with export allowed.\n ' - delta_rel: builtins.float - 'Relative difference between the prediction and the consensus.\n This is calculated as (prediction / consensus) - 1.\n Only available for Visible Alpha KPIs for users with a subscription with export allowed.\n ' - delta_by_error: builtins.float - 'The delta divided by the error.\n For ratio KPIs this is absolute delta / mae (using PiT mae if available).\n For non-ratio KPIs this is relative delta / mape (using PiT mape if available).\n Only available for Visible Alpha KPIs for users with a subscription with export allowed.\n ' - model_quality: global___ModelQuality.ValueType - 'Model quality.' - mape: builtins.float - 'Mean absolute percentage error.' - mape_pit: builtins.float - 'Point-in-time mean absolute percentage error.' - mae: builtins.float - 'Mean absolute error.' - mae_pit: builtins.float - 'Point-in-time mean absolute error.' - error_count: builtins.int - 'The number of data points used to calculate the MAPE and MAE metrics.\n Note that his may be different from the number of data points available, as we\n may choose to only use the most recent data points.\n ' - hit_rate: builtins.float - 'Hit rate.' - hit_rate_count: builtins.int - 'The number of data points included in the hit rate calculation.\n If the difference between the consensus and prediction is below a certain threshold,\n a data point may not be included in the calculation.\n ' - revision_1_week: builtins.float - 'Revision to the predicted value compared to the prediction from 1 week ago.\n If the KPI is a ratio, this is just the difference between the current prediction and the\n prediction from 1 week ago, otherwise this is the relative change.\n For Exabel Models and custom models, a backtest may be used to get the historical prediction.\n ' - revision_1_month: builtins.float - 'Revision to the predicted value compared to the prediction from 1 month ago.\n If the KPI is a ratio, this is just the difference between the current prediction and the\n prediction from 1 month ago, otherwise this is the relative change.\n For Exabel Models and custom models, a backtest may be used to get the historical prediction.\n ' - error: builtins.str - 'An error message in case the model training or backtesting failed.' - - @property - def date(self) -> exabel.api.time.date_pb2.Date: - """The fiscal period end date for which the prediction has been made.""" - - def __init__(self, *, prediction: builtins.float | None=..., prediction_yoy_rel: builtins.float | None=..., prediction_yoy_abs: builtins.float | None=..., consensus: builtins.float | None=..., consensus_yoy_rel: builtins.float | None=..., consensus_yoy_abs: builtins.float | None=..., delta_abs: builtins.float | None=..., delta_rel: builtins.float | None=..., delta_by_error: builtins.float | None=..., model_quality: global___ModelQuality.ValueType | None=..., mape: builtins.float | None=..., mape_pit: builtins.float | None=..., mae: builtins.float | None=..., mae_pit: builtins.float | None=..., error_count: builtins.int | None=..., hit_rate: builtins.float | None=..., hit_rate_count: builtins.int | None=..., revision_1_week: builtins.float | None=..., revision_1_month: builtins.float | None=..., date: exabel.api.time.date_pb2.Date | None=..., error: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_consensus', b'_consensus', '_consensus_yoy_abs', b'_consensus_yoy_abs', '_consensus_yoy_rel', b'_consensus_yoy_rel', '_delta_abs', b'_delta_abs', '_delta_by_error', b'_delta_by_error', '_delta_rel', b'_delta_rel', '_error_count', b'_error_count', '_hit_rate', b'_hit_rate', '_hit_rate_count', b'_hit_rate_count', '_mae', b'_mae', '_mae_pit', b'_mae_pit', '_mape', b'_mape', '_mape_pit', b'_mape_pit', '_prediction', b'_prediction', '_prediction_yoy_abs', b'_prediction_yoy_abs', '_prediction_yoy_rel', b'_prediction_yoy_rel', '_revision_1_month', b'_revision_1_month', '_revision_1_week', b'_revision_1_week', 'consensus', b'consensus', 'consensus_yoy_abs', b'consensus_yoy_abs', 'consensus_yoy_rel', b'consensus_yoy_rel', 'date', b'date', 'delta_abs', b'delta_abs', 'delta_by_error', b'delta_by_error', 'delta_rel', b'delta_rel', 'error_count', b'error_count', 'hit_rate', b'hit_rate', 'hit_rate_count', b'hit_rate_count', 'mae', b'mae', 'mae_pit', b'mae_pit', 'mape', b'mape', 'mape_pit', b'mape_pit', 'prediction', b'prediction', 'prediction_yoy_abs', b'prediction_yoy_abs', 'prediction_yoy_rel', b'prediction_yoy_rel', 'revision_1_month', b'revision_1_month', 'revision_1_week', b'revision_1_week']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_consensus', b'_consensus', '_consensus_yoy_abs', b'_consensus_yoy_abs', '_consensus_yoy_rel', b'_consensus_yoy_rel', '_delta_abs', b'_delta_abs', '_delta_by_error', b'_delta_by_error', '_delta_rel', b'_delta_rel', '_error_count', b'_error_count', '_hit_rate', b'_hit_rate', '_hit_rate_count', b'_hit_rate_count', '_mae', b'_mae', '_mae_pit', b'_mae_pit', '_mape', b'_mape', '_mape_pit', b'_mape_pit', '_prediction', b'_prediction', '_prediction_yoy_abs', b'_prediction_yoy_abs', '_prediction_yoy_rel', b'_prediction_yoy_rel', '_revision_1_month', b'_revision_1_month', '_revision_1_week', b'_revision_1_week', 'consensus', b'consensus', 'consensus_yoy_abs', b'consensus_yoy_abs', 'consensus_yoy_rel', b'consensus_yoy_rel', 'date', b'date', 'delta_abs', b'delta_abs', 'delta_by_error', b'delta_by_error', 'delta_rel', b'delta_rel', 'error', b'error', 'error_count', b'error_count', 'hit_rate', b'hit_rate', 'hit_rate_count', b'hit_rate_count', 'mae', b'mae', 'mae_pit', b'mae_pit', 'mape', b'mape', 'mape_pit', b'mape_pit', 'model_quality', b'model_quality', 'prediction', b'prediction', 'prediction_yoy_abs', b'prediction_yoy_abs', 'prediction_yoy_rel', b'prediction_yoy_rel', 'revision_1_month', b'revision_1_month', 'revision_1_week', b'revision_1_week']) -> None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_consensus', b'_consensus']) -> typing.Literal['consensus'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_consensus_yoy_abs', b'_consensus_yoy_abs']) -> typing.Literal['consensus_yoy_abs'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_consensus_yoy_rel', b'_consensus_yoy_rel']) -> typing.Literal['consensus_yoy_rel'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_delta_abs', b'_delta_abs']) -> typing.Literal['delta_abs'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_delta_by_error', b'_delta_by_error']) -> typing.Literal['delta_by_error'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_delta_rel', b'_delta_rel']) -> typing.Literal['delta_rel'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_error_count', b'_error_count']) -> typing.Literal['error_count'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_hit_rate', b'_hit_rate']) -> typing.Literal['hit_rate'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_hit_rate_count', b'_hit_rate_count']) -> typing.Literal['hit_rate_count'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_mae', b'_mae']) -> typing.Literal['mae'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_mae_pit', b'_mae_pit']) -> typing.Literal['mae_pit'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_mape', b'_mape']) -> typing.Literal['mape'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_mape_pit', b'_mape_pit']) -> typing.Literal['mape_pit'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_prediction', b'_prediction']) -> typing.Literal['prediction'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_prediction_yoy_abs', b'_prediction_yoy_abs']) -> typing.Literal['prediction_yoy_abs'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_prediction_yoy_rel', b'_prediction_yoy_rel']) -> typing.Literal['prediction_yoy_rel'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_revision_1_month', b'_revision_1_month']) -> typing.Literal['revision_1_month'] | None: - ... - - @typing.overload - def WhichOneof(self, oneof_group: typing.Literal['_revision_1_week', b'_revision_1_week']) -> typing.Literal['revision_1_week'] | None: - ... -global___KpiModelData = KpiModelData - -@typing.final -class KpiModelWeightGroups(google.protobuf.message.Message): - """KPI model weight groups.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - WEIGHT_GROUPS_FIELD_NUMBER: builtins.int - IS_COEFFICIENTS_FIELD_NUMBER: builtins.int - is_coefficients: builtins.bool - 'Whether the weights are coefficients that should be formatted as decimal numbers.\n If false, the weights are normalized weights that add up to 1.\n ' - - @property - def weight_groups(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiModelWeightGroup]: - """Weights for all predictors in the model.""" - - def __init__(self, *, weight_groups: collections.abc.Iterable[global___KpiModelWeightGroup] | None=..., is_coefficients: builtins.bool | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['is_coefficients', b'is_coefficients', 'weight_groups', b'weight_groups']) -> None: - ... -global___KpiModelWeightGroups = KpiModelWeightGroups - -@typing.final -class KpiModelWeightGroup(google.protobuf.message.Message): - """Weight for a group of related KPI model input features.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - DISPLAY_NAME_FIELD_NUMBER: builtins.int - GROUP_FIELD_NUMBER: builtins.int - FEATURE_WEIGHTS_FIELD_NUMBER: builtins.int - display_name: builtins.str - "Display name of the model input feature/predictor.\n For ratio prediction models, this is either 'Baseline' (representing the predictor built by forecasting\n the KPI time series) or it is the display name of the KPI mapping group from which the predictor originates.\n For other model types, display names include 'Seasonality' and 'Reported KPI (lagged)'.\n " - - @property - def group(self) -> global___KpiMappingGroupReference: - """The KPI mapping group from which the predictor originates. - Only set when the predictor originates from a KPI mapping group. - """ - - @property - def feature_weights(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiModelFeatureWeight]: - """The individual feature weights.""" - - def __init__(self, *, display_name: builtins.str | None=..., group: global___KpiMappingGroupReference | None=..., feature_weights: collections.abc.Iterable[global___KpiModelFeatureWeight] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['group', b'group']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['display_name', b'display_name', 'feature_weights', b'feature_weights', 'group', b'group']) -> None: - ... -global___KpiModelWeightGroup = KpiModelWeightGroup - -@typing.final -class KpiModelFeatureWeight(google.protobuf.message.Message): - """Weight for a single KPI model input feature.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - WEIGHT_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - weight: builtins.float - 'The weight of the input feature.' - display_name: builtins.str - "Display name of the feature.\n If there is only a single feature weight, this is identical to the `KpiModelWeightGroup.display_name`.\n If there are multiple feature weights, this is the display name of the feature. For example,\n for seasonality, the individual feature weights may include 'Q1', 'Q2', 'Q3', 'Q4' (for the quarter features).\n " - - def __init__(self, *, weight: builtins.float | None=..., display_name: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_weight', b'_weight', 'weight', b'weight']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_weight', b'_weight', 'display_name', b'display_name', 'weight', b'weight']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_weight', b'_weight']) -> typing.Literal['weight'] | None: - ... -global___KpiModelFeatureWeight = KpiModelFeatureWeight - -@typing.final -class FiscalPeriod(google.protobuf.message.Message): - """Represents a fiscal period.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - END_DATE_FIELD_NUMBER: builtins.int - LABEL_FIELD_NUMBER: builtins.int - REPORT_DATE_FIELD_NUMBER: builtins.int - label: builtins.str - 'The fiscal period label. Examples: 1Q-2003, 2H-1997, FY-2029.' - - @property - def end_date(self) -> exabel.api.time.date_pb2.Date: - """The last date of the fiscal period.""" - - @property - def report_date(self) -> exabel.api.time.date_pb2.Date: - """The report date of the fiscal period.""" - - def __init__(self, *, end_date: exabel.api.time.date_pb2.Date | None=..., label: builtins.str | None=..., report_date: exabel.api.time.date_pb2.Date | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_label', b'_label', 'end_date', b'end_date', 'label', b'label', 'report_date', b'report_date']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_label', b'_label', 'end_date', b'end_date', 'label', b'label', 'report_date', b'report_date']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_label', b'_label']) -> typing.Literal['label'] | None: - ... -global___FiscalPeriod = FiscalPeriod - -@typing.final -class FiscalPeriodSelector(google.protobuf.message.Message): - """Selector for a fiscal period.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - RELATIVE_SELECTOR_FIELD_NUMBER: builtins.int - PERIOD_END_FIELD_NUMBER: builtins.int - FREQ_FIELD_NUMBER: builtins.int - relative_selector: global___RelativeFiscalPeriodSelector.ValueType - 'Relative fiscal period.' - freq: builtins.str - 'Fiscal period frequency.\n Allowed values are empty, "FQ", "FS" and "FY".\n Must be set to either "FQ", "FS" or "FY" if `period_end` is specified.\n If empty, frequency is determined based on KPI counts. The frequency\n with the most number of KPIs with mappings for the user is used.\n ' - - @property - def period_end(self) -> exabel.api.time.date_pb2.Date: - """Specific fiscal period end.""" - - def __init__(self, *, relative_selector: global___RelativeFiscalPeriodSelector.ValueType | None=..., period_end: exabel.api.time.date_pb2.Date | None=..., freq: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['period_end', b'period_end']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['freq', b'freq', 'period_end', b'period_end', 'relative_selector', b'relative_selector']) -> None: - ... -global___FiscalPeriodSelector = FiscalPeriodSelector - -@typing.final -class KpiHierarchy(google.protobuf.message.Message): - """Represents a hierarchy of KPIs for a specific company.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - FREQ_FIELD_NUMBER: builtins.int - BREAKDOWN_FIELD_NUMBER: builtins.int - name: builtins.str - 'The resource name of the KPI hierarchy, e.g., "kpiHierarchies/135".' - freq: builtins.str - 'The frequency of the KPIs in this hierarchy.' - - @property - def breakdown(self) -> global___KpiBreakdown: - """A breakdown of the KPIs.""" - - def __init__(self, *, name: builtins.str | None=..., freq: builtins.str | None=..., breakdown: global___KpiBreakdown | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['breakdown', b'breakdown']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['breakdown', b'breakdown', 'freq', b'freq', 'name', b'name']) -> None: - ... -global___KpiHierarchy = KpiHierarchy - -@typing.final -class KpiBreakdown(google.protobuf.message.Message): - """A breakdown of the KPIs.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KPIS_FIELD_NUMBER: builtins.int - - @property - def kpis(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiBreakdownNode]: - """The top-level nodes in the breakdown, each of which represents a KPI.""" - - def __init__(self, *, kpis: collections.abc.Iterable[global___KpiBreakdownNode] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['kpis', b'kpis']) -> None: - ... -global___KpiBreakdown = KpiBreakdown - -@typing.final -class KpiBreakdownNode(google.protobuf.message.Message): - """A node in the tree representing the breakdown of a KPI.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - KPI_FIELD_NUMBER: builtins.int - HEADER_FIELD_NUMBER: builtins.int - CHILDREN_FIELD_NUMBER: builtins.int - header: builtins.str - 'The string representing this node, when the node represents a grouping of KPIs and not a\n single one.\n ' - - @property - def kpi(self) -> global___Kpi: - """The KPI represented by this node. - Only StructuredKpi is supported, and only the KPI type and the value should be set. - """ - - @property - def children(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___KpiBreakdownNode]: - """The children of this node.""" - - def __init__(self, *, kpi: global___Kpi | None=..., header: builtins.str | None=..., children: collections.abc.Iterable[global___KpiBreakdownNode] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['content', b'content', 'header', b'header', 'kpi', b'kpi']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['children', b'children', 'content', b'content', 'header', b'header', 'kpi', b'kpi']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['content', b'content']) -> typing.Literal['kpi', 'header'] | None: - ... -global___KpiBreakdownNode = KpiBreakdownNode - -@typing.final -class KpiScreenCompanyResult(google.protobuf.message.Message): - """KPI screen results for a single company.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - COMPANY_FIELD_NUMBER: builtins.int - FISCAL_PERIOD_FIELD_NUMBER: builtins.int - RESULTS_FIELD_NUMBER: builtins.int - - @property - def company(self) -> global___Company: - """The company.""" - - @property - def fiscal_period(self) -> global___FiscalPeriod: - """The fiscal period for this result.""" - - @property - def results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CompanyKpiModelResult]: - """KPI model results for this company.""" - - def __init__(self, *, company: global___Company | None=..., fiscal_period: global___FiscalPeriod | None=..., results: collections.abc.Iterable[global___CompanyKpiModelResult] | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['company', b'company', 'fiscal_period', b'fiscal_period']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['company', b'company', 'fiscal_period', b'fiscal_period', 'results', b'results']) -> None: - ... -global___KpiScreenCompanyResult = KpiScreenCompanyResult \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2_grpc.py deleted file mode 100644 index 4fae9255..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/kpi_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_service_pb2.py deleted file mode 100644 index 5e3c12e9..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/kpi_service_pb2.py +++ /dev/null @@ -1,81 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/kpi_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.analytics.v1 import kpi_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_kpi__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/analytics/v1/kpi_service.proto\x12\x17exabel.api.analytics.v1\x1a*exabel/api/analytics/v1/kpi_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x9e\x01\n\x1cListKpiMappingResultsRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0ekpiMappingName\xe0A\x02\x12>\n\tpage_size\x18\x02 \x01(\x05B+\x92A(2&Maximum number of companies to return.\x12\x12\n\npage_token\x18\x03 \x01(\t"\x90\x01\n\x1dListKpiMappingResultsResponse\x12B\n\x07results\x18\x01 \x03(\x0b21.exabel.api.analytics.v1.CompanyKpiMappingResults\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"\xc8\x01\n"ListCompanyBaseModelResultsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02\x12=\n\x06period\x18\x02 \x01(\x0b2-.exabel.api.analytics.v1.FiscalPeriodSelector\x12:\n\nkpi_source\x18\x03 \x01(\x0e2".exabel.api.analytics.v1.KpiSourceB\x02\x18\x01"\x9d\x01\n#ListCompanyBaseModelResultsResponse\x12?\n\x07results\x18\x01 \x03(\x0b2..exabel.api.analytics.v1.CompanyKpiModelResult\x125\n\x06period\x18\x02 \x01(\x0b2%.exabel.api.analytics.v1.FiscalPeriod"\xd0\x01\n*ListCompanyHierarchicalModelResultsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02\x12=\n\x06period\x18\x02 \x01(\x0b2-.exabel.api.analytics.v1.FiscalPeriodSelector\x12:\n\nkpi_source\x18\x03 \x01(\x0e2".exabel.api.analytics.v1.KpiSourceB\x02\x18\x01"\xe3\x01\n+ListCompanyHierarchicalModelResultsResponse\x12?\n\x07results\x18\x01 \x03(\x0b2..exabel.api.analytics.v1.CompanyKpiModelResult\x12<\n\rkpi_hierarchy\x18\x02 \x01(\x0b2%.exabel.api.analytics.v1.KpiHierarchy\x125\n\x06period\x18\x03 \x01(\x0b2%.exabel.api.analytics.v1.FiscalPeriod"~\n#ListCompanyKpiMappingResultsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02\x12.\n\x03kpi\x18\x02 \x01(\x0b2\x1c.exabel.api.analytics.v1.KpiB\x03\xe0A\x02"f\n$ListCompanyKpiMappingResultsResponse\x12>\n\x07results\x18\x01 \x03(\x0b2-.exabel.api.analytics.v1.KpiMappingResultData"|\n!ListCompanyKpiModelResultsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02\x12.\n\x03kpi\x18\x02 \x01(\x0b2\x1c.exabel.api.analytics.v1.KpiB\x03\xe0A\x02"\x9c\x02\n"ListCompanyKpiModelResultsResponse\x127\n\x0cexabel_model\x18\x01 \x01(\x0b2!.exabel.api.analytics.v1.KpiModel\x12=\n\x12hierarchical_model\x18\x02 \x01(\x0b2!.exabel.api.analytics.v1.KpiModel\x128\n\rcustom_models\x18\x03 \x03(\x0b2!.exabel.api.analytics.v1.KpiModel\x12D\n\x12kpi_mapping_models\x18\x04 \x03(\x0b2(.exabel.api.analytics.v1.KpiMappingModel"\x9a\x01\n\x1bListKpiScreenResultsRequest\x12\'\n\x04name\x18\x01 \x01(\tB\x19\x92A\x13\xca>\x10\xfa\x02\rkpiScreenName\xe0A\x02\x12>\n\tpage_size\x18\x02 \x01(\x05B+\x92A(2&Maximum number of companies to return.\x12\x12\n\npage_token\x18\x03 \x01(\t"\x8d\x01\n\x1cListKpiScreenResultsResponse\x12@\n\x07results\x18\x01 \x03(\x0b2/.exabel.api.analytics.v1.KpiScreenCompanyResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x052\xe5\x0b\n\nKpiService\x12\xcf\x01\n\x15ListKpiMappingResults\x125.exabel.api.analytics.v1.ListKpiMappingResultsRequest\x1a6.exabel.api.analytics.v1.ListKpiMappingResultsResponse"G\x92A\x1a\x12\x18List KPI mapping results\x82\xd3\xe4\x93\x02$\x12"/v1/{parent=kpiMappings/*}/results\x12\x82\x02\n\x1bListCompanyBaseModelResults\x12;.exabel.api.analytics.v1.ListCompanyBaseModelResultsRequest\x1a<.exabel.api.analytics.v1.ListCompanyBaseModelResultsResponse"h\x92A!\x12\x1fList company base model results\x82\xd3\xe4\x93\x02>\x12\x11\xfa\x02\x0ekpiMappingName\xe0A\x02' - _globals['_LISTKPIMAPPINGRESULTSREQUEST'].fields_by_name['page_size']._loaded_options = None - _globals['_LISTKPIMAPPINGRESULTSREQUEST'].fields_by_name['page_size']._serialized_options = b'\x92A(2&Maximum number of companies to return.' - _globals['_LISTCOMPANYBASEMODELRESULTSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTCOMPANYBASEMODELRESULTSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02' - _globals['_LISTCOMPANYBASEMODELRESULTSREQUEST'].fields_by_name['kpi_source']._loaded_options = None - _globals['_LISTCOMPANYBASEMODELRESULTSREQUEST'].fields_by_name['kpi_source']._serialized_options = b'\x18\x01' - _globals['_LISTCOMPANYHIERARCHICALMODELRESULTSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTCOMPANYHIERARCHICALMODELRESULTSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02' - _globals['_LISTCOMPANYHIERARCHICALMODELRESULTSREQUEST'].fields_by_name['kpi_source']._loaded_options = None - _globals['_LISTCOMPANYHIERARCHICALMODELRESULTSREQUEST'].fields_by_name['kpi_source']._serialized_options = b'\x18\x01' - _globals['_LISTCOMPANYKPIMAPPINGRESULTSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTCOMPANYKPIMAPPINGRESULTSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02' - _globals['_LISTCOMPANYKPIMAPPINGRESULTSREQUEST'].fields_by_name['kpi']._loaded_options = None - _globals['_LISTCOMPANYKPIMAPPINGRESULTSREQUEST'].fields_by_name['kpi']._serialized_options = b'\xe0A\x02' - _globals['_LISTCOMPANYKPIMODELRESULTSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTCOMPANYKPIMODELRESULTSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02' - _globals['_LISTCOMPANYKPIMODELRESULTSREQUEST'].fields_by_name['kpi']._loaded_options = None - _globals['_LISTCOMPANYKPIMODELRESULTSREQUEST'].fields_by_name['kpi']._serialized_options = b'\xe0A\x02' - _globals['_LISTKPISCREENRESULTSREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_LISTKPISCREENRESULTSREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x13\xca>\x10\xfa\x02\rkpiScreenName\xe0A\x02' - _globals['_LISTKPISCREENRESULTSREQUEST'].fields_by_name['page_size']._loaded_options = None - _globals['_LISTKPISCREENRESULTSREQUEST'].fields_by_name['page_size']._serialized_options = b'\x92A(2&Maximum number of companies to return.' - _globals['_KPISERVICE'].methods_by_name['ListKpiMappingResults']._loaded_options = None - _globals['_KPISERVICE'].methods_by_name['ListKpiMappingResults']._serialized_options = b'\x92A\x1a\x12\x18List KPI mapping results\x82\xd3\xe4\x93\x02$\x12"/v1/{parent=kpiMappings/*}/results' - _globals['_KPISERVICE'].methods_by_name['ListCompanyBaseModelResults']._loaded_options = None - _globals['_KPISERVICE'].methods_by_name['ListCompanyBaseModelResults']._serialized_options = b'\x92A!\x12\x1fList company base model results\x82\xd3\xe4\x93\x02>\x12={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class KpiServiceStub(object): - """Service to retrieve KPI results. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListKpiMappingResults = channel.unary_unary('/exabel.api.analytics.v1.KpiService/ListKpiMappingResults', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsResponse.FromString, _registered_method=True) - self.ListCompanyBaseModelResults = channel.unary_unary('/exabel.api.analytics.v1.KpiService/ListCompanyBaseModelResults', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsResponse.FromString, _registered_method=True) - self.ListCompanyHierarchicalModelResults = channel.unary_unary('/exabel.api.analytics.v1.KpiService/ListCompanyHierarchicalModelResults', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsResponse.FromString, _registered_method=True) - self.ListCompanyKpiMappingResults = channel.unary_unary('/exabel.api.analytics.v1.KpiService/ListCompanyKpiMappingResults', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsResponse.FromString, _registered_method=True) - self.ListCompanyKpiModelResults = channel.unary_unary('/exabel.api.analytics.v1.KpiService/ListCompanyKpiModelResults', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsResponse.FromString, _registered_method=True) - self.ListKpiScreenResults = channel.unary_unary('/exabel.api.analytics.v1.KpiService/ListKpiScreenResults', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsResponse.FromString, _registered_method=True) - -class KpiServiceServicer(object): - """Service to retrieve KPI results. - """ - - def ListKpiMappingResults(self, request, context): - """List KPI mapping results for a single KPI mapping collection. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListCompanyBaseModelResults(self, request, context): - """List base model results for a company. - - Returns results for all modeled KPIs for the given company. This is provided as a list of KPIs, - with the latest model predictions and metadata for each KPI. - - Base models work by modeling each KPI independently, using the vendor alternative data - available to your customer/user, and combining the best signals for that KPI. - - The default "Exabel Model" that you see for all KPIs is a base model. If you have trained a - custom model and set that as your primary model for the KPI, you may see that returned instead. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListCompanyHierarchicalModelResults(self, request, context): - """List hierarchical model results for a company. - - Returns results for all modeled KPIs for the given company. This is provided as a list of KPIs, - with the latest model predictions and metadata for each KPI. - - Hierarchical models build on top of the base models by harmonizing their predictions with - knowledge of each company's financial model, e.g. Total revenue = Segment A + Segment B + ... - This produces more accurate predictions that are coherent across all segments. Note that - consensus may be used for KPIs for which you have no alternative data; this is denoted in the - metadata. Hierarchical models are only available for some companies - contact - support@exabel.com with requests. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListCompanyKpiMappingResults(self, request, context): - """List KPI mapping results for a single company KPI. - - Returns the statistical test results of all KPI mappings for a given company KPI. This is - provided as a list of KPI mappings, each with the model backtest MAPE/MAE, correlation scores, - MAEs, and p-values. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListCompanyKpiModelResults(self, request, context): - """List model results for a single company KPI. - - Returns all models for a given company KPI. This includes: all single-predictor models derived - from each individual KPI mapping; the Exabel model that is an automatic ensemble of the best - single-predictor models; any custom models you train; and the hierarchical model (if available) - that harmonizes model predictions across a company's KPIs as the final modeling layer. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListKpiScreenResults(self, request, context): - """List KPI screen results. - - Returns results from a saved KPI screen. This is provided as a list of companies and their KPIs - that meet the screen criteria, with the latest model predictions and metadata for each KPI. - - As KPI screens are private to each user, you should authenticate with a user-level access - token, rather than the customer-level API key (which will not have access to individual users' - KPI screens). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_KpiServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListKpiMappingResults': grpc.unary_unary_rpc_method_handler(servicer.ListKpiMappingResults, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsResponse.SerializeToString), 'ListCompanyBaseModelResults': grpc.unary_unary_rpc_method_handler(servicer.ListCompanyBaseModelResults, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsResponse.SerializeToString), 'ListCompanyHierarchicalModelResults': grpc.unary_unary_rpc_method_handler(servicer.ListCompanyHierarchicalModelResults, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsResponse.SerializeToString), 'ListCompanyKpiMappingResults': grpc.unary_unary_rpc_method_handler(servicer.ListCompanyKpiMappingResults, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsResponse.SerializeToString), 'ListCompanyKpiModelResults': grpc.unary_unary_rpc_method_handler(servicer.ListCompanyKpiModelResults, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsResponse.SerializeToString), 'ListKpiScreenResults': grpc.unary_unary_rpc_method_handler(servicer.ListKpiScreenResults, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsResponse.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.analytics.v1.KpiService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.analytics.v1.KpiService', rpc_method_handlers) - -class KpiService(object): - """Service to retrieve KPI results. - """ - - @staticmethod - def ListKpiMappingResults(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiService/ListKpiMappingResults', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiMappingResultsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListCompanyBaseModelResults(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiService/ListCompanyBaseModelResults', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyBaseModelResultsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListCompanyHierarchicalModelResults(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiService/ListCompanyHierarchicalModelResults', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyHierarchicalModelResultsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListCompanyKpiMappingResults(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiService/ListCompanyKpiMappingResults', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiMappingResultsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListCompanyKpiModelResults(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiService/ListCompanyKpiModelResults', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListCompanyKpiModelResultsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListKpiScreenResults(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.KpiService/ListKpiScreenResults', exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_kpi__service__pb2.ListKpiScreenResultsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.py deleted file mode 100644 index 9c4344d1..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/prediction_model_messages.proto') -_sym_db = _symbol_database.Default() -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n7exabel/api/analytics/v1/prediction_model_messages.proto\x12\x17exabel.api.analytics.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x96\x02\n\x12PredictionModelRun\x123\n\x04name\x18\x01 \x01(\tB%\x92A\x1fJ\x1d"predictionModels/123/runs/3"\xe0A\x03\x124\n\x0bdescription\x18\x02 \x01(\tB\x1f\x92A\x1cJ\x1a"Initiated by API request"\x12B\n\rconfiguration\x18\x03 \x01(\x0e2+.exabel.api.analytics.v1.ModelConfiguration\x12!\n\x14configuration_source\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\rauto_activate\x18\x05 \x01(\x08B\x17\n\x15_configuration_source*e\n\x12ModelConfiguration\x12%\n!MODEL_CONFIGURATION_NOT_SPECIFIED\x10\x00\x12\n\n\x06LATEST\x10\x01\x12\n\n\x06ACTIVE\x10\x02\x12\x10\n\x0cSPECIFIC_RUN\x10\x03BZ\n\x1bcom.exabel.api.analytics.v1B\x1cPredictionModelMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.prediction_model_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x1cPredictionModelMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_PREDICTIONMODELRUN'].fields_by_name['name']._loaded_options = None - _globals['_PREDICTIONMODELRUN'].fields_by_name['name']._serialized_options = b'\x92A\x1fJ\x1d"predictionModels/123/runs/3"\xe0A\x03' - _globals['_PREDICTIONMODELRUN'].fields_by_name['description']._loaded_options = None - _globals['_PREDICTIONMODELRUN'].fields_by_name['description']._serialized_options = b'\x92A\x1cJ\x1a"Initiated by API request"' - _globals['_MODELCONFIGURATION']._serialized_start = 446 - _globals['_MODELCONFIGURATION']._serialized_end = 547 - _globals['_PREDICTIONMODELRUN']._serialized_start = 166 - _globals['_PREDICTIONMODELRUN']._serialized_end = 444 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.pyi deleted file mode 100644 index 9097b10e..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2.pyi +++ /dev/null @@ -1,77 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2022 Exabel AS. All rights reserved.""" -import builtins -import google.protobuf.descriptor -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message -import sys -import typing -if sys.version_info >= (3, 10): - import typing as typing_extensions -else: - import typing_extensions -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _ModelConfiguration: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _ModelConfigurationEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ModelConfiguration.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - MODEL_CONFIGURATION_NOT_SPECIFIED: _ModelConfiguration.ValueType - 'Not specified - defaults to use the latest configuration.' - LATEST: _ModelConfiguration.ValueType - 'Latest configuration.' - ACTIVE: _ModelConfiguration.ValueType - 'Configuration of the active run. A specific run may be activated from the prediction model user interface.' - SPECIFIC_RUN: _ModelConfiguration.ValueType - 'Configuration of a specific run. The run number must be specified as well.' - -class ModelConfiguration(_ModelConfiguration, metaclass=_ModelConfigurationEnumTypeWrapper): - """Specifies which model configuration to use. If not specified, the latest model configuration is used. - Note that the current signal library is always loaded. - """ -MODEL_CONFIGURATION_NOT_SPECIFIED: ModelConfiguration.ValueType -'Not specified - defaults to use the latest configuration.' -LATEST: ModelConfiguration.ValueType -'Latest configuration.' -ACTIVE: ModelConfiguration.ValueType -'Configuration of the active run. A specific run may be activated from the prediction model user interface.' -SPECIFIC_RUN: ModelConfiguration.ValueType -'Configuration of a specific run. The run number must be specified as well.' -global___ModelConfiguration = ModelConfiguration - -@typing.final -class PredictionModelRun(google.protobuf.message.Message): - """A prediction model run.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - CONFIGURATION_FIELD_NUMBER: builtins.int - CONFIGURATION_SOURCE_FIELD_NUMBER: builtins.int - AUTO_ACTIVATE_FIELD_NUMBER: builtins.int - name: builtins.str - 'Unique resource name of the run, e.g. `predictionModels/123/runs/3`.' - description: builtins.str - 'You may use this to record some notes about the run. This is shown in the prediction model\n interface when viewing all runs, and when viewing the results of a single run.\n ' - configuration: global___ModelConfiguration.ValueType - 'Which model configuration to use. If not specified, the latest model configuration is used.\n Note that the current signal library is always loaded.\n ' - configuration_source: builtins.int - 'Prediction model run number from which model configuration should be retrieved, e.g. `1`.\n Only relevant when `configuration` is set to `ModelConfiguration.SPECIFIC_RUN`.\n ' - auto_activate: builtins.bool - 'Whether to automatically set this run as active once it completes.\n The run will not be activated if it fails for any of the entities in the model.\n ' - - def __init__(self, *, name: builtins.str | None=..., description: builtins.str | None=..., configuration: global___ModelConfiguration.ValueType | None=..., configuration_source: builtins.int | None=..., auto_activate: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_configuration_source', b'_configuration_source', 'configuration_source', b'configuration_source']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_configuration_source', b'_configuration_source', 'auto_activate', b'auto_activate', 'configuration', b'configuration', 'configuration_source', b'configuration_source', 'description', b'description', 'name', b'name']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_configuration_source', b'_configuration_source']) -> typing.Literal['configuration_source'] | None: - ... -global___PredictionModelRun = PredictionModelRun \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2_grpc.py deleted file mode 100644 index b901142a..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/prediction_model_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.py deleted file mode 100644 index dceb9463..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/prediction_model_service_pb2.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/prediction_model_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.analytics.v1 import prediction_model_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_prediction__model__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n6exabel/api/analytics/v1/prediction_model_service.proto\x12\x17exabel.api.analytics.v1\x1a7exabel/api/analytics/v1/prediction_model_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x91\x01\n\x1fCreatePredictionModelRunRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\x92A\x19\xca>\x16\xfa\x02\x13predictionModelName\xe0A\x02\x12=\n\x03run\x18\x02 \x01(\x0b2+.exabel.api.analytics.v1.PredictionModelRunB\x03\xe0A\x022\xe8\x01\n\x16PredictionModelService\x12\xcd\x01\n\x18CreatePredictionModelRun\x128.exabel.api.analytics.v1.CreatePredictionModelRunRequest\x1a+.exabel.api.analytics.v1.PredictionModelRun"J\x92A\x16\x12\x14Run prediction model\x82\xd3\xe4\x93\x02+"$/v1/{parent=predictionModels/*}/runs:\x03runBY\n\x1bcom.exabel.api.analytics.v1B\x1bPredictionModelServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.prediction_model_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x1bPredictionModelServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_CREATEPREDICTIONMODELRUNREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_CREATEPREDICTIONMODELRUNREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x19\xca>\x16\xfa\x02\x13predictionModelName\xe0A\x02' - _globals['_CREATEPREDICTIONMODELRUNREQUEST'].fields_by_name['run']._loaded_options = None - _globals['_CREATEPREDICTIONMODELRUNREQUEST'].fields_by_name['run']._serialized_options = b'\xe0A\x02' - _globals['_PREDICTIONMODELSERVICE'].methods_by_name['CreatePredictionModelRun']._loaded_options = None - _globals['_PREDICTIONMODELSERVICE'].methods_by_name['CreatePredictionModelRun']._serialized_options = b'\x92A\x16\x12\x14Run prediction model\x82\xd3\xe4\x93\x02+"$/v1/{parent=predictionModels/*}/runs:\x03run' - _globals['_CREATEPREDICTIONMODELRUNREQUEST']._serialized_start = 252 - _globals['_CREATEPREDICTIONMODELRUNREQUEST']._serialized_end = 397 - _globals['_PREDICTIONMODELSERVICE']._serialized_start = 400 - _globals['_PREDICTIONMODELSERVICE']._serialized_end = 632 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2.py deleted file mode 100644 index a6cf2394..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/service.proto') -_sym_db = _symbol_database.Default() -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%exabel/api/analytics/v1/service.proto\x12\x17exabel.api.analytics.v1\x1a.protoc_gen_openapiv2/options/annotations.protoB\xa9\x03\n\x1bcom.exabel.api.analytics.v1B\x0cServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1\x92A\xdb\x02\x12T\n\x14Exabel Analytics API"5\n\x06Exabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x051.0.0\x1a\x18analytics.api.exabel.com*\x01\x022\x10application/json:\x10application/jsonZR\n#\n\x07API key\x12\x18\x08\x02\x12\x07API key\x1a\tx-api-key \x02\n+\n\x06Bearer\x12!\x08\x02\x12\x0cAccess token\x1a\rauthorization \x02b\r\n\x0b\n\x07API key\x12\x00b\x0c\n\n\n\x06Bearer\x12\x00rQ\n#More about the Exabel Analytics API\x12*https://help.exabel.com/docs/analytics-apib\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x0cServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1\x92A\xdb\x02\x12T\n\x14Exabel Analytics API"5\n\x06Exabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x051.0.0\x1a\x18analytics.api.exabel.com*\x01\x022\x10application/json:\x10application/jsonZR\n#\n\x07API key\x12\x18\x08\x02\x12\x07API key\x1a\tx-api-key \x02\n+\n\x06Bearer\x12!\x08\x02\x12\x0cAccess token\x1a\rauthorization \x02b\r\n\x0b\n\x07API key\x12\x00b\x0c\n\n\n\x06Bearer\x12\x00rQ\n#More about the Exabel Analytics API\x12*https://help.exabel.com/docs/analytics-api' \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2_grpc.py deleted file mode 100644 index 3fd1dbd1..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/service_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2.py deleted file mode 100644 index bf8975d9..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/tag_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.analytics.v1 import item_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_item__messages__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/analytics/v1/tag_messages.proto\x12\x17exabel.api.analytics.v1\x1a+exabel/api/analytics/v1/item_messages.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\xc5\x01\n\x03Tag\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0A\x03\x12#\n\x0cdisplay_name\x18\x02 \x01(\tB\r\x92A\nJ\x08"My tag"\x12.\n\x0bdescription\x18\x03 \x01(\tB\x19\x92A\x16J\x14"My tag description"\x12\x18\n\x0bentity_type\x18\x04 \x01(\tB\x03\xe0A\x03\x12<\n\x08metadata\x18\x05 \x01(\x0b2%.exabel.api.analytics.v1.ItemMetadataB\x03\xe0A\x03BN\n\x1bcom.exabel.api.analytics.v1B\x10TagMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.tag_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x10TagMessagesProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_TAG'].fields_by_name['name']._loaded_options = None - _globals['_TAG'].fields_by_name['name']._serialized_options = b'\xe0A\x03' - _globals['_TAG'].fields_by_name['display_name']._loaded_options = None - _globals['_TAG'].fields_by_name['display_name']._serialized_options = b'\x92A\nJ\x08"My tag"' - _globals['_TAG'].fields_by_name['description']._loaded_options = None - _globals['_TAG'].fields_by_name['description']._serialized_options = b'\x92A\x16J\x14"My tag description"' - _globals['_TAG'].fields_by_name['entity_type']._loaded_options = None - _globals['_TAG'].fields_by_name['entity_type']._serialized_options = b'\xe0A\x03' - _globals['_TAG'].fields_by_name['metadata']._loaded_options = None - _globals['_TAG'].fields_by_name['metadata']._serialized_options = b'\xe0A\x03' - _globals['_TAG']._serialized_start = 198 - _globals['_TAG']._serialized_end = 395 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2.pyi deleted file mode 100644 index aeb74d21..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2.pyi +++ /dev/null @@ -1,42 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -""" -import builtins -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.message -import typing -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class Tag(google.protobuf.message.Message): - """Represents a tag.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - ENTITY_TYPE_FIELD_NUMBER: builtins.int - METADATA_FIELD_NUMBER: builtins.int - name: builtins.str - 'Unique resource name of the tag, e.g. `tags/user:806f697b-e9fa-4443-9f92-ba46e5b60930`.' - display_name: builtins.str - 'Display name of the tag. This is shown wherever the tag is used in the Exabel app.' - description: builtins.str - 'You may use this to provide more information about the tag. This is shown in the Library when\n browsing for tags.\n ' - entity_type: builtins.str - "Resource name of the tag's entity type.\n\n Tags can only contain entities of one entity type. For new tags, this is set once the first\n entity is added.\n " - - @property - def metadata(self) -> exabel.api.analytics.v1.item_messages_pb2.ItemMetadata: - """Metadata about the tag.""" - - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., description: builtins.str | None=..., entity_type: builtins.str | None=..., metadata: exabel.api.analytics.v1.item_messages_pb2.ItemMetadata | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['metadata', b'metadata']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'display_name', b'display_name', 'entity_type', b'entity_type', 'metadata', b'metadata', 'name', b'name']) -> None: - ... -global___Tag = Tag \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2_grpc.py deleted file mode 100644 index 91d0f7dc..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/tag_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2.py deleted file mode 100644 index d4e47e2c..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2.py +++ /dev/null @@ -1,81 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/analytics/v1/tag_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.analytics.v1 import tag_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/analytics/v1/tag_service.proto\x12\x17exabel.api.analytics.v1\x1a*exabel/api/analytics/v1/tag_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"R\n\x10CreateTagRequest\x12.\n\x03tag\x18\x01 \x01(\x0b2\x1c.exabel.api.analytics.v1.TagB\x03\xe0A\x02\x12\x0e\n\x06folder\x18\x02 \x01(\t"2\n\rGetTagRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02"s\n\x10UpdateTagRequest\x12.\n\x03tag\x18\x01 \x01(\x0b2\x1c.exabel.api.analytics.v1.TagB\x03\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask"5\n\x10DeleteTagRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02"`\n\x0fListTagsRequest\x129\n\tpage_size\x18\x01 \x01(\x05B&\x92A#2!Maximum number of tags to return.\x12\x12\n\npage_token\x18\x02 \x01(\t"k\n\x10ListTagsResponse\x12*\n\x04tags\x18\x01 \x03(\x0b2\x1c.exabel.api.analytics.v1.Tag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"M\n\x12AddEntitiesRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02\x12\x14\n\x0centity_names\x18\x02 \x03(\t"\x15\n\x13AddEntitiesResponse"P\n\x15RemoveEntitiesRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02\x12\x14\n\x0centity_names\x18\x02 \x03(\t"\x18\n\x16RemoveEntitiesResponse"\x90\x01\n\x16ListTagEntitiesRequest\x12#\n\x06parent\x18\x01 \x01(\tB\x13\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02\x12=\n\tpage_size\x18\x02 \x01(\x05B*\x92A\'2%Maximum number of entities to return.\x12\x12\n\npage_token\x18\x03 \x01(\t"\\\n\x17ListTagEntitiesResponse\x12\x14\n\x0centity_names\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x052\xa5\t\n\nTagService\x12z\n\tCreateTag\x12).exabel.api.analytics.v1.CreateTagRequest\x1a\x1c.exabel.api.analytics.v1.Tag"$\x92A\x0c\x12\nCreate tag\x82\xd3\xe4\x93\x02\x0f"\x08/v1/tags:\x03tag\x12u\n\x06GetTag\x12&.exabel.api.analytics.v1.GetTagRequest\x1a\x1c.exabel.api.analytics.v1.Tag"%\x92A\t\x12\x07Get tag\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/{name=tags/*}\x12\x87\x01\n\tUpdateTag\x12).exabel.api.analytics.v1.UpdateTagRequest\x1a\x1c.exabel.api.analytics.v1.Tag"1\x92A\x0c\x12\nUpdate tag\x82\xd3\xe4\x93\x02\x1c2\x15/v1/{tag.name=tags/*}:\x03tag\x12x\n\tDeleteTag\x12).exabel.api.analytics.v1.DeleteTagRequest\x1a\x16.google.protobuf.Empty"(\x92A\x0c\x12\nDelete tag\x82\xd3\xe4\x93\x02\x13*\x11/v1/{name=tags/*}\x12\x7f\n\x08ListTags\x12(.exabel.api.analytics.v1.ListTagsRequest\x1a).exabel.api.analytics.v1.ListTagsResponse"\x1e\x92A\x0b\x12\tList tags\x82\xd3\xe4\x93\x02\n\x12\x08/v1/tags\x12\xaa\x01\n\x0bAddEntities\x12+.exabel.api.analytics.v1.AddEntitiesRequest\x1a,.exabel.api.analytics.v1.AddEntitiesResponse"@\x92A\x15\x12\x13Add entities to tag\x82\xd3\xe4\x93\x02""\x1d/v1/{name=tags/*}:addEntities:\x01*\x12\xbb\x01\n\x0eRemoveEntities\x12..exabel.api.analytics.v1.RemoveEntitiesRequest\x1a/.exabel.api.analytics.v1.RemoveEntitiesResponse"H\x92A\x1a\x12\x18Remove entities from tag\x82\xd3\xe4\x93\x02%" /v1/{name=tags/*}:removeEntities:\x01*\x12\xb3\x01\n\x0fListTagEntities\x12/.exabel.api.analytics.v1.ListTagEntitiesRequest\x1a0.exabel.api.analytics.v1.ListTagEntitiesResponse"=\x92A\x16\x12\x14List entities in tag\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{parent=tags/*}/entitiesBM\n\x1bcom.exabel.api.analytics.v1B\x0fTagServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.analytics.v1.tag_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1bcom.exabel.api.analytics.v1B\x0fTagServiceProtoP\x01Z\x1bexabel.com/api/analytics/v1' - _globals['_CREATETAGREQUEST'].fields_by_name['tag']._loaded_options = None - _globals['_CREATETAGREQUEST'].fields_by_name['tag']._serialized_options = b'\xe0A\x02' - _globals['_GETTAGREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETTAGREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02' - _globals['_UPDATETAGREQUEST'].fields_by_name['tag']._loaded_options = None - _globals['_UPDATETAGREQUEST'].fields_by_name['tag']._serialized_options = b'\xe0A\x02' - _globals['_DELETETAGREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETETAGREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02' - _globals['_LISTTAGSREQUEST'].fields_by_name['page_size']._loaded_options = None - _globals['_LISTTAGSREQUEST'].fields_by_name['page_size']._serialized_options = b'\x92A#2!Maximum number of tags to return.' - _globals['_ADDENTITIESREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_ADDENTITIESREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02' - _globals['_REMOVEENTITIESREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_REMOVEENTITIESREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02' - _globals['_LISTTAGENTITIESREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTTAGENTITIESREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\r\xca>\n\xfa\x02\x07tagName\xe0A\x02' - _globals['_LISTTAGENTITIESREQUEST'].fields_by_name['page_size']._loaded_options = None - _globals['_LISTTAGENTITIESREQUEST'].fields_by_name['page_size']._serialized_options = b"\x92A'2%Maximum number of entities to return." - _globals['_TAGSERVICE'].methods_by_name['CreateTag']._loaded_options = None - _globals['_TAGSERVICE'].methods_by_name['CreateTag']._serialized_options = b'\x92A\x0c\x12\nCreate tag\x82\xd3\xe4\x93\x02\x0f"\x08/v1/tags:\x03tag' - _globals['_TAGSERVICE'].methods_by_name['GetTag']._loaded_options = None - _globals['_TAGSERVICE'].methods_by_name['GetTag']._serialized_options = b'\x92A\t\x12\x07Get tag\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/{name=tags/*}' - _globals['_TAGSERVICE'].methods_by_name['UpdateTag']._loaded_options = None - _globals['_TAGSERVICE'].methods_by_name['UpdateTag']._serialized_options = b'\x92A\x0c\x12\nUpdate tag\x82\xd3\xe4\x93\x02\x1c2\x15/v1/{tag.name=tags/*}:\x03tag' - _globals['_TAGSERVICE'].methods_by_name['DeleteTag']._loaded_options = None - _globals['_TAGSERVICE'].methods_by_name['DeleteTag']._serialized_options = b'\x92A\x0c\x12\nDelete tag\x82\xd3\xe4\x93\x02\x13*\x11/v1/{name=tags/*}' - _globals['_TAGSERVICE'].methods_by_name['ListTags']._loaded_options = None - _globals['_TAGSERVICE'].methods_by_name['ListTags']._serialized_options = b'\x92A\x0b\x12\tList tags\x82\xd3\xe4\x93\x02\n\x12\x08/v1/tags' - _globals['_TAGSERVICE'].methods_by_name['AddEntities']._loaded_options = None - _globals['_TAGSERVICE'].methods_by_name['AddEntities']._serialized_options = b'\x92A\x15\x12\x13Add entities to tag\x82\xd3\xe4\x93\x02""\x1d/v1/{name=tags/*}:addEntities:\x01*' - _globals['_TAGSERVICE'].methods_by_name['RemoveEntities']._loaded_options = None - _globals['_TAGSERVICE'].methods_by_name['RemoveEntities']._serialized_options = b'\x92A\x1a\x12\x18Remove entities from tag\x82\xd3\xe4\x93\x02%" /v1/{name=tags/*}:removeEntities:\x01*' - _globals['_TAGSERVICE'].methods_by_name['ListTagEntities']._loaded_options = None - _globals['_TAGSERVICE'].methods_by_name['ListTagEntities']._serialized_options = b'\x92A\x16\x12\x14List entities in tag\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{parent=tags/*}/entities' - _globals['_CREATETAGREQUEST']._serialized_start = 288 - _globals['_CREATETAGREQUEST']._serialized_end = 370 - _globals['_GETTAGREQUEST']._serialized_start = 372 - _globals['_GETTAGREQUEST']._serialized_end = 422 - _globals['_UPDATETAGREQUEST']._serialized_start = 424 - _globals['_UPDATETAGREQUEST']._serialized_end = 539 - _globals['_DELETETAGREQUEST']._serialized_start = 541 - _globals['_DELETETAGREQUEST']._serialized_end = 594 - _globals['_LISTTAGSREQUEST']._serialized_start = 596 - _globals['_LISTTAGSREQUEST']._serialized_end = 692 - _globals['_LISTTAGSRESPONSE']._serialized_start = 694 - _globals['_LISTTAGSRESPONSE']._serialized_end = 801 - _globals['_ADDENTITIESREQUEST']._serialized_start = 803 - _globals['_ADDENTITIESREQUEST']._serialized_end = 880 - _globals['_ADDENTITIESRESPONSE']._serialized_start = 882 - _globals['_ADDENTITIESRESPONSE']._serialized_end = 903 - _globals['_REMOVEENTITIESREQUEST']._serialized_start = 905 - _globals['_REMOVEENTITIESREQUEST']._serialized_end = 985 - _globals['_REMOVEENTITIESRESPONSE']._serialized_start = 987 - _globals['_REMOVEENTITIESRESPONSE']._serialized_end = 1011 - _globals['_LISTTAGENTITIESREQUEST']._serialized_start = 1014 - _globals['_LISTTAGENTITIESREQUEST']._serialized_end = 1158 - _globals['_LISTTAGENTITIESRESPONSE']._serialized_start = 1160 - _globals['_LISTTAGENTITIESRESPONSE']._serialized_end = 1252 - _globals['_TAGSERVICE']._serialized_start = 1255 - _globals['_TAGSERVICE']._serialized_end = 2444 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2_grpc.py deleted file mode 100644 index 3d793c7d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/analytics/v1/tag_service_pb2_grpc.py +++ /dev/null @@ -1,162 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.analytics.v1 import tag_messages_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2 -from .....exabel.api.analytics.v1 import tag_service_pb2 as exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/analytics/v1/tag_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class TagServiceStub(object): - """Service for managing tags. See the User Guide for more information about tags: - https://help.exabel.com/docs/tags-screens - - Requests to the TagService are executed in the context of the customer's service account (SA). - The SA is a special user that is a member of the customer user group, giving it access to all - folders that are shared with this user group, but not to private folders. - Hence, only tags that are in folders shared to the SA, via the customer user group, - will be accessible via the TagService. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateTag = channel.unary_unary('/exabel.api.analytics.v1.TagService/CreateTag', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.CreateTagRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, _registered_method=True) - self.GetTag = channel.unary_unary('/exabel.api.analytics.v1.TagService/GetTag', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.GetTagRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, _registered_method=True) - self.UpdateTag = channel.unary_unary('/exabel.api.analytics.v1.TagService/UpdateTag', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.UpdateTagRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, _registered_method=True) - self.DeleteTag = channel.unary_unary('/exabel.api.analytics.v1.TagService/DeleteTag', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.DeleteTagRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.ListTags = channel.unary_unary('/exabel.api.analytics.v1.TagService/ListTags', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsResponse.FromString, _registered_method=True) - self.AddEntities = channel.unary_unary('/exabel.api.analytics.v1.TagService/AddEntities', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesResponse.FromString, _registered_method=True) - self.RemoveEntities = channel.unary_unary('/exabel.api.analytics.v1.TagService/RemoveEntities', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesResponse.FromString, _registered_method=True) - self.ListTagEntities = channel.unary_unary('/exabel.api.analytics.v1.TagService/ListTagEntities', request_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesResponse.FromString, _registered_method=True) - -class TagServiceServicer(object): - """Service for managing tags. See the User Guide for more information about tags: - https://help.exabel.com/docs/tags-screens - - Requests to the TagService are executed in the context of the customer's service account (SA). - The SA is a special user that is a member of the customer user group, giving it access to all - folders that are shared with this user group, but not to private folders. - Hence, only tags that are in folders shared to the SA, via the customer user group, - will be accessible via the TagService. - """ - - def CreateTag(self, request, context): - """Create a tag. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetTag(self, request, context): - """Get a tag. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateTag(self, request, context): - """Update a tag. - - Note that this method will update all fields unless `update_mask` is set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteTag(self, request, context): - """Delete a tag. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListTags(self, request, context): - """List all tags accessible by the user. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def AddEntities(self, request, context): - """Add entities to a tag. Entities that exist in the tag already will be ignored - - Entities that exist in the tag already will be ignored. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def RemoveEntities(self, request, context): - """Remove a set of entities from tag. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListTagEntities(self, request, context): - """List all entities in a tag. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_TagServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'CreateTag': grpc.unary_unary_rpc_method_handler(servicer.CreateTag, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.CreateTagRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.SerializeToString), 'GetTag': grpc.unary_unary_rpc_method_handler(servicer.GetTag, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.GetTagRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.SerializeToString), 'UpdateTag': grpc.unary_unary_rpc_method_handler(servicer.UpdateTag, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.UpdateTagRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.SerializeToString), 'DeleteTag': grpc.unary_unary_rpc_method_handler(servicer.DeleteTag, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.DeleteTagRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'ListTags': grpc.unary_unary_rpc_method_handler(servicer.ListTags, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsResponse.SerializeToString), 'AddEntities': grpc.unary_unary_rpc_method_handler(servicer.AddEntities, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesResponse.SerializeToString), 'RemoveEntities': grpc.unary_unary_rpc_method_handler(servicer.RemoveEntities, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesResponse.SerializeToString), 'ListTagEntities': grpc.unary_unary_rpc_method_handler(servicer.ListTagEntities, request_deserializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesRequest.FromString, response_serializer=exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesResponse.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.analytics.v1.TagService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.analytics.v1.TagService', rpc_method_handlers) - -class TagService(object): - """Service for managing tags. See the User Guide for more information about tags: - https://help.exabel.com/docs/tags-screens - - Requests to the TagService are executed in the context of the customer's service account (SA). - The SA is a special user that is a member of the customer user group, giving it access to all - folders that are shared with this user group, but not to private folders. - Hence, only tags that are in folders shared to the SA, via the customer user group, - will be accessible via the TagService. - """ - - @staticmethod - def CreateTag(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.TagService/CreateTag', exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.CreateTagRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetTag(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.TagService/GetTag', exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.GetTagRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateTag(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.TagService/UpdateTag', exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.UpdateTagRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_tag__messages__pb2.Tag.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteTag(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.TagService/DeleteTag', exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.DeleteTagRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListTags(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.TagService/ListTags', exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def AddEntities(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.TagService/AddEntities', exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.AddEntitiesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def RemoveEntities(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.TagService/RemoveEntities', exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.RemoveEntitiesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListTagEntities(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.analytics.v1.TagService/ListTagEntities', exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesRequest.SerializeToString, exabel_dot_api_dot_analytics_dot_v1_dot_tag__service__pb2.ListTagEntitiesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2.py deleted file mode 100644 index 8ecbc0e9..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/calendar_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.time import date_pb2 as exabel_dot_api_dot_time_dot_date__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/data/v1/calendar_messages.proto\x12\x12exabel.api.data.v1\x1a\x1aexabel/api/time/date.proto"i\n\x0cFiscalPeriod\x120\n\tfrequency\x18\x01 \x01(\x0e2\x1d.exabel.api.data.v1.Frequency\x12\'\n\x08end_date\x18\x02 \x01(\x0b2\x15.exabel.api.time.Date*Q\n\tFrequency\x12\x19\n\x15FREQUENCY_UNSPECIFIED\x10\x00\x12\r\n\tQUARTERLY\x10\x01\x12\x0e\n\nSEMIANNUAL\x10\x02\x12\n\n\x06ANNUAL\x10\x03BI\n\x16com.exabel.api.data.v1B\x15CalendarMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.calendar_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x15CalendarMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_FREQUENCY']._serialized_start = 201 - _globals['_FREQUENCY']._serialized_end = 282 - _globals['_FISCALPERIOD']._serialized_start = 94 - _globals['_FISCALPERIOD']._serialized_end = 199 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2.pyi deleted file mode 100644 index 56bfa8de..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2.pyi +++ /dev/null @@ -1,66 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2025 Exabel AS. All rights reserved.""" -import builtins -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message -import sys -import typing -if sys.version_info >= (3, 10): - import typing as typing_extensions -else: - import typing_extensions -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _Frequency: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _FrequencyEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Frequency.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - FREQUENCY_UNSPECIFIED: _Frequency.ValueType - 'The frequency of the fiscal period is unspecified.' - QUARTERLY: _Frequency.ValueType - 'The fiscal period is quarterly.' - SEMIANNUAL: _Frequency.ValueType - 'The fiscal period is semi-annual.' - ANNUAL: _Frequency.ValueType - 'The fiscal periods is annual.' - -class Frequency(_Frequency, metaclass=_FrequencyEnumTypeWrapper): - """The frequency of a fiscal period.""" -FREQUENCY_UNSPECIFIED: Frequency.ValueType -'The frequency of the fiscal period is unspecified.' -QUARTERLY: Frequency.ValueType -'The fiscal period is quarterly.' -SEMIANNUAL: Frequency.ValueType -'The fiscal period is semi-annual.' -ANNUAL: Frequency.ValueType -'The fiscal periods is annual.' -global___Frequency = Frequency - -@typing.final -class FiscalPeriod(google.protobuf.message.Message): - """A fiscal period of a company.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - FREQUENCY_FIELD_NUMBER: builtins.int - END_DATE_FIELD_NUMBER: builtins.int - frequency: global___Frequency.ValueType - 'The frequency of the fiscal period.' - - @property - def end_date(self) -> exabel.api.time.date_pb2.Date: - """The last date in the fiscal period.""" - - def __init__(self, *, frequency: global___Frequency.ValueType | None=..., end_date: exabel.api.time.date_pb2.Date | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['end_date', b'end_date']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['end_date', b'end_date', 'frequency', b'frequency']) -> None: - ... -global___FiscalPeriod = FiscalPeriod \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2_grpc.py deleted file mode 100644 index 7dc6609e..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/calendar_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2.py deleted file mode 100644 index 1fc00915..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/calendar_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import calendar_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_calendar__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/data/v1/calendar_service.proto\x12\x12exabel.api.data.v1\x1a*exabel/api/data/v1/calendar_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x82\x01\n\x1fBatchCreateFiscalPeriodsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02\x126\n\x07periods\x18\x02 \x03(\x0b2 .exabel.api.data.v1.FiscalPeriodB\x03\xe0A\x02""\n BatchCreateFiscalPeriodsResponse"v\n\x19DeleteFiscalPeriodRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02\x120\n\x06period\x18\x02 \x01(\x0b2 .exabel.api.data.v1.FiscalPeriod"u\n\x18ListFiscalPeriodsRequest\x12\'\n\x06parent\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02\x120\n\tfrequency\x18\x02 \x01(\x0e2\x1d.exabel.api.data.v1.Frequency"N\n\x19ListFiscalPeriodsResponse\x121\n\x07periods\x18\x01 \x03(\x0b2 .exabel.api.data.v1.FiscalPeriod"\'\n%ListCompaniesWithFiscalPeriodsRequest";\n&ListCompaniesWithFiscalPeriodsResponse\x12\x11\n\tcompanies\x18\x01 \x03(\t2\x99\x07\n\x0fCalendarService\x12\xf8\x01\n\x18BatchCreateFiscalPeriods\x123.exabel.api.data.v1.BatchCreateFiscalPeriodsRequest\x1a4.exabel.api.data.v1.BatchCreateFiscalPeriodsResponse"q\x92A\x1e\x12\x1cCreate custom fiscal periods\x82\xd3\xe4\x93\x02J"E/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods:batchCreate:\x01*\x12\xd2\x01\n\x11ListFiscalPeriods\x12,.exabel.api.data.v1.ListFiscalPeriodsRequest\x1a-.exabel.api.data.v1.ListFiscalPeriodsResponse"`\x92A\x1c\x12\x1aList custom fiscal periods\x82\xd3\xe4\x93\x02;\x129/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods\x12\xbf\x01\n\x12DeleteFiscalPeriod\x12-.exabel.api.data.v1.DeleteFiscalPeriodRequest\x1a\x16.google.protobuf.Empty"b\x92A\x1e\x12\x1cDelete custom fiscal periods\x82\xd3\xe4\x93\x02;*9/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods\x12\xf3\x01\n\x1eListCompaniesWithFiscalPeriods\x129.exabel.api.data.v1.ListCompaniesWithFiscalPeriodsRequest\x1a:.exabel.api.data.v1.ListCompaniesWithFiscalPeriodsResponse"Z\x92A+\x12)List companies with custom fiscal periods\x82\xd3\xe4\x93\x02&\x12$/v1/companiesWithCustomFiscalPeriodsBH\n\x16com.exabel.api.data.v1B\x14CalendarServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.calendar_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x14CalendarServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_BATCHCREATEFISCALPERIODSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_BATCHCREATEFISCALPERIODSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02' - _globals['_BATCHCREATEFISCALPERIODSREQUEST'].fields_by_name['periods']._loaded_options = None - _globals['_BATCHCREATEFISCALPERIODSREQUEST'].fields_by_name['periods']._serialized_options = b'\xe0A\x02' - _globals['_DELETEFISCALPERIODREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_DELETEFISCALPERIODREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02' - _globals['_LISTFISCALPERIODSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTFISCALPERIODSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bcompanyName\xe0A\x02' - _globals['_CALENDARSERVICE'].methods_by_name['BatchCreateFiscalPeriods']._loaded_options = None - _globals['_CALENDARSERVICE'].methods_by_name['BatchCreateFiscalPeriods']._serialized_options = b'\x92A\x1e\x12\x1cCreate custom fiscal periods\x82\xd3\xe4\x93\x02J"E/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods:batchCreate:\x01*' - _globals['_CALENDARSERVICE'].methods_by_name['ListFiscalPeriods']._loaded_options = None - _globals['_CALENDARSERVICE'].methods_by_name['ListFiscalPeriods']._serialized_options = b'\x92A\x1c\x12\x1aList custom fiscal periods\x82\xd3\xe4\x93\x02;\x129/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods' - _globals['_CALENDARSERVICE'].methods_by_name['DeleteFiscalPeriod']._loaded_options = None - _globals['_CALENDARSERVICE'].methods_by_name['DeleteFiscalPeriod']._serialized_options = b'\x92A\x1e\x12\x1cDelete custom fiscal periods\x82\xd3\xe4\x93\x02;*9/v1/{parent=entityTypes/company/entities/*}/fiscalPeriods' - _globals['_CALENDARSERVICE'].methods_by_name['ListCompaniesWithFiscalPeriods']._loaded_options = None - _globals['_CALENDARSERVICE'].methods_by_name['ListCompaniesWithFiscalPeriods']._serialized_options = b'\x92A+\x12)List companies with custom fiscal periods\x82\xd3\xe4\x93\x02&\x12$/v1/companiesWithCustomFiscalPeriods' - _globals['_BATCHCREATEFISCALPERIODSREQUEST']._serialized_start = 250 - _globals['_BATCHCREATEFISCALPERIODSREQUEST']._serialized_end = 380 - _globals['_BATCHCREATEFISCALPERIODSRESPONSE']._serialized_start = 382 - _globals['_BATCHCREATEFISCALPERIODSRESPONSE']._serialized_end = 416 - _globals['_DELETEFISCALPERIODREQUEST']._serialized_start = 418 - _globals['_DELETEFISCALPERIODREQUEST']._serialized_end = 536 - _globals['_LISTFISCALPERIODSREQUEST']._serialized_start = 538 - _globals['_LISTFISCALPERIODSREQUEST']._serialized_end = 655 - _globals['_LISTFISCALPERIODSRESPONSE']._serialized_start = 657 - _globals['_LISTFISCALPERIODSRESPONSE']._serialized_end = 735 - _globals['_LISTCOMPANIESWITHFISCALPERIODSREQUEST']._serialized_start = 737 - _globals['_LISTCOMPANIESWITHFISCALPERIODSREQUEST']._serialized_end = 776 - _globals['_LISTCOMPANIESWITHFISCALPERIODSRESPONSE']._serialized_start = 778 - _globals['_LISTCOMPANIESWITHFISCALPERIODSRESPONSE']._serialized_end = 837 - _globals['_CALENDARSERVICE']._serialized_start = 840 - _globals['_CALENDARSERVICE']._serialized_end = 1761 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2.pyi deleted file mode 100644 index 8473c351..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2.pyi +++ /dev/null @@ -1,127 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2025 Exabel AS. All rights reserved.""" -import builtins -import collections.abc -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.message -import typing -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class BatchCreateFiscalPeriodsRequest(google.protobuf.message.Message): - """A request to create multiple custom fiscal periods for a company.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - PERIODS_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The resource name of the company.' - - @property - def periods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod]: - """The custom fiscal periods to add.""" - - def __init__(self, *, parent: builtins.str | None=..., periods: collections.abc.Iterable[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['parent', b'parent', 'periods', b'periods']) -> None: - ... -global___BatchCreateFiscalPeriodsRequest = BatchCreateFiscalPeriodsRequest - -@typing.final -class BatchCreateFiscalPeriodsResponse(google.protobuf.message.Message): - """The response to a request to create custom fiscal periods.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - def __init__(self) -> None: - ... -global___BatchCreateFiscalPeriodsResponse = BatchCreateFiscalPeriodsResponse - -@typing.final -class DeleteFiscalPeriodRequest(google.protobuf.message.Message): - """A request to delete a fiscal period for a company.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - PERIOD_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The resource name of the company.' - - @property - def period(self) -> exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod: - """The custom fiscal periods to delete. If not set, will delete all custom fiscal periods - for the given company. - """ - - def __init__(self, *, parent: builtins.str | None=..., period: exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['period', b'period']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['parent', b'parent', 'period', b'period']) -> None: - ... -global___DeleteFiscalPeriodRequest = DeleteFiscalPeriodRequest - -@typing.final -class ListFiscalPeriodsRequest(google.protobuf.message.Message): - """A request to list the custom fiscal periods for a company.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - FREQUENCY_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The resource name of the company.' - frequency: exabel.api.data.v1.calendar_messages_pb2.Frequency.ValueType - 'Optionally, a frequency.\n If a frequency is provided, only the custom fiscal periods of that frequency are returned.\n Otherwise, all the custom fiscal periods for the company are returned.\n ' - - def __init__(self, *, parent: builtins.str | None=..., frequency: exabel.api.data.v1.calendar_messages_pb2.Frequency.ValueType | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['frequency', b'frequency', 'parent', b'parent']) -> None: - ... -global___ListFiscalPeriodsRequest = ListFiscalPeriodsRequest - -@typing.final -class ListFiscalPeriodsResponse(google.protobuf.message.Message): - """The response to a request to list custom fiscal periods.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PERIODS_FIELD_NUMBER: builtins.int - - @property - def periods(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod]: - """The fiscal periods of the requested company.""" - - def __init__(self, *, periods: collections.abc.Iterable[exabel.api.data.v1.calendar_messages_pb2.FiscalPeriod] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['periods', b'periods']) -> None: - ... -global___ListFiscalPeriodsResponse = ListFiscalPeriodsResponse - -@typing.final -class ListCompaniesWithFiscalPeriodsRequest(google.protobuf.message.Message): - """A request to list all the companies for which custom fiscal periods have been uploaded.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - def __init__(self) -> None: - ... -global___ListCompaniesWithFiscalPeriodsRequest = ListCompaniesWithFiscalPeriodsRequest - -@typing.final -class ListCompaniesWithFiscalPeriodsResponse(google.protobuf.message.Message): - """The response to a request to list companies with custom fiscal periods.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - COMPANIES_FIELD_NUMBER: builtins.int - - @property - def companies(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: - """A list of resource names of the companies that have custom fiscal periods.""" - - def __init__(self, *, companies: collections.abc.Iterable[builtins.str] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['companies', b'companies']) -> None: - ... -global___ListCompaniesWithFiscalPeriodsResponse = ListCompaniesWithFiscalPeriodsResponse \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2_grpc.py deleted file mode 100644 index 5a1e00da..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/calendar_service_pb2_grpc.py +++ /dev/null @@ -1,102 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import calendar_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/calendar_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class CalendarServiceStub(object): - """Service for managing custom fiscal calendar data. - - Custom fiscal calendar data will supplement calendar data provided by Exabel. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.BatchCreateFiscalPeriods = channel.unary_unary('/exabel.api.data.v1.CalendarService/BatchCreateFiscalPeriods', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsResponse.FromString, _registered_method=True) - self.ListFiscalPeriods = channel.unary_unary('/exabel.api.data.v1.CalendarService/ListFiscalPeriods', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsResponse.FromString, _registered_method=True) - self.DeleteFiscalPeriod = channel.unary_unary('/exabel.api.data.v1.CalendarService/DeleteFiscalPeriod', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.DeleteFiscalPeriodRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.ListCompaniesWithFiscalPeriods = channel.unary_unary('/exabel.api.data.v1.CalendarService/ListCompaniesWithFiscalPeriods', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsResponse.FromString, _registered_method=True) - -class CalendarServiceServicer(object): - """Service for managing custom fiscal calendar data. - - Custom fiscal calendar data will supplement calendar data provided by Exabel. - """ - - def BatchCreateFiscalPeriods(self, request, context): - """Creates multiple custom fiscal periods for a company. - - Creates multiple custom fiscal periods for a given company. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListFiscalPeriods(self, request, context): - """Lists the custom fiscal periods for a company. - - Lists the custom fiscal periods for a given company. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteFiscalPeriod(self, request, context): - """Deletes one or all fiscal period for a company. - - Deletes one or all fiscal period for a given company. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListCompaniesWithFiscalPeriods(self, request, context): - """Lists all the companies with custom fiscal periods. - - Lists all the companies for which there are custom fiscal periods. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_CalendarServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'BatchCreateFiscalPeriods': grpc.unary_unary_rpc_method_handler(servicer.BatchCreateFiscalPeriods, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsResponse.SerializeToString), 'ListFiscalPeriods': grpc.unary_unary_rpc_method_handler(servicer.ListFiscalPeriods, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsResponse.SerializeToString), 'DeleteFiscalPeriod': grpc.unary_unary_rpc_method_handler(servicer.DeleteFiscalPeriod, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.DeleteFiscalPeriodRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'ListCompaniesWithFiscalPeriods': grpc.unary_unary_rpc_method_handler(servicer.ListCompaniesWithFiscalPeriods, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsResponse.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.CalendarService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.CalendarService', rpc_method_handlers) - -class CalendarService(object): - """Service for managing custom fiscal calendar data. - - Custom fiscal calendar data will supplement calendar data provided by Exabel. - """ - - @staticmethod - def BatchCreateFiscalPeriods(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.CalendarService/BatchCreateFiscalPeriods', exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.BatchCreateFiscalPeriodsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListFiscalPeriods(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.CalendarService/ListFiscalPeriods', exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListFiscalPeriodsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteFiscalPeriod(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.CalendarService/DeleteFiscalPeriod', exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.DeleteFiscalPeriodRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListCompaniesWithFiscalPeriods(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.CalendarService/ListCompaniesWithFiscalPeriods', exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_calendar__service__pb2.ListCompaniesWithFiscalPeriodsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2.py deleted file mode 100644 index b8131f64..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/common_messages.proto') -_sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/common_messages.proto\x12\x12exabel.api.data.v1"F\n\tEntitySet\x12\x10\n\x08entities\x18\x01 \x03(\t\x12\x0c\n\x04tags\x18\x02 \x03(\t\x12\x19\n\x11excluded_entities\x18\x03 \x03(\tBG\n\x16com.exabel.api.data.v1B\x13CommonMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.common_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x13CommonMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_ENTITYSET']._serialized_start = 64 - _globals['_ENTITYSET']._serialized_end = 134 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2_grpc.py deleted file mode 100644 index fde02d10..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/common_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/common_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2.py deleted file mode 100644 index 3136e94d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/data_set_messages.proto') -_sym_db = _symbol_database.Default() -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/data/v1/data_set_messages.proto\x12\x12exabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\xde\x03\n\x07DataSet\x12>\n\x04name\x18\x01 \x01(\tB0\x92A\'J\x14"dataSets/ns.stores"\xca>\x0e\xfa\x02\x0bdataSetName\xe0A\x05\xe0A\x02\x12\x18\n\x0blegacy_name\x18\x08 \x01(\tB\x03\xe0A\x03\x12#\n\x0cdisplay_name\x18\x02 \x01(\tB\r\x92A\nJ\x08"Stores"\x12>\n\x0bdescription\x18\x03 \x01(\tB)\x92A&J$"The data set of all store entities"\x12N\n\x07signals\x18\x04 \x03(\tB=\x92A7J5["signals/ns.customer_amount", "signals/ns.visitors"]\xe0A\x06\x12J\n\x0fderived_signals\x18\x07 \x03(\tB1\x92A.J,["derivedSignals/321", "derivedSignals/432"]\x12V\n\x13highlighted_signals\x18\x06 \x03(\tB9\x92A3J1["signals/ns.average_data", "derivedSignals/321"]\xe0A\x06\x12 \n\tread_only\x18\x05 \x01(\x08B\r\x92A\x07J\x05false\xe0A\x03BH\n\x16com.exabel.api.data.v1B\x14DataSetMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.data_set_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x14DataSetMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_DATASET'].fields_by_name['name']._loaded_options = None - _globals['_DATASET'].fields_by_name['name']._serialized_options = b'\x92A\'J\x14"dataSets/ns.stores"\xca>\x0e\xfa\x02\x0bdataSetName\xe0A\x05\xe0A\x02' - _globals['_DATASET'].fields_by_name['legacy_name']._loaded_options = None - _globals['_DATASET'].fields_by_name['legacy_name']._serialized_options = b'\xe0A\x03' - _globals['_DATASET'].fields_by_name['display_name']._loaded_options = None - _globals['_DATASET'].fields_by_name['display_name']._serialized_options = b'\x92A\nJ\x08"Stores"' - _globals['_DATASET'].fields_by_name['description']._loaded_options = None - _globals['_DATASET'].fields_by_name['description']._serialized_options = b'\x92A&J$"The data set of all store entities"' - _globals['_DATASET'].fields_by_name['signals']._loaded_options = None - _globals['_DATASET'].fields_by_name['signals']._serialized_options = b'\x92A7J5["signals/ns.customer_amount", "signals/ns.visitors"]\xe0A\x06' - _globals['_DATASET'].fields_by_name['derived_signals']._loaded_options = None - _globals['_DATASET'].fields_by_name['derived_signals']._serialized_options = b'\x92A.J,["derivedSignals/321", "derivedSignals/432"]' - _globals['_DATASET'].fields_by_name['highlighted_signals']._loaded_options = None - _globals['_DATASET'].fields_by_name['highlighted_signals']._serialized_options = b'\x92A3J1["signals/ns.average_data", "derivedSignals/321"]\xe0A\x06' - _globals['_DATASET'].fields_by_name['read_only']._loaded_options = None - _globals['_DATASET'].fields_by_name['read_only']._serialized_options = b'\x92A\x07J\x05false\xe0A\x03' - _globals['_DATASET']._serialized_start = 148 - _globals['_DATASET']._serialized_end = 626 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2_grpc.py deleted file mode 100644 index ca3714b7..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/data_set_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2.py deleted file mode 100644 index ffd2079a..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/data_set_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import data_set_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/data/v1/data_set_service.proto\x12\x12exabel.api.data.v1\x1a*exabel/api/data/v1/data_set_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x15\n\x13ListDataSetsRequest"F\n\x14ListDataSetsResponse\x12.\n\tdata_sets\x18\x01 \x03(\x0b2\x1b.exabel.api.data.v1.DataSet":\n\x11GetDataSetRequest\x12%\n\x04name\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bdataSetName\xe0A\x02"J\n\x14CreateDataSetRequest\x122\n\x08data_set\x18\x01 \x01(\x0b2\x1b.exabel.api.data.v1.DataSetB\x03\xe0A\x02"\x92\x01\n\x14UpdateDataSetRequest\x122\n\x08data_set\x18\x01 \x01(\x0b2\x1b.exabel.api.data.v1.DataSetB\x03\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08"=\n\x14DeleteDataSetRequest\x12%\n\x04name\x18\x01 \x01(\tB\x17\x92A\x11\xca>\x0e\xfa\x02\x0bdataSetName\xe0A\x022\xd3\x05\n\x0eDataSetService\x12\x8a\x01\n\x0cListDataSets\x12\'.exabel.api.data.v1.ListDataSetsRequest\x1a(.exabel.api.data.v1.ListDataSetsResponse"\'\x92A\x10\x12\x0eList data sets\x82\xd3\xe4\x93\x02\x0e\x12\x0c/v1/dataSets\x12\x80\x01\n\nGetDataSet\x12%.exabel.api.data.v1.GetDataSetRequest\x1a\x1b.exabel.api.data.v1.DataSet".\x92A\x0e\x12\x0cGet data set\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/{name=dataSets/*}\x12\x8a\x01\n\rCreateDataSet\x12(.exabel.api.data.v1.CreateDataSetRequest\x1a\x1b.exabel.api.data.v1.DataSet"2\x92A\x11\x12\x0fCreate data set\x82\xd3\xe4\x93\x02\x18"\x0c/v1/dataSets:\x08data_set\x12\x9c\x01\n\rUpdateDataSet\x12(.exabel.api.data.v1.UpdateDataSetRequest\x1a\x1b.exabel.api.data.v1.DataSet"D\x92A\x11\x12\x0fUpdate data set\x82\xd3\xe4\x93\x02*2\x1e/v1/{data_set.name=dataSets/*}:\x08data_set\x12\x84\x01\n\rDeleteDataSet\x12(.exabel.api.data.v1.DeleteDataSetRequest\x1a\x16.google.protobuf.Empty"1\x92A\x11\x12\x0fDelete data set\x82\xd3\xe4\x93\x02\x17*\x15/v1/{name=dataSets/*}BG\n\x16com.exabel.api.data.v1B\x13DataSetServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.data_set_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x13DataSetServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_GETDATASETREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETDATASETREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bdataSetName\xe0A\x02' - _globals['_CREATEDATASETREQUEST'].fields_by_name['data_set']._loaded_options = None - _globals['_CREATEDATASETREQUEST'].fields_by_name['data_set']._serialized_options = b'\xe0A\x02' - _globals['_UPDATEDATASETREQUEST'].fields_by_name['data_set']._loaded_options = None - _globals['_UPDATEDATASETREQUEST'].fields_by_name['data_set']._serialized_options = b'\xe0A\x02' - _globals['_DELETEDATASETREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETEDATASETREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x11\xca>\x0e\xfa\x02\x0bdataSetName\xe0A\x02' - _globals['_DATASETSERVICE'].methods_by_name['ListDataSets']._loaded_options = None - _globals['_DATASETSERVICE'].methods_by_name['ListDataSets']._serialized_options = b'\x92A\x10\x12\x0eList data sets\x82\xd3\xe4\x93\x02\x0e\x12\x0c/v1/dataSets' - _globals['_DATASETSERVICE'].methods_by_name['GetDataSet']._loaded_options = None - _globals['_DATASETSERVICE'].methods_by_name['GetDataSet']._serialized_options = b'\x92A\x0e\x12\x0cGet data set\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/{name=dataSets/*}' - _globals['_DATASETSERVICE'].methods_by_name['CreateDataSet']._loaded_options = None - _globals['_DATASETSERVICE'].methods_by_name['CreateDataSet']._serialized_options = b'\x92A\x11\x12\x0fCreate data set\x82\xd3\xe4\x93\x02\x18"\x0c/v1/dataSets:\x08data_set' - _globals['_DATASETSERVICE'].methods_by_name['UpdateDataSet']._loaded_options = None - _globals['_DATASETSERVICE'].methods_by_name['UpdateDataSet']._serialized_options = b'\x92A\x11\x12\x0fUpdate data set\x82\xd3\xe4\x93\x02*2\x1e/v1/{data_set.name=dataSets/*}:\x08data_set' - _globals['_DATASETSERVICE'].methods_by_name['DeleteDataSet']._loaded_options = None - _globals['_DATASETSERVICE'].methods_by_name['DeleteDataSet']._serialized_options = b'\x92A\x11\x12\x0fDelete data set\x82\xd3\xe4\x93\x02\x17*\x15/v1/{name=dataSets/*}' - _globals['_LISTDATASETSREQUEST']._serialized_start = 283 - _globals['_LISTDATASETSREQUEST']._serialized_end = 304 - _globals['_LISTDATASETSRESPONSE']._serialized_start = 306 - _globals['_LISTDATASETSRESPONSE']._serialized_end = 376 - _globals['_GETDATASETREQUEST']._serialized_start = 378 - _globals['_GETDATASETREQUEST']._serialized_end = 436 - _globals['_CREATEDATASETREQUEST']._serialized_start = 438 - _globals['_CREATEDATASETREQUEST']._serialized_end = 512 - _globals['_UPDATEDATASETREQUEST']._serialized_start = 515 - _globals['_UPDATEDATASETREQUEST']._serialized_end = 661 - _globals['_DELETEDATASETREQUEST']._serialized_start = 663 - _globals['_DELETEDATASETREQUEST']._serialized_end = 724 - _globals['_DATASETSERVICE']._serialized_start = 727 - _globals['_DATASETSERVICE']._serialized_end = 1450 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2_grpc.py deleted file mode 100644 index 449d4b4e..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/data_set_service_pb2_grpc.py +++ /dev/null @@ -1,135 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import data_set_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2 -from .....exabel.api.data.v1 import data_set_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/data_set_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class DataSetServiceStub(object): - """Service for managing data sets. Data sets are collections of signals that you may define and - manage, often to group data by source/vendor. The companies and entities that have time series - data for these signals are also part of the data set, and searchable within the data set in the - Exabel app. - - You may access data sets by subscribing to an Exabel data partner, or create your own data sets - from the data you import. - - See the User Guide for more information about data sets: https://help.exabel.com/docs/data-sets - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListDataSets = channel.unary_unary('/exabel.api.data.v1.DataSetService/ListDataSets', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsResponse.FromString, _registered_method=True) - self.GetDataSet = channel.unary_unary('/exabel.api.data.v1.DataSetService/GetDataSet', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.GetDataSetRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, _registered_method=True) - self.CreateDataSet = channel.unary_unary('/exabel.api.data.v1.DataSetService/CreateDataSet', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.CreateDataSetRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, _registered_method=True) - self.UpdateDataSet = channel.unary_unary('/exabel.api.data.v1.DataSetService/UpdateDataSet', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.UpdateDataSetRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, _registered_method=True) - self.DeleteDataSet = channel.unary_unary('/exabel.api.data.v1.DataSetService/DeleteDataSet', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.DeleteDataSetRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - -class DataSetServiceServicer(object): - """Service for managing data sets. Data sets are collections of signals that you may define and - manage, often to group data by source/vendor. The companies and entities that have time series - data for these signals are also part of the data set, and searchable within the data set in the - Exabel app. - - You may access data sets by subscribing to an Exabel data partner, or create your own data sets - from the data you import. - - See the User Guide for more information about data sets: https://help.exabel.com/docs/data-sets - """ - - def ListDataSets(self, request, context): - """Lists all data sets. - - Lists all data sets available to your customer, including both your own data sets as well as - those that you have subscribed to. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetDataSet(self, request, context): - """Gets one data set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateDataSet(self, request, context): - """Creates one data set and returns it. - - It is also possible to create a data set by calling `UpdateDataSet` - with `allow_missing` set to `true`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateDataSet(self, request, context): - """Updates one data set and returns it. - - This can also be used to create a data set by setting `allow_missing` to `true`. - - Note that this method will update all fields unless `update_mask` is set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteDataSet(self, request, context): - """Deletes one data set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_DataSetServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListDataSets': grpc.unary_unary_rpc_method_handler(servicer.ListDataSets, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsResponse.SerializeToString), 'GetDataSet': grpc.unary_unary_rpc_method_handler(servicer.GetDataSet, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.GetDataSetRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.SerializeToString), 'CreateDataSet': grpc.unary_unary_rpc_method_handler(servicer.CreateDataSet, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.CreateDataSetRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.SerializeToString), 'UpdateDataSet': grpc.unary_unary_rpc_method_handler(servicer.UpdateDataSet, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.UpdateDataSetRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.SerializeToString), 'DeleteDataSet': grpc.unary_unary_rpc_method_handler(servicer.DeleteDataSet, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.DeleteDataSetRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.DataSetService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.DataSetService', rpc_method_handlers) - -class DataSetService(object): - """Service for managing data sets. Data sets are collections of signals that you may define and - manage, often to group data by source/vendor. The companies and entities that have time series - data for these signals are also part of the data set, and searchable within the data set in the - Exabel app. - - You may access data sets by subscribing to an Exabel data partner, or create your own data sets - from the data you import. - - See the User Guide for more information about data sets: https://help.exabel.com/docs/data-sets - """ - - @staticmethod - def ListDataSets(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.DataSetService/ListDataSets', exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.ListDataSetsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetDataSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.DataSetService/GetDataSet', exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.GetDataSetRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateDataSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.DataSetService/CreateDataSet', exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.CreateDataSetRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateDataSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.DataSetService/UpdateDataSet', exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.UpdateDataSetRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_data__set__messages__pb2.DataSet.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteDataSet(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.DataSetService/DeleteDataSet', exabel_dot_api_dot_data_dot_v1_dot_data__set__service__pb2.DeleteDataSetRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2.py deleted file mode 100644 index 53650184..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2.py +++ /dev/null @@ -1,40 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/entity_messages.proto') -_sym_db = _symbol_database.Default() -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/entity_messages.proto\x12\x12exabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\xe2\x01\n\nEntityType\x12B\n\x04name\x18\x01 \x01(\tB4\x92A+J\x15"entityTypes/company"\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x05\xe0A\x02\x12&\n\x0cdisplay_name\x18\x02 \x01(\tB\x10\x92A\rJ\x0b"Companies"\x12,\n\x0bdescription\x18\x03 \x01(\tB\x17\x92A\x14J\x12"Public companies"\x12\x16\n\tread_only\x18\x04 \x01(\x08B\x03\xe0A\x03\x12"\n\x0eis_associative\x18\x05 \x01(\x08B\n\x92A\x07J\x05false"\xf7\x01\n\x06Entity\x12@\n\x04name\x18\x01 \x01(\tB2\x92A)J\x17"entities/ns.my_entity"\xca>\r\xfa\x02\nentityName\xe0A\x05\xe0A\x02\x12&\n\x0cdisplay_name\x18\x02 \x01(\tB\x10\x92A\rJ\x0b"My Entity"\x12>\n\x0bdescription\x18\x03 \x01(\tB)\x92A&J$"This is a description of My Entity"\x12\x16\n\tread_only\x18\x04 \x01(\x08B\x03\xe0A\x03\x12+\n\nproperties\x18d \x01(\x0b2\x17.google.protobuf.StructBG\n\x16com.exabel.api.data.v1B\x13EntityMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.entity_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x13EntityMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_ENTITYTYPE'].fields_by_name['name']._loaded_options = None - _globals['_ENTITYTYPE'].fields_by_name['name']._serialized_options = b'\x92A+J\x15"entityTypes/company"\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x05\xe0A\x02' - _globals['_ENTITYTYPE'].fields_by_name['display_name']._loaded_options = None - _globals['_ENTITYTYPE'].fields_by_name['display_name']._serialized_options = b'\x92A\rJ\x0b"Companies"' - _globals['_ENTITYTYPE'].fields_by_name['description']._loaded_options = None - _globals['_ENTITYTYPE'].fields_by_name['description']._serialized_options = b'\x92A\x14J\x12"Public companies"' - _globals['_ENTITYTYPE'].fields_by_name['read_only']._loaded_options = None - _globals['_ENTITYTYPE'].fields_by_name['read_only']._serialized_options = b'\xe0A\x03' - _globals['_ENTITYTYPE'].fields_by_name['is_associative']._loaded_options = None - _globals['_ENTITYTYPE'].fields_by_name['is_associative']._serialized_options = b'\x92A\x07J\x05false' - _globals['_ENTITY'].fields_by_name['name']._loaded_options = None - _globals['_ENTITY'].fields_by_name['name']._serialized_options = b'\x92A)J\x17"entities/ns.my_entity"\xca>\r\xfa\x02\nentityName\xe0A\x05\xe0A\x02' - _globals['_ENTITY'].fields_by_name['display_name']._loaded_options = None - _globals['_ENTITY'].fields_by_name['display_name']._serialized_options = b'\x92A\rJ\x0b"My Entity"' - _globals['_ENTITY'].fields_by_name['description']._loaded_options = None - _globals['_ENTITY'].fields_by_name['description']._serialized_options = b'\x92A&J$"This is a description of My Entity"' - _globals['_ENTITY'].fields_by_name['read_only']._loaded_options = None - _globals['_ENTITY'].fields_by_name['read_only']._serialized_options = b'\xe0A\x03' - _globals['_ENTITYTYPE']._serialized_start = 176 - _globals['_ENTITYTYPE']._serialized_end = 402 - _globals['_ENTITY']._serialized_start = 405 - _globals['_ENTITY']._serialized_end = 652 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2.pyi deleted file mode 100644 index 02d88756..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2.pyi +++ /dev/null @@ -1,71 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" -import builtins -import google.protobuf.descriptor -import google.protobuf.message -import google.protobuf.struct_pb2 -import typing -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class EntityType(google.protobuf.message.Message): - """An entity type resource in the Data API.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - READ_ONLY_FIELD_NUMBER: builtins.int - IS_ASSOCIATIVE_FIELD_NUMBER: builtins.int - name: builtins.str - 'Unique resource name of the entity type, e.g. `entityTypes/entityTypeIdentifier` or\n `entityTypes/namespace.entityTypeIdentifier`. The namespace must be empty (being global) or\n a namespace accessible to the customer.\n The entity type identifier must match the regex `\\w[\\w-]{0,63}`.\n ' - display_name: builtins.str - 'Used when showing the entity type in the Exabel app. Required when creating an entity type.' - description: builtins.str - 'Used when showing the entity type in the Exabel app.' - read_only: builtins.bool - 'Global entity types and those from data sets that you subscribe to will be read-only.' - is_associative: builtins.bool - 'Associative entity types connect multiple entity types - e.g. `company_occupation` to connect\n `company` and `occupation` entity types. These are typically used to hold time series data\n that is defined by the combination of 2 or more entities.\n ' - - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., description: builtins.str | None=..., read_only: builtins.bool | None=..., is_associative: builtins.bool | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'display_name', b'display_name', 'is_associative', b'is_associative', 'name', b'name', 'read_only', b'read_only']) -> None: - ... -global___EntityType = EntityType - -@typing.final -class Entity(google.protobuf.message.Message): - """An entity resource in the Data API. All entities have one entity type as its parent.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - READ_ONLY_FIELD_NUMBER: builtins.int - PROPERTIES_FIELD_NUMBER: builtins.int - name: builtins.str - 'Unique resource name of the entity,\n e.g. `entityTypes/entityTypeIdentifier/entities/entityIdentifier` or\n `entityTypes/namespace1.entityTypeIdentifier/entities/namespace2.entityIdentifier`.\n The namespaces must be empty (being global) or one of the predetermined namespaces the customer\n has access to. If `namespace1` is not empty, it must be equal to `namespace2`.\n The entity identifier must match the regex `\\w[\\w-]{0,63}`.\n ' - display_name: builtins.str - 'Used when showing the entity in the Exabel app. Required when creating an entity.' - description: builtins.str - 'Used when showing the entity in the Exabel app.' - read_only: builtins.bool - 'Global entities and those from data sets that you subscribe to will be read-only.' - - @property - def properties(self) -> google.protobuf.struct_pb2.Struct: - """Additional properties of this entity. This is currently not used in the Exabel app, but may be - in future. - """ - - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., description: builtins.str | None=..., read_only: builtins.bool | None=..., properties: google.protobuf.struct_pb2.Struct | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['properties', b'properties']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'display_name', b'display_name', 'name', b'name', 'properties', b'properties', 'read_only', b'read_only']) -> None: - ... -global___Entity = Entity \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2_grpc.py deleted file mode 100644 index b47dc26e..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/entity_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.py deleted file mode 100644 index aed6b6f3..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.py +++ /dev/null @@ -1,106 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/entity_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import entity_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2 -from .....exabel.api.data.v1 import search_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_search__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'exabel/api/data/v1/entity_service.proto\x12\x12exabel.api.data.v1\x1a(exabel/api/data/v1/entity_messages.proto\x1a(exabel/api/data/v1/search_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"?\n\x16ListEntityTypesRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t"|\n\x17ListEntityTypesResponse\x124\n\x0centity_types\x18\x01 \x03(\x0b2\x1e.exabel.api.data.v1.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"@\n\x14GetEntityTypeRequest\x12(\n\x04name\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02"j\n\x17CreateEntityTypeRequest\x12O\n\x0bentity_type\x18\x01 \x01(\x0b2\x1e.exabel.api.data.v1.EntityTypeB\x1a\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02"\xb2\x01\n\x17UpdateEntityTypeRequest\x12O\n\x0bentity_type\x18\x01 \x01(\x0b2\x1e.exabel.api.data.v1.EntityTypeB\x1a\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08"C\n\x17DeleteEntityTypeRequest\x12(\n\x04name\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02"h\n\x13ListEntitiesRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"q\n\x14ListEntitiesResponse\x12,\n\x08entities\x18\x01 \x03(\x0b2\x1a.exabel.api.data.v1.Entity\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"T\n\x15DeleteEntitiesRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02\x12\x0f\n\x07confirm\x18\x02 \x01(\x08"8\n\x10GetEntityRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92A\x10\xca>\r\xfa\x02\nentityName\xe0A\x02"r\n\x13CreateEntityRequest\x12*\n\x06parent\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02\x12/\n\x06entity\x18\x02 \x01(\x0b2\x1a.exabel.api.data.v1.EntityB\x03\xe0A\x02"\xa1\x01\n\x13UpdateEntityRequest\x12B\n\x06entity\x18\x01 \x01(\x0b2\x1a.exabel.api.data.v1.EntityB\x16\x92A\x10\xca>\r\xfa\x02\nentityName\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08";\n\x13DeleteEntityRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92A\x10\xca>\r\xfa\x02\nentityName\xe0A\x02"\xd2\x01\n\x15SearchEntitiesRequest\x12*\n\x06parent\x18\x04 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02\x122\n\x05terms\x18\x01 \x03(\x0b2\x1e.exabel.api.data.v1.SearchTermB\x03\xe0A\x02\x122\n\x07options\x18\x05 \x01(\x0b2!.exabel.api.data.v1.SearchOptions\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"\x96\x02\n\x16SearchEntitiesResponse\x12H\n\x07results\x18\x03 \x03(\x0b27.exabel.api.data.v1.SearchEntitiesResponse.SearchResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12,\n\x08entities\x18\x01 \x03(\x0b2\x1a.exabel.api.data.v1.Entity\x1ak\n\x0cSearchResult\x12-\n\x05terms\x18\x01 \x03(\x0b2\x1e.exabel.api.data.v1.SearchTerm\x12,\n\x08entities\x18\x02 \x03(\x0b2\x1a.exabel.api.data.v1.Entity2\xf7\x0e\n\rEntityService\x12\x99\x01\n\x0fListEntityTypes\x12*.exabel.api.data.v1.ListEntityTypesRequest\x1a+.exabel.api.data.v1.ListEntityTypesResponse"-\x92A\x13\x12\x11List entity types\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/entityTypes\x12\x8f\x01\n\rGetEntityType\x12(.exabel.api.data.v1.GetEntityTypeRequest\x1a\x1e.exabel.api.data.v1.EntityType"4\x92A\x11\x12\x0fGet entity type\x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=entityTypes/*}\x12\x9c\x01\n\x10CreateEntityType\x12+.exabel.api.data.v1.CreateEntityTypeRequest\x1a\x1e.exabel.api.data.v1.EntityType";\x92A\x14\x12\x12Create entity type\x82\xd3\xe4\x93\x02\x1e"\x0f/v1/entityTypes:\x0bentity_type\x12\xb1\x01\n\x10UpdateEntityType\x12+.exabel.api.data.v1.UpdateEntityTypeRequest\x1a\x1e.exabel.api.data.v1.EntityType"P\x92A\x14\x12\x12Update entity type\x82\xd3\xe4\x93\x0232$/v1/{entity_type.name=entityTypes/*}:\x0bentity_type\x12\x90\x01\n\x10DeleteEntityType\x12+.exabel.api.data.v1.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty"7\x92A\x14\x12\x12Delete entity type\x82\xd3\xe4\x93\x02\x1a*\x18/v1/{name=entityTypes/*}\x12\xa0\x01\n\x0cListEntities\x12\'.exabel.api.data.v1.ListEntitiesRequest\x1a(.exabel.api.data.v1.ListEntitiesResponse"=\x92A\x0f\x12\rList entities\x82\xd3\xe4\x93\x02%\x12#/v1/{parent=entityTypes/*}/entities\x12\x9b\x01\n\x0eDeleteEntities\x12).exabel.api.data.v1.DeleteEntitiesRequest\x1a\x16.google.protobuf.Empty"F\x92A\x18\x12\x16Delete entities (bulk)\x82\xd3\xe4\x93\x02%*#/v1/{parent=entityTypes/*}/entities\x12\x89\x01\n\tGetEntity\x12$.exabel.api.data.v1.GetEntityRequest\x1a\x1a.exabel.api.data.v1.Entity":\x92A\x0c\x12\nGet entity\x82\xd3\xe4\x93\x02%\x12#/v1/{name=entityTypes/*/entities/*}\x12\x9a\x01\n\x0cCreateEntity\x12\'.exabel.api.data.v1.CreateEntityRequest\x1a\x1a.exabel.api.data.v1.Entity"E\x92A\x0f\x12\rCreate entity\x82\xd3\xe4\x93\x02-"#/v1/{parent=entityTypes/*}/entities:\x06entity\x12\xa1\x01\n\x0cUpdateEntity\x12\'.exabel.api.data.v1.UpdateEntityRequest\x1a\x1a.exabel.api.data.v1.Entity"L\x92A\x0f\x12\rUpdate entity\x82\xd3\xe4\x93\x0242*/v1/{entity.name=entityTypes/*/entities/*}:\x06entity\x12\x8e\x01\n\x0cDeleteEntity\x12\'.exabel.api.data.v1.DeleteEntityRequest\x1a\x16.google.protobuf.Empty"=\x92A\x0f\x12\rDelete entity\x82\xd3\xe4\x93\x02%*#/v1/{name=entityTypes/*/entities/*}\x12\xb2\x01\n\x0eSearchEntities\x12).exabel.api.data.v1.SearchEntitiesRequest\x1a*.exabel.api.data.v1.SearchEntitiesResponse"I\x92A\x11\x12\x0fSearch entities\x82\xd3\xe4\x93\x02/"*/v1/{parent=entityTypes/*}/entities:search:\x01*BF\n\x16com.exabel.api.data.v1B\x12EntityServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.entity_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x12EntityServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_GETENTITYTYPEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETENTITYTYPEREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02' - _globals['_CREATEENTITYTYPEREQUEST'].fields_by_name['entity_type']._loaded_options = None - _globals['_CREATEENTITYTYPEREQUEST'].fields_by_name['entity_type']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02' - _globals['_UPDATEENTITYTYPEREQUEST'].fields_by_name['entity_type']._loaded_options = None - _globals['_UPDATEENTITYTYPEREQUEST'].fields_by_name['entity_type']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02' - _globals['_DELETEENTITYTYPEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETEENTITYTYPEREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02' - _globals['_LISTENTITIESREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTENTITIESREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02' - _globals['_DELETEENTITIESREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_DELETEENTITIESREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02' - _globals['_GETENTITYREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETENTITYREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nentityName\xe0A\x02' - _globals['_CREATEENTITYREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_CREATEENTITYREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02' - _globals['_CREATEENTITYREQUEST'].fields_by_name['entity']._loaded_options = None - _globals['_CREATEENTITYREQUEST'].fields_by_name['entity']._serialized_options = b'\xe0A\x02' - _globals['_UPDATEENTITYREQUEST'].fields_by_name['entity']._loaded_options = None - _globals['_UPDATEENTITYREQUEST'].fields_by_name['entity']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nentityName\xe0A\x02' - _globals['_DELETEENTITYREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETEENTITYREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nentityName\xe0A\x02' - _globals['_SEARCHENTITIESREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_SEARCHENTITIESREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0eentityTypeName\xe0A\x02' - _globals['_SEARCHENTITIESREQUEST'].fields_by_name['terms']._loaded_options = None - _globals['_SEARCHENTITIESREQUEST'].fields_by_name['terms']._serialized_options = b'\xe0A\x02' - _globals['_ENTITYSERVICE'].methods_by_name['ListEntityTypes']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['ListEntityTypes']._serialized_options = b'\x92A\x13\x12\x11List entity types\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/entityTypes' - _globals['_ENTITYSERVICE'].methods_by_name['GetEntityType']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['GetEntityType']._serialized_options = b'\x92A\x11\x12\x0fGet entity type\x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=entityTypes/*}' - _globals['_ENTITYSERVICE'].methods_by_name['CreateEntityType']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['CreateEntityType']._serialized_options = b'\x92A\x14\x12\x12Create entity type\x82\xd3\xe4\x93\x02\x1e"\x0f/v1/entityTypes:\x0bentity_type' - _globals['_ENTITYSERVICE'].methods_by_name['UpdateEntityType']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['UpdateEntityType']._serialized_options = b'\x92A\x14\x12\x12Update entity type\x82\xd3\xe4\x93\x0232$/v1/{entity_type.name=entityTypes/*}:\x0bentity_type' - _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntityType']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntityType']._serialized_options = b'\x92A\x14\x12\x12Delete entity type\x82\xd3\xe4\x93\x02\x1a*\x18/v1/{name=entityTypes/*}' - _globals['_ENTITYSERVICE'].methods_by_name['ListEntities']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['ListEntities']._serialized_options = b'\x92A\x0f\x12\rList entities\x82\xd3\xe4\x93\x02%\x12#/v1/{parent=entityTypes/*}/entities' - _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntities']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntities']._serialized_options = b'\x92A\x18\x12\x16Delete entities (bulk)\x82\xd3\xe4\x93\x02%*#/v1/{parent=entityTypes/*}/entities' - _globals['_ENTITYSERVICE'].methods_by_name['GetEntity']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['GetEntity']._serialized_options = b'\x92A\x0c\x12\nGet entity\x82\xd3\xe4\x93\x02%\x12#/v1/{name=entityTypes/*/entities/*}' - _globals['_ENTITYSERVICE'].methods_by_name['CreateEntity']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['CreateEntity']._serialized_options = b'\x92A\x0f\x12\rCreate entity\x82\xd3\xe4\x93\x02-"#/v1/{parent=entityTypes/*}/entities:\x06entity' - _globals['_ENTITYSERVICE'].methods_by_name['UpdateEntity']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['UpdateEntity']._serialized_options = b'\x92A\x0f\x12\rUpdate entity\x82\xd3\xe4\x93\x0242*/v1/{entity.name=entityTypes/*/entities/*}:\x06entity' - _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntity']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['DeleteEntity']._serialized_options = b'\x92A\x0f\x12\rDelete entity\x82\xd3\xe4\x93\x02%*#/v1/{name=entityTypes/*/entities/*}' - _globals['_ENTITYSERVICE'].methods_by_name['SearchEntities']._loaded_options = None - _globals['_ENTITYSERVICE'].methods_by_name['SearchEntities']._serialized_options = b'\x92A\x11\x12\x0fSearch entities\x82\xd3\xe4\x93\x02/"*/v1/{parent=entityTypes/*}/entities:search:\x01*' - _globals['_LISTENTITYTYPESREQUEST']._serialized_start = 321 - _globals['_LISTENTITYTYPESREQUEST']._serialized_end = 384 - _globals['_LISTENTITYTYPESRESPONSE']._serialized_start = 386 - _globals['_LISTENTITYTYPESRESPONSE']._serialized_end = 510 - _globals['_GETENTITYTYPEREQUEST']._serialized_start = 512 - _globals['_GETENTITYTYPEREQUEST']._serialized_end = 576 - _globals['_CREATEENTITYTYPEREQUEST']._serialized_start = 578 - _globals['_CREATEENTITYTYPEREQUEST']._serialized_end = 684 - _globals['_UPDATEENTITYTYPEREQUEST']._serialized_start = 687 - _globals['_UPDATEENTITYTYPEREQUEST']._serialized_end = 865 - _globals['_DELETEENTITYTYPEREQUEST']._serialized_start = 867 - _globals['_DELETEENTITYTYPEREQUEST']._serialized_end = 934 - _globals['_LISTENTITIESREQUEST']._serialized_start = 936 - _globals['_LISTENTITIESREQUEST']._serialized_end = 1040 - _globals['_LISTENTITIESRESPONSE']._serialized_start = 1042 - _globals['_LISTENTITIESRESPONSE']._serialized_end = 1155 - _globals['_DELETEENTITIESREQUEST']._serialized_start = 1157 - _globals['_DELETEENTITIESREQUEST']._serialized_end = 1241 - _globals['_GETENTITYREQUEST']._serialized_start = 1243 - _globals['_GETENTITYREQUEST']._serialized_end = 1299 - _globals['_CREATEENTITYREQUEST']._serialized_start = 1301 - _globals['_CREATEENTITYREQUEST']._serialized_end = 1415 - _globals['_UPDATEENTITYREQUEST']._serialized_start = 1418 - _globals['_UPDATEENTITYREQUEST']._serialized_end = 1579 - _globals['_DELETEENTITYREQUEST']._serialized_start = 1581 - _globals['_DELETEENTITYREQUEST']._serialized_end = 1640 - _globals['_SEARCHENTITIESREQUEST']._serialized_start = 1643 - _globals['_SEARCHENTITIESREQUEST']._serialized_end = 1853 - _globals['_SEARCHENTITIESRESPONSE']._serialized_start = 1856 - _globals['_SEARCHENTITIESRESPONSE']._serialized_end = 2134 - _globals['_SEARCHENTITIESRESPONSE_SEARCHRESULT']._serialized_start = 2027 - _globals['_SEARCHENTITIESRESPONSE_SEARCHRESULT']._serialized_end = 2134 - _globals['_ENTITYSERVICE']._serialized_start = 2137 - _globals['_ENTITYSERVICE']._serialized_end = 4048 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2_grpc.py deleted file mode 100644 index cebf06e9..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2_grpc.py +++ /dev/null @@ -1,249 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import entity_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2 -from .....exabel.api.data.v1 import entity_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/entity_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class EntityServiceStub(object): - """Service for managing entity types and entities. See the User Guide for more information about - entity types and entities: https://help.exabel.com/docs/entities - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListEntityTypes = channel.unary_unary('/exabel.api.data.v1.EntityService/ListEntityTypes', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesResponse.FromString, _registered_method=True) - self.GetEntityType = channel.unary_unary('/exabel.api.data.v1.EntityService/GetEntityType', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityTypeRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, _registered_method=True) - self.CreateEntityType = channel.unary_unary('/exabel.api.data.v1.EntityService/CreateEntityType', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityTypeRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, _registered_method=True) - self.UpdateEntityType = channel.unary_unary('/exabel.api.data.v1.EntityService/UpdateEntityType', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityTypeRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, _registered_method=True) - self.DeleteEntityType = channel.unary_unary('/exabel.api.data.v1.EntityService/DeleteEntityType', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityTypeRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.ListEntities = channel.unary_unary('/exabel.api.data.v1.EntityService/ListEntities', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesResponse.FromString, _registered_method=True) - self.DeleteEntities = channel.unary_unary('/exabel.api.data.v1.EntityService/DeleteEntities', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntitiesRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.GetEntity = channel.unary_unary('/exabel.api.data.v1.EntityService/GetEntity', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, _registered_method=True) - self.CreateEntity = channel.unary_unary('/exabel.api.data.v1.EntityService/CreateEntity', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, _registered_method=True) - self.UpdateEntity = channel.unary_unary('/exabel.api.data.v1.EntityService/UpdateEntity', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, _registered_method=True) - self.DeleteEntity = channel.unary_unary('/exabel.api.data.v1.EntityService/DeleteEntity', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.SearchEntities = channel.unary_unary('/exabel.api.data.v1.EntityService/SearchEntities', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesResponse.FromString, _registered_method=True) - -class EntityServiceServicer(object): - """Service for managing entity types and entities. See the User Guide for more information about - entity types and entities: https://help.exabel.com/docs/entities - """ - - def ListEntityTypes(self, request, context): - """Lists all known entity types. - - Lists all entity types available to your customer, including those created by you, and in the - global catalog. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetEntityType(self, request, context): - """Gets one entity type. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateEntityType(self, request, context): - """Creates one entity type and returns it. - - It is also possible to create an entity type set by calling `UpdateEntityType` - with `allow_missing` set to `true`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateEntityType(self, request, context): - """Updates one entity type and returns it. - - This can also be used to create an entity type by setting `allow_missing` to `true`. - - Note that this method will update all fields unless `update_mask` is set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteEntityType(self, request, context): - """Deletes one entity type. - - This can only be performed on entity types with no entities. You should delete entities before - deleting their entity type. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListEntities(self, request, context): - """Lists all entities of a given entity type. - - List all entities of a given entity type. - Some entity types are too large to be listed (company, regional, security, listing) - use the - Search method instead. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteEntities(self, request, context): - """Deletes entities. - - Deletes ***all*** entities of a given entity type, and their relationships and time series. - This is useful for cleaning up erroneous data imports and data that is no longer needed. - Note that the `confirm` field must be set to `true`. Only entities in your namespace(s) are - deleted, and the entity type itself is *not* deleted. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetEntity(self, request, context): - """Gets one entity. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateEntity(self, request, context): - """Creates one entity and returns it. - - It is also possible to create an entity by calling `UpdateEntity` - with `allow_missing` set to `true`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateEntity(self, request, context): - """Updates one entity and returns it. - - This can also be used to create an entity by setting `allow_missing` to `true`. - - Note that this method will update all fields unless `update_mask` is set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteEntity(self, request, context): - """Deletes one entity. - - This will delete ***all*** relationships and time series for the entity. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SearchEntities(self, request, context): - """Search for entities. - - Currently, only companies, securities, and listings can be searched. - - If multiple search terms are present, each search is performed individually, with results - returned in separate `SearchResult` objects. - - Companies may be searched by any of the following fields: - * `isin` (International Securities Identification Number) - * `mic` (Market Identifier Code) and `ticker` - * `bloomberg_ticker` (eg `AAPL US`) - * `bloomberg_symbol` (eg `AAPL US Equity`) - * `cusip` (Committee on Uniform Securities Identification Procedures) - * `figi` (Financial Instruments Global Identifier) - * `factset_identifier`: either FactSet entity identifier (eg `000C7F-E`) or FactSet permanent identifier (FSYM_ID, eg `R85KLC-S`) - * `text` - - `mic` and `ticker` must come in pairs, with `mic` immediately before `ticker`. Each pair is - treated as one search query. - - The `text` field supports free text search for ISINs, tickers and/or company names. If a - search term is sufficiently long, a prefix search will be performed. Up to five companies are - returned for each search. - - Securities may be searched by any of the following fields: - * `isin` - * `mic` and `ticker` - * `cusip` - - Listings may be searched by any of the following fields: - * `mic` and `ticker` - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_EntityServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListEntityTypes': grpc.unary_unary_rpc_method_handler(servicer.ListEntityTypes, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesResponse.SerializeToString), 'GetEntityType': grpc.unary_unary_rpc_method_handler(servicer.GetEntityType, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityTypeRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.SerializeToString), 'CreateEntityType': grpc.unary_unary_rpc_method_handler(servicer.CreateEntityType, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityTypeRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.SerializeToString), 'UpdateEntityType': grpc.unary_unary_rpc_method_handler(servicer.UpdateEntityType, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityTypeRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.SerializeToString), 'DeleteEntityType': grpc.unary_unary_rpc_method_handler(servicer.DeleteEntityType, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityTypeRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'ListEntities': grpc.unary_unary_rpc_method_handler(servicer.ListEntities, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesResponse.SerializeToString), 'DeleteEntities': grpc.unary_unary_rpc_method_handler(servicer.DeleteEntities, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntitiesRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'GetEntity': grpc.unary_unary_rpc_method_handler(servicer.GetEntity, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.SerializeToString), 'CreateEntity': grpc.unary_unary_rpc_method_handler(servicer.CreateEntity, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.SerializeToString), 'UpdateEntity': grpc.unary_unary_rpc_method_handler(servicer.UpdateEntity, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.SerializeToString), 'DeleteEntity': grpc.unary_unary_rpc_method_handler(servicer.DeleteEntity, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'SearchEntities': grpc.unary_unary_rpc_method_handler(servicer.SearchEntities, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesResponse.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.EntityService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.EntityService', rpc_method_handlers) - -class EntityService(object): - """Service for managing entity types and entities. See the User Guide for more information about - entity types and entities: https://help.exabel.com/docs/entities - """ - - @staticmethod - def ListEntityTypes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/ListEntityTypes', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntityTypesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetEntityType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/GetEntityType', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityTypeRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateEntityType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/CreateEntityType', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityTypeRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateEntityType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/UpdateEntityType', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityTypeRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.EntityType.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteEntityType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/DeleteEntityType', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityTypeRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListEntities(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/ListEntities', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.ListEntitiesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteEntities(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/DeleteEntities', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntitiesRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetEntity(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/GetEntity', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.GetEntityRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateEntity(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/CreateEntity', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.CreateEntityRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateEntity(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/UpdateEntity', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.UpdateEntityRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.Entity.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteEntity(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/DeleteEntity', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.DeleteEntityRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def SearchEntities(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.EntityService/SearchEntities', exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_entity__service__pb2.SearchEntitiesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2.py deleted file mode 100644 index 740356b3..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/holiday_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.time import date_pb2 as exabel_dot_api_dot_time_dot_date__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)exabel/api/data/v1/holiday_messages.proto\x12\x12exabel.api.data.v1\x1a\x1aexabel/api/time/date.proto"i\n\x14HolidaySpecification\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0cdisplay_name\x18\x02 \x01(\t\x12-\n\x08holidays\x18\x03 \x03(\x0b2\x1b.exabel.api.data.v1.Holiday"\x7f\n\x07Holiday\x12\r\n\x05label\x18\x01 \x01(\t\x12\x14\n\x0clower_window\x18\x02 \x01(\x05\x12\x14\n\x0cupper_window\x18\x03 \x01(\x05\x12\x13\n\x0bprior_scale\x18\x04 \x01(\x01\x12$\n\x05dates\x18\x05 \x03(\x0b2\x15.exabel.api.time.DateBH\n\x16com.exabel.api.data.v1B\x14HolidayMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.holiday_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x14HolidayMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_HOLIDAYSPECIFICATION']._serialized_start = 93 - _globals['_HOLIDAYSPECIFICATION']._serialized_end = 198 - _globals['_HOLIDAY']._serialized_start = 200 - _globals['_HOLIDAY']._serialized_end = 327 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2_grpc.py deleted file mode 100644 index da16375d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/holiday_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2.py deleted file mode 100644 index 738991be..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/holiday_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import holiday_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/holiday_service.proto\x12\x12exabel.api.data.v1\x1a)exabel/api/data/v1/holiday_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"I\n ListHolidaySpecificationsRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t"\x86\x01\n!ListHolidaySpecificationsResponse\x12H\n\x16holiday_specifications\x18\x01 \x03(\x0b2(.exabel.api.data.v1.HolidaySpecification\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"q\n\x1eGetHolidaySpecificationRequest\x12O\n\x04name\x18\x01 \x01(\tBA\x92A;J\x1b"holidaySpecifications/123"\xca>\x1b\xfa\x02\x18holidaySpecificationName\xe0A\x02"q\n!CreateHolidaySpecificationRequest\x12L\n\x15holiday_specification\x18\x01 \x01(\x0b2(.exabel.api.data.v1.HolidaySpecificationB\x03\xe0A\x02"q\n!UpdateHolidaySpecificationRequest\x12L\n\x15holiday_specification\x18\x01 \x01(\x0b2(.exabel.api.data.v1.HolidaySpecificationB\x03\xe0A\x02"t\n!DeleteHolidaySpecificationRequest\x12O\n\x04name\x18\x01 \x01(\tBA\x92A;J\x1b"holidaySpecifications/123"\xca>\x1b\xfa\x02\x18holidaySpecificationName\xe0A\x022\xb2\x08\n\x0eHolidayService\x12\xcb\x01\n\x19ListHolidaySpecifications\x124.exabel.api.data.v1.ListHolidaySpecificationsRequest\x1a5.exabel.api.data.v1.ListHolidaySpecificationsResponse"A\x92A\x1d\x12\x1bList holiday specifications\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/holidaySpecifications\x12\xc1\x01\n\x17GetHolidaySpecification\x122.exabel.api.data.v1.GetHolidaySpecificationRequest\x1a(.exabel.api.data.v1.HolidaySpecification"H\x92A\x1b\x12\x19Get holiday specification\x82\xd3\xe4\x93\x02$\x12"/v1/{name=holidaySpecifications/*}\x12\xd8\x01\n\x1aCreateHolidaySpecification\x125.exabel.api.data.v1.CreateHolidaySpecificationRequest\x1a(.exabel.api.data.v1.HolidaySpecification"Y\x92A\x1e\x12\x1cCreate holiday specification\x82\xd3\xe4\x93\x022"\x19/v1/holidaySpecifications:\x15holiday_specification\x12\xf7\x01\n\x1aUpdateHolidaySpecification\x125.exabel.api.data.v1.UpdateHolidaySpecificationRequest\x1a(.exabel.api.data.v1.HolidaySpecification"x\x92A\x1e\x12\x1cUpdate holiday specification\x82\xd3\xe4\x93\x02Q28/v1/{holiday_specification.name=holidaySpecifications/*}:\x15holiday_specification\x12\xb8\x01\n\x1aDeleteHolidaySpecification\x125.exabel.api.data.v1.DeleteHolidaySpecificationRequest\x1a\x16.google.protobuf.Empty"K\x92A\x1e\x12\x1cDelete holiday specification\x82\xd3\xe4\x93\x02$*"/v1/{name=holidaySpecifications/*}BG\n\x16com.exabel.api.data.v1B\x13HolidayServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.holiday_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x13HolidayServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_GETHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['name']._serialized_options = b'\x92A;J\x1b"holidaySpecifications/123"\xca>\x1b\xfa\x02\x18holidaySpecificationName\xe0A\x02' - _globals['_CREATEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['holiday_specification']._loaded_options = None - _globals['_CREATEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['holiday_specification']._serialized_options = b'\xe0A\x02' - _globals['_UPDATEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['holiday_specification']._loaded_options = None - _globals['_UPDATEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['holiday_specification']._serialized_options = b'\xe0A\x02' - _globals['_DELETEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETEHOLIDAYSPECIFICATIONREQUEST'].fields_by_name['name']._serialized_options = b'\x92A;J\x1b"holidaySpecifications/123"\xca>\x1b\xfa\x02\x18holidaySpecificationName\xe0A\x02' - _globals['_HOLIDAYSERVICE'].methods_by_name['ListHolidaySpecifications']._loaded_options = None - _globals['_HOLIDAYSERVICE'].methods_by_name['ListHolidaySpecifications']._serialized_options = b'\x92A\x1d\x12\x1bList holiday specifications\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/holidaySpecifications' - _globals['_HOLIDAYSERVICE'].methods_by_name['GetHolidaySpecification']._loaded_options = None - _globals['_HOLIDAYSERVICE'].methods_by_name['GetHolidaySpecification']._serialized_options = b'\x92A\x1b\x12\x19Get holiday specification\x82\xd3\xe4\x93\x02$\x12"/v1/{name=holidaySpecifications/*}' - _globals['_HOLIDAYSERVICE'].methods_by_name['CreateHolidaySpecification']._loaded_options = None - _globals['_HOLIDAYSERVICE'].methods_by_name['CreateHolidaySpecification']._serialized_options = b'\x92A\x1e\x12\x1cCreate holiday specification\x82\xd3\xe4\x93\x022"\x19/v1/holidaySpecifications:\x15holiday_specification' - _globals['_HOLIDAYSERVICE'].methods_by_name['UpdateHolidaySpecification']._loaded_options = None - _globals['_HOLIDAYSERVICE'].methods_by_name['UpdateHolidaySpecification']._serialized_options = b'\x92A\x1e\x12\x1cUpdate holiday specification\x82\xd3\xe4\x93\x02Q28/v1/{holiday_specification.name=holidaySpecifications/*}:\x15holiday_specification' - _globals['_HOLIDAYSERVICE'].methods_by_name['DeleteHolidaySpecification']._loaded_options = None - _globals['_HOLIDAYSERVICE'].methods_by_name['DeleteHolidaySpecification']._serialized_options = b'\x92A\x1e\x12\x1cDelete holiday specification\x82\xd3\xe4\x93\x02$*"/v1/{name=holidaySpecifications/*}' - _globals['_LISTHOLIDAYSPECIFICATIONSREQUEST']._serialized_start = 247 - _globals['_LISTHOLIDAYSPECIFICATIONSREQUEST']._serialized_end = 320 - _globals['_LISTHOLIDAYSPECIFICATIONSRESPONSE']._serialized_start = 323 - _globals['_LISTHOLIDAYSPECIFICATIONSRESPONSE']._serialized_end = 457 - _globals['_GETHOLIDAYSPECIFICATIONREQUEST']._serialized_start = 459 - _globals['_GETHOLIDAYSPECIFICATIONREQUEST']._serialized_end = 572 - _globals['_CREATEHOLIDAYSPECIFICATIONREQUEST']._serialized_start = 574 - _globals['_CREATEHOLIDAYSPECIFICATIONREQUEST']._serialized_end = 687 - _globals['_UPDATEHOLIDAYSPECIFICATIONREQUEST']._serialized_start = 689 - _globals['_UPDATEHOLIDAYSPECIFICATIONREQUEST']._serialized_end = 802 - _globals['_DELETEHOLIDAYSPECIFICATIONREQUEST']._serialized_start = 804 - _globals['_DELETEHOLIDAYSPECIFICATIONREQUEST']._serialized_end = 920 - _globals['_HOLIDAYSERVICE']._serialized_start = 923 - _globals['_HOLIDAYSERVICE']._serialized_end = 1997 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2_grpc.py deleted file mode 100644 index 01421781..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/holiday_service_pb2_grpc.py +++ /dev/null @@ -1,113 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import holiday_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2 -from .....exabel.api.data.v1 import holiday_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/holiday_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class HolidayServiceStub(object): - """Service for managing custom holiday specifications for Prophet forecasting. - - Holiday specifications define sets of holidays with their properties (dates, windows, weights) - that can be used when forecasting with the Prophet model. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListHolidaySpecifications = channel.unary_unary('/exabel.api.data.v1.HolidayService/ListHolidaySpecifications', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsResponse.FromString, _registered_method=True) - self.GetHolidaySpecification = channel.unary_unary('/exabel.api.data.v1.HolidayService/GetHolidaySpecification', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.GetHolidaySpecificationRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, _registered_method=True) - self.CreateHolidaySpecification = channel.unary_unary('/exabel.api.data.v1.HolidayService/CreateHolidaySpecification', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.CreateHolidaySpecificationRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, _registered_method=True) - self.UpdateHolidaySpecification = channel.unary_unary('/exabel.api.data.v1.HolidayService/UpdateHolidaySpecification', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.UpdateHolidaySpecificationRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, _registered_method=True) - self.DeleteHolidaySpecification = channel.unary_unary('/exabel.api.data.v1.HolidayService/DeleteHolidaySpecification', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.DeleteHolidaySpecificationRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - -class HolidayServiceServicer(object): - """Service for managing custom holiday specifications for Prophet forecasting. - - Holiday specifications define sets of holidays with their properties (dates, windows, weights) - that can be used when forecasting with the Prophet model. - """ - - def ListHolidaySpecifications(self, request, context): - """Lists all holiday specifications. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetHolidaySpecification(self, request, context): - """Gets one holiday specification. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateHolidaySpecification(self, request, context): - """Creates a new holiday specification. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateHolidaySpecification(self, request, context): - """Updates an existing holiday specification. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteHolidaySpecification(self, request, context): - """Deletes a holiday specification. - - Note: Deleting a holiday specification that is referenced by KPI mapping groups - will cause forecasting to fail for those groups until the reference is removed or updated. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_HolidayServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListHolidaySpecifications': grpc.unary_unary_rpc_method_handler(servicer.ListHolidaySpecifications, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsResponse.SerializeToString), 'GetHolidaySpecification': grpc.unary_unary_rpc_method_handler(servicer.GetHolidaySpecification, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.GetHolidaySpecificationRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.SerializeToString), 'CreateHolidaySpecification': grpc.unary_unary_rpc_method_handler(servicer.CreateHolidaySpecification, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.CreateHolidaySpecificationRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.SerializeToString), 'UpdateHolidaySpecification': grpc.unary_unary_rpc_method_handler(servicer.UpdateHolidaySpecification, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.UpdateHolidaySpecificationRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.SerializeToString), 'DeleteHolidaySpecification': grpc.unary_unary_rpc_method_handler(servicer.DeleteHolidaySpecification, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.DeleteHolidaySpecificationRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.HolidayService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.HolidayService', rpc_method_handlers) - -class HolidayService(object): - """Service for managing custom holiday specifications for Prophet forecasting. - - Holiday specifications define sets of holidays with their properties (dates, windows, weights) - that can be used when forecasting with the Prophet model. - """ - - @staticmethod - def ListHolidaySpecifications(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.HolidayService/ListHolidaySpecifications', exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.ListHolidaySpecificationsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetHolidaySpecification(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.HolidayService/GetHolidaySpecification', exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.GetHolidaySpecificationRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateHolidaySpecification(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.HolidayService/CreateHolidaySpecification', exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.CreateHolidaySpecificationRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateHolidaySpecification(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.HolidayService/UpdateHolidaySpecification', exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.UpdateHolidaySpecificationRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_holiday__messages__pb2.HolidaySpecification.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteHolidaySpecification(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.HolidayService/DeleteHolidaySpecification', exabel_dot_api_dot_data_dot_v1_dot_holiday__service__pb2.DeleteHolidaySpecificationRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2.py deleted file mode 100644 index fdea752f..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/import_job_service.proto') -_sym_db = _symbol_database.Default() -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+exabel/api/data/v1/import_job_service.proto\x12\x12exabel.api.data.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"4\n\x0eRunTaskRequest\x12"\n\x04name\x18\x01 \x01(\tB\x14\x92A\x0e\xca>\x0b\xfa\x02\x08taskName\xe0A\x02"\x11\n\x0fRunTaskResponse2\x9e\x01\n\x10ImportJobService\x12\x89\x01\n\x07RunTask\x12".exabel.api.data.v1.RunTaskRequest\x1a#.exabel.api.data.v1.RunTaskResponse"5\x92A\x11\x12\x0fRun import task\x82\xd3\xe4\x93\x02\x1b"\x16/v1/{name=tasks/*}:run:\x01*BJ\n\x16com.exabel.api.data.v1B\x16ImportJobsServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.import_job_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x16ImportJobsServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_RUNTASKREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_RUNTASKREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x0e\xca>\x0b\xfa\x02\x08taskName\xe0A\x02' - _globals['_IMPORTJOBSERVICE'].methods_by_name['RunTask']._loaded_options = None - _globals['_IMPORTJOBSERVICE'].methods_by_name['RunTask']._serialized_options = b'\x92A\x11\x12\x0fRun import task\x82\xd3\xe4\x93\x02\x1b"\x16/v1/{name=tasks/*}:run:\x01*' - _globals['_RUNTASKREQUEST']._serialized_start = 178 - _globals['_RUNTASKREQUEST']._serialized_end = 230 - _globals['_RUNTASKRESPONSE']._serialized_start = 232 - _globals['_RUNTASKRESPONSE']._serialized_end = 249 - _globals['_IMPORTJOBSERVICE']._serialized_start = 252 - _globals['_IMPORTJOBSERVICE']._serialized_end = 410 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2_grpc.py deleted file mode 100644 index 5841cd50..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/import_job_service_pb2_grpc.py +++ /dev/null @@ -1,68 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import import_job_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/import_job_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class ImportJobServiceStub(object): - """Service for managing import jobs. - - As set of import job stages is run as a single import job task. See the User Guide for more - information on import jobs: https://help.exabel.com/docs/importing-via-import-jobs - - The only current supported operation is run a given import job task. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.RunTask = channel.unary_unary('/exabel.api.data.v1.ImportJobService/RunTask', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskResponse.FromString, _registered_method=True) - -class ImportJobServiceServicer(object): - """Service for managing import jobs. - - As set of import job stages is run as a single import job task. See the User Guide for more - information on import jobs: https://help.exabel.com/docs/importing-via-import-jobs - - The only current supported operation is run a given import job task. - """ - - def RunTask(self, request, context): - """Runs an import task. - - Runs all the stages of an import job task. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_ImportJobServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'RunTask': grpc.unary_unary_rpc_method_handler(servicer.RunTask, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskResponse.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.ImportJobService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.ImportJobService', rpc_method_handlers) - -class ImportJobService(object): - """Service for managing import jobs. - - As set of import job stages is run as a single import job task. See the User Guide for more - information on import jobs: https://help.exabel.com/docs/importing-via-import-jobs - - The only current supported operation is run a given import job task. - """ - - @staticmethod - def RunTask(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.ImportJobService/RunTask', exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_import__job__service__pb2.RunTaskResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2.py deleted file mode 100644 index 1d494204..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2.py +++ /dev/null @@ -1,26 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/namespace_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import namespaces_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_namespaces__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*exabel/api/data/v1/namespace_service.proto\x12\x12exabel.api.data.v1\x1a,exabel/api/data/v1/namespaces_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x17\n\x15ListNamespacesRequest"K\n\x16ListNamespacesResponse\x121\n\nnamespaces\x18\x01 \x03(\x0b2\x1d.exabel.api.data.v1.Namespace2\xa8\x01\n\x10NamespaceService\x12\x93\x01\n\x0eListNamespaces\x12).exabel.api.data.v1.ListNamespacesRequest\x1a*.exabel.api.data.v1.ListNamespacesResponse"*\x92A\x11\x12\x0fList namespaces\x82\xd3\xe4\x93\x02\x10\x12\x0e/v1/namespacesBI\n\x16com.exabel.api.data.v1B\x15NamespaceServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.namespace_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x15NamespaceServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_NAMESPACESERVICE'].methods_by_name['ListNamespaces']._loaded_options = None - _globals['_NAMESPACESERVICE'].methods_by_name['ListNamespaces']._serialized_options = b'\x92A\x11\x12\x0fList namespaces\x82\xd3\xe4\x93\x02\x10\x12\x0e/v1/namespaces' - _globals['_LISTNAMESPACESREQUEST']._serialized_start = 190 - _globals['_LISTNAMESPACESREQUEST']._serialized_end = 213 - _globals['_LISTNAMESPACESRESPONSE']._serialized_start = 215 - _globals['_LISTNAMESPACESRESPONSE']._serialized_end = 290 - _globals['_NAMESPACESERVICE']._serialized_start = 293 - _globals['_NAMESPACESERVICE']._serialized_end = 461 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2_grpc.py deleted file mode 100644 index 8e9543b4..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/namespace_service_pb2_grpc.py +++ /dev/null @@ -1,67 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import namespace_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/namespace_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class NamespaceServiceStub(object): - """Service for managing namespaces. Namespaces allow Exabel to keep customer data segregated and - private to users of that customer. - - If you have an Exabel full platform license, you will have your own private namespace. All data - that you import will be created in that namespace, and therefore kept private. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListNamespaces = channel.unary_unary('/exabel.api.data.v1.NamespaceService/ListNamespaces', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesResponse.FromString, _registered_method=True) - -class NamespaceServiceServicer(object): - """Service for managing namespaces. Namespaces allow Exabel to keep customer data segregated and - private to users of that customer. - - If you have an Exabel full platform license, you will have your own private namespace. All data - that you import will be created in that namespace, and therefore kept private. - """ - - def ListNamespaces(self, request, context): - """Lists namespaces. - - Lists all namespaces accessible to your customer. If you have your own namespace, it will - listed as writeable. You may also have read access to other namespaces, depending on your - subscriptions. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_NamespaceServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListNamespaces': grpc.unary_unary_rpc_method_handler(servicer.ListNamespaces, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesResponse.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.NamespaceService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.NamespaceService', rpc_method_handlers) - -class NamespaceService(object): - """Service for managing namespaces. Namespaces allow Exabel to keep customer data segregated and - private to users of that customer. - - If you have an Exabel full platform license, you will have your own private namespace. All data - that you import will be created in that namespace, and therefore kept private. - """ - - @staticmethod - def ListNamespaces(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.NamespaceService/ListNamespaces', exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_namespace__service__pb2.ListNamespacesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2.py deleted file mode 100644 index d8cbae92..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/namespaces_messages.proto') -_sym_db = _symbol_database.Default() -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,exabel/api/data/v1/namespaces_messages.proto\x12\x12exabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto"6\n\tNamespace\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0A\x03\x12\x16\n\twriteable\x18\x02 \x01(\x08B\x03\xe0A\x03BK\n\x16com.exabel.api.data.v1B\x17NamespacesMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.namespaces_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x17NamespacesMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_NAMESPACE'].fields_by_name['name']._loaded_options = None - _globals['_NAMESPACE'].fields_by_name['name']._serialized_options = b'\xe0A\x03' - _globals['_NAMESPACE'].fields_by_name['writeable']._loaded_options = None - _globals['_NAMESPACE'].fields_by_name['writeable']._serialized_options = b'\xe0A\x03' - _globals['_NAMESPACE']._serialized_start = 101 - _globals['_NAMESPACE']._serialized_end = 155 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2_grpc.py deleted file mode 100644 index 676e81f1..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/namespaces_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/namespaces_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2.py deleted file mode 100644 index 9b153f58..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/relationship_messages.proto') -_sym_db = _symbol_database.Default() -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.exabel/api/data/v1/relationship_messages.proto\x12\x12exabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x85\x02\n\x10RelationshipType\x12S\n\x04name\x18\x01 \x01(\tBE\x92A\x17\xfa\x02\x14relationshipTypeName\xe0A\x05\xe0A\x02\x12A\n\x0bdescription\x18\x02 \x01(\tB,\x92A)J\'"Indicates that an entity owns a store"\x12\x16\n\tread_only\x18\x03 \x01(\x08B\x03\xe0A\x03\x12\x14\n\x0cis_ownership\x18\x04 \x01(\x08\x12+\n\nproperties\x18d \x01(\x0b2\x17.google.protobuf.Struct"\xf5\x02\n\x0cRelationship\x12R\n\x06parent\x18\x01 \x01(\tBB\x92A\x17\xfa\x02\x14relationshipTypeName\xe0A\x02\x12E\n\x0bfrom_entity\x18\x02 \x01(\tB0\x92A*J("entityTypes/company/entities/F_12345-E"\xe0A\x02\x12K\n\tto_entity\x18\x03 \x01(\tB8\x92A2J0"entityTypes/ns.store/entities/ns.some_store_id"\xe0A\x02\x128\n\x0bdescription\x18\x04 \x01(\tB#\x92A J\x1e"F_12345-E owns some_store_id"\x12\x16\n\tread_only\x18\x05 \x01(\x08B\x03\xe0A\x03\x12+\n\nproperties\x18d \x01(\x0b2\x17.google.protobuf.StructBM\n\x16com.exabel.api.data.v1B\x19RelationshipMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.relationship_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x19RelationshipMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_RELATIONSHIPTYPE'].fields_by_name['name']._loaded_options = None - _globals['_RELATIONSHIPTYPE'].fields_by_name['name']._serialized_options = b'\x92A\x17\xfa\x02\x14relationshipTypeName\xe0A\x05\xe0A\x02' - _globals['_RELATIONSHIPTYPE'].fields_by_name['description']._loaded_options = None - _globals['_RELATIONSHIPTYPE'].fields_by_name['description']._serialized_options = b'\x92A)J\'"Indicates that an entity owns a store"' - _globals['_RELATIONSHIPTYPE'].fields_by_name['read_only']._loaded_options = None - _globals['_RELATIONSHIPTYPE'].fields_by_name['read_only']._serialized_options = b'\xe0A\x03' - _globals['_RELATIONSHIP'].fields_by_name['parent']._loaded_options = None - _globals['_RELATIONSHIP'].fields_by_name['parent']._serialized_options = b'\x92A\x17\xfa\x02\x14relationshipTypeName\xe0A\x02' - _globals['_RELATIONSHIP'].fields_by_name['from_entity']._loaded_options = None - _globals['_RELATIONSHIP'].fields_by_name['from_entity']._serialized_options = b'\x92A*J("entityTypes/company/entities/F_12345-E"\xe0A\x02' - _globals['_RELATIONSHIP'].fields_by_name['to_entity']._loaded_options = None - _globals['_RELATIONSHIP'].fields_by_name['to_entity']._serialized_options = b'\x92A2J0"entityTypes/ns.store/entities/ns.some_store_id"\xe0A\x02' - _globals['_RELATIONSHIP'].fields_by_name['description']._loaded_options = None - _globals['_RELATIONSHIP'].fields_by_name['description']._serialized_options = b'\x92A J\x1e"F_12345-E owns some_store_id"' - _globals['_RELATIONSHIP'].fields_by_name['read_only']._loaded_options = None - _globals['_RELATIONSHIP'].fields_by_name['read_only']._serialized_options = b'\xe0A\x03' - _globals['_RELATIONSHIPTYPE']._serialized_start = 182 - _globals['_RELATIONSHIPTYPE']._serialized_end = 443 - _globals['_RELATIONSHIP']._serialized_start = 446 - _globals['_RELATIONSHIP']._serialized_end = 819 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2.pyi deleted file mode 100644 index a20cda88..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2.pyi +++ /dev/null @@ -1,86 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" -import builtins -import google.protobuf.descriptor -import google.protobuf.message -import google.protobuf.struct_pb2 -import typing -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class RelationshipType(google.protobuf.message.Message): - """A relationship type resource in the Data API.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - READ_ONLY_FIELD_NUMBER: builtins.int - IS_OWNERSHIP_FIELD_NUMBER: builtins.int - PROPERTIES_FIELD_NUMBER: builtins.int - name: builtins.str - 'Unique resource name of the relationship type, e.g.\n `relationshipTypes/namespace.relationshipTypeIdentifier`.\n The namespace must be empty (being global) or a namespace accessible to the customer.\n The relationship type identifier must match the regex `[A-Z][A-Z0-9_]{0,63}`.\n ' - description: builtins.str - 'This is currently not used in the Exabel app, but may be in future.' - read_only: builtins.bool - 'Global relationship types and those from data sets that you subscribe to will be read-only.' - is_ownership: builtins.bool - 'Whether this relationship type specifies an `ownership` in the data set model. Ownership\n relationships must go *from* the owner *to* the child entity.\n ' - - @property - def properties(self) -> google.protobuf.struct_pb2.Struct: - """Additional properties of this relationship type. This is currently not used in the Exabel app, - but may be in future. - """ - - def __init__(self, *, name: builtins.str | None=..., description: builtins.str | None=..., read_only: builtins.bool | None=..., is_ownership: builtins.bool | None=..., properties: google.protobuf.struct_pb2.Struct | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['properties', b'properties']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'is_ownership', b'is_ownership', 'name', b'name', 'properties', b'properties', 'read_only', b'read_only']) -> None: - ... -global___RelationshipType = RelationshipType - -@typing.final -class Relationship(google.protobuf.message.Message): - """A relationship resource in the Data API. All relationships have one relationship type as its - parent. Relationships do not have resource names, but are identified by their (type, from, to) - triple. There can only be one relationship of one type between two entities (as viewed by a - single user). The namespaces of the end points must either be empty (being global) or one of the - predetermined namespaces the customer has access to. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - FROM_ENTITY_FIELD_NUMBER: builtins.int - TO_ENTITY_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - READ_ONLY_FIELD_NUMBER: builtins.int - PROPERTIES_FIELD_NUMBER: builtins.int - parent: builtins.str - 'Parent relationship type, e.g. `relationshipTypes/ns.type1`.' - from_entity: builtins.str - 'Resource name of entity the relationship starts from, e.g.\n `entityTypes/ns.type1/entities/ns.entity1`.\n ' - to_entity: builtins.str - 'Resource name of entity the relationship goes to, e.g.\n `entityTypes/ns.type2/entities/ns.entity2`.\n ' - description: builtins.str - 'This is currently not used in the Exabel app, but may be in future.' - read_only: builtins.bool - 'Global relationships and those from data sets that you subscribe to will be read-only.' - - @property - def properties(self) -> google.protobuf.struct_pb2.Struct: - """Additional properties of this relationship. This is currently not used in the Exabel app, but - may be in future. - """ - - def __init__(self, *, parent: builtins.str | None=..., from_entity: builtins.str | None=..., to_entity: builtins.str | None=..., description: builtins.str | None=..., read_only: builtins.bool | None=..., properties: google.protobuf.struct_pb2.Struct | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['properties', b'properties']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'from_entity', b'from_entity', 'parent', b'parent', 'properties', b'properties', 'read_only', b'read_only', 'to_entity', b'to_entity']) -> None: - ... -global___Relationship = Relationship \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2_grpc.py deleted file mode 100644 index 728ca193..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/relationship_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2.py deleted file mode 100644 index d039e08d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2.py +++ /dev/null @@ -1,93 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/relationship_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import relationship_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-exabel/api/data/v1/relationship_service.proto\x12\x12exabel.api.data.v1\x1a.exabel/api/data/v1/relationship_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"E\n\x1cListRelationshipTypesRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t"\x8e\x01\n\x1dListRelationshipTypesResponse\x12@\n\x12relationship_types\x18\x01 \x03(\x0b2$.exabel.api.data.v1.RelationshipType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"e\n\x1dCreateRelationshipTypeRequest\x12D\n\x11relationship_type\x18\x01 \x01(\x0b2$.exabel.api.data.v1.RelationshipTypeB\x03\xe0A\x02"\xad\x01\n\x1dUpdateRelationshipTypeRequest\x12D\n\x11relationship_type\x18\x01 \x01(\x0b2$.exabel.api.data.v1.RelationshipTypeB\x03\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08"O\n\x1dDeleteRelationshipTypeRequest\x12.\n\x04name\x18\x01 \x01(\tB \x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02"L\n\x1aGetRelationshipTypeRequest\x12.\n\x04name\x18\x01 \x01(\tB \x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02"\x9b\x01\n\x18ListRelationshipsRequest\x120\n\x06parent\x18\x01 \x01(\tB \x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02\x12\x13\n\x0bfrom_entity\x18\x02 \x01(\t\x12\x11\n\tto_entity\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t"\x81\x01\n\x19ListRelationshipsResponse\x127\n\rrelationships\x18\x01 \x03(\x0b2 .exabel.api.data.v1.Relationship\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"|\n\x16GetRelationshipRequest\x120\n\x06parent\x18\x01 \x01(\tB \x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02\x12\x18\n\x0bfrom_entity\x18\x02 \x01(\tB\x03\xe0A\x02\x12\x16\n\tto_entity\x18\x03 \x01(\tB\x03\xe0A\x02"X\n\x19CreateRelationshipRequest\x12;\n\x0crelationship\x18\x01 \x01(\x0b2 .exabel.api.data.v1.RelationshipB\x03\xe0A\x02"\xa0\x01\n\x19UpdateRelationshipRequest\x12;\n\x0crelationship\x18\x01 \x01(\x0b2 .exabel.api.data.v1.RelationshipB\x03\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08"\x7f\n\x19DeleteRelationshipRequest\x120\n\x06parent\x18\x01 \x01(\tB \x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02\x12\x18\n\x0bfrom_entity\x18\x02 \x01(\tB\x03\xe0A\x02\x12\x16\n\tto_entity\x18\x03 \x01(\tB\x03\xe0A\x022\x94\x12\n\x13RelationshipService\x12\xb7\x01\n\x15ListRelationshipTypes\x120.exabel.api.data.v1.ListRelationshipTypesRequest\x1a1.exabel.api.data.v1.ListRelationshipTypesResponse"9\x92A\x19\x12\x17List relationship types\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/relationshipTypes\x12\xad\x01\n\x13GetRelationshipType\x12..exabel.api.data.v1.GetRelationshipTypeRequest\x1a$.exabel.api.data.v1.RelationshipType"@\x92A\x17\x12\x15Get relationship type\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{name=relationshipTypes/*}\x12\xc0\x01\n\x16CreateRelationshipType\x121.exabel.api.data.v1.CreateRelationshipTypeRequest\x1a$.exabel.api.data.v1.RelationshipType"M\x92A\x1a\x12\x18Create relationship type\x82\xd3\xe4\x93\x02*"\x15/v1/relationshipTypes:\x11relationship_type\x12\xdb\x01\n\x16UpdateRelationshipType\x121.exabel.api.data.v1.UpdateRelationshipTypeRequest\x1a$.exabel.api.data.v1.RelationshipType"h\x92A\x1a\x12\x18Update relationship type\x82\xd3\xe4\x93\x02E20/v1/{relationship_type.name=relationshipTypes/*}:\x11relationship_type\x12\xa8\x01\n\x16DeleteRelationshipType\x121.exabel.api.data.v1.DeleteRelationshipTypeRequest\x1a\x16.google.protobuf.Empty"C\x92A\x1a\x12\x18Delete relationship type\x82\xd3\xe4\x93\x02 *\x1e/v1/{name=relationshipTypes/*}\x12\xbf\x01\n\x11ListRelationships\x12,.exabel.api.data.v1.ListRelationshipsRequest\x1a-.exabel.api.data.v1.ListRelationshipsResponse"M\x92A\x14\x12\x12List relationships\x82\xd3\xe4\x93\x020\x12./v1/{parent=relationshipTypes/*}/relationships\x12\xf9\x01\n\x0fGetRelationship\x12*.exabel.api.data.v1.GetRelationshipRequest\x1a .exabel.api.data.v1.Relationship"\x97\x01\x92A\x12\x12\x10Get relationship\x82\xd3\xe4\x93\x02|\x12z/v1/{parent=relationshipTypes/*}/relationships/{from_entity=entityTypes/*/entities/*}/{to_entity=entityTypes/*/entities/*}\x12\xd0\x01\n\x12CreateRelationship\x12-.exabel.api.data.v1.CreateRelationshipRequest\x1a .exabel.api.data.v1.Relationship"i\x92A\x15\x12\x13Create relationship\x82\xd3\xe4\x93\x02K";/v1/{relationship.parent=relationshipTypes/*}/relationships:\x0crelationship\x12\x87\x03\n\x12UpdateRelationship\x12-.exabel.api.data.v1.UpdateRelationshipRequest\x1a .exabel.api.data.v1.Relationship"\x9f\x02\x92A\x15\x12\x13Update relationship\x82\xd3\xe4\x93\x02\x80\x022;/v1/{relationship.parent=relationshipTypes/*}/relationships:\x0crelationshipZ\xb2\x012\xa1\x01/v1/{relationship.parent=relationshipTypes/*}/relationships/{relationship.from_entity=entityTypes/*/entities/*}/{relationship.to_entity=entityTypes/*/entities/*}:\x0crelationship\x12\xab\x02\n\x12DeleteRelationship\x12-.exabel.api.data.v1.DeleteRelationshipRequest\x1a\x16.google.protobuf.Empty"\xcd\x01\x92A\x15\x12\x13Delete relationship\x82\xd3\xe4\x93\x02\xae\x01*./v1/{parent=relationshipTypes/*}/relationshipsZ|*z/v1/{parent=relationshipTypes/*}/relationships/{from_entity=entityTypes/*/entities/*}/{to_entity=entityTypes/*/entities/*}BL\n\x16com.exabel.api.data.v1B\x18RelationshipServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.relationship_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x18RelationshipServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_CREATERELATIONSHIPTYPEREQUEST'].fields_by_name['relationship_type']._loaded_options = None - _globals['_CREATERELATIONSHIPTYPEREQUEST'].fields_by_name['relationship_type']._serialized_options = b'\xe0A\x02' - _globals['_UPDATERELATIONSHIPTYPEREQUEST'].fields_by_name['relationship_type']._loaded_options = None - _globals['_UPDATERELATIONSHIPTYPEREQUEST'].fields_by_name['relationship_type']._serialized_options = b'\xe0A\x02' - _globals['_DELETERELATIONSHIPTYPEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETERELATIONSHIPTYPEREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02' - _globals['_GETRELATIONSHIPTYPEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETRELATIONSHIPTYPEREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02' - _globals['_LISTRELATIONSHIPSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTRELATIONSHIPSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02' - _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02' - _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['from_entity']._loaded_options = None - _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['from_entity']._serialized_options = b'\xe0A\x02' - _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['to_entity']._loaded_options = None - _globals['_GETRELATIONSHIPREQUEST'].fields_by_name['to_entity']._serialized_options = b'\xe0A\x02' - _globals['_CREATERELATIONSHIPREQUEST'].fields_by_name['relationship']._loaded_options = None - _globals['_CREATERELATIONSHIPREQUEST'].fields_by_name['relationship']._serialized_options = b'\xe0A\x02' - _globals['_UPDATERELATIONSHIPREQUEST'].fields_by_name['relationship']._loaded_options = None - _globals['_UPDATERELATIONSHIPREQUEST'].fields_by_name['relationship']._serialized_options = b'\xe0A\x02' - _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x1a\xca>\x17\xfa\x02\x14relationshipTypeName\xe0A\x02' - _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['from_entity']._loaded_options = None - _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['from_entity']._serialized_options = b'\xe0A\x02' - _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['to_entity']._loaded_options = None - _globals['_DELETERELATIONSHIPREQUEST'].fields_by_name['to_entity']._serialized_options = b'\xe0A\x02' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['ListRelationshipTypes']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['ListRelationshipTypes']._serialized_options = b'\x92A\x19\x12\x17List relationship types\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/relationshipTypes' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['GetRelationshipType']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['GetRelationshipType']._serialized_options = b'\x92A\x17\x12\x15Get relationship type\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{name=relationshipTypes/*}' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['CreateRelationshipType']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['CreateRelationshipType']._serialized_options = b'\x92A\x1a\x12\x18Create relationship type\x82\xd3\xe4\x93\x02*"\x15/v1/relationshipTypes:\x11relationship_type' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['UpdateRelationshipType']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['UpdateRelationshipType']._serialized_options = b'\x92A\x1a\x12\x18Update relationship type\x82\xd3\xe4\x93\x02E20/v1/{relationship_type.name=relationshipTypes/*}:\x11relationship_type' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['DeleteRelationshipType']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['DeleteRelationshipType']._serialized_options = b'\x92A\x1a\x12\x18Delete relationship type\x82\xd3\xe4\x93\x02 *\x1e/v1/{name=relationshipTypes/*}' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['ListRelationships']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['ListRelationships']._serialized_options = b'\x92A\x14\x12\x12List relationships\x82\xd3\xe4\x93\x020\x12./v1/{parent=relationshipTypes/*}/relationships' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['GetRelationship']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['GetRelationship']._serialized_options = b'\x92A\x12\x12\x10Get relationship\x82\xd3\xe4\x93\x02|\x12z/v1/{parent=relationshipTypes/*}/relationships/{from_entity=entityTypes/*/entities/*}/{to_entity=entityTypes/*/entities/*}' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['CreateRelationship']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['CreateRelationship']._serialized_options = b'\x92A\x15\x12\x13Create relationship\x82\xd3\xe4\x93\x02K";/v1/{relationship.parent=relationshipTypes/*}/relationships:\x0crelationship' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['UpdateRelationship']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['UpdateRelationship']._serialized_options = b'\x92A\x15\x12\x13Update relationship\x82\xd3\xe4\x93\x02\x80\x022;/v1/{relationship.parent=relationshipTypes/*}/relationships:\x0crelationshipZ\xb2\x012\xa1\x01/v1/{relationship.parent=relationshipTypes/*}/relationships/{relationship.from_entity=entityTypes/*/entities/*}/{relationship.to_entity=entityTypes/*/entities/*}:\x0crelationship' - _globals['_RELATIONSHIPSERVICE'].methods_by_name['DeleteRelationship']._loaded_options = None - _globals['_RELATIONSHIPSERVICE'].methods_by_name['DeleteRelationship']._serialized_options = b'\x92A\x15\x12\x13Delete relationship\x82\xd3\xe4\x93\x02\xae\x01*./v1/{parent=relationshipTypes/*}/relationshipsZ|*z/v1/{parent=relationshipTypes/*}/relationships/{from_entity=entityTypes/*/entities/*}/{to_entity=entityTypes/*/entities/*}' - _globals['_LISTRELATIONSHIPTYPESREQUEST']._serialized_start = 291 - _globals['_LISTRELATIONSHIPTYPESREQUEST']._serialized_end = 360 - _globals['_LISTRELATIONSHIPTYPESRESPONSE']._serialized_start = 363 - _globals['_LISTRELATIONSHIPTYPESRESPONSE']._serialized_end = 505 - _globals['_CREATERELATIONSHIPTYPEREQUEST']._serialized_start = 507 - _globals['_CREATERELATIONSHIPTYPEREQUEST']._serialized_end = 608 - _globals['_UPDATERELATIONSHIPTYPEREQUEST']._serialized_start = 611 - _globals['_UPDATERELATIONSHIPTYPEREQUEST']._serialized_end = 784 - _globals['_DELETERELATIONSHIPTYPEREQUEST']._serialized_start = 786 - _globals['_DELETERELATIONSHIPTYPEREQUEST']._serialized_end = 865 - _globals['_GETRELATIONSHIPTYPEREQUEST']._serialized_start = 867 - _globals['_GETRELATIONSHIPTYPEREQUEST']._serialized_end = 943 - _globals['_LISTRELATIONSHIPSREQUEST']._serialized_start = 946 - _globals['_LISTRELATIONSHIPSREQUEST']._serialized_end = 1101 - _globals['_LISTRELATIONSHIPSRESPONSE']._serialized_start = 1104 - _globals['_LISTRELATIONSHIPSRESPONSE']._serialized_end = 1233 - _globals['_GETRELATIONSHIPREQUEST']._serialized_start = 1235 - _globals['_GETRELATIONSHIPREQUEST']._serialized_end = 1359 - _globals['_CREATERELATIONSHIPREQUEST']._serialized_start = 1361 - _globals['_CREATERELATIONSHIPREQUEST']._serialized_end = 1449 - _globals['_UPDATERELATIONSHIPREQUEST']._serialized_start = 1452 - _globals['_UPDATERELATIONSHIPREQUEST']._serialized_end = 1612 - _globals['_DELETERELATIONSHIPREQUEST']._serialized_start = 1614 - _globals['_DELETERELATIONSHIPREQUEST']._serialized_end = 1741 - _globals['_RELATIONSHIPSERVICE']._serialized_start = 1744 - _globals['_RELATIONSHIPSERVICE']._serialized_end = 4068 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2.pyi deleted file mode 100644 index 9b690a9d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2.pyi +++ /dev/null @@ -1,280 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" -import builtins -import collections.abc -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.field_mask_pb2 -import google.protobuf.internal.containers -import google.protobuf.message -import typing -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class ListRelationshipTypesRequest(google.protobuf.message.Message): - """The request to list relationship types.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PAGE_SIZE_FIELD_NUMBER: builtins.int - PAGE_TOKEN_FIELD_NUMBER: builtins.int - page_size: builtins.int - 'Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.' - page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the same\n query parameters.\n ' - - def __init__(self, *, page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token']) -> None: - ... -global___ListRelationshipTypesRequest = ListRelationshipTypesRequest - -@typing.final -class ListRelationshipTypesResponse(google.protobuf.message.Message): - """The response to list relationship types. Returns all known relationship types.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - RELATIONSHIP_TYPES_FIELD_NUMBER: builtins.int - NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int - TOTAL_SIZE_FIELD_NUMBER: builtins.int - next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the number of results is less than the page size\n (NOT when the token is empty).\n ' - total_size: builtins.int - 'Total number of results, irrespective of paging.' - - @property - def relationship_types(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.relationship_messages_pb2.RelationshipType]: - """List of relationship types.""" - - def __init__(self, *, relationship_types: collections.abc.Iterable[exabel.api.data.v1.relationship_messages_pb2.RelationshipType] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['next_page_token', b'next_page_token', 'relationship_types', b'relationship_types', 'total_size', b'total_size']) -> None: - ... -global___ListRelationshipTypesResponse = ListRelationshipTypesResponse - -@typing.final -class CreateRelationshipTypeRequest(google.protobuf.message.Message): - """The request to create one relationship type.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - RELATIONSHIP_TYPE_FIELD_NUMBER: builtins.int - - @property - def relationship_type(self) -> exabel.api.data.v1.relationship_messages_pb2.RelationshipType: - """The relationship type to create.""" - - def __init__(self, *, relationship_type: exabel.api.data.v1.relationship_messages_pb2.RelationshipType | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['relationship_type', b'relationship_type']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['relationship_type', b'relationship_type']) -> None: - ... -global___CreateRelationshipTypeRequest = CreateRelationshipTypeRequest - -@typing.final -class UpdateRelationshipTypeRequest(google.protobuf.message.Message): - """The request to update one relationship type.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - RELATIONSHIP_TYPE_FIELD_NUMBER: builtins.int - UPDATE_MASK_FIELD_NUMBER: builtins.int - ALLOW_MISSING_FIELD_NUMBER: builtins.int - allow_missing: builtins.bool - 'If set to `true`, a new relationship type will be created if it did not exist, and\n `update_mask` is ignored.\n ' - - @property - def relationship_type(self) -> exabel.api.data.v1.relationship_messages_pb2.RelationshipType: - """The relationship type to update.""" - - @property - def update_mask(self) -> google.protobuf.field_mask_pb2.FieldMask: - """Use this to update only selected fields. For example, specify `description` to update only the - description. If `allow_missing` is set, this field is ignored. - - For REST requests, this is a comma-separated string. - """ - - def __init__(self, *, relationship_type: exabel.api.data.v1.relationship_messages_pb2.RelationshipType | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=..., allow_missing: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['relationship_type', b'relationship_type', 'update_mask', b'update_mask']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['allow_missing', b'allow_missing', 'relationship_type', b'relationship_type', 'update_mask', b'update_mask']) -> None: - ... -global___UpdateRelationshipTypeRequest = UpdateRelationshipTypeRequest - -@typing.final -class DeleteRelationshipTypeRequest(google.protobuf.message.Message): - """The request to delete one relationship type.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - name: builtins.str - 'The resource name of the relationship type to delete, for example `relationshipTypes/ns.type1`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... -global___DeleteRelationshipTypeRequest = DeleteRelationshipTypeRequest - -@typing.final -class GetRelationshipTypeRequest(google.protobuf.message.Message): - """The response to get one relationship type.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - name: builtins.str - 'The resource name of the requested relationship type, for example `relationshipTypes/ns.type1`.' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... -global___GetRelationshipTypeRequest = GetRelationshipTypeRequest - -@typing.final -class ListRelationshipsRequest(google.protobuf.message.Message): - """The request to list relationship of a specific type.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - FROM_ENTITY_FIELD_NUMBER: builtins.int - TO_ENTITY_FIELD_NUMBER: builtins.int - PAGE_SIZE_FIELD_NUMBER: builtins.int - PAGE_TOKEN_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The type of the relationship, for example `relationshipTypes/ns.type1`.\n Use parent `relationshipTypes/-` to include all types.\n ' - from_entity: builtins.str - 'Resource name of entity to list relationships from, e.g.\n `entityTypes/ns.type1/entities/ns.entity1`.\n ' - to_entity: builtins.str - 'Resource name of entity to list relationships to, e.g.\n `entityTypes/ns.type2/entities/ns.entity2`.\n ' - page_size: builtins.int - 'Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.' - page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the\n same query parameters.\n ' - - def __init__(self, *, parent: builtins.str | None=..., from_entity: builtins.str | None=..., to_entity: builtins.str | None=..., page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['from_entity', b'from_entity', 'page_size', b'page_size', 'page_token', b'page_token', 'parent', b'parent', 'to_entity', b'to_entity']) -> None: - ... -global___ListRelationshipsRequest = ListRelationshipsRequest - -@typing.final -class ListRelationshipsResponse(google.protobuf.message.Message): - """The response to list relationships.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - RELATIONSHIPS_FIELD_NUMBER: builtins.int - NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int - TOTAL_SIZE_FIELD_NUMBER: builtins.int - next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the number of results is less than the page size\n (NOT when the token is empty).\n ' - total_size: builtins.int - 'Total number of results, irrespective of paging.' - - @property - def relationships(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.relationship_messages_pb2.Relationship]: - """List of relationships. **Does not** return `description` or `properties`.""" - - def __init__(self, *, relationships: collections.abc.Iterable[exabel.api.data.v1.relationship_messages_pb2.Relationship] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['next_page_token', b'next_page_token', 'relationships', b'relationships', 'total_size', b'total_size']) -> None: - ... -global___ListRelationshipsResponse = ListRelationshipsResponse - -@typing.final -class GetRelationshipRequest(google.protobuf.message.Message): - """The request to get one relationship.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - FROM_ENTITY_FIELD_NUMBER: builtins.int - TO_ENTITY_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The type of the relationship, for example `relationshipTypes/ns.type1`.' - from_entity: builtins.str - 'Resource name of entity the relationship starts from, e.g.\n `entityTypes/ns.type1/entities/ns.entity1`.\n ' - to_entity: builtins.str - 'Resource name of entity the relationship goes to, e.g.\n `entityTypes/ns.type2/entities/ns.entity2`.\n ' - - def __init__(self, *, parent: builtins.str | None=..., from_entity: builtins.str | None=..., to_entity: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['from_entity', b'from_entity', 'parent', b'parent', 'to_entity', b'to_entity']) -> None: - ... -global___GetRelationshipRequest = GetRelationshipRequest - -@typing.final -class CreateRelationshipRequest(google.protobuf.message.Message): - """The request to create one relationship.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - RELATIONSHIP_FIELD_NUMBER: builtins.int - - @property - def relationship(self) -> exabel.api.data.v1.relationship_messages_pb2.Relationship: - """The relationship to create.""" - - def __init__(self, *, relationship: exabel.api.data.v1.relationship_messages_pb2.Relationship | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['relationship', b'relationship']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['relationship', b'relationship']) -> None: - ... -global___CreateRelationshipRequest = CreateRelationshipRequest - -@typing.final -class UpdateRelationshipRequest(google.protobuf.message.Message): - """The request to update one relationship.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - RELATIONSHIP_FIELD_NUMBER: builtins.int - UPDATE_MASK_FIELD_NUMBER: builtins.int - ALLOW_MISSING_FIELD_NUMBER: builtins.int - allow_missing: builtins.bool - 'If set to `true`, a new relationship will be created if it did not exist, and `update_mask` is\n ignored.\n ' - - @property - def relationship(self) -> exabel.api.data.v1.relationship_messages_pb2.Relationship: - """The relationship to update.""" - - @property - def update_mask(self) -> google.protobuf.field_mask_pb2.FieldMask: - """Use this to update only selected fields. For example, specify `description` to update only the - description. If `allow_missing` is set, this field is ignored. - - For REST requests, this is a comma-separated string. - """ - - def __init__(self, *, relationship: exabel.api.data.v1.relationship_messages_pb2.Relationship | None=..., update_mask: google.protobuf.field_mask_pb2.FieldMask | None=..., allow_missing: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['relationship', b'relationship', 'update_mask', b'update_mask']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['allow_missing', b'allow_missing', 'relationship', b'relationship', 'update_mask', b'update_mask']) -> None: - ... -global___UpdateRelationshipRequest = UpdateRelationshipRequest - -@typing.final -class DeleteRelationshipRequest(google.protobuf.message.Message): - """The request to delete one relationship.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - FROM_ENTITY_FIELD_NUMBER: builtins.int - TO_ENTITY_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The parent of the relationship to delete, for example `relationshipTypes/ns.type1`.' - from_entity: builtins.str - 'Resource name of entity the relationship starts from, e.g.\n `entityTypes/ns.type1/entities/ns.entity1`.\n ' - to_entity: builtins.str - 'Resource name of entity the relationship goes to, e.g.\n `entityTypes/ns.type2/entities/ns.entity2`.\n ' - - def __init__(self, *, parent: builtins.str | None=..., from_entity: builtins.str | None=..., to_entity: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['from_entity', b'from_entity', 'parent', b'parent', 'to_entity', b'to_entity']) -> None: - ... -global___DeleteRelationshipRequest = DeleteRelationshipRequest \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2_grpc.py deleted file mode 100644 index b44de63a..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/relationship_service_pb2_grpc.py +++ /dev/null @@ -1,193 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import relationship_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2 -from .....exabel.api.data.v1 import relationship_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/relationship_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class RelationshipServiceStub(object): - """Service for managing relationship types and relationships. See the User Guide for more - information about relationship types and relationships: - https://help.exabel.com/docs/relationships - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListRelationshipTypes = channel.unary_unary('/exabel.api.data.v1.RelationshipService/ListRelationshipTypes', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesResponse.FromString, _registered_method=True) - self.GetRelationshipType = channel.unary_unary('/exabel.api.data.v1.RelationshipService/GetRelationshipType', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipTypeRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, _registered_method=True) - self.CreateRelationshipType = channel.unary_unary('/exabel.api.data.v1.RelationshipService/CreateRelationshipType', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipTypeRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, _registered_method=True) - self.UpdateRelationshipType = channel.unary_unary('/exabel.api.data.v1.RelationshipService/UpdateRelationshipType', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipTypeRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, _registered_method=True) - self.DeleteRelationshipType = channel.unary_unary('/exabel.api.data.v1.RelationshipService/DeleteRelationshipType', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipTypeRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.ListRelationships = channel.unary_unary('/exabel.api.data.v1.RelationshipService/ListRelationships', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsResponse.FromString, _registered_method=True) - self.GetRelationship = channel.unary_unary('/exabel.api.data.v1.RelationshipService/GetRelationship', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, _registered_method=True) - self.CreateRelationship = channel.unary_unary('/exabel.api.data.v1.RelationshipService/CreateRelationship', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, _registered_method=True) - self.UpdateRelationship = channel.unary_unary('/exabel.api.data.v1.RelationshipService/UpdateRelationship', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, _registered_method=True) - self.DeleteRelationship = channel.unary_unary('/exabel.api.data.v1.RelationshipService/DeleteRelationship', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - -class RelationshipServiceServicer(object): - """Service for managing relationship types and relationships. See the User Guide for more - information about relationship types and relationships: - https://help.exabel.com/docs/relationships - """ - - def ListRelationshipTypes(self, request, context): - """List all relationship types from a common catalog. - - Lists all relationship types available to your customer, including those created by you, and in - the global catalog. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetRelationshipType(self, request, context): - """Gets one relationship type. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateRelationshipType(self, request, context): - """Creates one relationship type and returns it. - - It is also possible to create a relationship type by calling `UpdateRelationshipType` - with `allow_missing` set to `true`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateRelationshipType(self, request, context): - """Updates one relationship type and returns it. - - This can also be used to create a relationship type by setting `allow_missing` to `true`. - - Note that this method update all fields unless `update_mask` is set. - - Note that modifying the `is_ownership` property may be a slow operation, as all individual - relationships of this type will have to be updated. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteRelationshipType(self, request, context): - """Deletes one relationship type. - - This can only be performed on relationship types with no relationships. You should delete - relationships before deleting their entity type. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListRelationships(self, request, context): - """Lists relationship of a specific type. - - If neither `from_entity` or `to_entity` is given, it is expected that this call will - take some time to complete. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetRelationship(self, request, context): - """Gets one relationship. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateRelationship(self, request, context): - """Creates one relationship and returns it. - - It is also possible to create a relationship by calling `UpdateRelationship` - with `allow_missing` set to `true`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateRelationship(self, request, context): - """Updates one relationship and returns it. - - This can also be used to create a relationship by setting `allow_missing` to `true`. - - Note that this method will update all fields unless `update_mask` is set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteRelationship(self, request, context): - """Deletes one relationship. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_RelationshipServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListRelationshipTypes': grpc.unary_unary_rpc_method_handler(servicer.ListRelationshipTypes, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesResponse.SerializeToString), 'GetRelationshipType': grpc.unary_unary_rpc_method_handler(servicer.GetRelationshipType, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipTypeRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.SerializeToString), 'CreateRelationshipType': grpc.unary_unary_rpc_method_handler(servicer.CreateRelationshipType, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipTypeRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.SerializeToString), 'UpdateRelationshipType': grpc.unary_unary_rpc_method_handler(servicer.UpdateRelationshipType, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipTypeRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.SerializeToString), 'DeleteRelationshipType': grpc.unary_unary_rpc_method_handler(servicer.DeleteRelationshipType, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipTypeRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'ListRelationships': grpc.unary_unary_rpc_method_handler(servicer.ListRelationships, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsResponse.SerializeToString), 'GetRelationship': grpc.unary_unary_rpc_method_handler(servicer.GetRelationship, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.SerializeToString), 'CreateRelationship': grpc.unary_unary_rpc_method_handler(servicer.CreateRelationship, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.SerializeToString), 'UpdateRelationship': grpc.unary_unary_rpc_method_handler(servicer.UpdateRelationship, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.SerializeToString), 'DeleteRelationship': grpc.unary_unary_rpc_method_handler(servicer.DeleteRelationship, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.RelationshipService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.RelationshipService', rpc_method_handlers) - -class RelationshipService(object): - """Service for managing relationship types and relationships. See the User Guide for more - information about relationship types and relationships: - https://help.exabel.com/docs/relationships - """ - - @staticmethod - def ListRelationshipTypes(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/ListRelationshipTypes', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipTypesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetRelationshipType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/GetRelationshipType', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipTypeRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateRelationshipType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/CreateRelationshipType', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipTypeRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateRelationshipType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/UpdateRelationshipType', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipTypeRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.RelationshipType.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteRelationshipType(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/DeleteRelationshipType', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipTypeRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListRelationships(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/ListRelationships', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.ListRelationshipsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetRelationship(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/GetRelationship', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.GetRelationshipRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateRelationship(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/CreateRelationship', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.CreateRelationshipRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateRelationship(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/UpdateRelationship', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.UpdateRelationshipRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_relationship__messages__pb2.Relationship.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteRelationship(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.RelationshipService/DeleteRelationship', exabel_dot_api_dot_data_dot_v1_dot_relationship__service__pb2.DeleteRelationshipRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2.py deleted file mode 100644 index ace7961f..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/search_messages.proto') -_sym_db = _symbol_database.Default() -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/search_messages.proto\x12\x12exabel.api.data.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"O\n\nSearchTerm\x12\x1d\n\x05field\x18\x01 \x01(\tB\x0e\x92A\x08J\x06"text"\xe0A\x02\x12"\n\x05query\x18\x02 \x01(\tB\x13\x92A\rJ\x0b"microsoft"\xe0A\x02"E\n\rSearchOptions\x124\n\x08universe\x18\x01 \x01(\x0e2".exabel.api.data.v1.SearchUniverse*Z\n\x0eSearchUniverse\x12\x1f\n\x1bSEARCH_UNIVERSE_UNSPECIFIED\x10\x00\x12\x14\n\x10EXABEL_COMPANIES\x10\x01\x12\x11\n\rALL_COMPANIES\x10\x02BG\n\x16com.exabel.api.data.v1B\x13SearchMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.search_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x13SearchMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_SEARCHTERM'].fields_by_name['field']._loaded_options = None - _globals['_SEARCHTERM'].fields_by_name['field']._serialized_options = b'\x92A\x08J\x06"text"\xe0A\x02' - _globals['_SEARCHTERM'].fields_by_name['query']._loaded_options = None - _globals['_SEARCHTERM'].fields_by_name['query']._serialized_options = b'\x92A\rJ\x0b"microsoft"\xe0A\x02' - _globals['_SEARCHUNIVERSE']._serialized_start = 297 - _globals['_SEARCHUNIVERSE']._serialized_end = 387 - _globals['_SEARCHTERM']._serialized_start = 145 - _globals['_SEARCHTERM']._serialized_end = 224 - _globals['_SEARCHOPTIONS']._serialized_start = 226 - _globals['_SEARCHOPTIONS']._serialized_end = 295 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2.pyi deleted file mode 100644 index 2ea39495..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2.pyi +++ /dev/null @@ -1,71 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" -import builtins -import google.protobuf.descriptor -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message -import sys -import typing -if sys.version_info >= (3, 10): - import typing as typing_extensions -else: - import typing_extensions -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _SearchUniverse: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _SearchUniverseEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SearchUniverse.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - SEARCH_UNIVERSE_UNSPECIFIED: _SearchUniverse.ValueType - 'No search universe specified. This is the default behaviour.\n For text search for entityTypes/company, this searches the Exabel company universe.\n ' - EXABEL_COMPANIES: _SearchUniverse.ValueType - 'Search all companies in the Exabel company universe. This includes all companies with\n price data or a directly connected time series. Only supported for text search for\n entityTypes/company.\n ' - ALL_COMPANIES: _SearchUniverse.ValueType - "Search all companies, including companies not in the Exabel company universe. This includes all\n FactSet companies of type 'SUB' and 'PVT'. Only supported for text search for entityTypes/company.\n " - -class SearchUniverse(_SearchUniverse, metaclass=_SearchUniverseEnumTypeWrapper): - """Enum to select search universe.""" -SEARCH_UNIVERSE_UNSPECIFIED: SearchUniverse.ValueType -'No search universe specified. This is the default behaviour.\nFor text search for entityTypes/company, this searches the Exabel company universe.\n' -EXABEL_COMPANIES: SearchUniverse.ValueType -'Search all companies in the Exabel company universe. This includes all companies with\nprice data or a directly connected time series. Only supported for text search for\nentityTypes/company.\n' -ALL_COMPANIES: SearchUniverse.ValueType -"Search all companies, including companies not in the Exabel company universe. This includes all\nFactSet companies of type 'SUB' and 'PVT'. Only supported for text search for entityTypes/company.\n" -global___SearchUniverse = SearchUniverse - -@typing.final -class SearchTerm(google.protobuf.message.Message): - """A single search term in a search request.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - FIELD_FIELD_NUMBER: builtins.int - QUERY_FIELD_NUMBER: builtins.int - field: builtins.str - 'The name of the field that should be matched. Field names are\n case-insensitive.\n ' - query: builtins.str - 'The query against which the field is matched.' - - def __init__(self, *, field: builtins.str | None=..., query: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['field', b'field', 'query', b'query']) -> None: - ... -global___SearchTerm = SearchTerm - -@typing.final -class SearchOptions(google.protobuf.message.Message): - """Options on how the search should be performed.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - UNIVERSE_FIELD_NUMBER: builtins.int - universe: global___SearchUniverse.ValueType - "The entity universe to search. Currently only supported for 'text' search for entityType/company." - - def __init__(self, *, universe: global___SearchUniverse.ValueType | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['universe', b'universe']) -> None: - ... -global___SearchOptions = SearchOptions \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2_grpc.py deleted file mode 100644 index ac84b7ab..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/search_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/search_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2.py deleted file mode 100644 index 384f2799..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/service.proto') -_sym_db = _symbol_database.Default() -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n exabel/api/data/v1/service.proto\x12\x12exabel.api.data.v1\x1a.protoc_gen_openapiv2/options/annotations.protoB\x8c\x03\n\x16com.exabel.api.data.v1B\x0cServiceProtoP\x01Z\x16exabel.com/api/data/v1\x92A\xc8\x02\x12P\n\x0fExabel Data API"5\n\x06Exabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x061.0.25\x1a\x13data.api.exabel.com*\x01\x022\x10application/json:\x10application/jsonZR\n#\n\x07API key\x12\x18\x08\x02\x12\x07API key\x1a\tx-api-key \x02\n+\n\x06Bearer\x12!\x08\x02\x12\x0cAccess token\x1a\rauthorization \x02b\r\n\x0b\n\x07API key\x12\x00b\x0c\n\n\n\x06Bearer\x12\x00rG\n\x1eMore about the Exabel Data API\x12%https://help.exabel.com/docs/data-apib\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x0cServiceProtoP\x01Z\x16exabel.com/api/data/v1\x92A\xc8\x02\x12P\n\x0fExabel Data API"5\n\x06Exabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x061.0.25\x1a\x13data.api.exabel.com*\x01\x022\x10application/json:\x10application/jsonZR\n#\n\x07API key\x12\x18\x08\x02\x12\x07API key\x1a\tx-api-key \x02\n+\n\x06Bearer\x12!\x08\x02\x12\x0cAccess token\x1a\rauthorization \x02b\r\n\x0b\n\x07API key\x12\x00b\x0c\n\n\n\x06Bearer\x12\x00rG\n\x1eMore about the Exabel Data API\x12%https://help.exabel.com/docs/data-api' \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2_grpc.py deleted file mode 100644 index 696c927f..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/service_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2.py deleted file mode 100644 index e1bbffad..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2.py +++ /dev/null @@ -1,54 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/signal_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import common_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_common__messages__pb2 -from .....exabel.api.math import aggregation_pb2 as exabel_dot_api_dot_math_dot_aggregation__pb2 -from .....exabel.api.math import change_pb2 as exabel_dot_api_dot_math_dot_change__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(exabel/api/data/v1/signal_messages.proto\x12\x12exabel.api.data.v1\x1a(exabel/api/data/v1/common_messages.proto\x1a!exabel/api/math/aggregation.proto\x1a\x1cexabel/api/math/change.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\xdb\x02\n\x06Signal\x12<\n\x04name\x18\x01 \x01(\tB.\x92A%J\x13"signals/ns.signal"\xca>\r\xfa\x02\nsignalName\xe0A\x05\xe0A\x02\x12\x17\n\x0bentity_type\x18\x02 \x01(\tB\x02\x18\x01\x12&\n\x0cdisplay_name\x18\x03 \x01(\tB\x10\x92A\rJ\x0b"My signal"\x12/\n\x0bdescription\x18\x04 \x01(\tB\x1a\x92A\x17J\x15"Describes my signal"\x129\n\x13downsampling_method\x18\x05 \x01(\x0e2\x1c.exabel.api.math.Aggregation\x12\x16\n\tread_only\x18\x06 \x01(\x08B\x03\xe0A\x03\x12N\n\x0centity_types\x18\x07 \x03(\tB8\x92A2J0["entityTypes/ns.type1", "entityTypes/ns.type2"]\xe0A\x03"\xc7\x03\n\rDerivedSignal\x12D\n\x04name\x18\x01 \x01(\tB6\x92A-J\x14"derivedSignals/321"\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x05\xe0A\x02\x12\x16\n\tdata_sets\x18\x02 \x03(\tB\x03\xe0A\x03\x12)\n\x0cdisplay_name\x18\x03 \x01(\tB\x13\x92A\rJ\x0b"My signal"\xe0A\x03\x12*\n\x05label\x18\n \x01(\tB\x1b\x92A\x15J\x13"signal_expression"\xe0A\x03\x122\n\x0bdescription\x18\x04 \x01(\tB\x1d\x92A\x17J\x15"Describes my signal"\xe0A\x03\x12\x12\n\nexpression\x18\t \x01(\t\x12>\n\x13downsampling_method\x18\x05 \x01(\x0e2\x1c.exabel.api.math.AggregationB\x03\xe0A\x03\x12,\n\x06change\x18\x06 \x01(\x0e2\x17.exabel.api.math.ChangeB\x03\xe0A\x03\x126\n\nentity_set\x18\x07 \x01(\x0b2\x1d.exabel.api.data.v1.EntitySetB\x03\xe0A\x03\x12\x13\n\x0bhighlighted\x18\x08 \x01(\x08"L\n\x0eDerivedSignals\x12:\n\x0fderived_signals\x18\x01 \x03(\x0b2!.exabel.api.data.v1.DerivedSignalBG\n\x16com.exabel.api.data.v1B\x13SignalMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.signal_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x13SignalMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_SIGNAL'].fields_by_name['name']._loaded_options = None - _globals['_SIGNAL'].fields_by_name['name']._serialized_options = b'\x92A%J\x13"signals/ns.signal"\xca>\r\xfa\x02\nsignalName\xe0A\x05\xe0A\x02' - _globals['_SIGNAL'].fields_by_name['entity_type']._loaded_options = None - _globals['_SIGNAL'].fields_by_name['entity_type']._serialized_options = b'\x18\x01' - _globals['_SIGNAL'].fields_by_name['display_name']._loaded_options = None - _globals['_SIGNAL'].fields_by_name['display_name']._serialized_options = b'\x92A\rJ\x0b"My signal"' - _globals['_SIGNAL'].fields_by_name['description']._loaded_options = None - _globals['_SIGNAL'].fields_by_name['description']._serialized_options = b'\x92A\x17J\x15"Describes my signal"' - _globals['_SIGNAL'].fields_by_name['read_only']._loaded_options = None - _globals['_SIGNAL'].fields_by_name['read_only']._serialized_options = b'\xe0A\x03' - _globals['_SIGNAL'].fields_by_name['entity_types']._loaded_options = None - _globals['_SIGNAL'].fields_by_name['entity_types']._serialized_options = b'\x92A2J0["entityTypes/ns.type1", "entityTypes/ns.type2"]\xe0A\x03' - _globals['_DERIVEDSIGNAL'].fields_by_name['name']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['name']._serialized_options = b'\x92A-J\x14"derivedSignals/321"\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x05\xe0A\x02' - _globals['_DERIVEDSIGNAL'].fields_by_name['data_sets']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['data_sets']._serialized_options = b'\xe0A\x03' - _globals['_DERIVEDSIGNAL'].fields_by_name['display_name']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['display_name']._serialized_options = b'\x92A\rJ\x0b"My signal"\xe0A\x03' - _globals['_DERIVEDSIGNAL'].fields_by_name['label']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['label']._serialized_options = b'\x92A\x15J\x13"signal_expression"\xe0A\x03' - _globals['_DERIVEDSIGNAL'].fields_by_name['description']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['description']._serialized_options = b'\x92A\x17J\x15"Describes my signal"\xe0A\x03' - _globals['_DERIVEDSIGNAL'].fields_by_name['downsampling_method']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['downsampling_method']._serialized_options = b'\xe0A\x03' - _globals['_DERIVEDSIGNAL'].fields_by_name['change']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['change']._serialized_options = b'\xe0A\x03' - _globals['_DERIVEDSIGNAL'].fields_by_name['entity_set']._loaded_options = None - _globals['_DERIVEDSIGNAL'].fields_by_name['entity_set']._serialized_options = b'\xe0A\x03' - _globals['_SIGNAL']._serialized_start = 253 - _globals['_SIGNAL']._serialized_end = 600 - _globals['_DERIVEDSIGNAL']._serialized_start = 603 - _globals['_DERIVEDSIGNAL']._serialized_end = 1058 - _globals['_DERIVEDSIGNALS']._serialized_start = 1060 - _globals['_DERIVEDSIGNALS']._serialized_end = 1136 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2.pyi deleted file mode 100644 index a3a9f080..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2.pyi +++ /dev/null @@ -1,120 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2024 Exabel AS. All rights reserved.""" -import builtins -import collections.abc -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.message -import typing -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class Signal(google.protobuf.message.Message): - """A signal resource in the Data API. Signals are normally associated with a set of entity types, - but may apply to any entities. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - ENTITY_TYPE_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - DOWNSAMPLING_METHOD_FIELD_NUMBER: builtins.int - READ_ONLY_FIELD_NUMBER: builtins.int - ENTITY_TYPES_FIELD_NUMBER: builtins.int - name: builtins.str - 'Unique resource name of the raw data signal, e.g. `signals/signalIdentifier` or\n `signals/namespace.signalIdentifier`. The namespace must be empty (being global) or a\n namespace accessible to the customer.\n The signal identifier must match the regex `[a-zA-Z]\\w{0,127}`.\n ' - entity_type: builtins.str - 'No longer in use.' - display_name: builtins.str - 'Used when showing the signal in the Exabel app. Required when creating a signal.' - description: builtins.str - 'Used when showing the signal in the Exabel app.' - downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType - 'The default downsampling method to use when this signal is re-sampled into larger intervals.\n When two or more values in an interval needs to be aggregated into a single value, specifies\n how they are combined.\n ' - read_only: builtins.bool - 'Global signals and those from data sets that you subscribe to will be read-only.' - - @property - def entity_types(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: - """List of entity types that this signal has time series for, e.g. - `entityTypes/ns.type1`, `entityTypes/ns.type2`. - """ - - def __init__(self, *, name: builtins.str | None=..., entity_type: builtins.str | None=..., display_name: builtins.str | None=..., description: builtins.str | None=..., downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType | None=..., read_only: builtins.bool | None=..., entity_types: collections.abc.Iterable[builtins.str] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'display_name', b'display_name', 'downsampling_method', b'downsampling_method', 'entity_type', b'entity_type', 'entity_types', b'entity_types', 'name', b'name', 'read_only', b'read_only']) -> None: - ... -global___Signal = Signal - -@typing.final -class DerivedSignal(google.protobuf.message.Message): - """A derived signal resource in the Data API. A derived signal is part of one data set and can be - added or removed using the `derived_signals` field of `UpdateDataSet`. It cannot be edited - through the Data API; it must be edited in the library. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DATA_SETS_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - LABEL_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - EXPRESSION_FIELD_NUMBER: builtins.int - DOWNSAMPLING_METHOD_FIELD_NUMBER: builtins.int - CHANGE_FIELD_NUMBER: builtins.int - ENTITY_SET_FIELD_NUMBER: builtins.int - HIGHLIGHTED_FIELD_NUMBER: builtins.int - name: builtins.str - "Unique resource name of the derived signal, e.g. `derivedSignals/signalIdentifier`. Derived\n signals don't have namespaces in their resource names. The signal identifier must be numeric.\n " - display_name: builtins.str - 'The display name of the signal.' - label: builtins.str - 'The label of the signal.' - description: builtins.str - 'The description of the signal.' - expression: builtins.str - 'The signal expression.' - downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType - 'The default downsampling method to use when this signal is re-sampled into larger intervals.\n When two or more values in an interval needs to be aggregated into a single value, specifies\n how they are combined.\n ' - change: exabel.api.math.change_pb2.Change.ValueType - 'The method used to calculate changes in this signal.' - highlighted: builtins.bool - 'Whether this derived signal is highlighted (inside a specific data set).' - - @property - def data_sets(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: - """The data set(s) this derived signal belongs to.""" - - @property - def entity_set(self) -> exabel.api.data.v1.common_messages_pb2.EntitySet: - """The set of entities that this derived signal is valid for.""" - - def __init__(self, *, name: builtins.str | None=..., data_sets: collections.abc.Iterable[builtins.str] | None=..., display_name: builtins.str | None=..., label: builtins.str | None=..., description: builtins.str | None=..., expression: builtins.str | None=..., downsampling_method: exabel.api.math.aggregation_pb2.Aggregation.ValueType | None=..., change: exabel.api.math.change_pb2.Change.ValueType | None=..., entity_set: exabel.api.data.v1.common_messages_pb2.EntitySet | None=..., highlighted: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['entity_set', b'entity_set']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['change', b'change', 'data_sets', b'data_sets', 'description', b'description', 'display_name', b'display_name', 'downsampling_method', b'downsampling_method', 'entity_set', b'entity_set', 'expression', b'expression', 'highlighted', b'highlighted', 'label', b'label', 'name', b'name']) -> None: - ... -global___DerivedSignal = DerivedSignal - -@typing.final -class DerivedSignals(google.protobuf.message.Message): - """A list of signals.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - DERIVED_SIGNALS_FIELD_NUMBER: builtins.int - - @property - def derived_signals(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DerivedSignal]: - """The list of signals.""" - - def __init__(self, *, derived_signals: collections.abc.Iterable[global___DerivedSignal] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['derived_signals', b'derived_signals']) -> None: - ... -global___DerivedSignals = DerivedSignals \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2_grpc.py deleted file mode 100644 index b90a3e1f..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/signal_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2.py deleted file mode 100644 index faf2bc1b..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2.py +++ /dev/null @@ -1,75 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/signal_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import signal_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'exabel/api/data/v1/signal_service.proto\x12\x12exabel.api.data.v1\x1a(exabel/api/data/v1/signal_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto";\n\x12ListSignalsRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t"o\n\x13ListSignalsResponse\x12+\n\x07signals\x18\x01 \x03(\x0b2\x1a.exabel.api.data.v1.Signal\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"8\n\x10GetSignalRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92A\x10\xca>\r\xfa\x02\nsignalName\xe0A\x02"e\n\x13CreateSignalRequest\x12/\n\x06signal\x18\x01 \x01(\x0b2\x1a.exabel.api.data.v1.SignalB\x03\xe0A\x02\x12\x1d\n\x15create_library_signal\x18\x02 \x01(\x08"\xad\x01\n\x13UpdateSignalRequest\x12/\n\x06signal\x18\x01 \x01(\x0b2\x1a.exabel.api.data.v1.SignalB\x03\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08\x12\x1d\n\x15create_library_signal\x18\x04 \x01(\x08";\n\x13DeleteSignalRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92A\x10\xca>\r\xfa\x02\nsignalName\xe0A\x02"B\n\x19ListDerivedSignalsRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t"\x85\x01\n\x1aListDerivedSignalsResponse\x12:\n\x0fderived_signals\x18\x01 \x03(\x0b2!.exabel.api.data.v1.DerivedSignal\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"3\n\x1bFilterDerivedSignalsRequest\x12\x14\n\x0centity_names\x18\x01 \x03(\t"\xd8\x01\n\x1cFilterDerivedSignalsResponse\x12]\n\x0fderived_signals\x18\x01 \x03(\x0b2D.exabel.api.data.v1.FilterDerivedSignalsResponse.DerivedSignalsEntry\x1aY\n\x13DerivedSignalsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x121\n\x05value\x18\x02 \x01(\x0b2".exabel.api.data.v1.DerivedSignals:\x028\x01"F\n\x17GetDerivedSignalRequest\x12+\n\x04name\x18\x01 \x01(\tB\x1d\x92A\x17\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x022\xb3\t\n\rSignalService\x12\x84\x01\n\x0bListSignals\x12&.exabel.api.data.v1.ListSignalsRequest\x1a\'.exabel.api.data.v1.ListSignalsResponse"$\x92A\x0e\x12\x0cList signals\x82\xd3\xe4\x93\x02\r\x12\x0b/v1/signals\x12z\n\tGetSignal\x12$.exabel.api.data.v1.GetSignalRequest\x1a\x1a.exabel.api.data.v1.Signal"+\x92A\x0c\x12\nGet signal\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/{name=signals/*}\x12\x82\x01\n\x0cCreateSignal\x12\'.exabel.api.data.v1.CreateSignalRequest\x1a\x1a.exabel.api.data.v1.Signal"-\x92A\x0f\x12\rCreate signal\x82\xd3\xe4\x93\x02\x15"\x0b/v1/signals:\x06signal\x12\x92\x01\n\x0cUpdateSignal\x12\'.exabel.api.data.v1.UpdateSignalRequest\x1a\x1a.exabel.api.data.v1.Signal"=\x92A\x0f\x12\rUpdate signal\x82\xd3\xe4\x93\x02%2\x1b/v1/{signal.name=signals/*}:\x06signal\x12\x7f\n\x0cDeleteSignal\x12\'.exabel.api.data.v1.DeleteSignalRequest\x1a\x16.google.protobuf.Empty".\x92A\x0f\x12\rDelete signal\x82\xd3\xe4\x93\x02\x16*\x14/v1/{name=signals/*}\x12\xa8\x01\n\x12ListDerivedSignals\x12-.exabel.api.data.v1.ListDerivedSignalsRequest\x1a..exabel.api.data.v1.ListDerivedSignalsResponse"3\x92A\x16\x12\x14List derived signals\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/derivedSignals\x12\xb7\x01\n\x14FilterDerivedSignals\x12/.exabel.api.data.v1.FilterDerivedSignalsRequest\x1a0.exabel.api.data.v1.FilterDerivedSignalsResponse"<\x92A\x18\x12\x16Filter derived signals\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/derivedSignals:filter\x12\x9e\x01\n\x10GetDerivedSignal\x12+.exabel.api.data.v1.GetDerivedSignalRequest\x1a!.exabel.api.data.v1.DerivedSignal":\x92A\x14\x12\x12Get derived signal\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/{name=derivedSignals/*}BF\n\x16com.exabel.api.data.v1B\x12SignalServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.signal_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x12SignalServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_GETSIGNALREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETSIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nsignalName\xe0A\x02' - _globals['_CREATESIGNALREQUEST'].fields_by_name['signal']._loaded_options = None - _globals['_CREATESIGNALREQUEST'].fields_by_name['signal']._serialized_options = b'\xe0A\x02' - _globals['_UPDATESIGNALREQUEST'].fields_by_name['signal']._loaded_options = None - _globals['_UPDATESIGNALREQUEST'].fields_by_name['signal']._serialized_options = b'\xe0A\x02' - _globals['_DELETESIGNALREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETESIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nsignalName\xe0A\x02' - _globals['_FILTERDERIVEDSIGNALSRESPONSE_DERIVEDSIGNALSENTRY']._loaded_options = None - _globals['_FILTERDERIVEDSIGNALSRESPONSE_DERIVEDSIGNALSENTRY']._serialized_options = b'8\x01' - _globals['_GETDERIVEDSIGNALREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETDERIVEDSIGNALREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x17\xca>\x14\xfa\x02\x11derivedSignalName\xe0A\x02' - _globals['_SIGNALSERVICE'].methods_by_name['ListSignals']._loaded_options = None - _globals['_SIGNALSERVICE'].methods_by_name['ListSignals']._serialized_options = b'\x92A\x0e\x12\x0cList signals\x82\xd3\xe4\x93\x02\r\x12\x0b/v1/signals' - _globals['_SIGNALSERVICE'].methods_by_name['GetSignal']._loaded_options = None - _globals['_SIGNALSERVICE'].methods_by_name['GetSignal']._serialized_options = b'\x92A\x0c\x12\nGet signal\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/{name=signals/*}' - _globals['_SIGNALSERVICE'].methods_by_name['CreateSignal']._loaded_options = None - _globals['_SIGNALSERVICE'].methods_by_name['CreateSignal']._serialized_options = b'\x92A\x0f\x12\rCreate signal\x82\xd3\xe4\x93\x02\x15"\x0b/v1/signals:\x06signal' - _globals['_SIGNALSERVICE'].methods_by_name['UpdateSignal']._loaded_options = None - _globals['_SIGNALSERVICE'].methods_by_name['UpdateSignal']._serialized_options = b'\x92A\x0f\x12\rUpdate signal\x82\xd3\xe4\x93\x02%2\x1b/v1/{signal.name=signals/*}:\x06signal' - _globals['_SIGNALSERVICE'].methods_by_name['DeleteSignal']._loaded_options = None - _globals['_SIGNALSERVICE'].methods_by_name['DeleteSignal']._serialized_options = b'\x92A\x0f\x12\rDelete signal\x82\xd3\xe4\x93\x02\x16*\x14/v1/{name=signals/*}' - _globals['_SIGNALSERVICE'].methods_by_name['ListDerivedSignals']._loaded_options = None - _globals['_SIGNALSERVICE'].methods_by_name['ListDerivedSignals']._serialized_options = b'\x92A\x16\x12\x14List derived signals\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/derivedSignals' - _globals['_SIGNALSERVICE'].methods_by_name['FilterDerivedSignals']._loaded_options = None - _globals['_SIGNALSERVICE'].methods_by_name['FilterDerivedSignals']._serialized_options = b'\x92A\x18\x12\x16Filter derived signals\x82\xd3\xe4\x93\x02\x1b\x12\x19/v1/derivedSignals:filter' - _globals['_SIGNALSERVICE'].methods_by_name['GetDerivedSignal']._loaded_options = None - _globals['_SIGNALSERVICE'].methods_by_name['GetDerivedSignal']._serialized_options = b'\x92A\x14\x12\x12Get derived signal\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/{name=derivedSignals/*}' - _globals['_LISTSIGNALSREQUEST']._serialized_start = 279 - _globals['_LISTSIGNALSREQUEST']._serialized_end = 338 - _globals['_LISTSIGNALSRESPONSE']._serialized_start = 340 - _globals['_LISTSIGNALSRESPONSE']._serialized_end = 451 - _globals['_GETSIGNALREQUEST']._serialized_start = 453 - _globals['_GETSIGNALREQUEST']._serialized_end = 509 - _globals['_CREATESIGNALREQUEST']._serialized_start = 511 - _globals['_CREATESIGNALREQUEST']._serialized_end = 612 - _globals['_UPDATESIGNALREQUEST']._serialized_start = 615 - _globals['_UPDATESIGNALREQUEST']._serialized_end = 788 - _globals['_DELETESIGNALREQUEST']._serialized_start = 790 - _globals['_DELETESIGNALREQUEST']._serialized_end = 849 - _globals['_LISTDERIVEDSIGNALSREQUEST']._serialized_start = 851 - _globals['_LISTDERIVEDSIGNALSREQUEST']._serialized_end = 917 - _globals['_LISTDERIVEDSIGNALSRESPONSE']._serialized_start = 920 - _globals['_LISTDERIVEDSIGNALSRESPONSE']._serialized_end = 1053 - _globals['_FILTERDERIVEDSIGNALSREQUEST']._serialized_start = 1055 - _globals['_FILTERDERIVEDSIGNALSREQUEST']._serialized_end = 1106 - _globals['_FILTERDERIVEDSIGNALSRESPONSE']._serialized_start = 1109 - _globals['_FILTERDERIVEDSIGNALSRESPONSE']._serialized_end = 1325 - _globals['_FILTERDERIVEDSIGNALSRESPONSE_DERIVEDSIGNALSENTRY']._serialized_start = 1236 - _globals['_FILTERDERIVEDSIGNALSRESPONSE_DERIVEDSIGNALSENTRY']._serialized_end = 1325 - _globals['_GETDERIVEDSIGNALREQUEST']._serialized_start = 1327 - _globals['_GETDERIVEDSIGNALREQUEST']._serialized_end = 1397 - _globals['_SIGNALSERVICE']._serialized_start = 1400 - _globals['_SIGNALSERVICE']._serialized_end = 2603 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2_grpc.py deleted file mode 100644 index 62d39423..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/signal_service_pb2_grpc.py +++ /dev/null @@ -1,159 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import signal_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2 -from .....exabel.api.data.v1 import signal_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/signal_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class SignalServiceStub(object): - """Service for managing raw data signals. See the User Guide for more information about raw data - signals: https://help.exabel.com/docs/signals - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListSignals = channel.unary_unary('/exabel.api.data.v1.SignalService/ListSignals', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsResponse.FromString, _registered_method=True) - self.GetSignal = channel.unary_unary('/exabel.api.data.v1.SignalService/GetSignal', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetSignalRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, _registered_method=True) - self.CreateSignal = channel.unary_unary('/exabel.api.data.v1.SignalService/CreateSignal', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.CreateSignalRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, _registered_method=True) - self.UpdateSignal = channel.unary_unary('/exabel.api.data.v1.SignalService/UpdateSignal', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.UpdateSignalRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, _registered_method=True) - self.DeleteSignal = channel.unary_unary('/exabel.api.data.v1.SignalService/DeleteSignal', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.DeleteSignalRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.ListDerivedSignals = channel.unary_unary('/exabel.api.data.v1.SignalService/ListDerivedSignals', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsResponse.FromString, _registered_method=True) - self.FilterDerivedSignals = channel.unary_unary('/exabel.api.data.v1.SignalService/FilterDerivedSignals', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsResponse.FromString, _registered_method=True) - self.GetDerivedSignal = channel.unary_unary('/exabel.api.data.v1.SignalService/GetDerivedSignal', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetDerivedSignalRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.DerivedSignal.FromString, _registered_method=True) - -class SignalServiceServicer(object): - """Service for managing raw data signals. See the User Guide for more information about raw data - signals: https://help.exabel.com/docs/signals - """ - - def ListSignals(self, request, context): - """Lists all known signals. - - Lists all raw data signals available to your customer, including those created by you, and in - the global catalog. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetSignal(self, request, context): - """Gets one signal. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateSignal(self, request, context): - """Creates one signal and returns it. - - It is also possible to create a signal by calling `UpdateSignal` - with `allow_missing` set to `true`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateSignal(self, request, context): - """Updates one signal and returns it. - - This can also be used to create a signal by setting `allow_missing` to `true`. - - Note that this method will update all fields unless `update_mask` is set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteSignal(self, request, context): - """Deletes one signal. ALL time series for this signal will also be deleted. - - This will delete ***all*** time series for this signal. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListDerivedSignals(self, request, context): - """Lists all known derived signals. - - Lists all derived data signals available to your customer, including those created by you, in the - global catalog, and from data sets you are subscribed to. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def FilterDerivedSignals(self, request, context): - """Gets all derived signals that apply to at least one of several entities. - - Selects from all derived data signals available to your customer (including those created by you, in the - global catalog, and from data sets you are subscribed to), those signals that apply to at least one of the - requested entities. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetDerivedSignal(self, request, context): - """Gets one derived signal. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_SignalServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListSignals': grpc.unary_unary_rpc_method_handler(servicer.ListSignals, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsResponse.SerializeToString), 'GetSignal': grpc.unary_unary_rpc_method_handler(servicer.GetSignal, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetSignalRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.SerializeToString), 'CreateSignal': grpc.unary_unary_rpc_method_handler(servicer.CreateSignal, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.CreateSignalRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.SerializeToString), 'UpdateSignal': grpc.unary_unary_rpc_method_handler(servicer.UpdateSignal, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.UpdateSignalRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.SerializeToString), 'DeleteSignal': grpc.unary_unary_rpc_method_handler(servicer.DeleteSignal, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.DeleteSignalRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'ListDerivedSignals': grpc.unary_unary_rpc_method_handler(servicer.ListDerivedSignals, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsResponse.SerializeToString), 'FilterDerivedSignals': grpc.unary_unary_rpc_method_handler(servicer.FilterDerivedSignals, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsResponse.SerializeToString), 'GetDerivedSignal': grpc.unary_unary_rpc_method_handler(servicer.GetDerivedSignal, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetDerivedSignalRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.DerivedSignal.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.SignalService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.SignalService', rpc_method_handlers) - -class SignalService(object): - """Service for managing raw data signals. See the User Guide for more information about raw data - signals: https://help.exabel.com/docs/signals - """ - - @staticmethod - def ListSignals(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.SignalService/ListSignals', exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListSignalsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.SignalService/GetSignal', exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetSignalRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.SignalService/CreateSignal', exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.CreateSignalRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.SignalService/UpdateSignal', exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.UpdateSignalRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.Signal.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.SignalService/DeleteSignal', exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.DeleteSignalRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListDerivedSignals(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.SignalService/ListDerivedSignals', exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.ListDerivedSignalsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def FilterDerivedSignals(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.SignalService/FilterDerivedSignals', exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.FilterDerivedSignalsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetDerivedSignal(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.SignalService/GetDerivedSignal', exabel_dot_api_dot_data_dot_v1_dot_signal__service__pb2.GetDerivedSignalRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_signal__messages__pb2.DerivedSignal.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2.py deleted file mode 100644 index 89e14e32..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/time_series_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.time import time_range_pb2 as exabel_dot_api_dot_time_dot_time__range__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 -from google.type import decimal_pb2 as google_dot_type_dot_decimal__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n-exabel/api/data/v1/time_series_messages.proto\x12\x12exabel.api.data.v1\x1a exabel/api/time/time_range.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x19google/type/decimal.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x83\x02\n\nTimeSeries\x12y\n\x04name\x18\x01 \x01(\tBk\x92AbJL"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors"\xca>\x11\xfa\x02\x0etimeSeriesName\xe0A\x05\xe0A\x02\x123\n\x06points\x18\x02 \x03(\x0b2#.exabel.api.data.v1.TimeSeriesPoint\x12\x16\n\tread_only\x18\x03 \x01(\x08B\x03\xe0A\x03\x12-\n\x05units\x18\x04 \x01(\x0b2\x19.exabel.api.data.v1.UnitsB\x03\xe0A\x01"\x9d\x01\n\x0fTimeSeriesPoint\x12-\n\x04time\x18\x01 \x01(\x0b2\x1a.google.protobuf.TimestampB\x03\xe0A\x02\x12+\n\x05value\x18\x02 \x01(\x0b2\x1c.google.protobuf.DoubleValue\x12.\n\nknown_time\x18\x03 \x01(\x0b2\x1a.google.protobuf.Timestamp"u\n\x0eTimeSeriesView\x12.\n\ntime_range\x18\x01 \x01(\x0b2\x1a.exabel.api.time.TimeRange\x123\n\nknown_time\x18\x02 \x01(\x0b2\x1a.google.protobuf.TimestampB\x03\xe0A\x01"\x9f\x01\n\x10DefaultKnownTime\x12\x16\n\x0ccurrent_time\x18\x01 \x01(\x08H\x00\x120\n\nknown_time\x18\x02 \x01(\x0b2\x1a.google.protobuf.TimestampH\x00\x120\n\x0btime_offset\x18\x03 \x01(\x0b2\x19.google.protobuf.DurationH\x00B\x0f\n\rspecification"\x94\x01\n\x05Units\x12/\n\x05units\x18\x01 \x03(\x0b2\x18.exabel.api.data.v1.UnitB\x06\xe0A\x01\xe0A\x05\x120\n\nmultiplier\x18\x02 \x01(\x0b2\x14.google.type.DecimalB\x06\xe0A\x01\xe0A\x05\x12\x18\n\x0bdescription\x18\x03 \x01(\tB\x03\xe0A\x01J\x04\x08\x04\x10\x05R\x08is_ratio"\x85\x02\n\x04Unit\x12=\n\tdimension\x18\x01 \x01(\x0e2".exabel.api.data.v1.Unit.DimensionB\x06\xe0A\x01\xe0A\x05\x12\x14\n\x04unit\x18\x02 \x01(\tB\x06\xe0A\x01\xe0A\x05\x12\x18\n\x08exponent\x18\x03 \x01(\x11B\x06\xe0A\x01\xe0A\x05"\x8d\x01\n\tDimension\x12\x15\n\x11DIMENSION_UNKNOWN\x10\x00\x12\x16\n\x12DIMENSION_CURRENCY\x10\x01\x12\x12\n\x0eDIMENSION_MASS\x10\x02\x12\x14\n\x10DIMENSION_LENGTH\x10\x03\x12\x12\n\x0eDIMENSION_TIME\x10\x04\x12\x13\n\x0fDIMENSION_RATIO\x10\x05BK\n\x16com.exabel.api.data.v1B\x17TimeSeriesMessagesProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.time_series_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x17TimeSeriesMessagesProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_TIMESERIES'].fields_by_name['name']._loaded_options = None - _globals['_TIMESERIES'].fields_by_name['name']._serialized_options = b'\x92AbJL"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors"\xca>\x11\xfa\x02\x0etimeSeriesName\xe0A\x05\xe0A\x02' - _globals['_TIMESERIES'].fields_by_name['read_only']._loaded_options = None - _globals['_TIMESERIES'].fields_by_name['read_only']._serialized_options = b'\xe0A\x03' - _globals['_TIMESERIES'].fields_by_name['units']._loaded_options = None - _globals['_TIMESERIES'].fields_by_name['units']._serialized_options = b'\xe0A\x01' - _globals['_TIMESERIESPOINT'].fields_by_name['time']._loaded_options = None - _globals['_TIMESERIESPOINT'].fields_by_name['time']._serialized_options = b'\xe0A\x02' - _globals['_TIMESERIESVIEW'].fields_by_name['known_time']._loaded_options = None - _globals['_TIMESERIESVIEW'].fields_by_name['known_time']._serialized_options = b'\xe0A\x01' - _globals['_UNITS'].fields_by_name['units']._loaded_options = None - _globals['_UNITS'].fields_by_name['units']._serialized_options = b'\xe0A\x01\xe0A\x05' - _globals['_UNITS'].fields_by_name['multiplier']._loaded_options = None - _globals['_UNITS'].fields_by_name['multiplier']._serialized_options = b'\xe0A\x01\xe0A\x05' - _globals['_UNITS'].fields_by_name['description']._loaded_options = None - _globals['_UNITS'].fields_by_name['description']._serialized_options = b'\xe0A\x01' - _globals['_UNIT'].fields_by_name['dimension']._loaded_options = None - _globals['_UNIT'].fields_by_name['dimension']._serialized_options = b'\xe0A\x01\xe0A\x05' - _globals['_UNIT'].fields_by_name['unit']._loaded_options = None - _globals['_UNIT'].fields_by_name['unit']._serialized_options = b'\xe0A\x01\xe0A\x05' - _globals['_UNIT'].fields_by_name['exponent']._loaded_options = None - _globals['_UNIT'].fields_by_name['exponent']._serialized_options = b'\xe0A\x01\xe0A\x05' - _globals['_TIMESERIES']._serialized_start = 309 - _globals['_TIMESERIES']._serialized_end = 568 - _globals['_TIMESERIESPOINT']._serialized_start = 571 - _globals['_TIMESERIESPOINT']._serialized_end = 728 - _globals['_TIMESERIESVIEW']._serialized_start = 730 - _globals['_TIMESERIESVIEW']._serialized_end = 847 - _globals['_DEFAULTKNOWNTIME']._serialized_start = 850 - _globals['_DEFAULTKNOWNTIME']._serialized_end = 1009 - _globals['_UNITS']._serialized_start = 1012 - _globals['_UNITS']._serialized_end = 1160 - _globals['_UNIT']._serialized_start = 1163 - _globals['_UNIT']._serialized_end = 1424 - _globals['_UNIT_DIMENSION']._serialized_start = 1283 - _globals['_UNIT_DIMENSION']._serialized_end = 1424 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2_grpc.py deleted file mode 100644 index bf3de6a8..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/time_series_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2.py deleted file mode 100644 index c57761e4..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2.py +++ /dev/null @@ -1,113 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/data/v1/time_series_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.data.v1 import time_series_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,exabel/api/data/v1/time_series_service.proto\x12\x12exabel.api.data.v1\x1a-exabel/api/data/v1/time_series_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x17google/rpc/status.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"l\n\x15ListTimeSeriesRequest\x12,\n\x06parent\x18\x01 \x01(\tB\x1c\x92A\x16\xca>\x13\xfa\x02\x10timeSeriesParent\xe0A\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"z\n\x16ListTimeSeriesResponse\x123\n\x0btime_series\x18\x01 \x03(\x0b2\x1e.exabel.api.data.v1.TimeSeries\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05"r\n\x14GetTimeSeriesRequest\x12(\n\x04name\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0etimeSeriesName\xe0A\x02\x120\n\x04view\x18\x02 \x01(\x0b2".exabel.api.data.v1.TimeSeriesView"\x9b\x01\n\rInsertOptions\x12@\n\x12default_known_time\x18\x01 \x01(\x0b2$.exabel.api.data.v1.DefaultKnownTime\x12\x16\n\ncreate_tag\x18\x02 \x01(\x08B\x02\x18\x01\x12\x1c\n\x0fshould_optimise\x18\x03 \x01(\x08H\x00\x88\x01\x01B\x12\n\x10_should_optimise"\xa7\x01\n\rUpdateOptions\x12\x15\n\rallow_missing\x18\x01 \x01(\x08\x12&\n\x1creplace_existing_time_series\x18\x02 \x01(\x08H\x00\x12\x1c\n\x12replace_known_time\x18\x03 \x01(\x08H\x00\x12&\n\x1creplace_existing_data_points\x18\x04 \x01(\x08H\x00B\x11\n\x0freplace_options"\xd4\x02\n\x17CreateTimeSeriesRequest\x128\n\x0btime_series\x18\x01 \x01(\x0b2\x1e.exabel.api.data.v1.TimeSeriesB\x03\xe0A\x02\x120\n\x04view\x18\x02 \x01(\x0b2".exabel.api.data.v1.TimeSeriesView\x129\n\x0einsert_options\x18\x06 \x01(\x0b2!.exabel.api.data.v1.InsertOptions\x12D\n\x12default_known_time\x18\x03 \x01(\x0b2$.exabel.api.data.v1.DefaultKnownTimeB\x02\x18\x01\x12\x16\n\ncreate_tag\x18\x04 \x01(\x08B\x02\x18\x01\x12 \n\x0fshould_optimise\x18\x05 \x01(\x08B\x02\x18\x01H\x00\x88\x01\x01B\x12\n\x10_should_optimise"\xca\x03\n\x17UpdateTimeSeriesRequest\x128\n\x0btime_series\x18\x01 \x01(\x0b2\x1e.exabel.api.data.v1.TimeSeriesB\x03\xe0A\x02\x120\n\x04view\x18\x02 \x01(\x0b2".exabel.api.data.v1.TimeSeriesView\x129\n\x0einsert_options\x18\x08 \x01(\x0b2!.exabel.api.data.v1.InsertOptions\x129\n\x0eupdate_options\x18\t \x01(\x0b2!.exabel.api.data.v1.UpdateOptions\x12D\n\x12default_known_time\x18\x03 \x01(\x0b2$.exabel.api.data.v1.DefaultKnownTimeB\x02\x18\x01\x12\x19\n\rallow_missing\x18\x04 \x01(\x08B\x02\x18\x01\x12\x16\n\ncreate_tag\x18\x05 \x01(\x08B\x02\x18\x01\x12 \n\x0fshould_optimise\x18\x06 \x01(\x08B\x02\x18\x01H\x00\x88\x01\x01\x12\x1e\n\x12replace_known_time\x18\x07 \x01(\x08B\x02\x18\x01B\x12\n\x10_should_optimise"\xee\x03\n\x17ImportTimeSeriesRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02\x123\n\x0btime_series\x18\x02 \x03(\x0b2\x1e.exabel.api.data.v1.TimeSeries\x12\x1a\n\x12status_in_response\x18\x06 \x01(\x08\x129\n\x0einsert_options\x18\n \x01(\x0b2!.exabel.api.data.v1.InsertOptions\x129\n\x0eupdate_options\x18\x0b \x01(\x0b2!.exabel.api.data.v1.UpdateOptions\x12D\n\x12default_known_time\x18\x03 \x01(\x0b2$.exabel.api.data.v1.DefaultKnownTimeB\x02\x18\x01\x12\x19\n\rallow_missing\x18\x04 \x01(\x08B\x02\x18\x01\x12\x16\n\ncreate_tag\x18\x05 \x01(\x08B\x02\x18\x01\x12(\n\x1creplace_existing_time_series\x18\x07 \x01(\x08B\x02\x18\x01\x12 \n\x0fshould_optimise\x18\x08 \x01(\x08B\x02\x18\x01H\x00\x88\x01\x01\x12\x1e\n\x12replace_known_time\x18\t \x01(\x08B\x02\x18\x01B\x12\n\x10_should_optimise"\xa2\x02\n\x18ImportTimeSeriesResponse\x12X\n\tresponses\x18\x01 \x03(\x0b2E.exabel.api.data.v1.ImportTimeSeriesResponse.SingleTimeSeriesResponse\x1a\xab\x01\n\x18SingleTimeSeriesResponse\x12k\n\x10time_series_name\x18\x01 \x01(\tBQ\x92ANJL"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors"\x12"\n\x06status\x18\x02 \x01(\x0b2\x12.google.rpc.Status"C\n\x17DeleteTimeSeriesRequest\x12(\n\x04name\x18\x01 \x01(\tB\x1a\x92A\x14\xca>\x11\xfa\x02\x0etimeSeriesName\xe0A\x02"\x8a\x01\n"BatchDeleteTimeSeriesPointsRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02\x123\n\x0btime_series\x18\x02 \x03(\x0b2\x1e.exabel.api.data.v1.TimeSeries\x12\x1a\n\x12status_in_response\x18\x03 \x01(\x08"\xc2\x02\n#BatchDeleteTimeSeriesPointsResponse\x12h\n\tresponses\x18\x01 \x03(\x0b2U.exabel.api.data.v1.BatchDeleteTimeSeriesPointsResponse.BatchDeleteTimeSeriesResponse\x1a\xb0\x01\n\x1dBatchDeleteTimeSeriesResponse\x12k\n\x10time_series_name\x18\x01 \x01(\tBQ\x92ANJL"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors"\x12"\n\x06status\x18\x02 \x01(\x0b2\x12.google.rpc.Status2\x89\x0e\n\x11TimeSeriesService\x12\xdb\x01\n\x0eListTimeSeries\x12).exabel.api.data.v1.ListTimeSeriesRequest\x1a*.exabel.api.data.v1.ListTimeSeriesResponse"r\x92A\x12\x12\x10List time series\x82\xd3\xe4\x93\x02W\x120/v1/{parent=entityTypes/*/entities/*}/timeSeriesZ#\x12!/v1/{parent=signals/*}/timeSeries\x12\xd5\x01\n\rGetTimeSeries\x12(.exabel.api.data.v1.GetTimeSeriesRequest\x1a\x1e.exabel.api.data.v1.TimeSeries"z\x92A\x11\x12\x0fGet time series\x82\xd3\xe4\x93\x02`\x12-/v1/{name=entityTypes/*/entities/*/signals/*}Z/\x12-/v1/{name=signals/*/entityTypes/*/entities/*}\x12\x92\x02\n\x10CreateTimeSeries\x12+.exabel.api.data.v1.CreateTimeSeriesRequest\x1a\x1e.exabel.api.data.v1.TimeSeries"\xb0\x01\x92A\x14\x12\x12Create time series\x82\xd3\xe4\x93\x02\x92\x01"9/v1/{time_series.name=entityTypes/*/entities/*/signals/*}:\x0btime_seriesZH"9/v1/{time_series.name=signals/*/entityTypes/*/entities/*}:\x0btime_series\x12\x92\x02\n\x10UpdateTimeSeries\x12+.exabel.api.data.v1.UpdateTimeSeriesRequest\x1a\x1e.exabel.api.data.v1.TimeSeries"\xb0\x01\x92A\x14\x12\x12Update time series\x82\xd3\xe4\x93\x02\x92\x0129/v1/{time_series.name=entityTypes/*/entities/*/signals/*}:\x0btime_seriesZH29/v1/{time_series.name=signals/*/entityTypes/*/entities/*}:\x0btime_series\x12\xf8\x01\n\x10ImportTimeSeries\x12+.exabel.api.data.v1.ImportTimeSeriesRequest\x1a,.exabel.api.data.v1.ImportTimeSeriesResponse"\x88\x01\x92A\x14\x12\x12Import time series\x82\xd3\xe4\x93\x02k"7/v1/{parent=entityTypes/*/entities/*}/timeSeries:import:\x01*Z-"(/v1/{parent=signals/*}/timeSeries:import:\x01*\x12\xbf\x02\n\x1bBatchDeleteTimeSeriesPoints\x126.exabel.api.data.v1.BatchDeleteTimeSeriesPointsRequest\x1a7.exabel.api.data.v1.BatchDeleteTimeSeriesPointsResponse"\xae\x01\x92A!\x12\x1fBatch delete time series points\x82\xd3\xe4\x93\x02\x83\x01"C/v1/{parent=entityTypes/*/entities/*}/timeSeries/points:batchDelete:\x01*Z9"4/v1/{parent=signals/*}/timeSeries/points:batchDelete:\x01*\x12\xd6\x01\n\x10DeleteTimeSeries\x12+.exabel.api.data.v1.DeleteTimeSeriesRequest\x1a\x16.google.protobuf.Empty"}\x92A\x14\x12\x12Delete time series\x82\xd3\xe4\x93\x02`*-/v1/{name=entityTypes/*/entities/*/signals/*}Z/*-/v1/{name=signals/*/entityTypes/*/entities/*}BJ\n\x16com.exabel.api.data.v1B\x16TimeSeriesServiceProtoP\x01Z\x16exabel.com/api/data/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.data.v1.time_series_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x16com.exabel.api.data.v1B\x16TimeSeriesServiceProtoP\x01Z\x16exabel.com/api/data/v1' - _globals['_LISTTIMESERIESREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTTIMESERIESREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x16\xca>\x13\xfa\x02\x10timeSeriesParent\xe0A\x02' - _globals['_GETTIMESERIESREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETTIMESERIESREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0etimeSeriesName\xe0A\x02' - _globals['_INSERTOPTIONS'].fields_by_name['create_tag']._loaded_options = None - _globals['_INSERTOPTIONS'].fields_by_name['create_tag']._serialized_options = b'\x18\x01' - _globals['_CREATETIMESERIESREQUEST'].fields_by_name['time_series']._loaded_options = None - _globals['_CREATETIMESERIESREQUEST'].fields_by_name['time_series']._serialized_options = b'\xe0A\x02' - _globals['_CREATETIMESERIESREQUEST'].fields_by_name['default_known_time']._loaded_options = None - _globals['_CREATETIMESERIESREQUEST'].fields_by_name['default_known_time']._serialized_options = b'\x18\x01' - _globals['_CREATETIMESERIESREQUEST'].fields_by_name['create_tag']._loaded_options = None - _globals['_CREATETIMESERIESREQUEST'].fields_by_name['create_tag']._serialized_options = b'\x18\x01' - _globals['_CREATETIMESERIESREQUEST'].fields_by_name['should_optimise']._loaded_options = None - _globals['_CREATETIMESERIESREQUEST'].fields_by_name['should_optimise']._serialized_options = b'\x18\x01' - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['time_series']._loaded_options = None - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['time_series']._serialized_options = b'\xe0A\x02' - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['default_known_time']._loaded_options = None - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['default_known_time']._serialized_options = b'\x18\x01' - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['allow_missing']._loaded_options = None - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['allow_missing']._serialized_options = b'\x18\x01' - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['create_tag']._loaded_options = None - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['create_tag']._serialized_options = b'\x18\x01' - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['should_optimise']._loaded_options = None - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['should_optimise']._serialized_options = b'\x18\x01' - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['replace_known_time']._loaded_options = None - _globals['_UPDATETIMESERIESREQUEST'].fields_by_name['replace_known_time']._serialized_options = b'\x18\x01' - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['parent']._serialized_options = b'\xe0A\x02' - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['default_known_time']._loaded_options = None - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['default_known_time']._serialized_options = b'\x18\x01' - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['allow_missing']._loaded_options = None - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['allow_missing']._serialized_options = b'\x18\x01' - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['create_tag']._loaded_options = None - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['create_tag']._serialized_options = b'\x18\x01' - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['replace_existing_time_series']._loaded_options = None - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['replace_existing_time_series']._serialized_options = b'\x18\x01' - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['should_optimise']._loaded_options = None - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['should_optimise']._serialized_options = b'\x18\x01' - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['replace_known_time']._loaded_options = None - _globals['_IMPORTTIMESERIESREQUEST'].fields_by_name['replace_known_time']._serialized_options = b'\x18\x01' - _globals['_IMPORTTIMESERIESRESPONSE_SINGLETIMESERIESRESPONSE'].fields_by_name['time_series_name']._loaded_options = None - _globals['_IMPORTTIMESERIESRESPONSE_SINGLETIMESERIESRESPONSE'].fields_by_name['time_series_name']._serialized_options = b'\x92ANJL"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors"' - _globals['_DELETETIMESERIESREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETETIMESERIESREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x14\xca>\x11\xfa\x02\x0etimeSeriesName\xe0A\x02' - _globals['_BATCHDELETETIMESERIESPOINTSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_BATCHDELETETIMESERIESPOINTSREQUEST'].fields_by_name['parent']._serialized_options = b'\xe0A\x02' - _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE_BATCHDELETETIMESERIESRESPONSE'].fields_by_name['time_series_name']._loaded_options = None - _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE_BATCHDELETETIMESERIESRESPONSE'].fields_by_name['time_series_name']._serialized_options = b'\x92ANJL"entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors"' - _globals['_TIMESERIESSERVICE'].methods_by_name['ListTimeSeries']._loaded_options = None - _globals['_TIMESERIESSERVICE'].methods_by_name['ListTimeSeries']._serialized_options = b'\x92A\x12\x12\x10List time series\x82\xd3\xe4\x93\x02W\x120/v1/{parent=entityTypes/*/entities/*}/timeSeriesZ#\x12!/v1/{parent=signals/*}/timeSeries' - _globals['_TIMESERIESSERVICE'].methods_by_name['GetTimeSeries']._loaded_options = None - _globals['_TIMESERIESSERVICE'].methods_by_name['GetTimeSeries']._serialized_options = b'\x92A\x11\x12\x0fGet time series\x82\xd3\xe4\x93\x02`\x12-/v1/{name=entityTypes/*/entities/*/signals/*}Z/\x12-/v1/{name=signals/*/entityTypes/*/entities/*}' - _globals['_TIMESERIESSERVICE'].methods_by_name['CreateTimeSeries']._loaded_options = None - _globals['_TIMESERIESSERVICE'].methods_by_name['CreateTimeSeries']._serialized_options = b'\x92A\x14\x12\x12Create time series\x82\xd3\xe4\x93\x02\x92\x01"9/v1/{time_series.name=entityTypes/*/entities/*/signals/*}:\x0btime_seriesZH"9/v1/{time_series.name=signals/*/entityTypes/*/entities/*}:\x0btime_series' - _globals['_TIMESERIESSERVICE'].methods_by_name['UpdateTimeSeries']._loaded_options = None - _globals['_TIMESERIESSERVICE'].methods_by_name['UpdateTimeSeries']._serialized_options = b'\x92A\x14\x12\x12Update time series\x82\xd3\xe4\x93\x02\x92\x0129/v1/{time_series.name=entityTypes/*/entities/*/signals/*}:\x0btime_seriesZH29/v1/{time_series.name=signals/*/entityTypes/*/entities/*}:\x0btime_series' - _globals['_TIMESERIESSERVICE'].methods_by_name['ImportTimeSeries']._loaded_options = None - _globals['_TIMESERIESSERVICE'].methods_by_name['ImportTimeSeries']._serialized_options = b'\x92A\x14\x12\x12Import time series\x82\xd3\xe4\x93\x02k"7/v1/{parent=entityTypes/*/entities/*}/timeSeries:import:\x01*Z-"(/v1/{parent=signals/*}/timeSeries:import:\x01*' - _globals['_TIMESERIESSERVICE'].methods_by_name['BatchDeleteTimeSeriesPoints']._loaded_options = None - _globals['_TIMESERIESSERVICE'].methods_by_name['BatchDeleteTimeSeriesPoints']._serialized_options = b'\x92A!\x12\x1fBatch delete time series points\x82\xd3\xe4\x93\x02\x83\x01"C/v1/{parent=entityTypes/*/entities/*}/timeSeries/points:batchDelete:\x01*Z9"4/v1/{parent=signals/*}/timeSeries/points:batchDelete:\x01*' - _globals['_TIMESERIESSERVICE'].methods_by_name['DeleteTimeSeries']._loaded_options = None - _globals['_TIMESERIESSERVICE'].methods_by_name['DeleteTimeSeries']._serialized_options = b'\x92A\x14\x12\x12Delete time series\x82\xd3\xe4\x93\x02`*-/v1/{name=entityTypes/*/entities/*/signals/*}Z/*-/v1/{name=signals/*/entityTypes/*/entities/*}' - _globals['_LISTTIMESERIESREQUEST']._serialized_start = 280 - _globals['_LISTTIMESERIESREQUEST']._serialized_end = 388 - _globals['_LISTTIMESERIESRESPONSE']._serialized_start = 390 - _globals['_LISTTIMESERIESRESPONSE']._serialized_end = 512 - _globals['_GETTIMESERIESREQUEST']._serialized_start = 514 - _globals['_GETTIMESERIESREQUEST']._serialized_end = 628 - _globals['_INSERTOPTIONS']._serialized_start = 631 - _globals['_INSERTOPTIONS']._serialized_end = 786 - _globals['_UPDATEOPTIONS']._serialized_start = 789 - _globals['_UPDATEOPTIONS']._serialized_end = 956 - _globals['_CREATETIMESERIESREQUEST']._serialized_start = 959 - _globals['_CREATETIMESERIESREQUEST']._serialized_end = 1299 - _globals['_UPDATETIMESERIESREQUEST']._serialized_start = 1302 - _globals['_UPDATETIMESERIESREQUEST']._serialized_end = 1760 - _globals['_IMPORTTIMESERIESREQUEST']._serialized_start = 1763 - _globals['_IMPORTTIMESERIESREQUEST']._serialized_end = 2257 - _globals['_IMPORTTIMESERIESRESPONSE']._serialized_start = 2260 - _globals['_IMPORTTIMESERIESRESPONSE']._serialized_end = 2550 - _globals['_IMPORTTIMESERIESRESPONSE_SINGLETIMESERIESRESPONSE']._serialized_start = 2379 - _globals['_IMPORTTIMESERIESRESPONSE_SINGLETIMESERIESRESPONSE']._serialized_end = 2550 - _globals['_DELETETIMESERIESREQUEST']._serialized_start = 2552 - _globals['_DELETETIMESERIESREQUEST']._serialized_end = 2619 - _globals['_BATCHDELETETIMESERIESPOINTSREQUEST']._serialized_start = 2622 - _globals['_BATCHDELETETIMESERIESPOINTSREQUEST']._serialized_end = 2760 - _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE']._serialized_start = 2763 - _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE']._serialized_end = 3085 - _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE_BATCHDELETETIMESERIESRESPONSE']._serialized_start = 2909 - _globals['_BATCHDELETETIMESERIESPOINTSRESPONSE_BATCHDELETETIMESERIESRESPONSE']._serialized_end = 3085 - _globals['_TIMESERIESSERVICE']._serialized_start = 3088 - _globals['_TIMESERIESSERVICE']._serialized_end = 4889 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2.pyi deleted file mode 100644 index c1ecace9..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2.pyi +++ /dev/null @@ -1,439 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2022 Exabel AS. All rights reserved.""" -import builtins -import collections.abc -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.message -import google.rpc.status_pb2 -import typing -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -@typing.final -class ListTimeSeriesRequest(google.protobuf.message.Message): - """The request to list time series. This request has an implicit empty `TimeSeriesView` parameter, - so only the canonical names are returned. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - PAGE_SIZE_FIELD_NUMBER: builtins.int - PAGE_TOKEN_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The parent entity or signal of time series to list, for example `entityTypes/ns.type1/entities/ns.entity1`\n or `signal/ns.signal1`.\n ' - page_size: builtins.int - 'Maximum number of results to return. Defaults to 1000, which is the maximum allowed value.' - page_token: builtins.str - 'Token for a specific page of results, as returned from a previous list request with the same\n query parameters.\n ' - - def __init__(self, *, parent: builtins.str | None=..., page_size: builtins.int | None=..., page_token: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['page_size', b'page_size', 'page_token', b'page_token', 'parent', b'parent']) -> None: - ... -global___ListTimeSeriesRequest = ListTimeSeriesRequest - -@typing.final -class ListTimeSeriesResponse(google.protobuf.message.Message): - """The response to list time series. Returns all matching time series.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - TIME_SERIES_FIELD_NUMBER: builtins.int - NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int - TOTAL_SIZE_FIELD_NUMBER: builtins.int - next_page_token: builtins.str - 'Token for the next page of results, which can be sent to a subsequent query.\n The end of the list is reached when the number of results is less than the page size\n (NOT when the token is empty).\n ' - total_size: builtins.int - 'Total number of results, irrespective of paging.' - - @property - def time_series(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.time_series_messages_pb2.TimeSeries]: - """List of time series. Only the resource `name` field is returned.""" - - def __init__(self, *, time_series: collections.abc.Iterable[exabel.api.data.v1.time_series_messages_pb2.TimeSeries] | None=..., next_page_token: builtins.str | None=..., total_size: builtins.int | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['next_page_token', b'next_page_token', 'time_series', b'time_series', 'total_size', b'total_size']) -> None: - ... -global___ListTimeSeriesResponse = ListTimeSeriesResponse - -@typing.final -class GetTimeSeriesRequest(google.protobuf.message.Message): - """The request to get one time series. The returned time series will contain its canonical name. - Not all time series are capable of returning data. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - VIEW_FIELD_NUMBER: builtins.int - name: builtins.str - 'The resource name of the requested time series, for example\n `entityTypes/ns.type1/entities/ns.entity1/signals/ns.signal1`\n or `signals/ns.signal1/entityTypes/ns.type1/entities/ns.entity1`. The returned time series will\n always contain its canonical name `entityTypes/ns.type1/entities/ns.entity1/signals/ns.signal1`.\n ' - - @property - def view(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView: - """Specifies which parts of the time series should be returned in the request.""" - - def __init__(self, *, name: builtins.str | None=..., view: exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['view', b'view']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name', 'view', b'view']) -> None: - ... -global___GetTimeSeriesRequest = GetTimeSeriesRequest - -@typing.final -class InsertOptions(google.protobuf.message.Message): - """Common options when insert time series values.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - DEFAULT_KNOWN_TIME_FIELD_NUMBER: builtins.int - CREATE_TAG_FIELD_NUMBER: builtins.int - SHOULD_OPTIMISE_FIELD_NUMBER: builtins.int - create_tag: builtins.bool - 'This field is not in use anymore.' - should_optimise: builtins.bool - 'Whether time series storage optimisation should be enabled or not. If not set, optimisation is\n at the discretion of the server.\n ' - - @property - def default_known_time(self) -> exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime: - """The specification of the default known time to use for points that don't explicitly have a - known time set. If not set, the time of insertion is used as the default known time - (`current_time = true`). - """ - - def __init__(self, *, default_known_time: exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime | None=..., create_tag: builtins.bool | None=..., should_optimise: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_should_optimise', b'_should_optimise', 'default_known_time', b'default_known_time', 'should_optimise', b'should_optimise']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_should_optimise', b'_should_optimise', 'create_tag', b'create_tag', 'default_known_time', b'default_known_time', 'should_optimise', b'should_optimise']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_should_optimise', b'_should_optimise']) -> typing.Literal['should_optimise'] | None: - ... -global___InsertOptions = InsertOptions - -@typing.final -class UpdateOptions(google.protobuf.message.Message): - """Common options when updating one or more time series.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - ALLOW_MISSING_FIELD_NUMBER: builtins.int - REPLACE_EXISTING_TIME_SERIES_FIELD_NUMBER: builtins.int - REPLACE_KNOWN_TIME_FIELD_NUMBER: builtins.int - REPLACE_EXISTING_DATA_POINTS_FIELD_NUMBER: builtins.int - allow_missing: builtins.bool - 'If set to `true`, new time series will be created if they did not exist.' - replace_existing_time_series: builtins.bool - 'Set to `true` to first delete all data from existing time series, including units. This means\n that all historical, point-in-time and units data for the time series will be destroyed and\n replaced with the data in this call.\n Use with care! For instance: If this flag is set, and an import job splits one time series\n over multiple calls, only the data in the last call will be kept.\n ' - replace_known_time: builtins.bool - 'Specifies that the known times of _all_ inserted points are a fixed timestamp specified in\n `insert_options.default_known_time`, and additionally that all existing values of the\n time series should be unset at this timestamp. If this is set, either\n `insert_options.default_known_time.current_time` or\n `insert_options.default_known_time.known_time` must be set, and it is an error to specify the\n known time of any inserted points.\n Use with care! For instance: If this flag is set, and an import job splits one time series\n over multiple calls, only the data in the last call will be kept.\n ' - replace_existing_data_points: builtins.bool - 'Whether to remove existing data points for other known times of the inserted time series\n points. Data points for times not present in the request will be left untouched.\n ' - - def __init__(self, *, allow_missing: builtins.bool | None=..., replace_existing_time_series: builtins.bool | None=..., replace_known_time: builtins.bool | None=..., replace_existing_data_points: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['replace_existing_data_points', b'replace_existing_data_points', 'replace_existing_time_series', b'replace_existing_time_series', 'replace_known_time', b'replace_known_time', 'replace_options', b'replace_options']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['allow_missing', b'allow_missing', 'replace_existing_data_points', b'replace_existing_data_points', 'replace_existing_time_series', b'replace_existing_time_series', 'replace_known_time', b'replace_known_time', 'replace_options', b'replace_options']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['replace_options', b'replace_options']) -> typing.Literal['replace_existing_time_series', 'replace_known_time', 'replace_existing_data_points'] | None: - ... -global___UpdateOptions = UpdateOptions - -@typing.final -class CreateTimeSeriesRequest(google.protobuf.message.Message): - """The request to create one time series. The parents of the time series will be inferred from - `time_series.name`. The returned time series will contain its canonical name. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - TIME_SERIES_FIELD_NUMBER: builtins.int - VIEW_FIELD_NUMBER: builtins.int - INSERT_OPTIONS_FIELD_NUMBER: builtins.int - DEFAULT_KNOWN_TIME_FIELD_NUMBER: builtins.int - CREATE_TAG_FIELD_NUMBER: builtins.int - SHOULD_OPTIMISE_FIELD_NUMBER: builtins.int - create_tag: builtins.bool - 'This field is not in use anymore.' - should_optimise: builtins.bool - 'This field is deprecated and replaced with insert_options.should_optimise.' - - @property - def time_series(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeries: - """The time series to create.""" - - @property - def view(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView: - """Specifies which parts of the time series should be returned in the request.""" - - @property - def insert_options(self) -> global___InsertOptions: - """Insert options for this request.""" - - @property - def default_known_time(self) -> exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime: - """This field is deprecated and replaced with insert_options.default_known_time.""" - - def __init__(self, *, time_series: exabel.api.data.v1.time_series_messages_pb2.TimeSeries | None=..., view: exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView | None=..., insert_options: global___InsertOptions | None=..., default_known_time: exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime | None=..., create_tag: builtins.bool | None=..., should_optimise: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_should_optimise', b'_should_optimise', 'default_known_time', b'default_known_time', 'insert_options', b'insert_options', 'should_optimise', b'should_optimise', 'time_series', b'time_series', 'view', b'view']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_should_optimise', b'_should_optimise', 'create_tag', b'create_tag', 'default_known_time', b'default_known_time', 'insert_options', b'insert_options', 'should_optimise', b'should_optimise', 'time_series', b'time_series', 'view', b'view']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_should_optimise', b'_should_optimise']) -> typing.Literal['should_optimise'] | None: - ... -global___CreateTimeSeriesRequest = CreateTimeSeriesRequest - -@typing.final -class UpdateTimeSeriesRequest(google.protobuf.message.Message): - """The request to update one time series. The returned time series will contain its canonical name.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - TIME_SERIES_FIELD_NUMBER: builtins.int - VIEW_FIELD_NUMBER: builtins.int - INSERT_OPTIONS_FIELD_NUMBER: builtins.int - UPDATE_OPTIONS_FIELD_NUMBER: builtins.int - DEFAULT_KNOWN_TIME_FIELD_NUMBER: builtins.int - ALLOW_MISSING_FIELD_NUMBER: builtins.int - CREATE_TAG_FIELD_NUMBER: builtins.int - SHOULD_OPTIMISE_FIELD_NUMBER: builtins.int - REPLACE_KNOWN_TIME_FIELD_NUMBER: builtins.int - allow_missing: builtins.bool - 'This field is deprecated and replaced with update_options.allow_missing.' - create_tag: builtins.bool - 'This field is not in use anymore.' - should_optimise: builtins.bool - 'This field is deprecated and replaced with insert_options.should_optimise.' - replace_known_time: builtins.bool - 'This field is deprecated and replaced with update_options.replace_known_time.' - - @property - def time_series(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeries: - """The time series to update. The data in this request and the existing data are merged together: - All points in the request will overwrite the existing points with the same key, unless - the new value is empty, in which case the point will be deleted. - """ - - @property - def view(self) -> exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView: - """Specifies which parts of the time series should be returned in the request.""" - - @property - def insert_options(self) -> global___InsertOptions: - """Insert options for this request.""" - - @property - def update_options(self) -> global___UpdateOptions: - """Update options for this request.""" - - @property - def default_known_time(self) -> exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime: - """This field is deprecated and replaced with insert_options.default_known_time.""" - - def __init__(self, *, time_series: exabel.api.data.v1.time_series_messages_pb2.TimeSeries | None=..., view: exabel.api.data.v1.time_series_messages_pb2.TimeSeriesView | None=..., insert_options: global___InsertOptions | None=..., update_options: global___UpdateOptions | None=..., default_known_time: exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime | None=..., allow_missing: builtins.bool | None=..., create_tag: builtins.bool | None=..., should_optimise: builtins.bool | None=..., replace_known_time: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_should_optimise', b'_should_optimise', 'default_known_time', b'default_known_time', 'insert_options', b'insert_options', 'should_optimise', b'should_optimise', 'time_series', b'time_series', 'update_options', b'update_options', 'view', b'view']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_should_optimise', b'_should_optimise', 'allow_missing', b'allow_missing', 'create_tag', b'create_tag', 'default_known_time', b'default_known_time', 'insert_options', b'insert_options', 'replace_known_time', b'replace_known_time', 'should_optimise', b'should_optimise', 'time_series', b'time_series', 'update_options', b'update_options', 'view', b'view']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_should_optimise', b'_should_optimise']) -> typing.Literal['should_optimise'] | None: - ... -global___UpdateTimeSeriesRequest = UpdateTimeSeriesRequest - -@typing.final -class ImportTimeSeriesRequest(google.protobuf.message.Message): - """The request to import multiple time series. The parents of the time series will be inferred from - `time_series.name`. - """ - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - TIME_SERIES_FIELD_NUMBER: builtins.int - STATUS_IN_RESPONSE_FIELD_NUMBER: builtins.int - INSERT_OPTIONS_FIELD_NUMBER: builtins.int - UPDATE_OPTIONS_FIELD_NUMBER: builtins.int - DEFAULT_KNOWN_TIME_FIELD_NUMBER: builtins.int - ALLOW_MISSING_FIELD_NUMBER: builtins.int - CREATE_TAG_FIELD_NUMBER: builtins.int - REPLACE_EXISTING_TIME_SERIES_FIELD_NUMBER: builtins.int - SHOULD_OPTIMISE_FIELD_NUMBER: builtins.int - REPLACE_KNOWN_TIME_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The common parent of all time series to import. May include `-` as a wild card.' - status_in_response: builtins.bool - 'Set to `true` to report the status of each time series in the response. If `false`, a failure\n for one time series will fail the entire request, and a sample of the failures will be\n reported in the trailers.\n ' - allow_missing: builtins.bool - 'This field is deprecated and replaced with update_options.allow_missing.' - create_tag: builtins.bool - 'This field is not in use anymore.' - replace_existing_time_series: builtins.bool - 'This field is deprecated and replaced with update_options.replace_existing_time_series.' - should_optimise: builtins.bool - 'This field is deprecated and replaced with insert_options.should_optimise.' - replace_known_time: builtins.bool - 'This field is deprecated and replaced with update_options.replace_known_time.' - - @property - def time_series(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.time_series_messages_pb2.TimeSeries]: - """One or more time series to import.""" - - @property - def insert_options(self) -> global___InsertOptions: - """Insert options for this request.""" - - @property - def update_options(self) -> global___UpdateOptions: - """Update options for this request.""" - - @property - def default_known_time(self) -> exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime: - """This field is deprecated and replaced with insert_options.default_known_time.""" - - def __init__(self, *, parent: builtins.str | None=..., time_series: collections.abc.Iterable[exabel.api.data.v1.time_series_messages_pb2.TimeSeries] | None=..., status_in_response: builtins.bool | None=..., insert_options: global___InsertOptions | None=..., update_options: global___UpdateOptions | None=..., default_known_time: exabel.api.data.v1.time_series_messages_pb2.DefaultKnownTime | None=..., allow_missing: builtins.bool | None=..., create_tag: builtins.bool | None=..., replace_existing_time_series: builtins.bool | None=..., should_optimise: builtins.bool | None=..., replace_known_time: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['_should_optimise', b'_should_optimise', 'default_known_time', b'default_known_time', 'insert_options', b'insert_options', 'should_optimise', b'should_optimise', 'update_options', b'update_options']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['_should_optimise', b'_should_optimise', 'allow_missing', b'allow_missing', 'create_tag', b'create_tag', 'default_known_time', b'default_known_time', 'insert_options', b'insert_options', 'parent', b'parent', 'replace_existing_time_series', b'replace_existing_time_series', 'replace_known_time', b'replace_known_time', 'should_optimise', b'should_optimise', 'status_in_response', b'status_in_response', 'time_series', b'time_series', 'update_options', b'update_options']) -> None: - ... - - def WhichOneof(self, oneof_group: typing.Literal['_should_optimise', b'_should_optimise']) -> typing.Literal['should_optimise'] | None: - ... -global___ImportTimeSeriesRequest = ImportTimeSeriesRequest - -@typing.final -class ImportTimeSeriesResponse(google.protobuf.message.Message): - """The response to import multiple time series.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - @typing.final - class SingleTimeSeriesResponse(google.protobuf.message.Message): - """The status for one time series.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - TIME_SERIES_NAME_FIELD_NUMBER: builtins.int - STATUS_FIELD_NUMBER: builtins.int - time_series_name: builtins.str - 'The resource name of the time series, for example\n `entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors`.\n ' - - @property - def status(self) -> google.rpc.status_pb2.Status: - """The status for this time series. A `status.code = OK` indicates that the time series - was imported successfully. - """ - - def __init__(self, *, time_series_name: builtins.str | None=..., status: google.rpc.status_pb2.Status | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['status', b'status']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['status', b'status', 'time_series_name', b'time_series_name']) -> None: - ... - RESPONSES_FIELD_NUMBER: builtins.int - - @property - def responses(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImportTimeSeriesResponse.SingleTimeSeriesResponse]: - """One response for each time series, in order. This list is populated if and only if - `status_in_response` was set to `true` in the request. - """ - - def __init__(self, *, responses: collections.abc.Iterable[global___ImportTimeSeriesResponse.SingleTimeSeriesResponse] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['responses', b'responses']) -> None: - ... -global___ImportTimeSeriesResponse = ImportTimeSeriesResponse - -@typing.final -class DeleteTimeSeriesRequest(google.protobuf.message.Message): - """The request to delete one time series.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - name: builtins.str - 'The resource name of the time series to be deleted, for example\n `entityTypes/ns.type1/entities/ns.entity1/signals/ns.signal1` or\n `signals/ns.signal1/entityTypes/ns.type1/entities/ns.entity1`.\n ' - - def __init__(self, *, name: builtins.str | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['name', b'name']) -> None: - ... -global___DeleteTimeSeriesRequest = DeleteTimeSeriesRequest - -@typing.final -class BatchDeleteTimeSeriesPointsRequest(google.protobuf.message.Message): - """The request to batch delete specific points of one or more time series.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - TIME_SERIES_FIELD_NUMBER: builtins.int - STATUS_IN_RESPONSE_FIELD_NUMBER: builtins.int - parent: builtins.str - 'The common parent of all time series to delete points from, for example\n `entityTypes/ns.type1/entities/ns.entity1/signals/ns.signal1` or\n `signals/ns.signal1/entityTypes/ns.type1/entities/ns.entity1`.\n May include `-` as a wild card.\n ' - status_in_response: builtins.bool - 'Set to `true` to report the status of each time series in the response. If `false`, a failure\n for one time series will fail the entire request, and a sample of the failures will be\n reported in the trailers.\n ' - - @property - def time_series(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[exabel.api.data.v1.time_series_messages_pb2.TimeSeries]: - """The list of time series points to delete. If a `known_time` is empty, _all_ data for the time - series at that time is deleted. For all points, `value` is ignored. Trying to delete points - from a non-existing time series will result in an error, but trying to delete a non-existing - point from an existing time series will _not_ result in an error. - """ - - def __init__(self, *, parent: builtins.str | None=..., time_series: collections.abc.Iterable[exabel.api.data.v1.time_series_messages_pb2.TimeSeries] | None=..., status_in_response: builtins.bool | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['parent', b'parent', 'status_in_response', b'status_in_response', 'time_series', b'time_series']) -> None: - ... -global___BatchDeleteTimeSeriesPointsRequest = BatchDeleteTimeSeriesPointsRequest - -@typing.final -class BatchDeleteTimeSeriesPointsResponse(google.protobuf.message.Message): - """The response to batch delete multiple time series points.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - - @typing.final - class BatchDeleteTimeSeriesResponse(google.protobuf.message.Message): - """The status for one time series.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - TIME_SERIES_NAME_FIELD_NUMBER: builtins.int - STATUS_FIELD_NUMBER: builtins.int - time_series_name: builtins.str - 'The resource name of the time series, for example\n `entityTypes/store/entities/ns.apple_store_fifth_avenue/signals/ns.visitors`.\n ' - - @property - def status(self) -> google.rpc.status_pb2.Status: - """The status for this time series. A `status.code = OK` indicates that all time series points - was deleted successfully. - """ - - def __init__(self, *, time_series_name: builtins.str | None=..., status: google.rpc.status_pb2.Status | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['status', b'status']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['status', b'status', 'time_series_name', b'time_series_name']) -> None: - ... - RESPONSES_FIELD_NUMBER: builtins.int - - @property - def responses(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___BatchDeleteTimeSeriesPointsResponse.BatchDeleteTimeSeriesResponse]: - """One response for each time series, in order. This list is populated if and only if - `status_in_response` was set to `true` in the request. - """ - - def __init__(self, *, responses: collections.abc.Iterable[global___BatchDeleteTimeSeriesPointsResponse.BatchDeleteTimeSeriesResponse] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['responses', b'responses']) -> None: - ... -global___BatchDeleteTimeSeriesPointsResponse = BatchDeleteTimeSeriesPointsResponse \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2_grpc.py deleted file mode 100644 index 060b1d19..00000000 --- a/exabel_data_sdk/stubs/exabel/api/data/v1/time_series_service_pb2_grpc.py +++ /dev/null @@ -1,206 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.data.v1 import time_series_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2 -from .....exabel.api.data.v1 import time_series_service_pb2 as exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/data/v1/time_series_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class TimeSeriesServiceStub(object): - """Service for managing time series. See the User Guide for more information about time series: - https://help.exabel.com/docs/time-series - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListTimeSeries = channel.unary_unary('/exabel.api.data.v1.TimeSeriesService/ListTimeSeries', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesResponse.FromString, _registered_method=True) - self.GetTimeSeries = channel.unary_unary('/exabel.api.data.v1.TimeSeriesService/GetTimeSeries', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.GetTimeSeriesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, _registered_method=True) - self.CreateTimeSeries = channel.unary_unary('/exabel.api.data.v1.TimeSeriesService/CreateTimeSeries', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.CreateTimeSeriesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, _registered_method=True) - self.UpdateTimeSeries = channel.unary_unary('/exabel.api.data.v1.TimeSeriesService/UpdateTimeSeries', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.UpdateTimeSeriesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, _registered_method=True) - self.ImportTimeSeries = channel.unary_unary('/exabel.api.data.v1.TimeSeriesService/ImportTimeSeries', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesResponse.FromString, _registered_method=True) - self.BatchDeleteTimeSeriesPoints = channel.unary_unary('/exabel.api.data.v1.TimeSeriesService/BatchDeleteTimeSeriesPoints', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsResponse.FromString, _registered_method=True) - self.DeleteTimeSeries = channel.unary_unary('/exabel.api.data.v1.TimeSeriesService/DeleteTimeSeries', request_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.DeleteTimeSeriesRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - -class TimeSeriesServiceServicer(object): - """Service for managing time series. See the User Guide for more information about time series: - https://help.exabel.com/docs/time-series - """ - - def ListTimeSeries(self, request, context): - """Lists time series. - - Lists all time series for one entity or for one signal. Only the names are returned. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetTimeSeries(self, request, context): - """Gets one time series. - - Use this method to get time series data points. - - *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps - must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateTimeSeries(self, request, context): - """Creates one time series. - - *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps - must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. - - The default `known_time` for a data point is insertion time, i.e. same as setting - `current_time` to `true`. To override the default behaviour, set one of the - `default_known_time` fields. - - The optional `view` argument lets you request for time series data points to be returned - within a date range. If this is not set, no values are returned. - - It is also possible to create a time series by calling `UpdateTimeSeries` - with `allow_missing` set to `true`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateTimeSeries(self, request, context): - """Updates one time series. - - This can also be used to create a time series by setting `allow_missing` to `true`. - - Updating a time series will usually create a new version of the time series. However, by - explicitly setting a known time, any version may be changed or updated. If a value already - exists with exactly the same timestamp *and* known time, it will be updated. Otherwise a new - point will be created. - - If a timestamp that is previously known is not included, its value is *not* deleted, even - though it is within the range of this update. The old value will simply continue to exist at - the new version. Data points without values are cleared from this version, meaning that the - old value will continue to exist up until the new version, then cease to exist. - - Time series storage is optimized by discarding values which haven't changed from the previous - versions. Note that this optimization may cause surprising behavior when updating older - versions. When older versions are updated, it is therefore recommended to perform a full - backload from this version on. - - The default `known_time` for a data point is insertion time, i.e. same as setting - `current_time` to `true`. To override the default behaviour, set one of the - `default_known_time` fields. - - *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps - must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. - - The optional `view` argument lets you request for time series data points to be returned - within a date range. If this is not set, no values are returned. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ImportTimeSeries(self, request, context): - """Creates or update multiple time series. - - Import multiple time series in bulk, by creating new time series or updating existing time - series. - - If you would like to import multiple time series belonging to different signals, specify `-` - as the signal identifier. (Signal identifiers are part of each time series' resource name, so - your time series will still be assigned to their corresponding signals.) - - The default `known_time` for a data point is insertion time, i.e. same as setting - `current_time` to `true`. To override the default behaviour, set one of the - `default_known_time` fields. - - *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps - must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def BatchDeleteTimeSeriesPoints(self, request, context): - """Deletes specific time series points for multiple time series. - - Delete multiple time series points in bulk, by erasing the points from the storage. Use with - care: Time series storage is optimized by discarding values which haven't changed from the - previous versions. Note that this optimization may cause surprising behavior when updating - older versions. When older versions are deleted, it is therefore recommended to perform a full - backload from this version on. - - Deleting a value is both different from inserting NaN values, or inserting _no_ value. - - If you would like to delete multiple time series points belonging to different signals, - specify `-` as the signal identifier. (Signal identifiers are part of each time series' - resource name, so your time series will still be assigned to their corresponding signals.) - - *Note*: Exabel only supports processing time series with daily or lower resolution. Timestamps - must be RFC 3339 timestamps, normalised to **midnight UTC**, e.g. `2020-01-01T00:00:00Z`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteTimeSeries(self, request, context): - """Deletes one time series. - - This will delete the time series and ***all*** its data points. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_TimeSeriesServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListTimeSeries': grpc.unary_unary_rpc_method_handler(servicer.ListTimeSeries, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesResponse.SerializeToString), 'GetTimeSeries': grpc.unary_unary_rpc_method_handler(servicer.GetTimeSeries, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.GetTimeSeriesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.SerializeToString), 'CreateTimeSeries': grpc.unary_unary_rpc_method_handler(servicer.CreateTimeSeries, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.CreateTimeSeriesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.SerializeToString), 'UpdateTimeSeries': grpc.unary_unary_rpc_method_handler(servicer.UpdateTimeSeries, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.UpdateTimeSeriesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.SerializeToString), 'ImportTimeSeries': grpc.unary_unary_rpc_method_handler(servicer.ImportTimeSeries, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesResponse.SerializeToString), 'BatchDeleteTimeSeriesPoints': grpc.unary_unary_rpc_method_handler(servicer.BatchDeleteTimeSeriesPoints, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsRequest.FromString, response_serializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsResponse.SerializeToString), 'DeleteTimeSeries': grpc.unary_unary_rpc_method_handler(servicer.DeleteTimeSeries, request_deserializer=exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.DeleteTimeSeriesRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.data.v1.TimeSeriesService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.data.v1.TimeSeriesService', rpc_method_handlers) - -class TimeSeriesService(object): - """Service for managing time series. See the User Guide for more information about time series: - https://help.exabel.com/docs/time-series - """ - - @staticmethod - def ListTimeSeries(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.TimeSeriesService/ListTimeSeries', exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ListTimeSeriesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetTimeSeries(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.TimeSeriesService/GetTimeSeries', exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.GetTimeSeriesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateTimeSeries(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.TimeSeriesService/CreateTimeSeries', exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.CreateTimeSeriesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateTimeSeries(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.TimeSeriesService/UpdateTimeSeries', exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.UpdateTimeSeriesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_time__series__messages__pb2.TimeSeries.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ImportTimeSeries(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.TimeSeriesService/ImportTimeSeries', exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.ImportTimeSeriesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def BatchDeleteTimeSeriesPoints(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.TimeSeriesService/BatchDeleteTimeSeriesPoints', exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsRequest.SerializeToString, exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.BatchDeleteTimeSeriesPointsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteTimeSeries(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.data.v1.TimeSeriesService/DeleteTimeSeries', exabel_dot_api_dot_data_dot_v1_dot_time__series__service__pb2.DeleteTimeSeriesRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2.py deleted file mode 100644 index 3e2169ac..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/management/v1/folder_messages.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.management.v1 import user_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_user__messages__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.exabel/api/management/v1/folder_messages.proto\x12\x18exabel.api.management.v1\x1a,exabel/api/management/v1/user_messages.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\xf3\x01\n\x06Folder\x120\n\x04name\x18\x01 \x01(\tB"\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName\x120\n\x0cdisplay_name\x18\x02 \x01(\tB\x1a\x92A\x14J\x12"My shared folder"\xe0A\x02\x124\n\x0bdescription\x18\x05 \x01(\tB\x1f\x92A\x1cJ\x1a"This is my shared folder"\x12\x12\n\x05write\x18\x03 \x01(\x08B\x03\xe0A\x03\x12;\n\x05items\x18\x04 \x03(\x0b2$.exabel.api.management.v1.FolderItemB\x06\xe0A\x06\xe0A\x03"\xf0\x02\n\nFolderItem\x122\n\x06parent\x18\x01 \x01(\tB"\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName\x12*\n\x04name\x18\x02 \x01(\tB\x1c\x92A\x16J\x14"derivedSignals/123"\xe0A\x03\x12&\n\x0cdisplay_name\x18\x03 \x01(\tB\x10\x92A\rJ\x0b"my_signal"\x12\x13\n\x0bdescription\x18\t \x01(\t\x12;\n\titem_type\x18\x04 \x01(\x0e2(.exabel.api.management.v1.FolderItemType\x12/\n\x0bcreate_time\x18\x05 \x01(\x0b2\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b2\x1a.google.protobuf.Timestamp\x12\x12\n\ncreated_by\x18\x07 \x01(\t\x12\x12\n\nupdated_by\x18\x08 \x01(\t"O\n\x0eFolderAccessor\x12.\n\x05group\x18\x01 \x01(\x0b2\x1f.exabel.api.management.v1.Group\x12\r\n\x05write\x18\x02 \x01(\x08"B\n\x0cSearchResult\x122\n\x04item\x18\x01 \x01(\x0b2$.exabel.api.management.v1.FolderItem*\xe0\x01\n\x0eFolderItemType\x12\x1c\n\x18FOLDER_ITEM_TYPE_INVALID\x10\x00\x12\x12\n\x0eDERIVED_SIGNAL\x10\x01\x12\x14\n\x10PREDICTION_MODEL\x10\x02\x12\x16\n\x12PORTFOLIO_STRATEGY\x10\x03\x12\r\n\tDASHBOARD\x10\x04\x12\x0e\n\nDRILL_DOWN\x10\x05\x12\x07\n\x03TAG\x10\x06\x12\n\n\x06SCREEN\x10\x07\x12\x13\n\x0fFINANCIAL_MODEL\x10\x08\x12\t\n\x05CHART\x10\t\x12\x0f\n\x0bKPI_MAPPING\x10\n\x12\t\n\x05ALERT\x10\x0bBS\n\x1ccom.exabel.api.management.v1B\x13FolderMessagesProtoP\x01Z\x1cexabel.com/api/management/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.folder_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1ccom.exabel.api.management.v1B\x13FolderMessagesProtoP\x01Z\x1cexabel.com/api/management/v1' - _globals['_FOLDER'].fields_by_name['name']._loaded_options = None - _globals['_FOLDER'].fields_by_name['name']._serialized_options = b'\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName' - _globals['_FOLDER'].fields_by_name['display_name']._loaded_options = None - _globals['_FOLDER'].fields_by_name['display_name']._serialized_options = b'\x92A\x14J\x12"My shared folder"\xe0A\x02' - _globals['_FOLDER'].fields_by_name['description']._loaded_options = None - _globals['_FOLDER'].fields_by_name['description']._serialized_options = b'\x92A\x1cJ\x1a"This is my shared folder"' - _globals['_FOLDER'].fields_by_name['write']._loaded_options = None - _globals['_FOLDER'].fields_by_name['write']._serialized_options = b'\xe0A\x03' - _globals['_FOLDER'].fields_by_name['items']._loaded_options = None - _globals['_FOLDER'].fields_by_name['items']._serialized_options = b'\xe0A\x06\xe0A\x03' - _globals['_FOLDERITEM'].fields_by_name['parent']._loaded_options = None - _globals['_FOLDERITEM'].fields_by_name['parent']._serialized_options = b'\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName' - _globals['_FOLDERITEM'].fields_by_name['name']._loaded_options = None - _globals['_FOLDERITEM'].fields_by_name['name']._serialized_options = b'\x92A\x16J\x14"derivedSignals/123"\xe0A\x03' - _globals['_FOLDERITEM'].fields_by_name['display_name']._loaded_options = None - _globals['_FOLDERITEM'].fields_by_name['display_name']._serialized_options = b'\x92A\rJ\x0b"my_signal"' - _globals['_FOLDERITEMTYPE']._serialized_start = 1003 - _globals['_FOLDERITEMTYPE']._serialized_end = 1227 - _globals['_FOLDER']._serialized_start = 237 - _globals['_FOLDER']._serialized_end = 480 - _globals['_FOLDERITEM']._serialized_start = 483 - _globals['_FOLDERITEM']._serialized_end = 851 - _globals['_FOLDERACCESSOR']._serialized_start = 853 - _globals['_FOLDERACCESSOR']._serialized_end = 932 - _globals['_SEARCHRESULT']._serialized_start = 934 - _globals['_SEARCHRESULT']._serialized_end = 1000 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2.pyi deleted file mode 100644 index b593441d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2.pyi +++ /dev/null @@ -1,196 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2022 Exabel AS. All rights reserved.""" -import builtins -import collections.abc -from ..... import exabel -import google.protobuf.descriptor -import google.protobuf.internal.containers -import google.protobuf.internal.enum_type_wrapper -import google.protobuf.message -import google.protobuf.timestamp_pb2 -import sys -import typing -if sys.version_info >= (3, 10): - import typing as typing_extensions -else: - import typing_extensions -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _FolderItemType: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _FolderItemTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_FolderItemType.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - FOLDER_ITEM_TYPE_INVALID: _FolderItemType.ValueType - 'Invalid item type.' - DERIVED_SIGNAL: _FolderItemType.ValueType - 'Derived signal.' - PREDICTION_MODEL: _FolderItemType.ValueType - 'Prediction model.' - PORTFOLIO_STRATEGY: _FolderItemType.ValueType - 'Portfolio strategy.' - DASHBOARD: _FolderItemType.ValueType - 'Dashboard.' - DRILL_DOWN: _FolderItemType.ValueType - 'Company or entity drill down view.' - TAG: _FolderItemType.ValueType - 'Static tag.' - SCREEN: _FolderItemType.ValueType - 'Screen.' - FINANCIAL_MODEL: _FolderItemType.ValueType - 'Financial model.' - CHART: _FolderItemType.ValueType - 'Chart.' - KPI_MAPPING: _FolderItemType.ValueType - 'KPI mapping.' - ALERT: _FolderItemType.ValueType - 'Alert.' - -class FolderItemType(_FolderItemType, metaclass=_FolderItemTypeEnumTypeWrapper): - """An enum representing the type of a folder item.""" -FOLDER_ITEM_TYPE_INVALID: FolderItemType.ValueType -'Invalid item type.' -DERIVED_SIGNAL: FolderItemType.ValueType -'Derived signal.' -PREDICTION_MODEL: FolderItemType.ValueType -'Prediction model.' -PORTFOLIO_STRATEGY: FolderItemType.ValueType -'Portfolio strategy.' -DASHBOARD: FolderItemType.ValueType -'Dashboard.' -DRILL_DOWN: FolderItemType.ValueType -'Company or entity drill down view.' -TAG: FolderItemType.ValueType -'Static tag.' -SCREEN: FolderItemType.ValueType -'Screen.' -FINANCIAL_MODEL: FolderItemType.ValueType -'Financial model.' -CHART: FolderItemType.ValueType -'Chart.' -KPI_MAPPING: FolderItemType.ValueType -'KPI mapping.' -ALERT: FolderItemType.ValueType -'Alert.' -global___FolderItemType = FolderItemType - -@typing.final -class Folder(google.protobuf.message.Message): - """A folder.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - NAME_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - WRITE_FIELD_NUMBER: builtins.int - ITEMS_FIELD_NUMBER: builtins.int - name: builtins.str - 'Unique resource name of the folder, e.g. `folders/123`. In the "Create folder" method, this is\n ignored and may be left empty.\n ' - display_name: builtins.str - 'Appears in the Exabel Library in the list of folders.' - description: builtins.str - 'The description of the folder.' - write: builtins.bool - 'Whether the API caller has write access to the folder.' - - @property - def items(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FolderItem]: - """List of items in the folder. To add or remove folder items, use the "Move folder items" method.""" - - def __init__(self, *, name: builtins.str | None=..., display_name: builtins.str | None=..., description: builtins.str | None=..., write: builtins.bool | None=..., items: collections.abc.Iterable[global___FolderItem] | None=...) -> None: - ... - - def ClearField(self, field_name: typing.Literal['description', b'description', 'display_name', b'display_name', 'items', b'items', 'name', b'name', 'write', b'write']) -> None: - ... -global___Folder = Folder - -@typing.final -class FolderItem(google.protobuf.message.Message): - """An item in a folder.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - PARENT_FIELD_NUMBER: builtins.int - NAME_FIELD_NUMBER: builtins.int - DISPLAY_NAME_FIELD_NUMBER: builtins.int - DESCRIPTION_FIELD_NUMBER: builtins.int - ITEM_TYPE_FIELD_NUMBER: builtins.int - CREATE_TIME_FIELD_NUMBER: builtins.int - UPDATE_TIME_FIELD_NUMBER: builtins.int - CREATED_BY_FIELD_NUMBER: builtins.int - UPDATED_BY_FIELD_NUMBER: builtins.int - parent: builtins.str - 'Resource name of the parent folder, e.g. `folders/123`.' - name: builtins.str - 'Resource name of the item, e.g. `derivedSignals/123` or `models/987`.' - display_name: builtins.str - 'Appears in the Exabel Library when viewing items in a folder, and also when the item is opened.' - description: builtins.str - 'Appears in the Exabel Library under each item, and when the item is opened.' - item_type: global___FolderItemType.ValueType - 'Item type.' - created_by: builtins.str - 'Resource name of the user who created the item.' - updated_by: builtins.str - 'Resource name of the user who last updated the item.' - - @property - def create_time(self) -> google.protobuf.timestamp_pb2.Timestamp: - """When the item was created.""" - - @property - def update_time(self) -> google.protobuf.timestamp_pb2.Timestamp: - """When the item was last updated.""" - - def __init__(self, *, parent: builtins.str | None=..., name: builtins.str | None=..., display_name: builtins.str | None=..., description: builtins.str | None=..., item_type: global___FolderItemType.ValueType | None=..., create_time: google.protobuf.timestamp_pb2.Timestamp | None=..., update_time: google.protobuf.timestamp_pb2.Timestamp | None=..., created_by: builtins.str | None=..., updated_by: builtins.str | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['create_time', b'create_time', 'update_time', b'update_time']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['create_time', b'create_time', 'created_by', b'created_by', 'description', b'description', 'display_name', b'display_name', 'item_type', b'item_type', 'name', b'name', 'parent', b'parent', 'update_time', b'update_time', 'updated_by', b'updated_by']) -> None: - ... -global___FolderItem = FolderItem - -@typing.final -class FolderAccessor(google.protobuf.message.Message): - """An accessor of a folder.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - GROUP_FIELD_NUMBER: builtins.int - WRITE_FIELD_NUMBER: builtins.int - write: builtins.bool - 'Whether the user group has write access. Read access is implied.' - - @property - def group(self) -> exabel.api.management.v1.user_messages_pb2.Group: - """User group that has access to the folder.""" - - def __init__(self, *, group: exabel.api.management.v1.user_messages_pb2.Group | None=..., write: builtins.bool | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['group', b'group']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['group', b'group', 'write', b'write']) -> None: - ... -global___FolderAccessor = FolderAccessor - -@typing.final -class SearchResult(google.protobuf.message.Message): - """A search result.""" - DESCRIPTOR: google.protobuf.descriptor.Descriptor - ITEM_FIELD_NUMBER: builtins.int - - @property - def item(self) -> global___FolderItem: - """The folder item.""" - - def __init__(self, *, item: global___FolderItem | None=...) -> None: - ... - - def HasField(self, field_name: typing.Literal['item', b'item']) -> builtins.bool: - ... - - def ClearField(self, field_name: typing.Literal['item', b'item']) -> None: - ... -global___SearchResult = SearchResult \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2_grpc.py deleted file mode 100644 index ce569f7d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/folder_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/management/v1/folder_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2.py deleted file mode 100644 index 2cefdc02..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2.py +++ /dev/null @@ -1,107 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/management/v1/library_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.management.v1 import folder_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.exabel/api/management/v1/library_service.proto\x12\x18exabel.api.management.v1\x1a.exabel/api/management/v1/folder_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x14\n\x12ListFoldersRequest"H\n\x13ListFoldersResponse\x121\n\x07folders\x18\x01 \x03(\x0b2 .exabel.api.management.v1.Folder"8\n\x10GetFolderRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92A\x10\xca>\r\xfa\x02\nfolderName\xe0A\x02"L\n\x13CreateFolderRequest\x125\n\x06folder\x18\x01 \x01(\x0b2 .exabel.api.management.v1.FolderB\x03\xe0A\x02"\x94\x01\n\x13UpdateFolderRequest\x125\n\x06folder\x18\x01 \x01(\x0b2 .exabel.api.management.v1.FolderB\x03\xe0A\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b2\x1a.google.protobuf.FieldMask\x12\x15\n\rallow_missing\x18\x03 \x01(\x08";\n\x13DeleteFolderRequest\x12$\n\x04name\x18\x01 \x01(\tB\x16\x92A\x10\xca>\r\xfa\x02\nfolderName\xe0A\x02"\x86\x01\n\x10ListItemsRequest\x125\n\x06parent\x18\x01 \x01(\tB%\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName\xe0A\x01\x12;\n\titem_type\x18\x02 \x01(\x0e2(.exabel.api.management.v1.FolderItemType"H\n\x11ListItemsResponse\x123\n\x05items\x18\x01 \x03(\x0b2$.exabel.api.management.v1.FolderItem"U\n\x10MoveItemsRequest\x12\x12\n\x05items\x18\x01 \x03(\tB\x03\xe0A\x02\x12-\n\rtarget_folder\x18\x02 \x01(\tB\x16\x92A\x10\xca>\r\xfa\x02\nfolderName\xe0A\x02"\x13\n\x11MoveItemsResponse"?\n\x1aListFolderAccessorsRequest\x12!\n\x04name\x18\x01 \x01(\tB\x13\x92A\x10\xca>\r\xfa\x02\nfolderName"a\n\x1bListFolderAccessorsResponse\x12B\n\x10folder_accessors\x18\x01 \x03(\x0b2(.exabel.api.management.v1.FolderAccessor"y\n\x12ShareFolderRequest\x122\n\x06folder\x18\x01 \x01(\tB"\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName\x12 \n\x05group\x18\x02 \x01(\tB\x11\x92A\x0eJ\x0c"groups/123"\x12\r\n\x05write\x18\x03 \x01(\x08"l\n\x14UnshareFolderRequest\x122\n\x06folder\x18\x01 \x01(\tB"\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName\x12 \n\x05group\x18\x02 \x01(\tB\x11\x92A\x0eJ\x0c"groups/123""\xd0\x01\n\x12SearchItemsRequest\x12=\n\x06folder\x18\x01 \x01(\tB-\x92A\'J\x0b"folders/-"\xca>\x17\xfa\x02\x14folderNameAllFolders\xe0A\x02\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0A\x02\x12@\n\titem_type\x18\x03 \x01(\x0e2(.exabel.api.management.v1.FolderItemTypeB\x03\xe0A\x01\x12\x12\n\npage_token\x18\x04 \x01(\t\x12\x11\n\tpage_size\x18\x05 \x01(\x05"g\n\x13SearchItemsResponse\x127\n\x07results\x18\x01 \x03(\x0b2&.exabel.api.management.v1.SearchResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xdc\r\n\x0eLibraryService\x12\x90\x01\n\x0bListFolders\x12,.exabel.api.management.v1.ListFoldersRequest\x1a-.exabel.api.management.v1.ListFoldersResponse"$\x92A\x0e\x12\x0cList folders\x82\xd3\xe4\x93\x02\r\x12\x0b/v1/folders\x12\x86\x01\n\tGetFolder\x12*.exabel.api.management.v1.GetFolderRequest\x1a .exabel.api.management.v1.Folder"+\x92A\x0c\x12\nGet folder\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/{name=folders/*}\x12\x8e\x01\n\x0cCreateFolder\x12-.exabel.api.management.v1.CreateFolderRequest\x1a .exabel.api.management.v1.Folder"-\x92A\x0f\x12\rCreate folder\x82\xd3\xe4\x93\x02\x15"\x0b/v1/folders:\x06folder\x12\x9e\x01\n\x0cUpdateFolder\x12-.exabel.api.management.v1.UpdateFolderRequest\x1a .exabel.api.management.v1.Folder"=\x92A\x0f\x12\rUpdate folder\x82\xd3\xe4\x93\x02%2\x1b/v1/{folder.name=folders/*}:\x06folder\x12\x85\x01\n\x0cDeleteFolder\x12-.exabel.api.management.v1.DeleteFolderRequest\x1a\x16.google.protobuf.Empty".\x92A\x0f\x12\rDelete folder\x82\xd3\xe4\x93\x02\x16*\x14/v1/{name=folders/*}\x12\xa0\x01\n\tListItems\x12*.exabel.api.management.v1.ListItemsRequest\x1a+.exabel.api.management.v1.ListItemsResponse":\x92A\x13\x12\x11List folder items\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{parent=folders/*}/items\x12\xab\x01\n\tMoveItems\x12*.exabel.api.management.v1.MoveItemsRequest\x1a+.exabel.api.management.v1.MoveItemsResponse"E\x92A\x13\x12\x11Move folder items\x82\xd3\xe4\x93\x02)"\'/v1/{target_folder=folders/*}:moveItems\x12\xc4\x01\n\x13ListFolderAccessors\x124.exabel.api.management.v1.ListFolderAccessorsRequest\x1a5.exabel.api.management.v1.ListFolderAccessorsResponse"@\x92A\x17\x12\x15List folder accessors\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{name=folders/*}/accessors\x12\x8d\x01\n\x0bShareFolder\x12,.exabel.api.management.v1.ShareFolderRequest\x1a\x16.google.protobuf.Empty"8\x92A\x0e\x12\x0cShare folder\x82\xd3\xe4\x93\x02!"\x1c/v1/{folder=folders/*}:share:\x01*\x12\x95\x01\n\rUnshareFolder\x12..exabel.api.management.v1.UnshareFolderRequest\x1a\x16.google.protobuf.Empty"<\x92A\x10\x12\x0eUnshare folder\x82\xd3\xe4\x93\x02#"\x1e/v1/{folder=folders/*}:unshare:\x01*\x12\xb3\x01\n\x0bSearchItems\x12,.exabel.api.management.v1.SearchItemsRequest\x1a-.exabel.api.management.v1.SearchItemsResponse"G\x92A\x19\x12\x17Search for folder items\x82\xd3\xe4\x93\x02%\x12#/v1/{folder=folders/*}/items:searchBS\n\x1ccom.exabel.api.management.v1B\x13LibraryServiceProtoP\x01Z\x1cexabel.com/api/management/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.library_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1ccom.exabel.api.management.v1B\x13LibraryServiceProtoP\x01Z\x1cexabel.com/api/management/v1' - _globals['_GETFOLDERREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_GETFOLDERREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nfolderName\xe0A\x02' - _globals['_CREATEFOLDERREQUEST'].fields_by_name['folder']._loaded_options = None - _globals['_CREATEFOLDERREQUEST'].fields_by_name['folder']._serialized_options = b'\xe0A\x02' - _globals['_UPDATEFOLDERREQUEST'].fields_by_name['folder']._loaded_options = None - _globals['_UPDATEFOLDERREQUEST'].fields_by_name['folder']._serialized_options = b'\xe0A\x02' - _globals['_DELETEFOLDERREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_DELETEFOLDERREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nfolderName\xe0A\x02' - _globals['_LISTITEMSREQUEST'].fields_by_name['parent']._loaded_options = None - _globals['_LISTITEMSREQUEST'].fields_by_name['parent']._serialized_options = b'\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName\xe0A\x01' - _globals['_MOVEITEMSREQUEST'].fields_by_name['items']._loaded_options = None - _globals['_MOVEITEMSREQUEST'].fields_by_name['items']._serialized_options = b'\xe0A\x02' - _globals['_MOVEITEMSREQUEST'].fields_by_name['target_folder']._loaded_options = None - _globals['_MOVEITEMSREQUEST'].fields_by_name['target_folder']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nfolderName\xe0A\x02' - _globals['_LISTFOLDERACCESSORSREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_LISTFOLDERACCESSORSREQUEST'].fields_by_name['name']._serialized_options = b'\x92A\x10\xca>\r\xfa\x02\nfolderName' - _globals['_SHAREFOLDERREQUEST'].fields_by_name['folder']._loaded_options = None - _globals['_SHAREFOLDERREQUEST'].fields_by_name['folder']._serialized_options = b'\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName' - _globals['_SHAREFOLDERREQUEST'].fields_by_name['group']._loaded_options = None - _globals['_SHAREFOLDERREQUEST'].fields_by_name['group']._serialized_options = b'\x92A\x0eJ\x0c"groups/123"' - _globals['_UNSHAREFOLDERREQUEST'].fields_by_name['folder']._loaded_options = None - _globals['_UNSHAREFOLDERREQUEST'].fields_by_name['folder']._serialized_options = b'\x92A\x1fJ\r"folders/123"\xca>\r\xfa\x02\nfolderName' - _globals['_UNSHAREFOLDERREQUEST'].fields_by_name['group']._loaded_options = None - _globals['_UNSHAREFOLDERREQUEST'].fields_by_name['group']._serialized_options = b'\x92A\x0eJ\x0c"groups/123"' - _globals['_SEARCHITEMSREQUEST'].fields_by_name['folder']._loaded_options = None - _globals['_SEARCHITEMSREQUEST'].fields_by_name['folder']._serialized_options = b'\x92A\'J\x0b"folders/-"\xca>\x17\xfa\x02\x14folderNameAllFolders\xe0A\x02' - _globals['_SEARCHITEMSREQUEST'].fields_by_name['query']._loaded_options = None - _globals['_SEARCHITEMSREQUEST'].fields_by_name['query']._serialized_options = b'\xe0A\x02' - _globals['_SEARCHITEMSREQUEST'].fields_by_name['item_type']._loaded_options = None - _globals['_SEARCHITEMSREQUEST'].fields_by_name['item_type']._serialized_options = b'\xe0A\x01' - _globals['_LIBRARYSERVICE'].methods_by_name['ListFolders']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['ListFolders']._serialized_options = b'\x92A\x0e\x12\x0cList folders\x82\xd3\xe4\x93\x02\r\x12\x0b/v1/folders' - _globals['_LIBRARYSERVICE'].methods_by_name['GetFolder']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['GetFolder']._serialized_options = b'\x92A\x0c\x12\nGet folder\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/{name=folders/*}' - _globals['_LIBRARYSERVICE'].methods_by_name['CreateFolder']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['CreateFolder']._serialized_options = b'\x92A\x0f\x12\rCreate folder\x82\xd3\xe4\x93\x02\x15"\x0b/v1/folders:\x06folder' - _globals['_LIBRARYSERVICE'].methods_by_name['UpdateFolder']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['UpdateFolder']._serialized_options = b'\x92A\x0f\x12\rUpdate folder\x82\xd3\xe4\x93\x02%2\x1b/v1/{folder.name=folders/*}:\x06folder' - _globals['_LIBRARYSERVICE'].methods_by_name['DeleteFolder']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['DeleteFolder']._serialized_options = b'\x92A\x0f\x12\rDelete folder\x82\xd3\xe4\x93\x02\x16*\x14/v1/{name=folders/*}' - _globals['_LIBRARYSERVICE'].methods_by_name['ListItems']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['ListItems']._serialized_options = b'\x92A\x13\x12\x11List folder items\x82\xd3\xe4\x93\x02\x1e\x12\x1c/v1/{parent=folders/*}/items' - _globals['_LIBRARYSERVICE'].methods_by_name['MoveItems']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['MoveItems']._serialized_options = b'\x92A\x13\x12\x11Move folder items\x82\xd3\xe4\x93\x02)"\'/v1/{target_folder=folders/*}:moveItems' - _globals['_LIBRARYSERVICE'].methods_by_name['ListFolderAccessors']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['ListFolderAccessors']._serialized_options = b'\x92A\x17\x12\x15List folder accessors\x82\xd3\xe4\x93\x02 \x12\x1e/v1/{name=folders/*}/accessors' - _globals['_LIBRARYSERVICE'].methods_by_name['ShareFolder']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['ShareFolder']._serialized_options = b'\x92A\x0e\x12\x0cShare folder\x82\xd3\xe4\x93\x02!"\x1c/v1/{folder=folders/*}:share:\x01*' - _globals['_LIBRARYSERVICE'].methods_by_name['UnshareFolder']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['UnshareFolder']._serialized_options = b'\x92A\x10\x12\x0eUnshare folder\x82\xd3\xe4\x93\x02#"\x1e/v1/{folder=folders/*}:unshare:\x01*' - _globals['_LIBRARYSERVICE'].methods_by_name['SearchItems']._loaded_options = None - _globals['_LIBRARYSERVICE'].methods_by_name['SearchItems']._serialized_options = b'\x92A\x19\x12\x17Search for folder items\x82\xd3\xe4\x93\x02%\x12#/v1/{folder=folders/*}/items:search' - _globals['_LISTFOLDERSREQUEST']._serialized_start = 298 - _globals['_LISTFOLDERSREQUEST']._serialized_end = 318 - _globals['_LISTFOLDERSRESPONSE']._serialized_start = 320 - _globals['_LISTFOLDERSRESPONSE']._serialized_end = 392 - _globals['_GETFOLDERREQUEST']._serialized_start = 394 - _globals['_GETFOLDERREQUEST']._serialized_end = 450 - _globals['_CREATEFOLDERREQUEST']._serialized_start = 452 - _globals['_CREATEFOLDERREQUEST']._serialized_end = 528 - _globals['_UPDATEFOLDERREQUEST']._serialized_start = 531 - _globals['_UPDATEFOLDERREQUEST']._serialized_end = 679 - _globals['_DELETEFOLDERREQUEST']._serialized_start = 681 - _globals['_DELETEFOLDERREQUEST']._serialized_end = 740 - _globals['_LISTITEMSREQUEST']._serialized_start = 743 - _globals['_LISTITEMSREQUEST']._serialized_end = 877 - _globals['_LISTITEMSRESPONSE']._serialized_start = 879 - _globals['_LISTITEMSRESPONSE']._serialized_end = 951 - _globals['_MOVEITEMSREQUEST']._serialized_start = 953 - _globals['_MOVEITEMSREQUEST']._serialized_end = 1038 - _globals['_MOVEITEMSRESPONSE']._serialized_start = 1040 - _globals['_MOVEITEMSRESPONSE']._serialized_end = 1059 - _globals['_LISTFOLDERACCESSORSREQUEST']._serialized_start = 1061 - _globals['_LISTFOLDERACCESSORSREQUEST']._serialized_end = 1124 - _globals['_LISTFOLDERACCESSORSRESPONSE']._serialized_start = 1126 - _globals['_LISTFOLDERACCESSORSRESPONSE']._serialized_end = 1223 - _globals['_SHAREFOLDERREQUEST']._serialized_start = 1225 - _globals['_SHAREFOLDERREQUEST']._serialized_end = 1346 - _globals['_UNSHAREFOLDERREQUEST']._serialized_start = 1348 - _globals['_UNSHAREFOLDERREQUEST']._serialized_end = 1456 - _globals['_SEARCHITEMSREQUEST']._serialized_start = 1459 - _globals['_SEARCHITEMSREQUEST']._serialized_end = 1667 - _globals['_SEARCHITEMSRESPONSE']._serialized_start = 1669 - _globals['_SEARCHITEMSRESPONSE']._serialized_end = 1772 - _globals['_LIBRARYSERVICE']._serialized_start = 1775 - _globals['_LIBRARYSERVICE']._serialized_end = 3531 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2_grpc.py deleted file mode 100644 index 9e7f9acf..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/library_service_pb2_grpc.py +++ /dev/null @@ -1,226 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.management.v1 import folder_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2 -from .....exabel.api.management.v1 import library_service_pb2 as exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/management/v1/library_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class LibraryServiceStub(object): - """Service to manage library items. - - Requests to the LibraryService are executed in the context of the customer's service account (SA). - The SA is a special user that is a member of the customer user group, giving it access to all - folders that are shared with this user group, but not to private folders. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListFolders = channel.unary_unary('/exabel.api.management.v1.LibraryService/ListFolders', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.FromString, _registered_method=True) - self.GetFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/GetFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, _registered_method=True) - self.CreateFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/CreateFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.CreateFolderRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, _registered_method=True) - self.UpdateFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/UpdateFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UpdateFolderRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, _registered_method=True) - self.DeleteFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/DeleteFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.DeleteFolderRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.ListItems = channel.unary_unary('/exabel.api.management.v1.LibraryService/ListItems', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.FromString, _registered_method=True) - self.MoveItems = channel.unary_unary('/exabel.api.management.v1.LibraryService/MoveItems', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsResponse.FromString, _registered_method=True) - self.ListFolderAccessors = channel.unary_unary('/exabel.api.management.v1.LibraryService/ListFolderAccessors', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsResponse.FromString, _registered_method=True) - self.ShareFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/ShareFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.UnshareFolder = channel.unary_unary('/exabel.api.management.v1.LibraryService/UnshareFolder', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) - self.SearchItems = channel.unary_unary('/exabel.api.management.v1.LibraryService/SearchItems', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsResponse.FromString, _registered_method=True) - -class LibraryServiceServicer(object): - """Service to manage library items. - - Requests to the LibraryService are executed in the context of the customer's service account (SA). - The SA is a special user that is a member of the customer user group, giving it access to all - folders that are shared with this user group, but not to private folders. - """ - - def ListFolders(self, request, context): - """Lists all folders. - - Folders are returned without folder items - use the "Get folder" or "List folder items" - methods to get folder items. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def GetFolder(self, request, context): - """Gets a folder including its items. - - The folder will be returned with its items. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def CreateFolder(self, request, context): - """Creates a folder. - - Only the display name and description can be set. Items must be added to the new folder - subsequently with the "Move folder items" method. - - The folder will be created as private to the service account user. To let other users access - this folder, you must also share it with the "Share folder" method. - - It is also possible to create a folder type by calling `UpdateFolder` - with `allow_missing` set to `true`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UpdateFolder(self, request, context): - """Updates a folder. - - Only the display name and description can be updated. Items must be added to a folder with the - "Move folder items" method. - - This can also be used to create an entity by setting `allow_missing` to `true`. - - Note that this method will update all fields unless `update_mask` is set. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeleteFolder(self, request, context): - """Deletes a folder. - - The folder must be empty before it can be deleted. Use the "Move folder items" if needed to - move items into another folder. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListItems(self, request, context): - """Lists all items of a specific type. - - List all folder items of a specific type (e.g. derived signal, dashboard). To get all items in - a folder, use the "Get folder" method instead. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def MoveItems(self, request, context): - """Moves items to a folder. - - Specify the target folder that items should be moved into. The service account must have write - access to all items that you want to move. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListFolderAccessors(self, request, context): - """Lists the accessors of a specific folder. - - An accessor is a user group with either read-only or read/write access. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ShareFolder(self, request, context): - """Shares a folder with a group. - - You may find the user group resource names from the "List groups" method in the UserService. - - To grant write access to a group with only read access, call this method with the `write` flag set to `true`. - - To revoke only write access from a group, call this method with the `write` flag set to `false`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UnshareFolder(self, request, context): - """Removes sharing of a folder with a group. - - This revokes both read and write access. To revoke only write access, use the "Share folder" - method with the `write` flag set to `false`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SearchItems(self, request, context): - """Search for folder items. - - Search for all folder items or items of a specific type (e.g. derived signal, dashboard) across all folders. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_LibraryServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListFolders': grpc.unary_unary_rpc_method_handler(servicer.ListFolders, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.SerializeToString), 'GetFolder': grpc.unary_unary_rpc_method_handler(servicer.GetFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.SerializeToString), 'CreateFolder': grpc.unary_unary_rpc_method_handler(servicer.CreateFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.CreateFolderRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.SerializeToString), 'UpdateFolder': grpc.unary_unary_rpc_method_handler(servicer.UpdateFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UpdateFolderRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.SerializeToString), 'DeleteFolder': grpc.unary_unary_rpc_method_handler(servicer.DeleteFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.DeleteFolderRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'ListItems': grpc.unary_unary_rpc_method_handler(servicer.ListItems, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.SerializeToString), 'MoveItems': grpc.unary_unary_rpc_method_handler(servicer.MoveItems, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsResponse.SerializeToString), 'ListFolderAccessors': grpc.unary_unary_rpc_method_handler(servicer.ListFolderAccessors, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsResponse.SerializeToString), 'ShareFolder': grpc.unary_unary_rpc_method_handler(servicer.ShareFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'UnshareFolder': grpc.unary_unary_rpc_method_handler(servicer.UnshareFolder, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString), 'SearchItems': grpc.unary_unary_rpc_method_handler(servicer.SearchItems, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsResponse.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.management.v1.LibraryService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.management.v1.LibraryService', rpc_method_handlers) - -class LibraryService(object): - """Service to manage library items. - - Requests to the LibraryService are executed in the context of the customer's service account (SA). - The SA is a special user that is a member of the customer user group, giving it access to all - folders that are shared with this user group, but not to private folders. - """ - - @staticmethod - def ListFolders(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/ListFolders', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFoldersResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def GetFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/GetFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.GetFolderRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def CreateFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/CreateFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.CreateFolderRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UpdateFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/UpdateFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UpdateFolderRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_folder__messages__pb2.Folder.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def DeleteFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/DeleteFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.DeleteFolderRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListItems(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/ListItems', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListItemsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def MoveItems(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/MoveItems', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.MoveItemsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListFolderAccessors(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/ListFolderAccessors', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ListFolderAccessorsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ShareFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/ShareFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.ShareFolderRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def UnshareFolder(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/UnshareFolder', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.UnshareFolderRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def SearchItems(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.LibraryService/SearchItems', exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_library__service__pb2.SearchItemsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2.py b/exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2.py deleted file mode 100644 index 2bee77a9..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/management/v1/service.proto') -_sym_db = _symbol_database.Default() -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&exabel/api/management/v1/service.proto\x12\x18exabel.api.management.v1\x1a.protoc_gen_openapiv2/options/annotations.protoB\xaf\x03\n\x1ccom.exabel.api.management.v1B\x0cServiceProtoP\x01Z\x1cexabel.com/api/management/v1\x92A\xdf\x02\x12U\n\x15Exabel Management API"5\n\x06Exabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x051.0.0\x1a\x19management.api.exabel.com*\x01\x022\x10application/json:\x10application/jsonZR\n#\n\x07API key\x12\x18\x08\x02\x12\x07API key\x1a\tx-api-key \x02\n+\n\x06Bearer\x12!\x08\x02\x12\x0cAccess token\x1a\rauthorization \x02b\r\n\x0b\n\x07API key\x12\x00b\x0c\n\n\n\x06Bearer\x12\x00rS\n$More about the Exabel Management API\x12+https://help.exabel.com/docs/management-apib\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1ccom.exabel.api.management.v1B\x0cServiceProtoP\x01Z\x1cexabel.com/api/management/v1\x92A\xdf\x02\x12U\n\x15Exabel Management API"5\n\x06Exabel\x12\x17https://www.exabel.com/\x1a\x12support@exabel.com2\x051.0.0\x1a\x19management.api.exabel.com*\x01\x022\x10application/json:\x10application/jsonZR\n#\n\x07API key\x12\x18\x08\x02\x12\x07API key\x1a\tx-api-key \x02\n+\n\x06Bearer\x12!\x08\x02\x12\x0cAccess token\x1a\rauthorization \x02b\r\n\x0b\n\x07API key\x12\x00b\x0c\n\n\n\x06Bearer\x12\x00rS\n$More about the Exabel Management API\x12+https://help.exabel.com/docs/management-api' \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2_grpc.py deleted file mode 100644 index cdb58725..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/service_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/management/v1/service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2.py b/exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2.py deleted file mode 100644 index 8c19e082..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/management/v1/user_messages.proto') -_sym_db = _symbol_database.Default() -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,exabel/api/management/v1/user_messages.proto\x12\x18exabel.api.management.v1\x1a\x1fgoogle/api/field_behavior.proto"9\n\x04User\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0A\x03\x12\r\n\x05email\x18\x02 \x01(\t\x12\x0f\n\x07blocked\x18\x03 \x01(\x08"_\n\x05Group\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0A\x03\x12\x14\n\x0cdisplay_name\x18\x02 \x01(\t\x12-\n\x05users\x18\x03 \x03(\x0b2\x1e.exabel.api.management.v1.UserBQ\n\x1ccom.exabel.api.management.v1B\x11UserMessagesProtoP\x01Z\x1cexabel.com/api/management/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.user_messages_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1ccom.exabel.api.management.v1B\x11UserMessagesProtoP\x01Z\x1cexabel.com/api/management/v1' - _globals['_USER'].fields_by_name['name']._loaded_options = None - _globals['_USER'].fields_by_name['name']._serialized_options = b'\xe0A\x03' - _globals['_GROUP'].fields_by_name['name']._loaded_options = None - _globals['_GROUP'].fields_by_name['name']._serialized_options = b'\xe0A\x03' - _globals['_USER']._serialized_start = 107 - _globals['_USER']._serialized_end = 164 - _globals['_GROUP']._serialized_start = 166 - _globals['_GROUP']._serialized_end = 261 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2_grpc.py deleted file mode 100644 index 375f5f8c..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/user_messages_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/management/v1/user_messages_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2.py b/exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2.py deleted file mode 100644 index 0fd05ddd..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/management/v1/user_service.proto') -_sym_db = _symbol_database.Default() -from .....exabel.api.management.v1 import user_messages_pb2 as exabel_dot_api_dot_management_dot_v1_dot_user__messages__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from .....protoc_gen_openapiv2.options import annotations_pb2 as protoc__gen__openapiv2_dot_options_dot_annotations__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n+exabel/api/management/v1/user_service.proto\x12\x18exabel.api.management.v1\x1a,exabel/api/management/v1/user_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a.protoc_gen_openapiv2/options/annotations.proto"\x13\n\x11ListGroupsRequest"E\n\x12ListGroupsResponse\x12/\n\x06groups\x18\x01 \x03(\x0b2\x1f.exabel.api.management.v1.Group"\x12\n\x10ListUsersRequest"B\n\x11ListUsersResponse\x12-\n\x05users\x18\x01 \x03(\x0b2\x1e.exabel.api.management.v1.User2\xa4\x02\n\x0bUserService\x12\x8b\x01\n\nListGroups\x12+.exabel.api.management.v1.ListGroupsRequest\x1a,.exabel.api.management.v1.ListGroupsResponse""\x92A\r\x12\x0bList groups\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/groups\x12\x86\x01\n\tListUsers\x12*.exabel.api.management.v1.ListUsersRequest\x1a+.exabel.api.management.v1.ListUsersResponse" \x92A\x0c\x12\nList users\x82\xd3\xe4\x93\x02\x0b\x12\t/v1/usersBP\n\x1ccom.exabel.api.management.v1B\x10UserServiceProtoP\x01Z\x1cexabel.com/api/management/v1b\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.management.v1.user_service_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x1ccom.exabel.api.management.v1B\x10UserServiceProtoP\x01Z\x1cexabel.com/api/management/v1' - _globals['_USERSERVICE'].methods_by_name['ListGroups']._loaded_options = None - _globals['_USERSERVICE'].methods_by_name['ListGroups']._serialized_options = b'\x92A\r\x12\x0bList groups\x82\xd3\xe4\x93\x02\x0c\x12\n/v1/groups' - _globals['_USERSERVICE'].methods_by_name['ListUsers']._loaded_options = None - _globals['_USERSERVICE'].methods_by_name['ListUsers']._serialized_options = b'\x92A\x0c\x12\nList users\x82\xd3\xe4\x93\x02\x0b\x12\t/v1/users' - _globals['_LISTGROUPSREQUEST']._serialized_start = 197 - _globals['_LISTGROUPSREQUEST']._serialized_end = 216 - _globals['_LISTGROUPSRESPONSE']._serialized_start = 218 - _globals['_LISTGROUPSRESPONSE']._serialized_end = 287 - _globals['_LISTUSERSREQUEST']._serialized_start = 289 - _globals['_LISTUSERSREQUEST']._serialized_end = 307 - _globals['_LISTUSERSRESPONSE']._serialized_start = 309 - _globals['_LISTUSERSRESPONSE']._serialized_end = 375 - _globals['_USERSERVICE']._serialized_start = 378 - _globals['_USERSERVICE']._serialized_end = 670 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2_grpc.py deleted file mode 100644 index c0452f1d..00000000 --- a/exabel_data_sdk/stubs/exabel/api/management/v1/user_service_pb2_grpc.py +++ /dev/null @@ -1,73 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -from .....exabel.api.management.v1 import user_service_pb2 as exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2 -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/management/v1/user_service_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') - -class UserServiceStub(object): - """Service to manage users and groups. - - Supported operations are listing the current customer's user groups and users. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListGroups = channel.unary_unary('/exabel.api.management.v1.UserService/ListGroups', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsResponse.FromString, _registered_method=True) - self.ListUsers = channel.unary_unary('/exabel.api.management.v1.UserService/ListUsers', request_serializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersRequest.SerializeToString, response_deserializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersResponse.FromString, _registered_method=True) - -class UserServiceServicer(object): - """Service to manage users and groups. - - Supported operations are listing the current customer's user groups and users. - """ - - def ListGroups(self, request, context): - """Lists all groups. Only groups for the current customer is returned. - - List all user groups in your customer, including the users in each user group. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListUsers(self, request, context): - """Lists all users in the current customer. - - List all users in your customer - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - -def add_UserServiceServicer_to_server(servicer, server): - rpc_method_handlers = {'ListGroups': grpc.unary_unary_rpc_method_handler(servicer.ListGroups, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsResponse.SerializeToString), 'ListUsers': grpc.unary_unary_rpc_method_handler(servicer.ListUsers, request_deserializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersRequest.FromString, response_serializer=exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersResponse.SerializeToString)} - generic_handler = grpc.method_handlers_generic_handler('exabel.api.management.v1.UserService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('exabel.api.management.v1.UserService', rpc_method_handlers) - -class UserService(object): - """Service to manage users and groups. - - Supported operations are listing the current customer's user groups and users. - """ - - @staticmethod - def ListGroups(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.UserService/ListGroups', exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListGroupsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) - - @staticmethod - def ListUsers(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/exabel.api.management.v1.UserService/ListUsers', exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersRequest.SerializeToString, exabel_dot_api_dot_management_dot_v1_dot_user__service__pb2.ListUsersResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata, _registered_method=True) \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2.py b/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2.py deleted file mode 100644 index 78329e9a..00000000 --- a/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/math/aggregation.proto') -_sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!exabel/api/math/aggregation.proto\x12\x0fexabel.api.math*l\n\x0bAggregation\x12\x17\n\x13AGGREGATION_INVALID\x10\x00\x12\x08\n\x04MEAN\x10\x01\x12\t\n\x05FIRST\x10\x02\x12\x08\n\x04LAST\x10\x03\x12\x07\n\x03SUM\x10\x04\x12\x07\n\x03MIN\x10\x05\x12\x07\n\x03MAX\x10\x06\x12\n\n\x06MEDIAN\x10\x07B>\n\x13com.exabel.api.mathB\x10AggregationProtoP\x01Z\x13exabel.com/api/mathb\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.math.aggregation_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x13com.exabel.api.mathB\x10AggregationProtoP\x01Z\x13exabel.com/api/math' - _globals['_AGGREGATION']._serialized_start = 54 - _globals['_AGGREGATION']._serialized_end = 162 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2.pyi b/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2.pyi deleted file mode 100644 index 3f6ea6e3..00000000 --- a/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2.pyi +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated by mypy-protobuf. Do not edit manually! -isort:skip_file -Copyright (c) 2019-2024 Exabel AS. All rights reserved.""" -import builtins -import google.protobuf.descriptor -import google.protobuf.internal.enum_type_wrapper -import sys -import typing -if sys.version_info >= (3, 10): - import typing as typing_extensions -else: - import typing_extensions -DESCRIPTOR: google.protobuf.descriptor.FileDescriptor - -class _Aggregation: - ValueType = typing.NewType('ValueType', builtins.int) - V: typing_extensions.TypeAlias = ValueType - -class _AggregationEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Aggregation.ValueType], builtins.type): - DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor - AGGREGATION_INVALID: _Aggregation.ValueType - 'Aggregation is unspecified and invalid. Aggregation must be set.' - MEAN: _Aggregation.ValueType - 'Takes the arithmetic mean of the data values. Example: 2, 1, 3, 5, 4 -> 3.' - FIRST: _Aggregation.ValueType - 'Selects the first value. Example: 2, 1, 3, 5, 4 -> 2.' - LAST: _Aggregation.ValueType - 'Selects the last value. Example: 2, 1, 3, 5, 4 -> 4.' - SUM: _Aggregation.ValueType - 'Sums the data values. Example: 2, 1, 3, 5, 4 -> 15.' - MIN: _Aggregation.ValueType - 'Selects the minimum value. Example: 2, 1, 3, 5, 4 -> 1.' - MAX: _Aggregation.ValueType - 'Selects the maximum value. Example: 2, 1, 3, 5, 4 -> 5.' - MEDIAN: _Aggregation.ValueType - 'Selects the median value. Example: 2, 1, 3, 5, 1000 -> 3.' - -class Aggregation(_Aggregation, metaclass=_AggregationEnumTypeWrapper): - """Aggregation methods.""" -AGGREGATION_INVALID: Aggregation.ValueType -'Aggregation is unspecified and invalid. Aggregation must be set.' -MEAN: Aggregation.ValueType -'Takes the arithmetic mean of the data values. Example: 2, 1, 3, 5, 4 -> 3.' -FIRST: Aggregation.ValueType -'Selects the first value. Example: 2, 1, 3, 5, 4 -> 2.' -LAST: Aggregation.ValueType -'Selects the last value. Example: 2, 1, 3, 5, 4 -> 4.' -SUM: Aggregation.ValueType -'Sums the data values. Example: 2, 1, 3, 5, 4 -> 15.' -MIN: Aggregation.ValueType -'Selects the minimum value. Example: 2, 1, 3, 5, 4 -> 1.' -MAX: Aggregation.ValueType -'Selects the maximum value. Example: 2, 1, 3, 5, 4 -> 5.' -MEDIAN: Aggregation.ValueType -'Selects the median value. Example: 2, 1, 3, 5, 1000 -> 3.' -global___Aggregation = Aggregation \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2_grpc.py deleted file mode 100644 index 9ca437c1..00000000 --- a/exabel_data_sdk/stubs/exabel/api/math/aggregation_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/math/aggregation_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/math/change_pb2.py b/exabel_data_sdk/stubs/exabel/api/math/change_pb2.py deleted file mode 100644 index 6e09db34..00000000 --- a/exabel_data_sdk/stubs/exabel/api/math/change_pb2.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/math/change.proto') -_sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cexabel/api/math/change.proto\x12\x0fexabel.api.math*<\n\x06Change\x12\x16\n\x12CHANGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08RELATIVE\x10\x01\x12\x0c\n\x08ABSOLUTE\x10\x02B9\n\x13com.exabel.api.mathB\x0bChangeProtoP\x01Z\x13exabel.com/api/mathb\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.math.change_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x13com.exabel.api.mathB\x0bChangeProtoP\x01Z\x13exabel.com/api/math' - _globals['_CHANGE']._serialized_start = 49 - _globals['_CHANGE']._serialized_end = 109 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/math/change_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/math/change_pb2_grpc.py deleted file mode 100644 index 0c6a2935..00000000 --- a/exabel_data_sdk/stubs/exabel/api/math/change_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/math/change_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/time/date_pb2.py b/exabel_data_sdk/stubs/exabel/api/time/date_pb2.py deleted file mode 100644 index d98054e4..00000000 --- a/exabel_data_sdk/stubs/exabel/api/time/date_pb2.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/time/date.proto') -_sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aexabel/api/time/date.proto\x12\x0fexabel.api.time"0\n\x04Date\x12\x0c\n\x04year\x18\x01 \x01(\x05\x12\r\n\x05month\x18\x02 \x01(\x05\x12\x0b\n\x03day\x18\x03 \x01(\x05B7\n\x13com.exabel.api.timeB\tDateProtoP\x01Z\x13exabel.com/api/timeb\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.time.date_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x13com.exabel.api.timeB\tDateProtoP\x01Z\x13exabel.com/api/time' - _globals['_DATE']._serialized_start = 47 - _globals['_DATE']._serialized_end = 95 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/time/date_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/time/date_pb2_grpc.py deleted file mode 100644 index cc392831..00000000 --- a/exabel_data_sdk/stubs/exabel/api/time/date_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/time/date_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/time/time_range_pb2.py b/exabel_data_sdk/stubs/exabel/api/time/time_range_pb2.py deleted file mode 100644 index d20d2d8e..00000000 --- a/exabel_data_sdk/stubs/exabel/api/time/time_range_pb2.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'exabel/api/time/time_range.proto') -_sym_db = _symbol_database.Default() -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n exabel/api/time/time_range.proto\x12\x0fexabel.api.time\x1a\x1fgoogle/protobuf/timestamp.proto"\x91\x01\n\tTimeRange\x12-\n\tfrom_time\x18\x01 \x01(\x0b2\x1a.google.protobuf.Timestamp\x12\x14\n\x0cexclude_from\x18\x02 \x01(\x08\x12+\n\x07to_time\x18\x03 \x01(\x0b2\x1a.google.protobuf.Timestamp\x12\x12\n\ninclude_to\x18\x04 \x01(\x08B<\n\x13com.exabel.api.timeB\x0eTimeRangeProtoP\x01Z\x13exabel.com/api/timeb\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'exabel.api.time.time_range_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\x13com.exabel.api.timeB\x0eTimeRangeProtoP\x01Z\x13exabel.com/api/time' - _globals['_TIMERANGE']._serialized_start = 87 - _globals['_TIMERANGE']._serialized_end = 232 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/exabel/api/time/time_range_pb2_grpc.py b/exabel_data_sdk/stubs/exabel/api/time/time_range_pb2_grpc.py deleted file mode 100644 index ea9efaf6..00000000 --- a/exabel_data_sdk/stubs/exabel/api/time/time_range_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in exabel/api/time/time_range_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2.py b/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2.py deleted file mode 100644 index 04b08b88..00000000 --- a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'protoc_gen_openapiv2/options/annotations.proto') -_sym_db = _symbol_database.Default() -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 -from ...protoc_gen_openapiv2.options import openapiv2_pb2 as protoc__gen__openapiv2_dot_options_dot_openapiv2__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.protoc_gen_openapiv2/options/annotations.proto\x12)grpc.gateway.protoc_gen_openapiv2.options\x1a google/protobuf/descriptor.proto\x1a,protoc_gen_openapiv2/options/openapiv2.proto:l\n\x11openapiv2_swagger\x12\x1c.google.protobuf.FileOptions\x18\x92\x08 \x01(\x0b22.grpc.gateway.protoc_gen_openapiv2.options.Swagger:r\n\x13openapiv2_operation\x12\x1e.google.protobuf.MethodOptions\x18\x92\x08 \x01(\x0b24.grpc.gateway.protoc_gen_openapiv2.options.Operation:m\n\x10openapiv2_schema\x12\x1f.google.protobuf.MessageOptions\x18\x92\x08 \x01(\x0b21.grpc.gateway.protoc_gen_openapiv2.options.Schema:g\n\ropenapiv2_tag\x12\x1f.google.protobuf.ServiceOptions\x18\x92\x08 \x01(\x0b2..grpc.gateway.protoc_gen_openapiv2.options.Tag:n\n\x0fopenapiv2_field\x12\x1d.google.protobuf.FieldOptions\x18\x92\x08 \x01(\x0b25.grpc.gateway.protoc_gen_openapiv2.options.JSONSchemaBHZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/optionsb\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protoc_gen_openapiv2.options.annotations_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'ZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options' \ No newline at end of file diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2_grpc.py b/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2_grpc.py deleted file mode 100644 index 31d1976f..00000000 --- a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/annotations_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in protoc_gen_openapiv2/options/annotations_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.py b/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.py deleted file mode 100644 index 692223ab..00000000 --- a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2.py +++ /dev/null @@ -1,108 +0,0 @@ -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 0, '', 'protoc_gen_openapiv2/options/openapiv2.proto') -_sym_db = _symbol_database.Default() -from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,protoc_gen_openapiv2/options/openapiv2.proto\x12)grpc.gateway.protoc_gen_openapiv2.options\x1a\x1cgoogle/protobuf/struct.proto"\xdd\x06\n\x07Swagger\x12\x0f\n\x07swagger\x18\x01 \x01(\t\x12=\n\x04info\x18\x02 \x01(\x0b2/.grpc.gateway.protoc_gen_openapiv2.options.Info\x12\x0c\n\x04host\x18\x03 \x01(\t\x12\x11\n\tbase_path\x18\x04 \x01(\t\x12B\n\x07schemes\x18\x05 \x03(\x0e21.grpc.gateway.protoc_gen_openapiv2.options.Scheme\x12\x10\n\x08consumes\x18\x06 \x03(\t\x12\x10\n\x08produces\x18\x07 \x03(\t\x12T\n\tresponses\x18\n \x03(\x0b2A.grpc.gateway.protoc_gen_openapiv2.options.Swagger.ResponsesEntry\x12\\\n\x14security_definitions\x18\x0b \x01(\x0b2>.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions\x12P\n\x08security\x18\x0c \x03(\x0b2>.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement\x12W\n\rexternal_docs\x18\x0e \x01(\x0b2@.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation\x12V\n\nextensions\x18\x0f \x03(\x0b2B.grpc.gateway.protoc_gen_openapiv2.options.Swagger.ExtensionsEntry\x1ae\n\x0eResponsesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12B\n\x05value\x18\x02 \x01(\x0b23.grpc.gateway.protoc_gen_openapiv2.options.Response:\x028\x01\x1aI\n\x0fExtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b2\x16.google.protobuf.Value:\x028\x01J\x04\x08\x08\x10\tJ\x04\x08\t\x10\nJ\x04\x08\r\x10\x0e"\xe6\x05\n\tOperation\x12\x0c\n\x04tags\x18\x01 \x03(\t\x12\x0f\n\x07summary\x18\x02 \x01(\t\x12\x13\n\x0bdescription\x18\x03 \x01(\t\x12W\n\rexternal_docs\x18\x04 \x01(\x0b2@.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation\x12\x14\n\x0coperation_id\x18\x05 \x01(\t\x12\x10\n\x08consumes\x18\x06 \x03(\t\x12\x10\n\x08produces\x18\x07 \x03(\t\x12V\n\tresponses\x18\t \x03(\x0b2C.grpc.gateway.protoc_gen_openapiv2.options.Operation.ResponsesEntry\x12B\n\x07schemes\x18\n \x03(\x0e21.grpc.gateway.protoc_gen_openapiv2.options.Scheme\x12\x12\n\ndeprecated\x18\x0b \x01(\x08\x12P\n\x08security\x18\x0c \x03(\x0b2>.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement\x12X\n\nextensions\x18\r \x03(\x0b2D.grpc.gateway.protoc_gen_openapiv2.options.Operation.ExtensionsEntry\x1ae\n\x0eResponsesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12B\n\x05value\x18\x02 \x01(\x0b23.grpc.gateway.protoc_gen_openapiv2.options.Response:\x028\x01\x1aI\n\x0fExtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b2\x16.google.protobuf.Value:\x028\x01J\x04\x08\x08\x10\t"\xab\x01\n\x06Header\x12\x13\n\x0bdescription\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0e\n\x06format\x18\x03 \x01(\t\x12\x0f\n\x07default\x18\x06 \x01(\t\x12\x0f\n\x07pattern\x18\r \x01(\tJ\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\tJ\x04\x08\t\x10\nJ\x04\x08\n\x10\x0bJ\x04\x08\x0b\x10\x0cJ\x04\x08\x0c\x10\rJ\x04\x08\x0e\x10\x0fJ\x04\x08\x0f\x10\x10J\x04\x08\x10\x10\x11J\x04\x08\x11\x10\x12J\x04\x08\x12\x10\x13"\xc2\x04\n\x08Response\x12\x13\n\x0bdescription\x18\x01 \x01(\t\x12A\n\x06schema\x18\x02 \x01(\x0b21.grpc.gateway.protoc_gen_openapiv2.options.Schema\x12Q\n\x07headers\x18\x03 \x03(\x0b2@.grpc.gateway.protoc_gen_openapiv2.options.Response.HeadersEntry\x12S\n\x08examples\x18\x04 \x03(\x0b2A.grpc.gateway.protoc_gen_openapiv2.options.Response.ExamplesEntry\x12W\n\nextensions\x18\x05 \x03(\x0b2C.grpc.gateway.protoc_gen_openapiv2.options.Response.ExtensionsEntry\x1aa\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12@\n\x05value\x18\x02 \x01(\x0b21.grpc.gateway.protoc_gen_openapiv2.options.Header:\x028\x01\x1a/\n\rExamplesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x028\x01\x1aI\n\x0fExtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b2\x16.google.protobuf.Value:\x028\x01"\xff\x02\n\x04Info\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0bdescription\x18\x02 \x01(\t\x12\x18\n\x10terms_of_service\x18\x03 \x01(\t\x12C\n\x07contact\x18\x04 \x01(\x0b22.grpc.gateway.protoc_gen_openapiv2.options.Contact\x12C\n\x07license\x18\x05 \x01(\x0b22.grpc.gateway.protoc_gen_openapiv2.options.License\x12\x0f\n\x07version\x18\x06 \x01(\t\x12S\n\nextensions\x18\x07 \x03(\x0b2?.grpc.gateway.protoc_gen_openapiv2.options.Info.ExtensionsEntry\x1aI\n\x0fExtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b2\x16.google.protobuf.Value:\x028\x01"3\n\x07Contact\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\r\n\x05email\x18\x03 \x01(\t"$\n\x07License\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t"9\n\x15ExternalDocumentation\x12\x13\n\x0bdescription\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t"\xee\x01\n\x06Schema\x12J\n\x0bjson_schema\x18\x01 \x01(\x0b25.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema\x12\x15\n\rdiscriminator\x18\x02 \x01(\t\x12\x11\n\tread_only\x18\x03 \x01(\x08\x12W\n\rexternal_docs\x18\x05 \x01(\x0b2@.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation\x12\x0f\n\x07example\x18\x06 \x01(\tJ\x04\x08\x04\x10\x05"\xfc\x06\n\nJSONSchema\x12\x0b\n\x03ref\x18\x03 \x01(\t\x12\r\n\x05title\x18\x05 \x01(\t\x12\x13\n\x0bdescription\x18\x06 \x01(\t\x12\x0f\n\x07default\x18\x07 \x01(\t\x12\x11\n\tread_only\x18\x08 \x01(\x08\x12\x0f\n\x07example\x18\t \x01(\t\x12\x13\n\x0bmultiple_of\x18\n \x01(\x01\x12\x0f\n\x07maximum\x18\x0b \x01(\x01\x12\x19\n\x11exclusive_maximum\x18\x0c \x01(\x08\x12\x0f\n\x07minimum\x18\r \x01(\x01\x12\x19\n\x11exclusive_minimum\x18\x0e \x01(\x08\x12\x12\n\nmax_length\x18\x0f \x01(\x04\x12\x12\n\nmin_length\x18\x10 \x01(\x04\x12\x0f\n\x07pattern\x18\x11 \x01(\t\x12\x11\n\tmax_items\x18\x14 \x01(\x04\x12\x11\n\tmin_items\x18\x15 \x01(\x04\x12\x14\n\x0cunique_items\x18\x16 \x01(\x08\x12\x16\n\x0emax_properties\x18\x18 \x01(\x04\x12\x16\n\x0emin_properties\x18\x19 \x01(\x04\x12\x10\n\x08required\x18\x1a \x03(\t\x12\r\n\x05array\x18" \x03(\t\x12Y\n\x04type\x18# \x03(\x0e2K.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes\x12\x0e\n\x06format\x18$ \x01(\t\x12\x0c\n\x04enum\x18. \x03(\t\x12f\n\x13field_configuration\x18\xe9\x07 \x01(\x0b2H.grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration\x1a-\n\x12FieldConfiguration\x12\x17\n\x0fpath_param_name\x18/ \x01(\t"w\n\x15JSONSchemaSimpleTypes\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05ARRAY\x10\x01\x12\x0b\n\x07BOOLEAN\x10\x02\x12\x0b\n\x07INTEGER\x10\x03\x12\x08\n\x04NULL\x10\x04\x12\n\n\x06NUMBER\x10\x05\x12\n\n\x06OBJECT\x10\x06\x12\n\n\x06STRING\x10\x07J\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03J\x04\x08\x04\x10\x05J\x04\x08\x12\x10\x13J\x04\x08\x13\x10\x14J\x04\x08\x17\x10\x18J\x04\x08\x1b\x10\x1cJ\x04\x08\x1c\x10\x1dJ\x04\x08\x1d\x10\x1eJ\x04\x08\x1e\x10"J\x04\x08%\x10*J\x04\x08*\x10+J\x04\x08+\x10."y\n\x03Tag\x12\x13\n\x0bdescription\x18\x02 \x01(\t\x12W\n\rexternal_docs\x18\x03 \x01(\x0b2@.grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentationJ\x04\x08\x01\x10\x02"\xe1\x01\n\x13SecurityDefinitions\x12^\n\x08security\x18\x01 \x03(\x0b2L.grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.SecurityEntry\x1aj\n\rSecurityEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12H\n\x05value\x18\x02 \x01(\x0b29.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme:\x028\x01"\xa0\x06\n\x0eSecurityScheme\x12L\n\x04type\x18\x01 \x01(\x0e2>.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type\x12\x13\n\x0bdescription\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12H\n\x02in\x18\x04 \x01(\x0e2<.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In\x12L\n\x04flow\x18\x05 \x01(\x0e2>.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow\x12\x19\n\x11authorization_url\x18\x06 \x01(\t\x12\x11\n\ttoken_url\x18\x07 \x01(\t\x12A\n\x06scopes\x18\x08 \x01(\x0b21.grpc.gateway.protoc_gen_openapiv2.options.Scopes\x12]\n\nextensions\x18\t \x03(\x0b2I.grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.ExtensionsEntry\x1aI\n\x0fExtensionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b2\x16.google.protobuf.Value:\x028\x01"K\n\x04Type\x12\x10\n\x0cTYPE_INVALID\x10\x00\x12\x0e\n\nTYPE_BASIC\x10\x01\x12\x10\n\x0cTYPE_API_KEY\x10\x02\x12\x0f\n\x0bTYPE_OAUTH2\x10\x03"1\n\x02In\x12\x0e\n\nIN_INVALID\x10\x00\x12\x0c\n\x08IN_QUERY\x10\x01\x12\r\n\tIN_HEADER\x10\x02"j\n\x04Flow\x12\x10\n\x0cFLOW_INVALID\x10\x00\x12\x11\n\rFLOW_IMPLICIT\x10\x01\x12\x11\n\rFLOW_PASSWORD\x10\x02\x12\x14\n\x10FLOW_APPLICATION\x10\x03\x12\x14\n\x10FLOW_ACCESS_CODE\x10\x04"\xcd\x02\n\x13SecurityRequirement\x12u\n\x14security_requirement\x18\x01 \x03(\x0b2W.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementEntry\x1a)\n\x18SecurityRequirementValue\x12\r\n\x05scope\x18\x01 \x03(\t\x1a\x93\x01\n\x18SecurityRequirementEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12f\n\x05value\x18\x02 \x01(\x0b2W.grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue:\x028\x01"\x83\x01\n\x06Scopes\x12K\n\x05scope\x18\x01 \x03(\x0b2<.grpc.gateway.protoc_gen_openapiv2.options.Scopes.ScopeEntry\x1a,\n\nScopeEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x028\x01*;\n\x06Scheme\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04HTTP\x10\x01\x12\t\n\x05HTTPS\x10\x02\x12\x06\n\x02WS\x10\x03\x12\x07\n\x03WSS\x10\x04BHZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/optionsb\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'protoc_gen_openapiv2.options.openapiv2_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'ZFgithub.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options' - _globals['_SWAGGER_RESPONSESENTRY']._loaded_options = None - _globals['_SWAGGER_RESPONSESENTRY']._serialized_options = b'8\x01' - _globals['_SWAGGER_EXTENSIONSENTRY']._loaded_options = None - _globals['_SWAGGER_EXTENSIONSENTRY']._serialized_options = b'8\x01' - _globals['_OPERATION_RESPONSESENTRY']._loaded_options = None - _globals['_OPERATION_RESPONSESENTRY']._serialized_options = b'8\x01' - _globals['_OPERATION_EXTENSIONSENTRY']._loaded_options = None - _globals['_OPERATION_EXTENSIONSENTRY']._serialized_options = b'8\x01' - _globals['_RESPONSE_HEADERSENTRY']._loaded_options = None - _globals['_RESPONSE_HEADERSENTRY']._serialized_options = b'8\x01' - _globals['_RESPONSE_EXAMPLESENTRY']._loaded_options = None - _globals['_RESPONSE_EXAMPLESENTRY']._serialized_options = b'8\x01' - _globals['_RESPONSE_EXTENSIONSENTRY']._loaded_options = None - _globals['_RESPONSE_EXTENSIONSENTRY']._serialized_options = b'8\x01' - _globals['_INFO_EXTENSIONSENTRY']._loaded_options = None - _globals['_INFO_EXTENSIONSENTRY']._serialized_options = b'8\x01' - _globals['_SECURITYDEFINITIONS_SECURITYENTRY']._loaded_options = None - _globals['_SECURITYDEFINITIONS_SECURITYENTRY']._serialized_options = b'8\x01' - _globals['_SECURITYSCHEME_EXTENSIONSENTRY']._loaded_options = None - _globals['_SECURITYSCHEME_EXTENSIONSENTRY']._serialized_options = b'8\x01' - _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY']._loaded_options = None - _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY']._serialized_options = b'8\x01' - _globals['_SCOPES_SCOPEENTRY']._loaded_options = None - _globals['_SCOPES_SCOPEENTRY']._serialized_options = b'8\x01' - _globals['_SCHEME']._serialized_start = 5781 - _globals['_SCHEME']._serialized_end = 5840 - _globals['_SWAGGER']._serialized_start = 122 - _globals['_SWAGGER']._serialized_end = 983 - _globals['_SWAGGER_RESPONSESENTRY']._serialized_start = 789 - _globals['_SWAGGER_RESPONSESENTRY']._serialized_end = 890 - _globals['_SWAGGER_EXTENSIONSENTRY']._serialized_start = 892 - _globals['_SWAGGER_EXTENSIONSENTRY']._serialized_end = 965 - _globals['_OPERATION']._serialized_start = 986 - _globals['_OPERATION']._serialized_end = 1728 - _globals['_OPERATION_RESPONSESENTRY']._serialized_start = 789 - _globals['_OPERATION_RESPONSESENTRY']._serialized_end = 890 - _globals['_OPERATION_EXTENSIONSENTRY']._serialized_start = 892 - _globals['_OPERATION_EXTENSIONSENTRY']._serialized_end = 965 - _globals['_HEADER']._serialized_start = 1731 - _globals['_HEADER']._serialized_end = 1902 - _globals['_RESPONSE']._serialized_start = 1905 - _globals['_RESPONSE']._serialized_end = 2483 - _globals['_RESPONSE_HEADERSENTRY']._serialized_start = 2262 - _globals['_RESPONSE_HEADERSENTRY']._serialized_end = 2359 - _globals['_RESPONSE_EXAMPLESENTRY']._serialized_start = 2361 - _globals['_RESPONSE_EXAMPLESENTRY']._serialized_end = 2408 - _globals['_RESPONSE_EXTENSIONSENTRY']._serialized_start = 892 - _globals['_RESPONSE_EXTENSIONSENTRY']._serialized_end = 965 - _globals['_INFO']._serialized_start = 2486 - _globals['_INFO']._serialized_end = 2869 - _globals['_INFO_EXTENSIONSENTRY']._serialized_start = 892 - _globals['_INFO_EXTENSIONSENTRY']._serialized_end = 965 - _globals['_CONTACT']._serialized_start = 2871 - _globals['_CONTACT']._serialized_end = 2922 - _globals['_LICENSE']._serialized_start = 2924 - _globals['_LICENSE']._serialized_end = 2960 - _globals['_EXTERNALDOCUMENTATION']._serialized_start = 2962 - _globals['_EXTERNALDOCUMENTATION']._serialized_end = 3019 - _globals['_SCHEMA']._serialized_start = 3022 - _globals['_SCHEMA']._serialized_end = 3260 - _globals['_JSONSCHEMA']._serialized_start = 3263 - _globals['_JSONSCHEMA']._serialized_end = 4155 - _globals['_JSONSCHEMA_FIELDCONFIGURATION']._serialized_start = 3911 - _globals['_JSONSCHEMA_FIELDCONFIGURATION']._serialized_end = 3956 - _globals['_JSONSCHEMA_JSONSCHEMASIMPLETYPES']._serialized_start = 3958 - _globals['_JSONSCHEMA_JSONSCHEMASIMPLETYPES']._serialized_end = 4077 - _globals['_TAG']._serialized_start = 4157 - _globals['_TAG']._serialized_end = 4278 - _globals['_SECURITYDEFINITIONS']._serialized_start = 4281 - _globals['_SECURITYDEFINITIONS']._serialized_end = 4506 - _globals['_SECURITYDEFINITIONS_SECURITYENTRY']._serialized_start = 4400 - _globals['_SECURITYDEFINITIONS_SECURITYENTRY']._serialized_end = 4506 - _globals['_SECURITYSCHEME']._serialized_start = 4509 - _globals['_SECURITYSCHEME']._serialized_end = 5309 - _globals['_SECURITYSCHEME_EXTENSIONSENTRY']._serialized_start = 892 - _globals['_SECURITYSCHEME_EXTENSIONSENTRY']._serialized_end = 965 - _globals['_SECURITYSCHEME_TYPE']._serialized_start = 5075 - _globals['_SECURITYSCHEME_TYPE']._serialized_end = 5150 - _globals['_SECURITYSCHEME_IN']._serialized_start = 5152 - _globals['_SECURITYSCHEME_IN']._serialized_end = 5201 - _globals['_SECURITYSCHEME_FLOW']._serialized_start = 5203 - _globals['_SECURITYSCHEME_FLOW']._serialized_end = 5309 - _globals['_SECURITYREQUIREMENT']._serialized_start = 5312 - _globals['_SECURITYREQUIREMENT']._serialized_end = 5645 - _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE']._serialized_start = 5454 - _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTVALUE']._serialized_end = 5495 - _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY']._serialized_start = 5498 - _globals['_SECURITYREQUIREMENT_SECURITYREQUIREMENTENTRY']._serialized_end = 5645 - _globals['_SCOPES']._serialized_start = 5648 - _globals['_SCOPES']._serialized_end = 5779 - _globals['_SCOPES_SCOPEENTRY']._serialized_start = 5735 - _globals['_SCOPES_SCOPEENTRY']._serialized_end = 5779 \ No newline at end of file diff --git a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py b/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py deleted file mode 100644 index 722accaf..00000000 --- a/exabel_data_sdk/stubs/protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc -import warnings -GRPC_GENERATED_VERSION = '1.71.2' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError(f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in protoc_gen_openapiv2/options/openapiv2_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.') \ No newline at end of file diff --git a/exabel_data_sdk/tests/client/api/api_client/test_exabel_api_group.py b/exabel_data_sdk/tests/client/api/api_client/test_exabel_api_group.py deleted file mode 100644 index fad45556..00000000 --- a/exabel_data_sdk/tests/client/api/api_client/test_exabel_api_group.py +++ /dev/null @@ -1,18 +0,0 @@ -import unittest - -from exabel_data_sdk.client.api.api_client.exabel_api_group import ExabelApiGroup -from exabel_data_sdk.client.client_config import ClientConfig - - -class TestExabelApiGroup(unittest.TestCase): - def test_get_host(self): - config = ClientConfig(api_key="123", data_api_host="localhost") - self.assertEqual("localhost", ExabelApiGroup.DATA_API.get_host(config)) - self.assertEqual( - "management.api.exabel.com", ExabelApiGroup.MANAGEMENT_API.get_host(config) - ) - - def test_get_port(self): - config = ClientConfig(api_key="123", analytics_api_port=123) - self.assertEqual(123, ExabelApiGroup.ANALYTICS_API.get_port(config)) - self.assertEqual(21443, ExabelApiGroup.MANAGEMENT_API.get_port(config)) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_namespace.py b/exabel_data_sdk/tests/client/api/data_classes/test_namespace.py deleted file mode 100644 index 0f751565..00000000 --- a/exabel_data_sdk/tests/client/api/data_classes/test_namespace.py +++ /dev/null @@ -1,12 +0,0 @@ -import unittest - -from exabel_data_sdk.client.api.data_classes.namespace import Namespace - - -class TestNamespace(unittest.TestCase): - def test_proto_conversion(self): - namespace = Namespace( - name="namespace/ns", - writeable=True, - ) - self.assertEqual(namespace, Namespace.from_proto(namespace.to_proto())) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_relationship_type.py b/exabel_data_sdk/tests/client/api/data_classes/test_relationship_type.py deleted file mode 100644 index f2560c09..00000000 --- a/exabel_data_sdk/tests/client/api/data_classes/test_relationship_type.py +++ /dev/null @@ -1,15 +0,0 @@ -import unittest - -from exabel_data_sdk.client.api.data_classes.relationship_type import RelationshipType - - -class TestRelationshipType(unittest.TestCase): - def test_proto_conversion(self): - relationship_type = RelationshipType( - name="relationshipTypes/ns1.owned_by", - description="description", - properties={"a": False, "b": 3.5, "c": "c_value"}, - ) - self.assertEqual( - relationship_type, RelationshipType.from_proto(relationship_type.to_proto()) - ) diff --git a/exabel_data_sdk/tests/client/api/data_classes/test_request_error.py b/exabel_data_sdk/tests/client/api/data_classes/test_request_error.py deleted file mode 100644 index 8deb2e11..00000000 --- a/exabel_data_sdk/tests/client/api/data_classes/test_request_error.py +++ /dev/null @@ -1,34 +0,0 @@ -import unittest - -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType - - -class TestErrorType(unittest.TestCase): - def test_from_precondition_failure_violation(self): - self.assertEqual( - ErrorType.from_precondition_failure_violation_type("NOT_FOUND"), ErrorType.NOT_FOUND - ) - self.assertEqual( - ErrorType.from_precondition_failure_violation_type("FAILED_PRECONDITION"), - ErrorType.FAILED_PRECONDITION, - ) - self.assertEqual( - ErrorType.from_precondition_failure_violation_type("PERMISSION_DENIED"), - ErrorType.PERMISSION_DENIED, - ) - self.assertEqual( - ErrorType.from_precondition_failure_violation_type("UNAVAILABLE"), ErrorType.UNAVAILABLE - ) - self.assertEqual( - ErrorType.from_precondition_failure_violation_type("TIMEOUT"), ErrorType.TIMEOUT - ) - self.assertEqual( - ErrorType.from_precondition_failure_violation_type("INTERNAL"), ErrorType.INTERNAL - ) - self.assertEqual( - ErrorType.from_precondition_failure_violation_type("UNKNOWN"), ErrorType.UNKNOWN - ) - self.assertEqual( - ErrorType.from_precondition_failure_violation_type("NOT_A_VALID_TYPE"), - ErrorType.UNKNOWN, - ) diff --git a/exabel_data_sdk/tests/client/api/test_error_handler.py b/exabel_data_sdk/tests/client/api/test_error_handler.py deleted file mode 100644 index 58b0a4b8..00000000 --- a/exabel_data_sdk/tests/client/api/test_error_handler.py +++ /dev/null @@ -1,68 +0,0 @@ -import unittest -from unittest.mock import MagicMock - -from grpc import RpcError, StatusCode - -from exabel_data_sdk.client.api.data_classes.request_error import ErrorType, RequestError -from exabel_data_sdk.client.api.error_handler import ( - grpc_status_to_error_type, - handle_grpc_error, - is_status_detail, -) - - -class TestHttpStatusToErrorType(unittest.TestCase): - def test_is_status_detail(self): - status_detail = MagicMock(spec=["key", "value"]) - status_detail.key = "grpc-status-details-anything" - self.assertTrue(is_status_detail(status_detail)) - status_detail.key = "not-grpc-status-details-anything" - self.assertFalse(is_status_detail(status_detail)) - status_detail = MagicMock(spec=["key"]) - self.assertFalse(is_status_detail(status_detail)) - status_detail = MagicMock(spec=["value"]) - self.assertFalse(is_status_detail(status_detail)) - - def test_grpc_status_to_error_type(self): - self.assertEqual(ErrorType.NOT_FOUND, grpc_status_to_error_type(StatusCode.NOT_FOUND)) - self.assertEqual( - ErrorType.ALREADY_EXISTS, grpc_status_to_error_type(StatusCode.ALREADY_EXISTS) - ) - self.assertEqual( - ErrorType.INVALID_ARGUMENT, grpc_status_to_error_type(StatusCode.INVALID_ARGUMENT) - ) - self.assertEqual( - ErrorType.PERMISSION_DENIED, grpc_status_to_error_type(StatusCode.PERMISSION_DENIED) - ) - self.assertEqual(ErrorType.UNAVAILABLE, grpc_status_to_error_type(StatusCode.UNAVAILABLE)) - self.assertEqual(ErrorType.TIMEOUT, grpc_status_to_error_type(StatusCode.DEADLINE_EXCEEDED)) - self.assertEqual( - ErrorType.RESOURCE_EXHAUSTED, grpc_status_to_error_type(StatusCode.RESOURCE_EXHAUSTED) - ) - self.assertEqual(ErrorType.INTERNAL, grpc_status_to_error_type(StatusCode.INTERNAL)) - self.assertEqual(ErrorType.INTERNAL, grpc_status_to_error_type(StatusCode.DATA_LOSS)) - - def test_handle_grpc_error(self): - @handle_grpc_error - def raise_grpc_error(status_code: StatusCode): - error = RpcError() - error.code = MagicMock(return_value=status_code) - error.details = MagicMock(return_value="Error details") - error.trailing_metadata = MagicMock(return_value=[]) - raise error - - for status_code in StatusCode: - with self.assertRaises(RequestError) as context: - raise_grpc_error(status_code) - self.assertEqual(grpc_status_to_error_type(status_code), context.exception.error_type) - self.assertEqual("Error details", context.exception.message) - - def test_reraise_non_grpc_error_as_request_error(self): - @handle_grpc_error - def raise_value_error(): - raise ValueError("Not an RPC error") - - with self.assertRaises(RequestError) as context: - raise_value_error() - self.assertEqual(ErrorType.INTERNAL, context.exception.error_type) - self.assertEqual("Not an RPC error", context.exception.message) diff --git a/exabel_data_sdk/tests/client/api/test_namespace_api.py b/exabel_data_sdk/tests/client/api/test_namespace_api.py deleted file mode 100644 index 868ddd02..00000000 --- a/exabel_data_sdk/tests/client/api/test_namespace_api.py +++ /dev/null @@ -1,51 +0,0 @@ -import unittest -from unittest import mock - -from exabel_data_sdk.client.api.data_classes.namespace import Namespace -from exabel_data_sdk.client.api.namespace_api import NamespaceApi -from exabel_data_sdk.client.client_config import ClientConfig -from exabel_data_sdk.util.exceptions import NoWriteableNamespaceError - - -class TestNamespaceApi(unittest.TestCase): - @mock.patch("exabel_data_sdk.client.api.namespace_api.NamespaceApi.list_namespaces") - def test_get_writeable_namespace(self, mock_list_namespaces): - namespace_api = NamespaceApi(ClientConfig(api_key="123")) - mock_list_namespaces.return_value = [ - Namespace(name="namespaces/ns1", writeable=True), - Namespace(name="namespaces/ns2", writeable=False), - ] - self.assertEqual( - Namespace(name="namespaces/ns1", writeable=True), - namespace_api.get_writeable_namespace(), - ) - - @mock.patch("exabel_data_sdk.client.api.namespace_api.NamespaceApi.list_namespaces") - def test_get_writeable_namespace__no_writable_namespace_should_fail(self, mock_list_namespaces): - namespace_api = NamespaceApi(ClientConfig(api_key="123")) - mock_list_namespaces.return_value = [ - Namespace(name="namespaces/ns1", writeable=False), - Namespace(name="namespaces/ns2", writeable=False), - ] - with self.assertRaises(NoWriteableNamespaceError) as cm: - namespace_api.get_writeable_namespace() - self.assertEqual( - "Current customer is not authorized to write to any namespace.", str(cm.exception) - ) - - @mock.patch("exabel_data_sdk.client.api.namespace_api.NamespaceApi.list_namespaces") - def test_get_writeable_namespace__multiple_writeable_namespaces_should_log_warning( - self, mock_list_namespaces - ): - namespace_api = NamespaceApi(ClientConfig(api_key="123")) - mock_list_namespaces.return_value = [ - Namespace(name="namespaces/ns1", writeable=True), - Namespace(name="namespaces/ns2", writeable=True), - ] - with self.assertLogs("exabel_data_sdk.client.api.namespace_api", "WARNING") as cm: - namespace_api.get_writeable_namespace() - self.assertEqual( - "WARNING:exabel_data_sdk.client.api.namespace_api:Current customer is authorized to " - "write to 2 namespaces. Using the first lexicographical result: 'namespaces/ns1'.", - str(cm.output[0]), - ) diff --git a/exabel_data_sdk/tests/client/query/test_query.py b/exabel_data_sdk/tests/client/query/test_query.py deleted file mode 100644 index 5f61fe52..00000000 --- a/exabel_data_sdk/tests/client/query/test_query.py +++ /dev/null @@ -1,56 +0,0 @@ -import unittest - -import pandas as pd - -from exabel_data_sdk.query.column import Column -from exabel_data_sdk.query.dashboard import Dashboard -from exabel_data_sdk.query.literal import to_sql -from exabel_data_sdk.query.signals import Signals - - -class TestQuery(unittest.TestCase): - def test_escape(self): - self.assertEqual("123", to_sql(123)) - self.assertEqual("'foo'", to_sql("foo")) - self.assertEqual("'foo'", to_sql("foo")) - self.assertEqual("''''", to_sql("'")) - self.assertEqual("'\"'", to_sql('"')) - self.assertEqual("'\\\"'", to_sql('\\"')) - self.assertEqual("'''\\'''''", to_sql("'\\''")) - - def test_dashboard_queries(self): - self.assertEqual( - "SELECT * FROM dashboard WHERE dashboard_id = 123", Dashboard.query(123).sql() - ) - self.assertEqual( - "SELECT foo, bar FROM dashboard WHERE dashboard_id = 'dash:123' " - "AND widget_id = 'widget:123'", - Dashboard.query("dash:123", ["foo", "bar"], "widget:123").sql(), - ) - self.assertEqual( - "SELECT foo, bar FROM dashboard WHERE dashboard_id = 'dash''123' " - "AND widget_id = 'widget\"123'", - Dashboard.query("dash'123", ["foo", "bar"], 'widget"123').sql(), - ) - - def test_signals_queries(self): - self.assertEqual("SELECT my_signal FROM signals", Signals.query(["my_signal"]).sql()) - self.assertEqual( - "SELECT a, b FROM signals WHERE factset_id IN ('FA', 'FB') " - "AND time >= '2020-01-01' AND time <= '2020-12-31'", - Signals.query( - ["a", "b"], - start_time="2020-01-01", - end_time=pd.Timestamp("2020-12-31"), - predicates=[Signals.FACTSET_ID.in_list("FA", "FB")], - ).sql(), - ) - self.assertEqual( - "SELECT 'a+b' AS total, 'get(''foo'')' AS myget FROM signals " - "WHERE has_tag('signal:dynamicTag:367') AND time >= '2020-01-01'", - Signals.query( - [Column("total", "a+b"), Column("myget", "get('foo')")], - "signal:dynamicTag:367", - "2020-01-01", - ).sql(), - ) diff --git a/exabel_data_sdk/tests/client/test_client_config.py b/exabel_data_sdk/tests/client/test_client_config.py deleted file mode 100644 index 6c7ff7e2..00000000 --- a/exabel_data_sdk/tests/client/test_client_config.py +++ /dev/null @@ -1,29 +0,0 @@ -import unittest - -from exabel_data_sdk.client.client_config import ClientConfig - - -class TestExabelClient(unittest.TestCase): - def test_default_config(self): - config = ClientConfig(api_key="123") - self.assertEqual("123", config.api_key) - self.assertEqual("Exabel Python SDK", config.client_name) - self.assertEqual("data.api.exabel.com", config.data_api_host) - self.assertEqual("analytics.api.exabel.com", config.analytics_api_host) - self.assertEqual("management.api.exabel.com", config.management_api_host) - self.assertEqual(21443, config.data_api_port) - self.assertEqual(60 * 15, config.timeout) - - def test_non_default_values(self): - config = ClientConfig( - api_key="123", - client_name="my client", - data_api_host="foo.bar.com", - data_api_port=1234, - timeout=45, - ) - self.assertEqual("123", config.api_key) - self.assertEqual("my client", config.client_name) - self.assertEqual("foo.bar.com", config.data_api_host) - self.assertEqual(1234, config.data_api_port) - self.assertEqual(45, config.timeout) diff --git a/exabel_data_sdk/tests/decorators.py b/exabel_data_sdk/tests/decorators.py deleted file mode 100644 index 4bd79323..00000000 --- a/exabel_data_sdk/tests/decorators.py +++ /dev/null @@ -1,35 +0,0 @@ -import importlib.util -import unittest -from typing import Callable, TypeVar - -T = TypeVar("T") - - -def requires_modules(*modules: str) -> Callable[..., type[T]]: - """ - Decorator for a class containing tests that require optional dependencies. - - If the modules are not importable, the tests are skipped. - """ - - def wrapper(original_class: type[T]) -> type[T]: - not_importable = [] - for module in modules: - if not _is_importable(module): - not_importable.append(module) - return unittest.skipUnless( - not not_importable, - f"Module(s): '{', '.join(not_importable)}' must be available to run these tests.", - )(original_class) - - return wrapper - - -def _is_importable(module: str) -> bool: - """ - Checks whether a module or sub-module is importable. - """ - parent_name = module.rpartition(".")[0] - if parent_name and not importlib.util.find_spec(parent_name): - return False - return importlib.util.find_spec(module) is not None diff --git a/exabel_data_sdk/tests/scripts/test_csv_script.py b/exabel_data_sdk/tests/scripts/test_csv_script.py deleted file mode 100644 index 82e432c4..00000000 --- a/exabel_data_sdk/tests/scripts/test_csv_script.py +++ /dev/null @@ -1,14 +0,0 @@ -import unittest -from argparse import ArgumentTypeError - -from exabel_data_sdk.scripts.csv_script import abort_threshold - - -class TestCsvScript(unittest.TestCase): - def test_abort_threshold_argument(self): - self.assertEqual(0.0, abort_threshold("0")) - self.assertEqual(0.5, abort_threshold("0.5")) - self.assertEqual(1.0, abort_threshold("1")) - self.assertRaises(ArgumentTypeError, abort_threshold, "1.1") - self.assertRaises(ArgumentTypeError, abort_threshold, "-0.1") - self.assertRaises(ArgumentTypeError, abort_threshold, "foo") diff --git a/exabel_data_sdk/tests/scripts/test_load_scripts.py b/exabel_data_sdk/tests/scripts/test_load_scripts.py deleted file mode 100644 index 81b4c279..00000000 --- a/exabel_data_sdk/tests/scripts/test_load_scripts.py +++ /dev/null @@ -1,11 +0,0 @@ -# ruff: noqa: F401 -from exabel_data_sdk.scripts.create_relationship_type import CreateRelationshipType -from exabel_data_sdk.scripts.create_signal import CreateSignal -from exabel_data_sdk.scripts.delete_entities import DeleteEntities -from exabel_data_sdk.scripts.delete_signal import DeleteSignal -from exabel_data_sdk.scripts.delete_time_series import DeleteTimeSeries -from exabel_data_sdk.scripts.list_entities import ListEntities -from exabel_data_sdk.scripts.list_entity_types import ListEntityTypes -from exabel_data_sdk.scripts.list_relationship_types import ListRelationshipTypes -from exabel_data_sdk.scripts.list_signals import ListSignals -from exabel_data_sdk.scripts.load_time_series_from_file import LoadTimeSeriesFromFile diff --git a/exabel_data_sdk/tests/services/test_csv_time_series_loader.py b/exabel_data_sdk/tests/services/test_csv_time_series_loader.py deleted file mode 100644 index ae278ec1..00000000 --- a/exabel_data_sdk/tests/services/test_csv_time_series_loader.py +++ /dev/null @@ -1,39 +0,0 @@ -import unittest - -from exabel_data_sdk import ExabelClient -from exabel_data_sdk.services.csv_exception import CsvLoadingException -from exabel_data_sdk.services.csv_time_series_loader import CsvTimeSeriesLoader -from exabel_data_sdk.services.file_loading_exception import FileLoadingException -from exabel_data_sdk.tests.client.exabel_mock_client import ExabelMockClient - - -class TestCsvTimeSeriesLoader(unittest.TestCase): - def test_read_csv_should_failed_by_non_numeric_signal_values(self): - client: ExabelClient = ExabelMockClient() - with self.assertRaises(FileLoadingException) as context: - CsvTimeSeriesLoader(client).load_time_series( - filename="exabel_data_sdk/tests/resources/" - "data/time_series_with_non_numeric_values.csv", - namespace="test", - ) - exception = context.exception - actual = str(exception) - self.assertIn( - "2 signal(s) contain non-numeric values. " - "Please ensure all values can be parsed to numeric values", - actual, - ) - self.assertIn( - "Signal 'production' contains 6 non-numeric values, check the first five as examples:", - actual, - ) - self.assertIn("Signal 'price' contains 3 non-numeric values", actual) - - def test_exeption_alias(self): - client: ExabelClient = ExabelMockClient() - with self.assertRaises(CsvLoadingException): - CsvTimeSeriesLoader(client).load_time_series( - filename="exabel_data_sdk/tests/resources/" - "data/time_series_with_non_numeric_values.csv", - namespace="test", - ) diff --git a/exabel_data_sdk/tests/services/test_file_writer_provider.py b/exabel_data_sdk/tests/services/test_file_writer_provider.py deleted file mode 100644 index 28012e78..00000000 --- a/exabel_data_sdk/tests/services/test_file_writer_provider.py +++ /dev/null @@ -1,37 +0,0 @@ -import unittest - -from exabel_data_sdk.services.csv_writer import CsvWriter -from exabel_data_sdk.services.excel_writer import ExcelWriter -from exabel_data_sdk.services.file_constants import EXCEL_EXTENSIONS, FULL_CSV_EXTENSIONS -from exabel_data_sdk.services.file_writer_provider import FileWriterProvider - - -class TestFileWriterProvider(unittest.TestCase): - def test_full_csv_extensions(self): - self.assertSetEqual( - {".csv.gz", ".csv.bz2", ".csv.zip", ".csv.xz", ".csv.zst", ".csv"}, - FULL_CSV_EXTENSIONS, - ) - - def test_get_extension(self): - self.assertEqual(".csv", FileWriterProvider.get_file_extension("test.csv")) - self.assertEqual(".csv.gz", FileWriterProvider.get_file_extension("test.csv.gz")) - self.assertEqual("", FileWriterProvider.get_file_extension(".a")) - self.assertEqual(".b", FileWriterProvider.get_file_extension(".a.b")) - self.assertEqual(".b.c", FileWriterProvider.get_file_extension(".a.b.c")) - self.assertEqual(".b.c.d", FileWriterProvider.get_file_extension(".a.b.c.d")) - self.assertEqual(".d", FileWriterProvider.get_file_extension("a.b/c.d")) - - def test_provide_csv_writer(self): - for extension in FULL_CSV_EXTENSIONS: - self.assertEqual(CsvWriter, FileWriterProvider.get_file_writer(f"test{extension}")) - - def test_provide_excel_writer(self): - for extension in EXCEL_EXTENSIONS: - self.assertEqual(ExcelWriter, FileWriterProvider.get_file_writer(f"test{extension}")) - - def test_provide_file_writer_should_fail(self): - self.assertRaises(ValueError, FileWriterProvider.get_file_writer, "test.a") - self.assertRaises(ValueError, FileWriterProvider.get_file_writer, ".csv") - self.assertRaises(ValueError, FileWriterProvider.get_file_writer, "test.parquet") - self.assertRaises(ValueError, FileWriterProvider.get_file_writer, "test.csv.a") diff --git a/exabel_data_sdk/tests/util/test_handle_missing_imports.py b/exabel_data_sdk/tests/util/test_handle_missing_imports.py deleted file mode 100644 index 9cdca48b..00000000 --- a/exabel_data_sdk/tests/util/test_handle_missing_imports.py +++ /dev/null @@ -1,37 +0,0 @@ -import unittest - -from exabel_data_sdk.util.handle_missing_imports import handle_missing_imports - -# ruff: noqa: F401 - - -class TestHandleMissingImports(unittest.TestCase): - def test_handle_missing_imports(self): - with self.assertWarns(UserWarning) as cm: - with handle_missing_imports({"exabel_data_sdk.might_not_exist": "library-name"}): - import exabel_data_sdk.might_not_exist - self.assertTrue(str(cm.warning).startswith("Module 'exabel_data_sdk.might_not_exist'")) - - def test_handle_missing_imports_custom_warning(self): - with self.assertWarns(UserWarning) as cm: - with handle_missing_imports( - {"exabel_data_sdk.might_not_exist": "library-name"}, warning="custom warning" - ): - import exabel_data_sdk.might_not_exist - self.assertTrue(str(cm.warning).startswith("custom warning")) - - def test_handle_missing_imports_reraise(self): - with self.assertRaises(ImportError) as cm: - with handle_missing_imports( - {"exabel_data_sdk.might_not_exist": "library-name"}, - warning="custom exception", - reraise=True, - ): - import exabel_data_sdk.might_not_exist - self.assertTrue(str(cm.exception).startswith("custom exception")) - - def test_handle_missing_imports_should_fail(self): - with self.assertRaises(ImportError) as cm: - with handle_missing_imports({}): - import exabel_data_sdk.does_not_exist - self.assertEqual("exabel_data_sdk.does_not_exist", str(cm.exception.name)) diff --git a/exabel_data_sdk/tests/util/test_parse_property_columns.py b/exabel_data_sdk/tests/util/test_parse_property_columns.py deleted file mode 100644 index eaaa1a2e..00000000 --- a/exabel_data_sdk/tests/util/test_parse_property_columns.py +++ /dev/null @@ -1,28 +0,0 @@ -import unittest - -from exabel_data_sdk.util.exceptions import ParsePropertyColumnsError -from exabel_data_sdk.util.parse_property_columns import parse_property_columns - - -class TestParsePropertyColumns(unittest.TestCase): - def test_parse_property_columns(self): - self.assertEqual( - { - "boolean_prop": bool, - "string_prop": str, - "integer_prop": int, - "float_prop": float, - }, - parse_property_columns( - "boolean_prop:bool", "string_prop:str", "integer_prop:int", "float_prop:float" - ), - ) - - def test_parse_property_columns_with_no_input(self): - self.assertEqual({}, parse_property_columns(*[])) - - def test_parse_property_columns_should_fail(self): - with self.assertRaises(ParsePropertyColumnsError): - parse_property_columns("prop:not_a_type") - with self.assertRaises(ParsePropertyColumnsError): - parse_property_columns("missing_type") diff --git a/exabel_data_sdk/tests/util/test_type_converter.py b/exabel_data_sdk/tests/util/test_type_converter.py deleted file mode 100644 index 8a63899c..00000000 --- a/exabel_data_sdk/tests/util/test_type_converter.py +++ /dev/null @@ -1,42 +0,0 @@ -import unittest -from math import isinf, isnan - -from exabel_data_sdk.util.exceptions import TypeConversionError -from exabel_data_sdk.util.type_converter import type_converter - - -class TestTypeConverter(unittest.TestCase): - def test_type_converter_with_string(self): - self.assertEqual(type_converter("string", str), "string") - - def test_type_converter_with_int(self): - self.assertEqual(type_converter("1", int), 1) - - def test_type_converter_with_float(self): - self.assertEqual(type_converter("1.0", float), 1.0) - self.assertEqual(type_converter("1", float), 1.0) - self.assertTrue(isnan(type_converter("nan", float))) - self.assertTrue(isinf(type_converter("inf", float))) - self.assertTrue(isinf(type_converter("-inf", float))) - - def test_type_converter_with_bool(self): - self.assertEqual(type_converter("true", bool), True) - self.assertEqual(type_converter("TRUE", bool), True) - self.assertEqual(type_converter("false", bool), False) - self.assertEqual(type_converter("FALSE", bool), False) - - def test_type_converter_with_int_should_fail(self): - with self.assertRaises(TypeConversionError): - type_converter("1.0", int) - - def test_type_converter_with_float_should_fail(self): - with self.assertRaises(TypeConversionError): - type_converter("not-a-float", float) - - def test_type_converter_with_bool_should_fail(self): - with self.assertRaises(TypeConversionError): - type_converter("not-a-bool", bool) - - def test_type_converter_with_invalid_type_should_fail(self): - with self.assertRaises(TypeConversionError): - type_converter("string", list) diff --git a/publish.sh b/publish.sh index 7680ce49..65842cd1 100755 --- a/publish.sh +++ b/publish.sh @@ -3,43 +3,90 @@ # Builds the files for distribution and uploads them to PyPI, provided that: # - You are on the main branch and there are no uncommitted changes. # - All the style checks run without errors. -# - All the tests run with errors. +# - All the tests run without errors. # # By default, the script uploads to Test PyPI (test.pypi.org); to upload to the real PyPI, run with -# the argument -r. +# the argument --real-pypi. # -# In either case, you will be asked for username and password. The username should be __token__, -# while the password is the token generated by PyPI for the account. +# Use --force to skip branch and uncommitted changes checks (only allowed for Test PyPI). +# +# Any additional arguments (e.g. --dry-run) are forwarded to uv publish. +# +# The environment variable UV_PUBLISH_TOKEN must be set to the token generated by PyPI for the +# account. set -euf UPLOAD_TO_REAL_PYPI=false +FORCE=false +EXTRA_ARGS=() -while getopts 'r' c; do - case "${c}" in - r) +for arg in "$@"; do + case "${arg}" in + --real-pypi) UPLOAD_TO_REAL_PYPI=true ;; + --force) + FORCE=true + ;; + *) + EXTRA_ARGS+=("${arg}") + ;; esac done -BRANCH=$(git rev-parse --abbrev-ref HEAD) -if [[ "${BRANCH}" != "main" ]]; then - echo "You can only publish from the main branch, but you are currently on '${BRANCH}'." - exit 1; +if [ "${FORCE}" == true ] && [ "${UPLOAD_TO_REAL_PYPI}" == true ]; then + echo "--force can only be used when publishing to Test PyPI." + exit 1 fi -if [ "$(git status --porcelain)" ]; then - echo "You have uncommitted changes. Clean them up before publishing." - exit 1; +if [ "${FORCE}" != true ]; then + BRANCH=$(git rev-parse --abbrev-ref HEAD) + if [[ "${BRANCH}" != "main" ]]; then + echo "You can only publish from the main branch, but you are currently on '${BRANCH}'." + exit 1; + fi + + if [ "$(git status --porcelain)" ]; then + echo "You have uncommitted changes. Clean them up before publishing." + exit 1; + fi fi bash build.sh +if [ -z "${UV_PUBLISH_TOKEN:-}" ]; then + echo "UV_PUBLISH_TOKEN is not set. Export it before publishing." + exit 1 +fi + +if [ "${UPLOAD_TO_REAL_PYPI}" == true ]; then + PUBLISH_INDEX="PyPI (https://pypi.org)" +else + PUBLISH_INDEX="Test PyPI (https://test.pypi.org)" +fi + +echo "" +echo "About to publish to: ${PUBLISH_INDEX}" +if [ ${#EXTRA_ARGS[@]} -gt 0 ]; then + echo "Extra arguments: ${EXTRA_ARGS[*]}" +fi +read -r -p "Do you want to continue? [y/N] " confirm +if [[ "${confirm}" != [yY] ]]; then + echo "Aborted." + exit 0 +fi + if [ "${UPLOAD_TO_REAL_PYPI}" == true ]; then echo "" echo "=== Publishing package to the real PyPI ===" - uv publish + uv publish "${EXTRA_ARGS[@]}" else echo "Publishing to test" - uv publish --publish-url https://test.pypi.org/legacy/ + uv publish --publish-url https://test.pypi.org/legacy/ "${EXTRA_ARGS[@]}" + echo "" + echo "To install from Test PyPI:" + echo " create a virtual environment in an empty directory" + echo " uv venv .venv" + echo " source .venv/bin/activate" + echo " uv pip install --index https://test.pypi.org/simple/ exabel" fi diff --git a/pyproject.toml b/pyproject.toml index ba2ee409..dd0ace41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] -name = "exabel-data-sdk" +name = "exabel" description = "Python SDK for the Exabel Data API" -version = "7.0.0" +version = "8.0.0" license = "MIT" license-files = ["LICENSE"] readme = "README.md" @@ -26,7 +26,7 @@ dependencies = [ "grpcio", "openpyxl", "pandas", - "protobuf>=4", + "protobuf>=6", "requests", "tqdm", ] @@ -48,6 +48,7 @@ athena = ["pyathena", "pyarrow", "sqlalchemy"] [project.urls] Homepage = "https://github.com/Exabel/python-sdk" +Documentation = "https://help.exabel.com" Source = "https://github.com/Exabel/python-sdk" Changelog = "https://github.com/Exabel/python-sdk/releases" @@ -59,13 +60,13 @@ build-backend = "uv_build" package = true [tool.uv.build-backend] -module-name = "exabel_data_sdk" +module-name = "exabel" module-root = "" source-exclude = [ - "exabel_data_sdk/tests/**", + "exabel/tests/**", ] wheel-exclude = [ - "exabel_data_sdk/tests/**", + "exabel/tests/**", ] [tool.mypy] @@ -98,12 +99,12 @@ ignore_errors = true follow_imports = "skip" [[tool.mypy.overrides]] -module = "exabel_data_sdk.stubs.*" +module = "exabel.stubs.*" disallow_untyped_defs = false disable_error_code = ["name-defined"] [tool.ruff] -src = ["exabel_data_sdk"] +src = ["exabel"] force-exclude = true extend-exclude = ["stubs"] line-length = 100 @@ -199,7 +200,7 @@ ignore = [ "**/__init__.py" = ["F401"] # unused-import [tool.ruff.lint.isort] -known-first-party = ["exabel_data_sdk"] +known-first-party = ["exabel"] detect-same-package = false [tool.ruff.lint.pep8-naming] diff --git a/setup.py b/setup.py deleted file mode 100644 index 177bab9e..00000000 --- a/setup.py +++ /dev/null @@ -1,72 +0,0 @@ -import itertools - -import setuptools - -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - -with open("VERSION", "r", encoding="utf-8") as fh: - version = fh.read() - -_SQLALCHEMY_REQUIREMENTS = [ - "sqlalchemy", -] - -_BIGQUERY_REQUIREMENTS = [ - "google-cloud-bigquery", - "sqlalchemy-bigquery", -] - -_SNOWFLAKE_REQUIREMENTS = _SQLALCHEMY_REQUIREMENTS + [ - "snowflake-connector-python[pandas]", - "snowflake-sqlalchemy", -] - -_ATHENA_REQUIREMENTS = _SQLALCHEMY_REQUIREMENTS + [ - "pyathena", - "pyarrow", -] - -extras = { - "snowflake": _SNOWFLAKE_REQUIREMENTS, - "bigquery": _BIGQUERY_REQUIREMENTS, - "athena": _ATHENA_REQUIREMENTS, -} -extras["all"] = list(itertools.chain.from_iterable(extras.values())) - - -setuptools.setup( - name="exabel-data-sdk", - version=version, - author="Exabel", - author_email="support@exabel.com", - description="Python SDK for the Exabel Data API", - license="MIT", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/Exabel/python-sdk", - packages=setuptools.find_packages(exclude=["exabel_data_sdk.tests*"]), - install_requires=[ - "google-api-core>1.31.3", - "googleapis-common-protos>=1.56.0", - "grpcio", - "openpyxl", - "pandas", - "protobuf>=4", - "requests", - "tqdm", - ], - extras_require=extras, - python_requires=">=3.10", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Financial and Insurance Industry", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], -) diff --git a/style.sh b/style.sh index d0ff3f8b..334e8983 100755 --- a/style.sh +++ b/style.sh @@ -4,10 +4,10 @@ set -euf echo "Running mypy." -mypy exabel_data_sdk +mypy exabel echo "Check style with ruff linter." -ruff check exabel_data_sdk +ruff check exabel echo "Check formatting with ruff formatter." -ruff format --check exabel_data_sdk +ruff format --check exabel diff --git a/test_installed.sh b/test_installed.sh index 48d2b2be..b1691da5 100755 --- a/test_installed.sh +++ b/test_installed.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -mkdir -p tests/exabel_data_sdk -cp -r ./exabel_data_sdk/tests ./tests/exabel_data_sdk/ +mkdir -p tests/exabel +cp -r ./exabel/tests ./tests/exabel/ # Workaround for running tests in sub-package -PYTHON_SITE_PACKAGE=$(pip show exabel_data_sdk|grep Location|cut -f 2 -d ' ') -echo "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" >> ${PYTHON_SITE_PACKAGE}/exabel_data_sdk/__init__.py +PYTHON_SITE_PACKAGE=$(pip show exabel|grep Location|cut -f 2 -d ' ') +echo "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" >> ${PYTHON_SITE_PACKAGE}/exabel/__init__.py echo "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" > tests/__init__.py -echo "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" > tests/exabel_data_sdk/__init__.py +echo "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" > tests/exabel/__init__.py cd ./tests/ -pytest ./exabel_data_sdk/tests +pytest ./exabel/tests diff --git a/uv.lock b/uv.lock index d857d862..0e1642d7 100644 --- a/uv.lock +++ b/uv.lock @@ -313,8 +313,8 @@ wheels = [ ] [[package]] -name = "exabel-data-sdk" -version = "7.0.0" +name = "exabel" +version = "8.0.0" source = { editable = "." } dependencies = [ { name = "google-api-core" }, @@ -360,7 +360,7 @@ requires-dist = [ { name = "grpcio" }, { name = "openpyxl" }, { name = "pandas" }, - { name = "protobuf", specifier = ">=4" }, + { name = "protobuf", specifier = ">=6" }, { name = "pyarrow", marker = "extra == 'athena'" }, { name = "pyathena", marker = "extra == 'athena'" }, { name = "requests" }, @@ -547,6 +547,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fe/65/5b235b40581ad75ab97dcd8b4218022ae8e3ab77c13c919f1a1dfe9171fd/greenlet-3.3.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:04bee4775f40ecefcdaa9d115ab44736cd4b9c5fba733575bfe9379419582e13", size = 273723, upload-time = "2026-01-23T15:30:37.521Z" }, { url = "https://files.pythonhosted.org/packages/ce/ad/eb4729b85cba2d29499e0a04ca6fbdd8f540afd7be142fd571eea43d712f/greenlet-3.3.1-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:50e1457f4fed12a50e427988a07f0f9df53cf0ee8da23fab16e6732c2ec909d4", size = 574874, upload-time = "2026-01-23T16:00:54.551Z" }, { url = "https://files.pythonhosted.org/packages/87/32/57cad7fe4c8b82fdaa098c89498ef85ad92dfbb09d5eb713adedfc2ae1f5/greenlet-3.3.1-cp310-cp310-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:070472cd156f0656f86f92e954591644e158fd65aa415ffbe2d44ca77656a8f5", size = 586309, upload-time = "2026-01-23T16:05:25.18Z" }, + { url = "https://files.pythonhosted.org/packages/66/66/f041005cb87055e62b0d68680e88ec1a57f4688523d5e2fb305841bc8307/greenlet-3.3.1-cp310-cp310-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1108b61b06b5224656121c3c8ee8876161c491cbe74e5c519e0634c837cf93d5", size = 597461, upload-time = "2026-01-23T16:15:51.943Z" }, { url = "https://files.pythonhosted.org/packages/87/eb/8a1ec2da4d55824f160594a75a9d8354a5fe0a300fb1c48e7944265217e1/greenlet-3.3.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3a300354f27dd86bae5fbf7002e6dd2b3255cd372e9242c933faf5e859b703fe", size = 586985, upload-time = "2026-01-23T15:32:47.968Z" }, { url = "https://files.pythonhosted.org/packages/15/1c/0621dd4321dd8c351372ee8f9308136acb628600658a49be1b7504208738/greenlet-3.3.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e84b51cbebf9ae573b5fbd15df88887815e3253fc000a7d0ff95170e8f7e9729", size = 1547271, upload-time = "2026-01-23T16:04:18.977Z" }, { url = "https://files.pythonhosted.org/packages/9d/53/24047f8924c83bea7a59c8678d9571209c6bfe5f4c17c94a78c06024e9f2/greenlet-3.3.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0093bd1a06d899892427217f0ff2a3c8f306182b8c754336d32e2d587c131b4", size = 1613427, upload-time = "2026-01-23T15:33:44.428Z" }, @@ -554,6 +555,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/e8/2e1462c8fdbe0f210feb5ac7ad2d9029af8be3bf45bd9fa39765f821642f/greenlet-3.3.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:5fd23b9bc6d37b563211c6abbb1b3cab27db385a4449af5c32e932f93017080c", size = 274974, upload-time = "2026-01-23T15:31:02.891Z" }, { url = "https://files.pythonhosted.org/packages/7e/a8/530a401419a6b302af59f67aaf0b9ba1015855ea7e56c036b5928793c5bd/greenlet-3.3.1-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:09f51496a0bfbaa9d74d36a52d2580d1ef5ed4fdfcff0a73730abfbbbe1403dd", size = 577175, upload-time = "2026-01-23T16:00:56.213Z" }, { url = "https://files.pythonhosted.org/packages/8e/89/7e812bb9c05e1aaef9b597ac1d0962b9021d2c6269354966451e885c4e6b/greenlet-3.3.1-cp311-cp311-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cb0feb07fe6e6a74615ee62a880007d976cf739b6669cce95daa7373d4fc69c5", size = 590401, upload-time = "2026-01-23T16:05:26.365Z" }, + { url = "https://files.pythonhosted.org/packages/70/ae/e2d5f0e59b94a2269b68a629173263fa40b63da32f5c231307c349315871/greenlet-3.3.1-cp311-cp311-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:67ea3fc73c8cd92f42467a72b75e8f05ed51a0e9b1d15398c913416f2dafd49f", size = 601161, upload-time = "2026-01-23T16:15:53.456Z" }, { url = "https://files.pythonhosted.org/packages/5c/ae/8d472e1f5ac5efe55c563f3eabb38c98a44b832602e12910750a7c025802/greenlet-3.3.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:39eda9ba259cc9801da05351eaa8576e9aa83eb9411e8f0c299e05d712a210f2", size = 590272, upload-time = "2026-01-23T15:32:49.411Z" }, { url = "https://files.pythonhosted.org/packages/a8/51/0fde34bebfcadc833550717eade64e35ec8738e6b097d5d248274a01258b/greenlet-3.3.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e2e7e882f83149f0a71ac822ebf156d902e7a5d22c9045e3e0d1daf59cee2cc9", size = 1550729, upload-time = "2026-01-23T16:04:20.867Z" }, { url = "https://files.pythonhosted.org/packages/16/c9/2fb47bee83b25b119d5a35d580807bb8b92480a54b68fef009a02945629f/greenlet-3.3.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:80aa4d79eb5564f2e0a6144fcc744b5a37c56c4a92d60920720e99210d88db0f", size = 1615552, upload-time = "2026-01-23T15:33:45.743Z" }, @@ -562,6 +564,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f9/c8/9d76a66421d1ae24340dfae7e79c313957f6e3195c144d2c73333b5bfe34/greenlet-3.3.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:7e806ca53acf6d15a888405880766ec84721aa4181261cd11a457dfe9a7a4975", size = 276443, upload-time = "2026-01-23T15:30:10.066Z" }, { url = "https://files.pythonhosted.org/packages/81/99/401ff34bb3c032d1f10477d199724f5e5f6fbfb59816ad1455c79c1eb8e7/greenlet-3.3.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d842c94b9155f1c9b3058036c24ffb8ff78b428414a19792b2380be9cecf4f36", size = 597359, upload-time = "2026-01-23T16:00:57.394Z" }, { url = "https://files.pythonhosted.org/packages/2b/bc/4dcc0871ed557792d304f50be0f7487a14e017952ec689effe2180a6ff35/greenlet-3.3.1-cp312-cp312-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:20fedaadd422fa02695f82093f9a98bad3dab5fcda793c658b945fcde2ab27ba", size = 607805, upload-time = "2026-01-23T16:05:28.068Z" }, + { url = "https://files.pythonhosted.org/packages/3b/cd/7a7ca57588dac3389e97f7c9521cb6641fd8b6602faf1eaa4188384757df/greenlet-3.3.1-cp312-cp312-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c620051669fd04ac6b60ebc70478210119c56e2d5d5df848baec4312e260e4ca", size = 622363, upload-time = "2026-01-23T16:15:54.754Z" }, { url = "https://files.pythonhosted.org/packages/cf/05/821587cf19e2ce1f2b24945d890b164401e5085f9d09cbd969b0c193cd20/greenlet-3.3.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:14194f5f4305800ff329cbf02c5fcc88f01886cadd29941b807668a45f0d2336", size = 609947, upload-time = "2026-01-23T15:32:51.004Z" }, { url = "https://files.pythonhosted.org/packages/a4/52/ee8c46ed9f8babaa93a19e577f26e3d28a519feac6350ed6f25f1afee7e9/greenlet-3.3.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7b2fe4150a0cf59f847a67db8c155ac36aed89080a6a639e9f16df5d6c6096f1", size = 1567487, upload-time = "2026-01-23T16:04:22.125Z" }, { url = "https://files.pythonhosted.org/packages/8f/7c/456a74f07029597626f3a6db71b273a3632aecb9afafeeca452cfa633197/greenlet-3.3.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:49f4ad195d45f4a66a0eb9c1ba4832bb380570d361912fa3554746830d332149", size = 1636087, upload-time = "2026-01-23T15:33:47.486Z" }, @@ -570,6 +573,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/ab/d26750f2b7242c2b90ea2ad71de70cfcd73a948a49513188a0fc0d6fc15a/greenlet-3.3.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:7ab327905cabb0622adca5971e488064e35115430cec2c35a50fd36e72a315b3", size = 275205, upload-time = "2026-01-23T15:30:24.556Z" }, { url = "https://files.pythonhosted.org/packages/10/d3/be7d19e8fad7c5a78eeefb2d896a08cd4643e1e90c605c4be3b46264998f/greenlet-3.3.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:65be2f026ca6a176f88fb935ee23c18333ccea97048076aef4db1ef5bc0713ac", size = 599284, upload-time = "2026-01-23T16:00:58.584Z" }, { url = "https://files.pythonhosted.org/packages/ae/21/fe703aaa056fdb0f17e5afd4b5c80195bbdab701208918938bd15b00d39b/greenlet-3.3.1-cp313-cp313-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7a3ae05b3d225b4155bda56b072ceb09d05e974bc74be6c3fc15463cf69f33fd", size = 610274, upload-time = "2026-01-23T16:05:29.312Z" }, + { url = "https://files.pythonhosted.org/packages/06/00/95df0b6a935103c0452dad2203f5be8377e551b8466a29650c4c5a5af6cc/greenlet-3.3.1-cp313-cp313-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:12184c61e5d64268a160226fb4818af4df02cfead8379d7f8b99a56c3a54ff3e", size = 624375, upload-time = "2026-01-23T16:15:55.915Z" }, { url = "https://files.pythonhosted.org/packages/cb/86/5c6ab23bb3c28c21ed6bebad006515cfe08b04613eb105ca0041fecca852/greenlet-3.3.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6423481193bbbe871313de5fd06a082f2649e7ce6e08015d2a76c1e9186ca5b3", size = 612904, upload-time = "2026-01-23T15:32:52.317Z" }, { url = "https://files.pythonhosted.org/packages/c2/f3/7949994264e22639e40718c2daf6f6df5169bf48fb038c008a489ec53a50/greenlet-3.3.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:33a956fe78bbbda82bfc95e128d61129b32d66bcf0a20a1f0c08aa4839ffa951", size = 1567316, upload-time = "2026-01-23T16:04:23.316Z" }, { url = "https://files.pythonhosted.org/packages/8d/6e/d73c94d13b6465e9f7cd6231c68abde838bb22408596c05d9059830b7872/greenlet-3.3.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4b065d3284be43728dd280f6f9a13990b56470b81be20375a207cdc814a983f2", size = 1636549, upload-time = "2026-01-23T15:33:48.643Z" }, @@ -578,6 +582,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ae/fb/011c7c717213182caf78084a9bea51c8590b0afda98001f69d9f853a495b/greenlet-3.3.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:bd59acd8529b372775cd0fcbc5f420ae20681c5b045ce25bd453ed8455ab99b5", size = 275737, upload-time = "2026-01-23T15:32:16.889Z" }, { url = "https://files.pythonhosted.org/packages/41/2e/a3a417d620363fdbb08a48b1dd582956a46a61bf8fd27ee8164f9dfe87c2/greenlet-3.3.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b31c05dd84ef6871dd47120386aed35323c944d86c3d91a17c4b8d23df62f15b", size = 646422, upload-time = "2026-01-23T16:01:00.354Z" }, { url = "https://files.pythonhosted.org/packages/b4/09/c6c4a0db47defafd2d6bab8ddfe47ad19963b4e30f5bed84d75328059f8c/greenlet-3.3.1-cp314-cp314-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:02925a0bfffc41e542c70aa14c7eda3593e4d7e274bfcccca1827e6c0875902e", size = 658219, upload-time = "2026-01-23T16:05:30.956Z" }, + { url = "https://files.pythonhosted.org/packages/e2/89/b95f2ddcc5f3c2bc09c8ee8d77be312df7f9e7175703ab780f2014a0e781/greenlet-3.3.1-cp314-cp314-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3e0f3878ca3a3ff63ab4ea478585942b53df66ddde327b59ecb191b19dbbd62d", size = 671455, upload-time = "2026-01-23T16:15:57.232Z" }, { url = "https://files.pythonhosted.org/packages/80/38/9d42d60dffb04b45f03dbab9430898352dba277758640751dc5cc316c521/greenlet-3.3.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34a729e2e4e4ffe9ae2408d5ecaf12f944853f40ad724929b7585bca808a9d6f", size = 660237, upload-time = "2026-01-23T15:32:53.967Z" }, { url = "https://files.pythonhosted.org/packages/96/61/373c30b7197f9e756e4c81ae90a8d55dc3598c17673f91f4d31c3c689c3f/greenlet-3.3.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:aec9ab04e82918e623415947921dea15851b152b822661cce3f8e4393c3df683", size = 1615261, upload-time = "2026-01-23T16:04:25.066Z" }, { url = "https://files.pythonhosted.org/packages/fd/d3/ca534310343f5945316f9451e953dcd89b36fe7a19de652a1dc5a0eeef3f/greenlet-3.3.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:71c767cf281a80d02b6c1bdc41c9468e1f5a494fb11bc8688c360524e273d7b1", size = 1683719, upload-time = "2026-01-23T15:33:50.61Z" }, @@ -586,6 +591,7 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/28/24/cbbec49bacdcc9ec652a81d3efef7b59f326697e7edf6ed775a5e08e54c2/greenlet-3.3.1-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:3e63252943c921b90abb035ebe9de832c436401d9c45f262d80e2d06cc659242", size = 282706, upload-time = "2026-01-23T15:33:05.525Z" }, { url = "https://files.pythonhosted.org/packages/86/2e/4f2b9323c144c4fe8842a4e0d92121465485c3c2c5b9e9b30a52e80f523f/greenlet-3.3.1-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:76e39058e68eb125de10c92524573924e827927df5d3891fbc97bd55764a8774", size = 651209, upload-time = "2026-01-23T16:01:01.517Z" }, { url = "https://files.pythonhosted.org/packages/d9/87/50ca60e515f5bb55a2fbc5f0c9b5b156de7d2fc51a0a69abc9d23914a237/greenlet-3.3.1-cp314-cp314t-manylinux_2_24_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c9f9d5e7a9310b7a2f416dd13d2e3fd8b42d803968ea580b7c0f322ccb389b97", size = 654300, upload-time = "2026-01-23T16:05:32.199Z" }, + { url = "https://files.pythonhosted.org/packages/7c/25/c51a63f3f463171e09cb586eb64db0861eb06667ab01a7968371a24c4f3b/greenlet-3.3.1-cp314-cp314t-manylinux_2_24_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4b9721549a95db96689458a1e0ae32412ca18776ed004463df3a9299c1b257ab", size = 662574, upload-time = "2026-01-23T16:15:58.364Z" }, { url = "https://files.pythonhosted.org/packages/1d/94/74310866dfa2b73dd08659a3d18762f83985ad3281901ba0ee9a815194fb/greenlet-3.3.1-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:92497c78adf3ac703b57f1e3813c2d874f27f71a178f9ea5887855da413cd6d2", size = 653842, upload-time = "2026-01-23T15:32:55.671Z" }, { url = "https://files.pythonhosted.org/packages/97/43/8bf0ffa3d498eeee4c58c212a3905dd6146c01c8dc0b0a046481ca29b18c/greenlet-3.3.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ed6b402bc74d6557a705e197d47f9063733091ed6357b3de33619d8a8d93ac53", size = 1614917, upload-time = "2026-01-23T16:04:26.276Z" }, { url = "https://files.pythonhosted.org/packages/89/90/a3be7a5f378fc6e84abe4dcfb2ba32b07786861172e502388b4c90000d1b/greenlet-3.3.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:59913f1e5ada20fde795ba906916aea25d442abcc0593fba7e26c92b7ad76249", size = 1676092, upload-time = "2026-01-23T15:33:52.176Z" },