Skip to content

Commit 19078d7

Browse files
ya-kcDataLens Team
andauthored
Sync bbb1789f9a607605ebf0641f00a67448c55eb29f (#1)
Co-authored-by: DataLens Team <datalens-opensource@yandex-team.ru>
1 parent 612d4ec commit 19078d7

799 files changed

Lines changed: 27834 additions & 10942 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bumpversion.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[bumpversion]
2+
current_version = 1.0.0
3+
commit = False
4+
tag = False
5+
6+
[bumpversion:file:lib/dl_version/dl_version/__init__.py]
7+
search = __version__ = "{current_version}"
8+
replace = __version__ = "{new_version}"
9+
10+
[bumpversion:file:lib/dl_version/pyproject.toml]
11+
search = version = "{current_version}"
12+
replace = version = "{new_version}"

ci/gh_list_changes.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ set -x
44

55
BASE_SHA="${1:-main}" # If outside PR, defaulting to main
66
HEAD_SHA="${2:-$(git symbolic-ref --short HEAD)}" # Default to the current branch
7+
DIFF_FILTER="${DIFF_FILTER:-ACMRTD}"
78

89

910
DIVERGE_COMMIT=$(git merge-base $BASE_SHA $HEAD_SHA)
10-
CHANGED_FILES=$(git diff --no-commit-id --name-only --diff-filter=ACMRTD $DIVERGE_COMMIT $HEAD_SHA || echo "")
11+
CHANGED_FILES=$(git diff --no-commit-id --name-only --diff-filter=$DIFF_FILTER $DIVERGE_COMMIT $HEAD_SHA || echo "")
1112

1213
echo "$CHANGED_FILES"
14+
15+
set +x

dl-repo.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
dl_repo:
44
fs_editor: git
55

6+
default_boilerplate_path: lib/dl_package_boilerplate
7+
68
package_types:
79
- type: terrarium # Repository tools
810
root_path: terrarium
9-
boilerplate_path: lib/dl_package_boilerplate
1011

1112
- type: lib # Main libraries
1213
root_path: lib
13-
boilerplate_path: lib/dl_package_boilerplate
1414
tags:
1515
- main_dependency_group
1616

1717
- type: app # Apps
1818
root_path: app
19-
boilerplate_path: lib/dl_package_boilerplate
2019
tags:
2120
- main_dependency_group
2221
- own_dependency_group
@@ -40,3 +39,8 @@ dl_repo:
4039

4140
plugins:
4241
- type: dependency_registration
42+
43+
edit_exclude_masks: # Files at paths that match these patterns (via re.match) will not be edited
44+
- ".*\\.mo"
45+
- ".*\\.xlsx"
46+
- ".*/__pycache__"

docker_build/bake_code_gen.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
target "gen_antlr" {
22
contexts = {
3-
src = "${DL_B_PROJECT_ROOT}/lib/bi_formula/bi_formula/parser/antlr/"
3+
src = "${DL_B_PROJECT_ROOT}/lib/dl_formula/dl_formula/parser/antlr/"
44
}
55
dockerfile = "./target_gen_antlr/Dockerfile"
6-
output = ["type=local,dest=${DL_B_PROJECT_ROOT}/lib/bi_formula/bi_formula/parser/antlr/gen"]
6+
output = ["type=local,dest=${DL_B_PROJECT_ROOT}/lib/dl_formula/dl_formula/parser/antlr/gen"]
77
}

docker_build/target_gen_antlr/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN apk add --no-cache sed python3 py3-pip
1111
RUN pip install pycodestyle==2.10.0 autopep8==2.0.2 autoflake isort
1212

1313
ENV AUTOGEN_DIR=/gen
14-
ENV ANTLR_PY_PACKAGE="bi_formula.parser.antlr.gen"
14+
ENV ANTLR_PY_PACKAGE="dl_formula.parser.antlr.gen"
1515

1616
COPY --from=src . /src
1717

lib/dl_api_client/dl_api_client/dsmaker/api/schemas/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
TreeRoleSpec,
3535
)
3636
from dl_constants.enums import (
37-
BIType,
3837
FieldRole,
3938
FieldType,
4039
FieldVisibility,
@@ -46,6 +45,7 @@
4645
QueryBlockPlacementType,
4746
QueryItemRefType,
4847
RangeType,
48+
UserDataType,
4949
WhereClauseOperation,
5050
)
5151

