diff --git a/lib/dl_connector_bitrix_gds/dl_connector_bitrix_gds/core/data_source.py b/lib/dl_connector_bitrix_gds/dl_connector_bitrix_gds/core/data_source.py index b8b02c330..964d175d2 100644 --- a/lib/dl_connector_bitrix_gds/dl_connector_bitrix_gds/core/data_source.py +++ b/lib/dl_connector_bitrix_gds/dl_connector_bitrix_gds/core/data_source.py @@ -1,5 +1,6 @@ from __future__ import annotations +import os from typing import ( ClassVar, Optional, @@ -21,8 +22,23 @@ ) +def _get_supported_join_types() -> frozenset[JoinType]: + flag = os.environ.get("EXPERIMENTAL_BITRIX_ENABLE_JOIN_TYPES", "false") + if flag.lower() == "true": + return frozenset( + { + JoinType.inner, + JoinType.left, + JoinType.full, + JoinType.right, + } + ) + + return frozenset() + + class BitrixGDSDataSource(PseudoSQLDataSource): - supported_join_types: ClassVar[frozenset[JoinType]] = frozenset() + supported_join_types: ClassVar[frozenset[JoinType]] = _get_supported_join_types() conn_type = CONNECTION_TYPE_BITRIX24 @property