diff --git a/src/thoughtspot_tml/_scriptability.py b/src/thoughtspot_tml/_scriptability.py index 8600f54..927273c 100644 --- a/src/thoughtspot_tml/_scriptability.py +++ b/src/thoughtspot_tml/_scriptability.py @@ -118,6 +118,7 @@ class ColumnProperties(betterproto.Message): hierarchical_column_name: str = betterproto.string_field(15, optional=True) synonym_type: str = betterproto.string_field(16, optional=True) value_casing: str = betterproto.string_field(17, optional=True) + custom_order: List[str] = betterproto.string_field(18, optional=True) @dataclass(eq=False, repr=False) @@ -221,6 +222,8 @@ class Filter(betterproto.Message): excluded_visualizations: List[str] = betterproto.string_field(4, optional=True) is_mandatory: bool = betterproto.bool_field(5, optional=True) date_filter: "DateFilterProto" = betterproto.message_field(6, optional=True) + is_single_value: bool = betterproto.bool_field(7, optional=True) + display_name: str = betterproto.string_field(8, optional=True) @dataclass(eq=False, repr=False) @@ -264,6 +267,28 @@ class Identity(betterproto.Message): fqn: str = betterproto.string_field(3, optional=True) +@dataclass(eq=False, repr=False) +class Schema(betterproto.Message): + tables: List["SchemaSchemaTable"] = betterproto.message_field(1, optional=True) + + +@dataclass(eq=False, repr=False) +class SchemaInPlaceJoin(betterproto.Message): + with_: str = betterproto.string_field(1, optional=True) + referencing_join: str = betterproto.string_field(2, optional=True) + on: str = betterproto.string_field(3, optional=True) + type: str = betterproto.string_field(4, optional=True) + cardinality: str = betterproto.string_field(5, optional=True) + + +@dataclass(eq=False, repr=False) +class SchemaSchemaTable(betterproto.Message): + name: str = betterproto.string_field(1, optional=True) + alias: str = betterproto.string_field(2, optional=True) + fqn: str = betterproto.string_field(3, optional=True) + joins: List["SchemaInPlaceJoin"] = betterproto.message_field(4, optional=True) + + @dataclass(eq=False, repr=False) class WorksheetEDocProto(betterproto.Message): name: str = betterproto.string_field(1, optional=True) @@ -278,6 +303,7 @@ class WorksheetEDocProto(betterproto.Message): joins_with: List["RelationEDocProto"] = betterproto.message_field(10, optional=True) lesson_plans: List["LessonPlanEDocProto"] = betterproto.message_field(12, optional=True) parameters: List["Parameter"] = betterproto.message_field(13, optional=True) + schema: "Schema" = betterproto.message_field(14, optional=True) @dataclass(eq=False, repr=False) diff --git a/src/thoughtspot_tml/_version.py b/src/thoughtspot_tml/_version.py index ff6ef86..962c851 100644 --- a/src/thoughtspot_tml/_version.py +++ b/src/thoughtspot_tml/_version.py @@ -1 +1 @@ -__version__ = "2.0.6" +__version__ = "2.0.7" diff --git a/src/thoughtspot_tml/utils.py b/src/thoughtspot_tml/utils.py index fa0ecc6..0fdba7e 100644 --- a/src/thoughtspot_tml/utils.py +++ b/src/thoughtspot_tml/utils.py @@ -289,8 +289,19 @@ def save(self, path: PathLike, *, info: Dict[str, Any] = None) -> None: with pathlib.Path(path).open(mode="w", encoding="UTF-8") as j: json.dump(data, j, indent=4) - def get_environment_guids(mapper, source, destination) -> Iterator[GUID, GUID]: - for key, environments in mapper._mapping.items(): + def get_environment_guids(self, *, source: str, destination: str) -> Iterator[GUID, GUID]: + """ + Iterate through all guid pairs between source and destination. + + Parameters + ---------- + source : str + name of the environment to fetch the source guid from + + destination : str + name of the environment to fetch the mapped guid from + """ + for key, environments in self._mapping.items(): guid_src = environments[source] guid_dst = environments[destination] yield guid_src, guid_dst