示例#1
0
	def deserialize(self, row: EntityRow) -> KeyStore:
		return KeyStore(
			tenantId=row.get('tenant_id'),
			keyType=row.get('key_type'),
			params=row.get('params'),
			createdAt=row.get('created_at'),
			createdBy=row.get('created_by')
		)
 def deserialize(self, row: EntityRow) -> Favorite:
     favorite = Favorite(connectedSpaceIds=row.get('connected_space_ids'),
                         dashboardIds=row.get('dashboard_ids'))
     # noinspection PyTypeChecker
     favorite: Favorite = UserBasedTupleShaper.deserialize(row, favorite)
     # noinspection PyTypeChecker
     favorite: Favorite = LastVisitShaper.deserialize(row, favorite)
     return favorite
示例#3
0
 def deserialize(self, row: EntityRow) -> Enum:
     # noinspection PyTypeChecker
     return TupleShaper.deserialize_tenant_based(
         row,
         Enum(enumId=row.get('enum_id'),
              name=row.get('name'),
              description=row.get('description'),
              parentEnumId=row.get('parent_enum_id')))
示例#4
0
	def deserialize(row: EntityRow, user_based_tuple: UserBasedTuple) -> UserBasedTuple:
		user_based_tuple.userId = row.get('user_id')
		user_based_tuple.tenantId = row.get('tenant_id')
		if isinstance(user_based_tuple, Auditable):
			user_based_tuple = AuditableShaper.deserialize(row, user_based_tuple)
		if isinstance(user_based_tuple, OptimisticLock):
			user_based_tuple = OptimisticLockShaper.deserialize(row, user_based_tuple)
		return user_based_tuple
 def deserialize(self, row: EntityRow) -> ConnectedSpaceGraphic:
     connected_space_graphic = ConnectedSpaceGraphic(
         connectId=row.get('connect_id'),
         topics=row.get('topics'),
         subjects=row.get('subjects'))
     # noinspection PyTypeChecker
     connected_space_graphic: ConnectedSpaceGraphic = UserBasedTupleShaper.deserialize(
         row, connected_space_graphic)
     return connected_space_graphic
示例#6
0
 def deserialize(self, row: EntityRow) -> ExternalWriter:
     # noinspection PyTypeChecker
     return TupleShaper.deserialize_tenant_based(
         row,
         ExternalWriter(writerId=row.get('writer_id'),
                        writerCode=row.get('writer_code'),
                        type=row.get('type'),
                        pat=row.get('pat'),
                        url=row.get('url')))
示例#7
0
 def deserialize(self, row: EntityRow) -> Dict[str, Any]:
     data = self.deserialize_fix_columns(row)
     if is_aggregation_topic(self.get_schema().get_topic()):
         data[TopicDataColumnNames.AGGREGATE_ASSIST.value] = row.get(
             TopicDataColumnNames.AGGREGATE_ASSIST.value)
         data[TopicDataColumnNames.VERSION.value] = row.get(
             TopicDataColumnNames.VERSION.value)
     ArrayHelper(self.get_mapper().get_column_names()).each(
         lambda x: self.deserialize_column(row, x, data))
     return data
示例#8
0
 def deserialize(self, row: EntityRow) -> Space:
     # noinspection PyTypeChecker
     return TupleShaper.deserialize_tenant_based(
         row,
         Space(spaceId=row.get('space_id'),
               name=row.get('name'),
               description=row.get('description'),
               topicIds=row.get('topic_ids'),
               groupIds=row.get('group_ids'),
               filters=row.get('filters')))
示例#9
0
	def deserialize(self, row: EntityRow) -> User:
		# noinspection PyTypeChecker
		return TupleShaper.deserialize_tenant_based(row, User(
			userId=row.get('user_id'),
			name=row.get('name'),
			nickName=row.get('nickname'),
			password=row.get('password'),
			isActive=row.get('is_active'),
			groupIds=row.get('group_ids'),
			role=row.get('role')
		))
示例#10
0
 def deserialize_fix_columns(self, row: EntityRow) -> Dict[str, Any]:
     return {
         TopicDataColumnNames.ID.value:
         row.get(TopicDataColumnNames.ID.value),
         TopicDataColumnNames.TENANT_ID.value:
         row.get(TopicDataColumnNames.TENANT_ID.value),
         TopicDataColumnNames.INSERT_TIME.value:
         row.get(TopicDataColumnNames.INSERT_TIME.value),
         TopicDataColumnNames.UPDATE_TIME.value:
         row.get(TopicDataColumnNames.UPDATE_TIME.value)
     }