@@ -184,7 +184,7 @@ class LegendItemSchema(DefaultSchema[LegendItem]):
184184
id = ma_fields.String()
185185
title = ma_fields.String()
186186
role_spec = ma_fields.Nested(RoleSpecSchema)
187-
data_type = ma_fields.Enum(BIType)
187+
data_type = ma_fields.Enum(UserDataType)
188188
field_type = ma_fields.Enum(FieldType)
189189
item_type = ma_fields.Enum(LegendItemType)
190190

lib/dl_api_client/dl_api_client/dsmaker/api/schemas/dataset.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@
5757
from dl_constants.enums import (
5858
AggregationFunction,
5959
BinaryJoinOperator,
60-
BIType,
6160
CalcMode,
6261
ComponentErrorLevel,
6362
ComponentType,
6463
ConditionPartCalcMode,
65-
CreateDSFrom,
64+
DataSourceType,
6665
FieldType,
6766
JoinConditionType,
6867
JoinType,
6968
ManagedBy,
7069
ParameterValueConstraintType,
70+
UserDataType,
7171
WhereClauseOperation,
7272
)
7373
from dl_model_tools.schema.dynamic_enum_field import DynamicEnumField
@@ -157,22 +157,22 @@ class ValueSchema(OneOfSchemaWithDumpLoadHooks):
157157
CONTEXT_KEY = "bi_value_type"
158158
type_field = "type"
159159
type_schemas = {
160-
BIType.string.name: StringValueSchema,
161-
BIType.integer.name: IntegerValueSchema,
162-
BIType.float.name: FloatValueSchema,
163-
BIType.date.name: DateValueSchema,
164-
BIType.datetime.name: DateTimeValueSchema,
165-
BIType.datetimetz.name: DateTimeTZValueSchema,
166-
BIType.genericdatetime.name: GenericDateTimeValueSchema,
167-
BIType.boolean.name: BooleanValueSchema,
168-
BIType.geopoint.name: GeoPointValueSchema,
169-
BIType.geopolygon.name: GeoPolygonValueSchema,
170-
BIType.uuid.name: UuidValueSchema,
171-
BIType.markup.name: MarkupValueSchema,
172-
BIType.array_str.name: ArrayStrValueSchema,
173-
BIType.array_int.name: ArrayIntValueSchema,
174-
BIType.array_float.name: ArrayFloatValueSchema,
175-
BIType.tree_str.name: TreeStrParameterValue,
160+
UserDataType.string.name: StringValueSchema,
161+
UserDataType.integer.name: IntegerValueSchema,
162+
UserDataType.float.name: FloatValueSchema,
163+
UserDataType.date.name: DateValueSchema,
164+
UserDataType.datetime.name: DateTimeValueSchema,
165+
UserDataType.datetimetz.name: DateTimeTZValueSchema,
166+
UserDataType.genericdatetime.name: GenericDateTimeValueSchema,
167+
UserDataType.boolean.name: BooleanValueSchema,
168+
UserDataType.geopoint.name: GeoPointValueSchema,
169+
UserDataType.geopolygon.name: GeoPolygonValueSchema,
170+
UserDataType.uuid.name: UuidValueSchema,
171+
UserDataType.markup.name: MarkupValueSchema,
172+
UserDataType.array_str.name: ArrayStrValueSchema,
173+
UserDataType.array_int.name: ArrayIntValueSchema,
174+
UserDataType.array_float.name: ArrayFloatValueSchema,
175+
UserDataType.tree_str.name: TreeStrParameterValue,
176176
}
177177

