|
26 | 26 | from dl_constants.enums import ( |
27 | 27 | AggregationFunction, |
28 | 28 | BinaryJoinOperator, |
29 | | - BIType, |
30 | 29 | CalcMode, |
31 | 30 | ComponentErrorLevel, |
32 | 31 | ComponentType, |
33 | 32 | ConditionPartCalcMode, |
34 | | - CreateDSFrom, |
| 33 | + DataSourceType, |
35 | 34 | FieldRole, |
36 | 35 | FieldType, |
37 | 36 | FieldVisibility, |
|
45 | 44 | QueryBlockPlacementType, |
46 | 45 | QueryItemRefType, |
47 | 46 | RangeType, |
| 47 | + UserDataType, |
48 | 48 | WhereClauseOperation, |
49 | 49 | ) |
50 | 50 |
|
@@ -215,7 +215,7 @@ def __eq__(self, other: Any) -> bool: |
215 | 215 | @attr.s |
216 | 216 | class DataSource(ApiProxyObject): |
217 | 217 | 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) |
219 | 219 | parameters: dict = attr.ib(default=None) |
220 | 220 | raw_schema: list = attr.ib(factory=list) |
221 | 221 | index_info_set: Optional[list] = attr.ib(default=None) |
@@ -331,7 +331,7 @@ class _Column: |
331 | 331 | # use attr.s on superclass of the "real" class so that comparison methods from ConditionMakerMixin are used |
332 | 332 | title: str = attr.ib(default=None) |
333 | 333 | 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) |
335 | 335 | native_type: Optional[dict] = attr.ib(default=None) |
336 | 336 | nullable: bool = attr.ib(default=True) |
337 | 337 | description: str = attr.ib(default="") |
@@ -369,88 +369,88 @@ def on(self, *conditions: List[JoinCondition]): # type: ignore # TODO: fix |
369 | 369 |
|
370 | 370 | @attr.s |
371 | 371 | class ParameterValue(Generic[_INNER_TYPE]): |
372 | | - type: BIType |
| 372 | + type: UserDataType |
373 | 373 | value: _INNER_TYPE = attr.ib() |
374 | 374 |
|
375 | 375 |
|
376 | 376 | @attr.s |
377 | 377 | class StringParameterValue(ParameterValue[str]): |
378 | | - type: BIType = BIType.string |
| 378 | + type: UserDataType = UserDataType.string |
379 | 379 |
|
380 | 380 |
|
381 | 381 | @attr.s |
382 | 382 | class IntegerParameterValue(ParameterValue[int]): |
383 | | - type: BIType = BIType.integer |
| 383 | + type: UserDataType = UserDataType.integer |
384 | 384 |
|
385 | 385 |
|
386 | 386 | @attr.s |
387 | 387 | class FloatParameterValue(ParameterValue[float]): |
388 | | - type: BIType = BIType.float |
| 388 | + type: UserDataType = UserDataType.float |
389 | 389 |
|
390 | 390 |
|
391 | 391 | @attr.s |
392 | 392 | class DateParameterValue(ParameterValue[date]): |
393 | | - type: BIType = BIType.date |
| 393 | + type: UserDataType = UserDataType.date |
394 | 394 |
|
395 | 395 |
|
396 | 396 | @attr.s |
397 | 397 | class DateTimeParameterValue(ParameterValue[datetime]): |
398 | | - type: BIType = BIType.datetime |
| 398 | + type: UserDataType = UserDataType.datetime |
399 | 399 |
|
400 | 400 |
|
401 | 401 | @attr.s |
402 | 402 | class DateTimeTZParameterValue(ParameterValue[datetime]): |
403 | | - type: BIType = BIType.datetimetz |
| 403 | + type: UserDataType = UserDataType.datetimetz |
404 | 404 |
|
405 | 405 |
|
406 | 406 | @attr.s |
407 | 407 | class GenericDateTimeParameterValue(ParameterValue[datetime]): |
408 | | - type: BIType = BIType.genericdatetime |
| 408 | + type: UserDataType = UserDataType.genericdatetime |
409 | 409 |
|
410 | 410 |
|
411 | 411 | @attr.s |
412 | 412 | class BooleanParameterValue(ParameterValue[bool]): |
413 | | - type: BIType = BIType.boolean |
| 413 | + type: UserDataType = UserDataType.boolean |
414 | 414 |
|
415 | 415 |
|
416 | 416 | @attr.s |
417 | 417 | class GeoPointParameterValue(ParameterValue[List[Union[int, float]]]): |
418 | | - type: BIType = BIType.geopoint |
| 418 | + type: UserDataType = UserDataType.geopoint |
419 | 419 |
|
420 | 420 |
|
421 | 421 | @attr.s |
422 | 422 | class GeoPolygonParameterValue(ParameterValue[List[List[List[Union[int, float]]]]]): |
423 | | - type: BIType = BIType.geopolygon |
| 423 | + type: UserDataType = UserDataType.geopolygon |
424 | 424 |
|
425 | 425 |
|
426 | 426 | @attr.s |
427 | 427 | class UuidParameterValue(ParameterValue[str]): |
428 | | - type: BIType = BIType.uuid |
| 428 | + type: UserDataType = UserDataType.uuid |
429 | 429 |
|
430 | 430 |
|
431 | 431 | @attr.s |
432 | 432 | class MarkupParameterValue(ParameterValue[str]): |
433 | | - type: BIType = BIType.markup |
| 433 | + type: UserDataType = UserDataType.markup |
434 | 434 |
|
435 | 435 |
|
436 | 436 | @attr.s |
437 | 437 | class ArrayStrParameterValue(ParameterValue[List[str]]): |
438 | | - type: BIType = BIType.array_str |
| 438 | + type: UserDataType = UserDataType.array_str |
439 | 439 |
|
440 | 440 |
|
441 | 441 | @attr.s |
442 | 442 | class ArrayIntParameterValue(ParameterValue[List[int]]): |
443 | | - type: BIType = BIType.array_int |
| 443 | + type: UserDataType = UserDataType.array_int |
444 | 444 |
|
445 | 445 |
|
446 | 446 | @attr.s |
447 | 447 | class ArrayFloatParameterValue(ParameterValue[List[float]]): |
448 | | - type: BIType = BIType.array_float |
| 448 | + type: UserDataType = UserDataType.array_float |
449 | 449 |
|
450 | 450 |
|
451 | 451 | @attr.s |
452 | 452 | class TreeStrParameterValue(ParameterValue[List[str]]): |
453 | | - type: BIType = BIType.tree_str |
| 453 | + type: UserDataType = UserDataType.tree_str |
454 | 454 |
|
455 | 455 |
|
456 | 456 | @attr.s |
@@ -517,9 +517,9 @@ class _ResultField(ApiProxyObject): |
517 | 517 | hidden: bool = attr.ib(default=False) |
518 | 518 | description: str = attr.ib(default="") |
519 | 519 | 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) |
523 | 523 | valid: bool = attr.ib(default=True) |
524 | 524 | has_auto_aggregation: bool = attr.ib(default=False) |
525 | 525 | lock_aggregation: bool = attr.ib(default=False) |
@@ -728,7 +728,7 @@ class LegendItem(LegendItemBase): # noqa |
728 | 728 | legend_item_id: int = attr.ib(kw_only=True) # redefine as strictly not None |
729 | 729 | id: str = attr.ib(kw_only=True) |
730 | 730 | 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) |
732 | 732 | field_type: FieldType = attr.ib(kw_only=True) |
733 | 733 | item_type: LegendItemType = attr.ib(kw_only=True) |
734 | 734 |
|
|
0 commit comments