示例#11
0
 def deserialize(self, row: EntityRow) -> PipelineGraphic:
     pipeline_graphic = PipelineGraphic(
         pipelineGraphId=row.get('pipeline_graphic_id'),
         name=row.get('name'),
         topics=row.get('topics'),
         createdAt=row.get('created_at'),
         lastModifiedAt=row.get('last_modified_at'))
     # noinspection PyTypeChecker
     pipeline_graphic: PipelineGraphic = UserBasedTupleShaper.deserialize(
         row, pipeline_graphic)
     return pipeline_graphic
 def deserialize(self, row: EntityRow) -> FactorIndex:
     return FactorIndex(factorIndexId=row.get('factor_index_id'),
                        factorId=row.get('factor_id'),
                        factorType=row.get('factor_type'),
                        factorName=row.get('factor_name'),
                        factorLabel=row.get('factor_label'),
                        factorDescription=row.get('factor_description'),
                        topicId=row.get('topic_id'),
                        topicName=row.get('topic_name'),
                        tenantId=row.get('tenant_id'),
                        createdAt=row.get('created_at'),
                        lastModifiedAt=row.get('last_modified_at'))
 def deserialize(self, row: EntityRow) -> ObjectiveAnalysis:
     analysis = ObjectiveAnalysis(analysisId=row.get('analysis_id'),
                                  title=row.get('title'),
                                  description=row.get('description'),
                                  perspectives=row.get('perspectives'))
     # noinspection PyTypeChecker
     analysis: ObjectiveAnalysis = UserBasedTupleShaper.deserialize(
         row, analysis)
     # noinspection PyTypeChecker
     analysis: ObjectiveAnalysis = LastVisitShaper.deserialize(
         row, analysis)
     return analysis
 def deserialize(self, row: EntityRow) -> Subject:
     subject = Subject(subjectId=row.get('subject_id'),
                       name=row.get('name'),
                       connectId=row.get('connect_id'),
                       autoRefreshInterval=row.get('auto_refresh_interval'),
                       dataset=row.get('dataset'))
     # noinspection PyTypeChecker
     subject: Subject = AuditableShaper.deserialize(row, subject)
     # noinspection PyTypeChecker
     subject: Subject = UserBasedTupleShaper.deserialize(row, subject)
     # noinspection PyTypeChecker
     subject: Subject = LastVisitShaper.deserialize(row, subject)
     return subject
示例#15
0
 def deserialize(self, row: EntityRow) -> LastSnapshot:
     last_snapshot = LastSnapshot(
         language=row.get('language'),
         lastDashboardId=row.get('last_dashboard_id'),
         adminDashboardId=row.get('admin_dashboard_id'),
         favoritePin=row.get('favorite_pin'))
     # noinspection PyTypeChecker
     last_snapshot: LastSnapshot = UserBasedTupleShaper.deserialize(
         row, last_snapshot)
     # noinspection PyTypeChecker
     last_snapshot: LastSnapshot = LastVisitShaper.deserialize(
         row, last_snapshot)
     return last_snapshot
示例#16
0
 def deserialize(self, row: EntityRow) -> TopicSnapshotJobLock:
     return TopicSnapshotJobLock(lockId=row.get('lock_id'),
                                 tenantId=row.get('tenant_id'),
                                 schedulerId=row.get('scheduler_id'),
                                 frequency=row.get('frequency'),
                                 processDate=row.get('process_date'),
                                 rowCount=row.get('row_count'),
                                 status=row.get('status'),
                                 userId=row.get('user_id'),
                                 createdAt=row.get('created_at'))
 def deserialize(self, row: EntityRow) -> PersonalAccessToken:
     return PersonalAccessToken(patId=row.get('pat_id'),
                                token=row.get('token'),
                                userId=row.get('user_id'),
                                username=row.get('username'),
                                tenantId=row.get('tenant_id'),
                                note=row.get('note'),
                                expired=row.get('expired'),
                                permissions=row.get('permissions'),
                                createdAt=row.get('created_at'))
 def deserialize(self, row: EntityRow) -> Dashboard:
     dashboard = Dashboard(
         dashboardId=row.get('dashboard_id'),
         name=row.get('name'),
         reports=row.get('reports'),
         paragraphs=row.get('paragraphs'),
         autoRefreshInterval=row.get('auto_refresh_interval'))
     # noinspection PyTypeChecker
     dashboard: Dashboard = AuditableShaper.deserialize(row, dashboard)
     # noinspection PyTypeChecker
     dashboard: Dashboard = UserBasedTupleShaper.deserialize(row, dashboard)
     # noinspection PyTypeChecker
     dashboard: Dashboard = LastVisitShaper.deserialize(row, dashboard)
     return dashboard
示例#19
0
 def deserialize(self, row: EntityRow) -> ConnectedSpace:
     connected_space = ConnectedSpace(connectId=row.get('connect_id'),
                                      spaceId=row.get('space_id'),
                                      name=row.get('name'),
                                      isTemplate=row.get('is_template'))
     # noinspection PyTypeChecker
     connected_space: ConnectedSpace = AuditableShaper.deserialize(
         row, connected_space)
     # noinspection PyTypeChecker
     connected_space: ConnectedSpace = UserBasedTupleShaper.deserialize(
         row, connected_space)
     # noinspection PyTypeChecker
     connected_space: ConnectedSpace = LastVisitShaper.deserialize(
         row, connected_space)
     return connected_space
 def deserialize(self, row: EntityRow) -> MonitorJobLock:
     return MonitorJobLock(lockId=row.get('lock_id'),
                           tenantId=row.get('tenant_id'),
                           topicId=row.get('topic_id'),
                           frequency=row.get('frequency'),
                           processDate=row.get('process_date'),
                           status=row.get('status'),
                           userId=row.get('user_id'),
                           createdAt=row.get('created_at'))
 def deserialize(self, row: EntityRow) -> MonitorRule:
     # noinspection PyTypeChecker
     return TupleShaper.deserialize_tenant_based(
         row,
         MonitorRule(ruleId=row.get('rule_id'),
                     code=row.get('code'),
                     grade=row.get('grade'),
                     severity=row.get('severity'),
                     topicId=row.get('topic_id'),
                     factorId=row.get('factor_id'),
                     params=row.get('params'),
                     enabled=row.get('enabled')))