178178
@pre_load(pass_many=False)
@@ -227,10 +227,10 @@ class ResultFieldSchema(DefaultSchema[ResultField]):
227227
hidden = ma_fields.Boolean(load_default=False)
228228
description = ma_fields.String()
229229
formula = ma_fields.String(load_default="")
230-
initial_data_type = ma_fields.Enum(BIType, allow_none=True)
231-
cast = ma_fields.Enum(BIType)
230+
initial_data_type = ma_fields.Enum(UserDataType, allow_none=True)
231+
cast = ma_fields.Enum(UserDataType)
232232
type = ma_fields.Enum(FieldType, readonly=True)
233-
data_type = ma_fields.Enum(BIType, allow_none=True)
233+
data_type = ma_fields.Enum(UserDataType, allow_none=True)
234234
valid = ma_fields.Boolean(allow_none=True)
235235
avatar_id = ma_fields.String(allow_none=True)
236236
aggregation = ma_fields.Enum(AggregationFunction, load_default=AggregationFunction.none.name)
@@ -280,7 +280,7 @@ class ColumnSchema(DefaultSchema[Column]):
280280
name = ma_fields.String()
281281
title = ma_fields.String()
282282
native_type = ma_fields.Dict(allow_none=True)
283-
user_type = ma_fields.Enum(BIType)
283+
user_type = ma_fields.Enum(UserDataType)
284284
description = ma_fields.String(dump_default="", allow_none=True)
285285
has_auto_aggregation = ma_fields.Boolean(dump_default=False, allow_none=True)
286286
lock_aggregation = ma_fields.Boolean(dump_default=False, allow_none=True)
@@ -293,7 +293,7 @@ class DataSourceSchema(DefaultSchema[DataSource]):
293293
id = ma_fields.String()
294294
title = ma_fields.String()
295295
connection_id = ma_fields.String(allow_none=True)
296-
source_type = DynamicEnumField(CreateDSFrom)
296+
source_type = DynamicEnumField(DataSourceType)
297297
raw_schema = ma_fields.Nested(ColumnSchema, allow_none=True, required=False, many=True)
298298
index_info_set = ma_fields.List(ma_fields.Dict, allow_none=True)
299299
parameters = ma_fields.Dict()

lib/dl_api_client/dl_api_client/dsmaker/primitives.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@
2626
from dl_constants.enums import (
2727
AggregationFunction,
2828
BinaryJoinOperator,
29-
BIType,
3029
CalcMode,
3130
ComponentErrorLevel,
3231
ComponentType,
3332
ConditionPartCalcMode,
34-
CreateDSFrom,
33+
DataSourceType,
3534
FieldRole,
3635
FieldType,
3736
FieldVisibility,
@@ -45,6 +44,7 @@
4544
QueryBlockPlacementType,
4645
QueryItemRefType,
4746
RangeType,
47+
UserDataType,
4848
WhereClauseOperation,
4949
)
5050

@@ -215,7 +215,7 @@ def __eq__(self, other: Any) -> bool:
215215
@attr.s
216216
class DataSource(ApiProxyObject):
217217
connection_id: str = attr.ib(default=None)
218-
source_type: Optional[CreateDSFrom] = attr.ib(default=None, converter=CreateDSFrom.normalize)
218+
source_type: Optional[DataSourceType] = attr.ib(default=None, converter=DataSourceType.normalize)
219219
parameters: dict = attr.ib(default=None)
220220
raw_schema: list = attr.ib(factory=list)
221221
index_info_set: Optional[list] = attr.ib(default=None)
@@ -331,7 +331,7 @@ class _Column:
331331
# use attr.s on superclass of the "real" class so that comparison methods from ConditionMakerMixin are used
332332
title: str = attr.ib(default=None)
333333
name: str = attr.ib(default=None)
334-
user_type: Optional[BIType] = attr.ib(default=None, converter=BIType.normalize)
334+
user_type: Optional[UserDataType] = attr.ib(default=None, converter=UserDataType.normalize)
335335
native_type: Optional[dict] = attr.ib(default=None)
336336
nullable: bool = attr.ib(default=True)
337337
description: str = attr.ib(default="")
@@ -369,88 +369,88 @@ def on(self, *conditions: List[JoinCondition]): # type: ignore # TODO: fix
369369

370370
@attr.s
371371
class ParameterValue(Generic[_INNER_TYPE]):
372-
type: BIType
372+
type: UserDataType
373373
value: _INNER_TYPE = attr.ib()
374374

375375

376376
@attr.s
377377
class StringParameterValue(ParameterValue[str]):
378-
type: BIType = BIType.string
378+
type: UserDataType = UserDataType.string
379379

380380

381381
@attr.s
382382
class IntegerParameterValue(ParameterValue[int]):
383-
type: BIType = BIType.integer
383+
type: UserDataType = UserDataType.integer
384384

385385

386386
@attr.s
387387
class FloatParameterValue(ParameterValue[float]):
388-
type: BIType = BIType.float
388+
type: UserDataType = UserDataType.float
389389

390390