示例#22
0
 def deserialize(self, row: EntityRow) -> EnumItem:
     # noinspection PyTypeChecker
     return EnumItem(itemId=row.get('item_id'),
                     code=row.get('code'),
                     label=row.get('label'),
                     parentCode=row.get('parent_code'),
                     replaceCode=row.get('replace_code'),
                     enumId=row.get('enum_id'),
                     tenantId=row.get('tenant_id'))
示例#23
0
	def deserialize(self, row: EntityRow) -> Pipeline:
		# noinspection PyTypeChecker
		return TupleShaper.deserialize_tenant_based(row, Pipeline(
			pipelineId=row.get('pipeline_id'),
			topicId=row.get('topic_id'),
			name=row.get('name'),
			type=row.get('type'),
			conditional=row.get('prerequisite_enabled'),
			on=row.get('prerequisite_on'),
			stages=row.get('stages'),
			enabled=row.get('enabled'),
			validated=row.get('validated')
		))
	def deserialize(self, row: EntityRow) -> Catalog:
		# noinspection PyTypeChecker
		return TupleShaper.deserialize_tenant_based(row, Catalog(
			catalogId=row.get('catalog_id'),
			name=row.get('name'),
			topicIds=row.get('topic_ids'),
			techOwnerId=row.get('tech_owner_id'),
			bizOwnerId=row.get('biz_owner_id'),
			tags=row.get('tags'),
			description=row.get('description')
		))
 def deserialize(self, row: EntityRow) -> UserGroup:
     # noinspection PyTypeChecker
     return TupleShaper.deserialize_tenant_based(
         row,
         UserGroup(userGroupId=row.get('user_group_id'),
                   name=row.get('name'),
                   description=row.get('description'),
                   userIds=row.get('user_ids'),
                   spaceIds=row.get('space_ids'),
                   indicatorIds=row.get('indicator_ids')))
 def deserialize(self, row: EntityRow) -> DataSource:
     # noinspection PyTypeChecker
     return TupleShaper.deserialize_tenant_based(
         row,
         DataSource(dataSourceId=row.get('data_source_id'),
                    dataSourceCode=row.get('data_source_code'),
                    dataSourceType=row.get('data_source_type'),
                    host=row.get('host'),
                    port=row.get('port'),
                    username=row.get('username'),
                    password=row.get('password'),
                    name=row.get('name'),
                    url=row.get('url'),
                    params=row.get('params')))
示例#27
0
	def deserialize(self, row: EntityRow) -> Achievement:
		achievement = Achievement(
			achievementId=row.get('achievement_id'),
			name=row.get('name'),
			description=row.get('description'),
			timeRangeType=row.get('time_range_type'),
			timeRangeYear=row.get('time_range_year'),
			timeRangeMonth=row.get('time_range_month'),
			compareWithPreviousTimeRange=row.get('compare_with_prev_time_range'),
			indicators=row.get('indicators')
		)
		# noinspection PyTypeChecker
		achievement: Achievement = UserBasedTupleShaper.deserialize(row, achievement)
		return achievement
示例#28
0
 def deserialize(self, row: EntityRow) -> Topic:
     # noinspection PyTypeChecker
     return TupleShaper.deserialize_tenant_based(
         row,
         Topic(topicId=row.get('topic_id'),
               name=row.get('name'),
               description=row.get('description'),
               type=row.get('type'),
               kind=row.get('kind'),
               dataSourceId=row.get('data_source_id'),
               factors=row.get('factors')))
示例#29
0
 def deserialize(self, row: EntityRow) -> Bucket:
     # noinspection PyTypeChecker
     return TupleShaper.deserialize_tenant_based(
         row,
         self.to_derived_bucket(
             Bucket(
                 bucketId=row.get('bucket_id'),
                 name=row.get('name'),
                 type=row.get('type'),
                 include=row.get('include'),
                 measure=row.get('measure'),
                 enumId=row.get('enum_id'),
                 segments=row.get('segments'),
                 description=row.get('description'),
             )))
	def deserialize(self, row: EntityRow) -> Dict[str, Any]:
		data = self.deserialize_fix_columns(row)
		data[TopicDataColumnNames.RAW_TOPIC_DATA.value] = row.get(TopicDataColumnNames.RAW_TOPIC_DATA.value)
		ArrayHelper(self.get_mapper().get_column_names()).each(lambda x: self.deserialize_column(row, x, data))
		return data