391391
@attr.s
392392
class DateParameterValue(ParameterValue[date]):
393-
type: BIType = BIType.date
393+
type: UserDataType = UserDataType.date
394394

395395

396396
@attr.s
397397
class DateTimeParameterValue(ParameterValue[datetime]):
398-
type: BIType = BIType.datetime
398+
type: UserDataType = UserDataType.datetime
399399

400400

401401
@attr.s
402402
class DateTimeTZParameterValue(ParameterValue[datetime]):
403-
type: BIType = BIType.datetimetz
403+
type: UserDataType = UserDataType.datetimetz
404404

405405

406406
@attr.s
407407
class GenericDateTimeParameterValue(ParameterValue[datetime]):
408-
type: BIType = BIType.genericdatetime
408+
type: UserDataType = UserDataType.genericdatetime
409409

410410

411411
@attr.s
412412
class BooleanParameterValue(ParameterValue[bool]):
413-
type: BIType = BIType.boolean
413+
type: UserDataType = UserDataType.boolean
414414

415415

416416
@attr.s
417417
class GeoPointParameterValue(ParameterValue[List[Union[int, float]]]):
418-
type: BIType = BIType.geopoint
418+
type: UserDataType = UserDataType.geopoint
419419

420420

421421
@attr.s
422422
class GeoPolygonParameterValue(ParameterValue[List[List[List[Union[int, float]]]]]):
423-
type: BIType = BIType.geopolygon
423+
type: UserDataType = UserDataType.geopolygon
424424

425425

426426
@attr.s
427427
class UuidParameterValue(ParameterValue[str]):
428-
type: BIType = BIType.uuid
428+
type: UserDataType = UserDataType.uuid
429429

430430

431431
@attr.s
432432
class MarkupParameterValue(ParameterValue[str]):
433-
type: BIType = BIType.markup
433+
type: UserDataType = UserDataType.markup
434434

435435

436436
@attr.s
437437
class ArrayStrParameterValue(ParameterValue[List[str]]):
438-
type: BIType = BIType.array_str
438+
type: UserDataType = UserDataType.array_str
439439

440440

441441
@attr.s
442442
class ArrayIntParameterValue(ParameterValue[List[int]]):
443-
type: BIType = BIType.array_int
443+
type: UserDataType = UserDataType.array_int
444444

445445

446446
@attr.s
447447
class ArrayFloatParameterValue(ParameterValue[List[float]]):
448-
type: BIType = BIType.array_float
448+
type: UserDataType = UserDataType.array_float
449449

450450

451451
@attr.s
452452
class TreeStrParameterValue(ParameterValue[List[str]]):
453-
type: BIType = BIType.tree_str
453+
type: UserDataType = UserDataType.tree_str
454454

455455

456456
@attr.s
@@ -517,9 +517,9 @@ class _ResultField(ApiProxyObject):
517517
hidden: bool = attr.ib(default=False)
518518
description: str = attr.ib(default="")
519519
formula: str = attr.ib(default="")
520-
initial_data_type: Optional[BIType] = attr.ib(default=None, converter=BIType.normalize)
521-
cast: Optional[BIType] = attr.ib(default=None, converter=BIType.normalize)
522-
data_type: Optional[BIType] = attr.ib(default=None, converter=BIType.normalize)
520+
initial_data_type: Optional[UserDataType] = attr.ib(default=None, converter=UserDataType.normalize)
521+
cast: Optional[UserDataType] = attr.ib(default=None, converter=UserDataType.normalize)
522+
data_type: Optional[UserDataType] = attr.ib(default=None, converter=UserDataType.normalize)
523523
valid: bool = attr.ib(default=True)
524524
has_auto_aggregation: bool = attr.ib(default=False)
525525
lock_aggregation: bool = attr.ib(default=False)
@@ -728,7 +728,7 @@ class LegendItem(LegendItemBase): # noqa
728728
legend_item_id: int = attr.ib(kw_only=True) # redefine as strictly not None
729729
id: str = attr.ib(kw_only=True)
730730
title: str = attr.ib(kw_only=True)
731-
data_type: BIType = attr.ib(kw_only=True)
731+
data_type: UserDataType = attr.ib(kw_only=True)
732732
field_type: FieldType = attr.ib(kw_only=True)
733733
item_type: LegendItemType = attr.ib(kw_only=True)
734734

0 commit comments

Comments
 (0)