openmetadata-ingestion 1.3.0.1__py3-none-any.whl → 1.3.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of openmetadata-ingestion might be problematic. Click here for more details.
- metadata/cli/db_dump.py +1 -0
- metadata/data_insight/processor/reports/cost_analysis_report_data_processor.py +39 -47
- metadata/data_insight/processor/reports/data_processor.py +1 -0
- metadata/data_insight/producer/cost_analysis_producer.py +78 -14
- metadata/data_insight/producer/entity_producer.py +1 -1
- metadata/data_insight/producer/producer_interface.py +1 -1
- metadata/data_insight/producer/web_analytics_producer.py +1 -1
- metadata/data_insight/source/metadata.py +10 -1
- metadata/data_quality/validations/table/base/tableColumnToMatchSet.py +2 -1
- metadata/data_quality/validations/table/pandas/tableColumnToMatchSet.py +2 -1
- metadata/data_quality/validations/table/sqlalchemy/tableColumnToMatchSet.py +7 -2
- metadata/examples/workflows/bigtable.yaml +32 -0
- metadata/generated/antlr/EntityLinkLexer.py +353 -319
- metadata/generated/schema/analytics/__init__.py +1 -1
- metadata/generated/schema/analytics/basic.py +1 -1
- metadata/generated/schema/analytics/reportData.py +1 -1
- metadata/generated/schema/analytics/reportDataType/__init__.py +1 -1
- metadata/generated/schema/analytics/reportDataType/aggregatedCostAnalysisReportData.py +1 -1
- metadata/generated/schema/analytics/reportDataType/entityReportData.py +1 -1
- metadata/generated/schema/analytics/reportDataType/rawCostAnalysisReportData.py +1 -1
- metadata/generated/schema/analytics/reportDataType/webAnalyticEntityViewReportData.py +1 -1
- metadata/generated/schema/analytics/reportDataType/webAnalyticUserActivityReportData.py +1 -1
- metadata/generated/schema/analytics/webAnalyticEvent.py +1 -1
- metadata/generated/schema/analytics/webAnalyticEventData.py +1 -1
- metadata/generated/schema/analytics/webAnalyticEventType/__init__.py +1 -1
- metadata/generated/schema/analytics/webAnalyticEventType/customEvent.py +1 -1
- metadata/generated/schema/analytics/webAnalyticEventType/pageViewEvent.py +1 -1
- metadata/generated/schema/api/__init__.py +1 -1
- metadata/generated/schema/api/addGlossaryToAssetsRequest.py +1 -1
- metadata/generated/schema/api/analytics/__init__.py +1 -1
- metadata/generated/schema/api/analytics/createWebAnalyticEvent.py +1 -1
- metadata/generated/schema/api/automations/__init__.py +1 -1
- metadata/generated/schema/api/automations/createWorkflow.py +1 -1
- metadata/generated/schema/api/bulkAssets.py +1 -1
- metadata/generated/schema/api/classification/__init__.py +1 -1
- metadata/generated/schema/api/classification/createClassification.py +1 -1
- metadata/generated/schema/api/classification/createTag.py +1 -1
- metadata/generated/schema/api/classification/loadTags.py +1 -1
- metadata/generated/schema/api/createBot.py +1 -1
- metadata/generated/schema/api/createEventPublisherJob.py +2 -2
- metadata/generated/schema/api/createType.py +1 -1
- metadata/generated/schema/api/data/__init__.py +1 -1
- metadata/generated/schema/api/data/createChart.py +1 -1
- metadata/generated/schema/api/data/createContainer.py +1 -1
- metadata/generated/schema/api/data/createCustomProperty.py +6 -10
- metadata/generated/schema/api/data/createDashboard.py +1 -1
- metadata/generated/schema/api/data/createDashboardDataModel.py +1 -1
- metadata/generated/schema/api/data/createDatabase.py +1 -1
- metadata/generated/schema/api/data/createDatabaseSchema.py +1 -1
- metadata/generated/schema/api/data/createGlossary.py +1 -1
- metadata/generated/schema/api/data/createGlossaryTerm.py +1 -1
- metadata/generated/schema/api/data/createMlModel.py +1 -1
- metadata/generated/schema/api/data/createPipeline.py +1 -1
- metadata/generated/schema/api/data/createQuery.py +1 -1
- metadata/generated/schema/api/data/createSearchIndex.py +1 -1
- metadata/generated/schema/api/data/createStoredProcedure.py +1 -1
- metadata/generated/schema/api/data/createTable.py +1 -1
- metadata/generated/schema/api/data/createTableProfile.py +1 -1
- metadata/generated/schema/api/data/createTopic.py +1 -1
- metadata/generated/schema/api/data/loadGlossary.py +1 -1
- metadata/generated/schema/api/data/restoreEntity.py +1 -1
- metadata/generated/schema/api/dataInsight/__init__.py +1 -1
- metadata/generated/schema/api/dataInsight/createDataInsightChart.py +1 -1
- metadata/generated/schema/api/dataInsight/kpi/__init__.py +1 -1
- metadata/generated/schema/api/dataInsight/kpi/createKpiRequest.py +1 -1
- metadata/generated/schema/api/docStore/__init__.py +1 -1
- metadata/generated/schema/api/docStore/createDocument.py +1 -1
- metadata/generated/schema/api/domains/__init__.py +1 -1
- metadata/generated/schema/api/domains/createDataProduct.py +1 -1
- metadata/generated/schema/api/domains/createDomain.py +1 -1
- metadata/generated/schema/api/feed/__init__.py +1 -1
- metadata/generated/schema/api/feed/closeTask.py +1 -1
- metadata/generated/schema/api/feed/createPost.py +1 -1
- metadata/generated/schema/api/feed/createSuggestion.py +1 -1
- metadata/generated/schema/api/feed/createThread.py +1 -1
- metadata/generated/schema/api/feed/resolveTask.py +1 -1
- metadata/generated/schema/api/feed/threadCount.py +1 -1
- metadata/generated/schema/api/lineage/__init__.py +1 -1
- metadata/generated/schema/api/lineage/addLineage.py +1 -1
- metadata/generated/schema/api/openMetadataServerVersion.py +1 -1
- metadata/generated/schema/api/policies/__init__.py +1 -1
- metadata/generated/schema/api/policies/createPolicy.py +1 -1
- metadata/generated/schema/api/services/__init__.py +1 -1
- metadata/generated/schema/api/services/createDashboardService.py +1 -1
- metadata/generated/schema/api/services/createDatabaseService.py +1 -1
- metadata/generated/schema/api/services/createMessagingService.py +1 -1
- metadata/generated/schema/api/services/createMetadataService.py +1 -1
- metadata/generated/schema/api/services/createMlModelService.py +1 -1
- metadata/generated/schema/api/services/createPipelineService.py +1 -1
- metadata/generated/schema/api/services/createSearchService.py +1 -1
- metadata/generated/schema/api/services/createStorageService.py +1 -1
- metadata/generated/schema/api/services/ingestionPipelines/__init__.py +1 -1
- metadata/generated/schema/api/services/ingestionPipelines/createIngestionPipeline.py +1 -1
- metadata/generated/schema/api/setOwner.py +1 -1
- metadata/generated/schema/api/teams/__init__.py +1 -1
- metadata/generated/schema/api/teams/createPersona.py +1 -1
- metadata/generated/schema/api/teams/createRole.py +1 -1
- metadata/generated/schema/api/teams/createTeam.py +1 -1
- metadata/generated/schema/api/teams/createUser.py +1 -1
- metadata/generated/schema/api/tests/__init__.py +1 -1
- metadata/generated/schema/api/tests/createCustomMetric.py +1 -1
- metadata/generated/schema/api/tests/createLogicalTestCases.py +1 -1
- metadata/generated/schema/api/tests/createTestCase.py +1 -1
- metadata/generated/schema/api/tests/createTestCaseResolutionStatus.py +1 -1
- metadata/generated/schema/api/tests/createTestDefinition.py +2 -1
- metadata/generated/schema/api/tests/createTestSuite.py +1 -1
- metadata/generated/schema/api/voteRequest.py +1 -1
- metadata/generated/schema/auth/__init__.py +1 -1
- metadata/generated/schema/auth/basicAuth.py +1 -1
- metadata/generated/schema/auth/basicLoginRequest.py +1 -1
- metadata/generated/schema/auth/changePasswordRequest.py +1 -1
- metadata/generated/schema/auth/createPersonalToken.py +1 -1
- metadata/generated/schema/auth/emailRequest.py +1 -1
- metadata/generated/schema/auth/emailVerificationToken.py +1 -1
- metadata/generated/schema/auth/generateToken.py +1 -1
- metadata/generated/schema/auth/jwtAuth.py +1 -1
- metadata/generated/schema/auth/loginRequest.py +1 -1
- metadata/generated/schema/auth/logoutRequest.py +1 -1
- metadata/generated/schema/auth/passwordResetRequest.py +1 -1
- metadata/generated/schema/auth/passwordResetToken.py +1 -1
- metadata/generated/schema/auth/personalAccessToken.py +1 -1
- metadata/generated/schema/auth/refreshToken.py +1 -1
- metadata/generated/schema/auth/registrationRequest.py +1 -1
- metadata/generated/schema/auth/revokePersonalToken.py +1 -1
- metadata/generated/schema/auth/revokeToken.py +1 -1
- metadata/generated/schema/auth/serviceTokenEnum.py +1 -1
- metadata/generated/schema/auth/ssoAuth.py +1 -1
- metadata/generated/schema/auth/tokenRefreshRequest.py +1 -1
- metadata/generated/schema/configuration/__init__.py +1 -1
- metadata/generated/schema/configuration/appsPrivateConfiguration.py +1 -1
- metadata/generated/schema/configuration/authConfig.py +1 -1
- metadata/generated/schema/configuration/authenticationConfiguration.py +1 -1
- metadata/generated/schema/configuration/authorizerConfiguration.py +1 -1
- metadata/generated/schema/configuration/changeEventConfiguration.py +1 -1
- metadata/generated/schema/configuration/dataQualityConfiguration.py +16 -0
- metadata/generated/schema/configuration/elasticSearchConfiguration.py +1 -1
- metadata/generated/schema/configuration/eventHandlerConfiguration.py +1 -1
- metadata/generated/schema/configuration/fernetConfiguration.py +1 -1
- metadata/generated/schema/configuration/jwtTokenConfiguration.py +1 -1
- metadata/generated/schema/configuration/kafkaEventConfiguration.py +1 -1
- metadata/generated/schema/configuration/ldapConfiguration.py +1 -1
- metadata/generated/schema/configuration/ldapTrustStoreConfig/__init__.py +1 -1
- metadata/generated/schema/configuration/ldapTrustStoreConfig/customTrustManagerConfig.py +1 -1
- metadata/generated/schema/configuration/ldapTrustStoreConfig/hostNameConfig.py +1 -1
- metadata/generated/schema/configuration/ldapTrustStoreConfig/jvmDefaultConfig.py +1 -1
- metadata/generated/schema/configuration/ldapTrustStoreConfig/trustAllConfig.py +1 -1
- metadata/generated/schema/configuration/ldapTrustStoreConfig/truststoreConfig.py +1 -1
- metadata/generated/schema/configuration/loginConfiguration.py +1 -1
- metadata/generated/schema/configuration/logoConfiguration.py +1 -1
- metadata/generated/schema/configuration/pipelineServiceClientConfiguration.py +1 -1
- metadata/generated/schema/configuration/slackAppConfiguration.py +1 -1
- metadata/generated/schema/configuration/taskNotificationConfiguration.py +1 -1
- metadata/generated/schema/configuration/testResultNotificationConfiguration.py +1 -1
- metadata/generated/schema/dataInsight/__init__.py +1 -1
- metadata/generated/schema/dataInsight/dataInsightChart.py +1 -1
- metadata/generated/schema/dataInsight/dataInsightChartResult.py +1 -1
- metadata/generated/schema/dataInsight/kpi/__init__.py +1 -1
- metadata/generated/schema/dataInsight/kpi/basic.py +1 -1
- metadata/generated/schema/dataInsight/kpi/kpi.py +1 -1
- metadata/generated/schema/dataInsight/type/__init__.py +1 -1
- metadata/generated/schema/dataInsight/type/aggregatedUnusedAssetsCount.py +1 -1
- metadata/generated/schema/dataInsight/type/aggregatedUnusedAssetsSize.py +1 -1
- metadata/generated/schema/dataInsight/type/aggregatedUsedVsUnusedAssetsCount.py +1 -1
- metadata/generated/schema/dataInsight/type/aggregatedUsedVsUnusedAssetsSize.py +1 -1
- metadata/generated/schema/dataInsight/type/dailyActiveUsers.py +1 -1
- metadata/generated/schema/dataInsight/type/mostActiveUsers.py +1 -1
- metadata/generated/schema/dataInsight/type/mostViewedEntities.py +1 -1
- metadata/generated/schema/dataInsight/type/pageViewsByEntities.py +1 -1
- metadata/generated/schema/dataInsight/type/percentageOfEntitiesWithDescriptionByType.py +1 -1
- metadata/generated/schema/dataInsight/type/percentageOfEntitiesWithOwnerByType.py +1 -1
- metadata/generated/schema/dataInsight/type/percentageOfServicesWithDescription.py +1 -1
- metadata/generated/schema/dataInsight/type/percentageOfServicesWithOwner.py +1 -1
- metadata/generated/schema/dataInsight/type/totalEntitiesByTier.py +1 -1
- metadata/generated/schema/dataInsight/type/totalEntitiesByType.py +1 -1
- metadata/generated/schema/dataInsight/type/unusedAssets.py +1 -1
- metadata/generated/schema/email/__init__.py +1 -1
- metadata/generated/schema/email/emailRequest.py +1 -1
- metadata/generated/schema/email/smtpSettings.py +1 -1
- metadata/generated/schema/entity/__init__.py +1 -1
- metadata/generated/schema/entity/applications/__init__.py +1 -1
- metadata/generated/schema/entity/applications/app.py +1 -1
- metadata/generated/schema/entity/applications/appRunRecord.py +1 -1
- metadata/generated/schema/entity/applications/configuration/__init__.py +1 -1
- metadata/generated/schema/entity/applications/configuration/applicationConfig.py +1 -1
- metadata/generated/schema/entity/applications/configuration/external/__init__.py +1 -1
- metadata/generated/schema/entity/applications/configuration/external/autoTaggerAppConfig.py +1 -1
- metadata/generated/schema/entity/applications/configuration/external/metaPilotAppConfig.py +1 -1
- metadata/generated/schema/entity/applications/configuration/internal/__init__.py +1 -1
- metadata/generated/schema/entity/applications/configuration/internal/dataInsightsAppConfig.py +1 -1
- metadata/generated/schema/entity/applications/configuration/internal/dataInsightsReportAppConfig.py +1 -1
- metadata/generated/schema/entity/applications/configuration/internal/searchIndexingAppConfig.py +2 -2
- metadata/generated/schema/entity/applications/configuration/private/external/__init__.py +1 -1
- metadata/generated/schema/entity/applications/configuration/private/external/metaPilotAppPrivateConfig.py +1 -1
- metadata/generated/schema/entity/applications/createAppRequest.py +1 -1
- metadata/generated/schema/entity/applications/jobStatus.py +1 -1
- metadata/generated/schema/entity/applications/liveExecutionContext.py +1 -1
- metadata/generated/schema/entity/applications/marketplace/__init__.py +1 -1
- metadata/generated/schema/entity/applications/marketplace/appMarketPlaceDefinition.py +1 -1
- metadata/generated/schema/entity/applications/marketplace/createAppMarketPlaceDefinitionReq.py +1 -1
- metadata/generated/schema/entity/applications/scheduledExecutionContext.py +1 -1
- metadata/generated/schema/entity/automations/__init__.py +1 -1
- metadata/generated/schema/entity/automations/testServiceConnection.py +1 -1
- metadata/generated/schema/entity/automations/workflow.py +1 -1
- metadata/generated/schema/entity/bot.py +1 -1
- metadata/generated/schema/entity/classification/__init__.py +1 -1
- metadata/generated/schema/entity/classification/classification.py +1 -1
- metadata/generated/schema/entity/classification/tag.py +1 -1
- metadata/generated/schema/entity/data/__init__.py +1 -1
- metadata/generated/schema/entity/data/chart.py +1 -1
- metadata/generated/schema/entity/data/container.py +1 -1
- metadata/generated/schema/entity/data/dashboard.py +1 -1
- metadata/generated/schema/entity/data/dashboardDataModel.py +1 -1
- metadata/generated/schema/entity/data/database.py +1 -1
- metadata/generated/schema/entity/data/databaseSchema.py +1 -1
- metadata/generated/schema/entity/data/glossary.py +1 -1
- metadata/generated/schema/entity/data/glossaryTerm.py +1 -1
- metadata/generated/schema/entity/data/metrics.py +1 -1
- metadata/generated/schema/entity/data/mlmodel.py +2 -2
- metadata/generated/schema/entity/data/pipeline.py +1 -1
- metadata/generated/schema/entity/data/query.py +1 -1
- metadata/generated/schema/entity/data/report.py +1 -1
- metadata/generated/schema/entity/data/searchIndex.py +1 -1
- metadata/generated/schema/entity/data/storedProcedure.py +1 -1
- metadata/generated/schema/entity/data/table.py +1 -1
- metadata/generated/schema/entity/data/topic.py +1 -1
- metadata/generated/schema/entity/docStore/__init__.py +1 -1
- metadata/generated/schema/entity/docStore/document.py +1 -1
- metadata/generated/schema/entity/domains/__init__.py +1 -1
- metadata/generated/schema/entity/domains/dataProduct.py +1 -1
- metadata/generated/schema/entity/domains/domain.py +1 -1
- metadata/generated/schema/entity/events/__init__.py +1 -1
- metadata/generated/schema/entity/events/webhook.py +1 -1
- metadata/generated/schema/entity/feed/__init__.py +1 -1
- metadata/generated/schema/entity/feed/suggestion.py +1 -1
- metadata/generated/schema/entity/feed/thread.py +1 -1
- metadata/generated/schema/entity/policies/__init__.py +1 -1
- metadata/generated/schema/entity/policies/accessControl/__init__.py +1 -1
- metadata/generated/schema/entity/policies/accessControl/resourceDescriptor.py +1 -1
- metadata/generated/schema/entity/policies/accessControl/resourcePermission.py +1 -1
- metadata/generated/schema/entity/policies/accessControl/rule.py +1 -1
- metadata/generated/schema/entity/policies/filters.py +1 -1
- metadata/generated/schema/entity/policies/policy.py +1 -1
- metadata/generated/schema/entity/services/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/common/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/common/sslCertPaths.py +1 -1
- metadata/generated/schema/entity/services/connections/common/sslCertValues.py +1 -1
- metadata/generated/schema/entity/services/connections/common/sslConfig.py +1 -1
- metadata/generated/schema/entity/services/connections/connectionBasicType.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/customDashboardConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/domoDashboardConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/lightdashConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/lookerConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/metabaseConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/modeConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/mstrConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/powerBIConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/qlikSenseConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/quickSightConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/redashConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/supersetConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/dashboard/tableauConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/database/athenaConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/azureSQLConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/bigQueryConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/bigTableConnection.py +41 -0
- metadata/generated/schema/entity/services/connections/database/clickhouseConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/common/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/database/common/basicAuth.py +1 -1
- metadata/generated/schema/entity/services/connections/database/common/iamAuthConfig.py +1 -1
- metadata/generated/schema/entity/services/connections/database/common/jwtAuth.py +1 -1
- metadata/generated/schema/entity/services/connections/database/couchbaseConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/customDatabaseConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/databricksConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/datalake/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/database/datalake/azureConfig.py +1 -1
- metadata/generated/schema/entity/services/connections/database/datalake/gcsConfig.py +1 -1
- metadata/generated/schema/entity/services/connections/database/datalake/s3Config.py +1 -1
- metadata/generated/schema/entity/services/connections/database/datalakeConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/db2Connection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/deltaLakeConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/domoDatabaseConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/dorisConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/druidConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/dynamoDBConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/glueConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/greenplumConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/hiveConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/iceberg/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/database/iceberg/dynamoDbCatalogConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/iceberg/glueCatalogConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/iceberg/hiveCatalogConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/iceberg/icebergCatalog.py +1 -1
- metadata/generated/schema/entity/services/connections/database/iceberg/icebergFileSystem.py +1 -1
- metadata/generated/schema/entity/services/connections/database/iceberg/restCatalogConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/icebergConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/impalaConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/mariaDBConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/mongoDBConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/mssqlConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/mysqlConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/oracleConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/pinotDBConnection.py +8 -6
- metadata/generated/schema/entity/services/connections/database/postgresConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/prestoConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/redshiftConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/salesforceConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/sapHanaConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/sasConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/singleStoreConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/snowflakeConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/sqliteConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/trinoConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/unityCatalogConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/database/verticaConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/messaging/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/messaging/customMessagingConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/messaging/kafkaConnection.py +14 -2
- metadata/generated/schema/entity/services/connections/messaging/kinesisConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/messaging/pulsarConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/messaging/redpandaConnection.py +14 -2
- metadata/generated/schema/entity/services/connections/messaging/saslMechanismType.py +1 -1
- metadata/generated/schema/entity/services/connections/metadata/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/metadata/alationConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/metadata/amundsenConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/metadata/atlasConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/metadata/metadataESConnection.py +2 -2
- metadata/generated/schema/entity/services/connections/metadata/openMetadataConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/mlmodel/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/mlmodel/customMlModelConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/mlmodel/mlflowConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/mlmodel/sageMakerConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/mlmodel/sklearnConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/airbyteConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/airflowConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/backendConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/customPipelineConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/dagsterConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/databricksPipelineConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/domoPipelineConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/fivetranConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/gluePipelineConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/nifiConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/sparkConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/pipeline/splineConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/search/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/search/customSearchConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/search/elasticSearch/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/search/elasticSearch/apiAuth.py +1 -1
- metadata/generated/schema/entity/services/connections/search/elasticSearch/basicAuth.py +1 -1
- metadata/generated/schema/entity/services/connections/search/elasticSearchConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/search/openSearchConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/serviceConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/storage/__init__.py +1 -1
- metadata/generated/schema/entity/services/connections/storage/adlsConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/storage/customStorageConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/storage/gcsConnection.py +1 -1
- metadata/generated/schema/entity/services/connections/storage/s3Connection.py +1 -1
- metadata/generated/schema/entity/services/connections/testConnectionDefinition.py +1 -1
- metadata/generated/schema/entity/services/connections/testConnectionResult.py +1 -1
- metadata/generated/schema/entity/services/dashboardService.py +1 -1
- metadata/generated/schema/entity/services/databaseService.py +4 -1
- metadata/generated/schema/entity/services/ingestionPipelines/__init__.py +1 -1
- metadata/generated/schema/entity/services/ingestionPipelines/ingestionPipeline.py +1 -1
- metadata/generated/schema/entity/services/ingestionPipelines/pipelineServiceClientResponse.py +1 -1
- metadata/generated/schema/entity/services/ingestionPipelines/status.py +1 -1
- metadata/generated/schema/entity/services/messagingService.py +1 -1
- metadata/generated/schema/entity/services/metadataService.py +1 -1
- metadata/generated/schema/entity/services/mlmodelService.py +1 -1
- metadata/generated/schema/entity/services/pipelineService.py +1 -1
- metadata/generated/schema/entity/services/searchService.py +1 -1
- metadata/generated/schema/entity/services/serviceType.py +1 -1
- metadata/generated/schema/entity/services/storageService.py +1 -1
- metadata/generated/schema/entity/teams/__init__.py +1 -1
- metadata/generated/schema/entity/teams/persona.py +1 -1
- metadata/generated/schema/entity/teams/role.py +1 -1
- metadata/generated/schema/entity/teams/team.py +1 -1
- metadata/generated/schema/entity/teams/teamHierarchy.py +1 -1
- metadata/generated/schema/entity/teams/user.py +1 -1
- metadata/generated/schema/entity/type.py +3 -18
- metadata/generated/schema/entity/utils/__init__.py +1 -1
- metadata/generated/schema/entity/utils/entitiesCount.py +1 -1
- metadata/generated/schema/entity/utils/servicesCount.py +1 -1
- metadata/generated/schema/entity/utils/supersetApiConnection.py +1 -1
- metadata/generated/schema/events/__init__.py +1 -1
- metadata/generated/schema/events/alertMetrics.py +1 -1
- metadata/generated/schema/events/api/__init__.py +1 -1
- metadata/generated/schema/events/api/createEventSubscription.py +1 -1
- metadata/generated/schema/events/emailAlertConfig.py +1 -1
- metadata/generated/schema/events/eventFilterRule.py +1 -1
- metadata/generated/schema/events/eventSubscription.py +3 -2
- metadata/generated/schema/events/eventSubscriptionOffset.py +1 -1
- metadata/generated/schema/events/failedEvent.py +1 -1
- metadata/generated/schema/events/filterResourceDescriptor.py +1 -1
- metadata/generated/schema/events/subscriptionResourceDescriptor.py +1 -1
- metadata/generated/schema/metadataIngestion/__init__.py +1 -1
- metadata/generated/schema/metadataIngestion/application.py +1 -1
- metadata/generated/schema/metadataIngestion/applicationPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/dashboardServiceMetadataPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/dataInsightPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/databaseServiceMetadataPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/databaseServiceProfilerPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/databaseServiceQueryLineagePipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/databaseServiceQueryUsagePipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtconfig/__init__.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtconfig/dbtAzureConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtconfig/dbtBucketDetails.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtconfig/dbtCloudConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtconfig/dbtGCSConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtconfig/dbtHttpConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtconfig/dbtLocalConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/dbtconfig/dbtS3Config.py +1 -1
- metadata/generated/schema/metadataIngestion/messagingServiceMetadataPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/metadataToElasticSearchPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/mlmodelServiceMetadataPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/pipelineServiceMetadataPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/searchServiceMetadataPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/__init__.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/containerMetadataConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/manifestMetadataConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/storageBucketDetails.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/storageMetadataADLSConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/storageMetadataGCSConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/storageMetadataHttpConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/storageMetadataLocalConfig.py +1 -1
- metadata/generated/schema/metadataIngestion/storage/storageMetadataS3Config.py +1 -1
- metadata/generated/schema/metadataIngestion/storageServiceMetadataPipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/testSuitePipeline.py +1 -1
- metadata/generated/schema/metadataIngestion/workflow.py +1 -1
- metadata/generated/schema/monitoring/__init__.py +1 -1
- metadata/generated/schema/monitoring/eventMonitorProvider.py +1 -1
- metadata/generated/schema/security/__init__.py +1 -1
- metadata/generated/schema/security/client/__init__.py +1 -1
- metadata/generated/schema/security/client/auth0SSOClientConfig.py +1 -1
- metadata/generated/schema/security/client/azureSSOClientConfig.py +1 -1
- metadata/generated/schema/security/client/customOidcSSOClientConfig.py +1 -1
- metadata/generated/schema/security/client/googleSSOClientConfig.py +1 -1
- metadata/generated/schema/security/client/oktaSSOClientConfig.py +1 -1
- metadata/generated/schema/security/client/openMetadataJWTClientConfig.py +1 -1
- metadata/generated/schema/security/client/samlSSOClientConfig.py +1 -1
- metadata/generated/schema/security/credentials/__init__.py +1 -1
- metadata/generated/schema/security/credentials/accessTokenAuth.py +1 -1
- metadata/generated/schema/security/credentials/apiAccessTokenAuth.py +1 -1
- metadata/generated/schema/security/credentials/awsCredentials.py +1 -1
- metadata/generated/schema/security/credentials/azureCredentials.py +16 -9
- metadata/generated/schema/security/credentials/basicAuth.py +1 -1
- metadata/generated/schema/security/credentials/bitbucketCredentials.py +1 -1
- metadata/generated/schema/security/credentials/gcpCredentials.py +1 -1
- metadata/generated/schema/security/credentials/gcpValues.py +1 -1
- metadata/generated/schema/security/credentials/gitCredentials.py +1 -1
- metadata/generated/schema/security/credentials/githubCredentials.py +1 -1
- metadata/generated/schema/security/secrets/__init__.py +1 -1
- metadata/generated/schema/security/secrets/secretsManagerClientLoader.py +1 -1
- metadata/generated/schema/security/secrets/secretsManagerConfiguration.py +1 -1
- metadata/generated/schema/security/secrets/secretsManagerProvider.py +3 -1
- metadata/generated/schema/security/securityConfiguration.py +1 -1
- metadata/generated/schema/security/ssl/__init__.py +1 -1
- metadata/generated/schema/security/ssl/validateSSLClientConfig.py +1 -1
- metadata/generated/schema/security/ssl/verifySSLConfig.py +1 -1
- metadata/generated/schema/settings/__init__.py +1 -1
- metadata/generated/schema/settings/settings.py +1 -1
- metadata/generated/schema/system/__init__.py +1 -1
- metadata/generated/schema/system/entityError.py +1 -1
- metadata/generated/schema/system/eventPublisherJob.py +1 -1
- metadata/generated/schema/system/indexingError.py +1 -1
- metadata/generated/schema/system/ui/__init__.py +1 -1
- metadata/generated/schema/system/ui/knowledgePanel.py +1 -1
- metadata/generated/schema/system/ui/page.py +1 -1
- metadata/generated/schema/tests/__init__.py +1 -1
- metadata/generated/schema/tests/assigned.py +1 -1
- metadata/generated/schema/tests/basic.py +1 -1
- metadata/generated/schema/tests/customMetric.py +1 -1
- metadata/generated/schema/tests/resolved.py +1 -1
- metadata/generated/schema/tests/testCase.py +1 -1
- metadata/generated/schema/tests/testCaseResolutionStatus.py +1 -1
- metadata/generated/schema/tests/testDefinition.py +2 -1
- metadata/generated/schema/tests/testSuite.py +1 -1
- metadata/generated/schema/type/__init__.py +1 -1
- metadata/generated/schema/type/auditLog.py +1 -1
- metadata/generated/schema/type/basic.py +6 -2
- metadata/generated/schema/type/bulkOperationResult.py +1 -1
- metadata/generated/schema/type/changeEvent.py +1 -1
- metadata/generated/schema/type/changeEventType.py +1 -1
- metadata/generated/schema/type/collectionDescriptor.py +1 -1
- metadata/generated/schema/type/csvDocumentation.py +1 -1
- metadata/generated/schema/type/csvErrorType.py +1 -1
- metadata/generated/schema/type/csvFile.py +1 -1
- metadata/generated/schema/type/csvImportResult.py +1 -1
- metadata/generated/schema/type/customProperties/__init__.py +3 -0
- metadata/generated/schema/type/customProperties/enumConfig.py +17 -0
- metadata/generated/schema/type/customProperty.py +52 -0
- metadata/generated/schema/type/dailyCount.py +1 -1
- metadata/generated/schema/type/databaseConnectionConfig.py +1 -1
- metadata/generated/schema/type/entityHistory.py +1 -1
- metadata/generated/schema/type/entityLineage.py +1 -1
- metadata/generated/schema/type/entityReference.py +1 -1
- metadata/generated/schema/type/entityReferenceList.py +1 -1
- metadata/generated/schema/type/entityRelationship.py +1 -1
- metadata/generated/schema/type/entityUsage.py +1 -1
- metadata/generated/schema/type/filterPattern.py +1 -1
- metadata/generated/schema/type/function.py +1 -1
- metadata/generated/schema/type/include.py +1 -1
- metadata/generated/schema/type/jdbcConnection.py +1 -1
- metadata/generated/schema/type/lifeCycle.py +1 -1
- metadata/generated/schema/type/paging.py +1 -1
- metadata/generated/schema/type/profile.py +1 -1
- metadata/generated/schema/type/queryParserData.py +1 -1
- metadata/generated/schema/type/reaction.py +1 -1
- metadata/generated/schema/type/schedule.py +1 -1
- metadata/generated/schema/type/schema.py +1 -1
- metadata/generated/schema/type/tableQuery.py +1 -1
- metadata/generated/schema/type/tableUsageCount.py +1 -1
- metadata/generated/schema/type/tagLabel.py +1 -1
- metadata/generated/schema/type/usageDetails.py +1 -1
- metadata/generated/schema/type/usageRequest.py +1 -1
- metadata/generated/schema/type/votes.py +1 -1
- metadata/great_expectations/action.py +4 -15
- metadata/ingestion/api/steps.py +14 -1
- metadata/ingestion/api/topology_runner.py +4 -1
- metadata/ingestion/models/custom_properties.py +0 -1
- metadata/ingestion/ometa/client.py +6 -0
- metadata/ingestion/ometa/mixins/custom_property_mixin.py +11 -11
- metadata/ingestion/ometa/ometa_api.py +1 -1
- metadata/ingestion/sink/metadata_rest.py +2 -2
- metadata/ingestion/source/dashboard/looker/metadata.py +3 -4
- metadata/ingestion/source/dashboard/metabase/client.py +4 -0
- metadata/ingestion/source/dashboard/metabase/metadata.py +5 -4
- metadata/ingestion/source/dashboard/metabase/models.py +2 -2
- metadata/ingestion/source/dashboard/tableau/metadata.py +18 -0
- metadata/ingestion/source/database/bigquery/helper.py +68 -1
- metadata/ingestion/source/database/bigquery/metadata.py +12 -3
- metadata/ingestion/source/database/bigquery/queries.py +22 -0
- metadata/ingestion/source/database/bigtable/client.py +62 -0
- metadata/ingestion/source/database/bigtable/connection.py +116 -0
- metadata/ingestion/source/database/bigtable/metadata.py +224 -0
- metadata/ingestion/source/database/bigtable/models.py +60 -0
- metadata/ingestion/source/database/common_db_source.py +2 -2
- metadata/ingestion/source/database/common_nosql_source.py +19 -2
- metadata/ingestion/source/database/databricks/metadata.py +132 -46
- metadata/ingestion/source/database/databricks/queries.py +3 -4
- metadata/ingestion/source/database/dbt/metadata.py +16 -28
- metadata/ingestion/source/database/oracle/queries.py +2 -2
- metadata/ingestion/source/messaging/common_broker_source.py +9 -7
- metadata/ingestion/source/messaging/kafka/connection.py +45 -4
- metadata/ingestion/source/mlmodel/sagemaker/metadata.py +20 -8
- metadata/profiler/orm/functions/conn_test.py +1 -0
- metadata/profiler/orm/functions/sum.py +1 -0
- metadata/profiler/orm/registry.py +1 -0
- metadata/profiler/processor/core.py +2 -2
- metadata/utils/datalake/datalake_utils.py +7 -1
- metadata/utils/execution_time_tracker.py +199 -0
- metadata/utils/filters.py +4 -0
- metadata/utils/helpers.py +0 -51
- metadata/utils/secrets/aws_based_secrets_manager.py +67 -4
- metadata/utils/secrets/aws_secrets_manager.py +7 -2
- metadata/utils/secrets/aws_ssm_secrets_manager.py +7 -2
- metadata/utils/secrets/azure_kv_secrets_manager.py +148 -0
- metadata/utils/secrets/external_secrets_manager.py +25 -3
- metadata/utils/secrets/secrets_manager_factory.py +13 -30
- metadata/workflow/base.py +4 -0
- metadata/workflow/output_handler.py +22 -0
- {openmetadata_ingestion-1.3.0.1.dist-info → openmetadata_ingestion-1.3.1.0.dist-info}/METADATA +297 -288
- {openmetadata_ingestion-1.3.0.1.dist-info → openmetadata_ingestion-1.3.1.0.dist-info}/RECORD +573 -562
- metadata/utils/secrets/client/loader.py +0 -77
- /metadata/{utils/secrets/client → ingestion/source/database/bigtable}/__init__.py +0 -0
- /metadata/utils/secrets/{noop_secrets_manager.py → db_secrets_manager.py} +0 -0
- {openmetadata_ingestion-1.3.0.1.dist-info → openmetadata_ingestion-1.3.1.0.dist-info}/LICENSE +0 -0
- {openmetadata_ingestion-1.3.0.1.dist-info → openmetadata_ingestion-1.3.1.0.dist-info}/WHEEL +0 -0
- {openmetadata_ingestion-1.3.0.1.dist-info → openmetadata_ingestion-1.3.1.0.dist-info}/entry_points.txt +0 -0
- {openmetadata_ingestion-1.3.0.1.dist-info → openmetadata_ingestion-1.3.1.0.dist-info}/top_level.txt +0 -0
|
@@ -21,6 +21,7 @@ from requests.exceptions import HTTPError
|
|
|
21
21
|
|
|
22
22
|
from metadata.config.common import ConfigModel
|
|
23
23
|
from metadata.ingestion.ometa.credentials import URL, get_api_version
|
|
24
|
+
from metadata.utils.execution_time_tracker import calculate_execution_time
|
|
24
25
|
from metadata.utils.logger import ometa_logger
|
|
25
26
|
|
|
26
27
|
logger = ometa_logger()
|
|
@@ -251,6 +252,7 @@ class REST:
|
|
|
251
252
|
|
|
252
253
|
return None
|
|
253
254
|
|
|
255
|
+
@calculate_execution_time(context="GET")
|
|
254
256
|
def get(self, path, data=None):
|
|
255
257
|
"""
|
|
256
258
|
GET method
|
|
@@ -264,6 +266,7 @@ class REST:
|
|
|
264
266
|
"""
|
|
265
267
|
return self._request("GET", path, data)
|
|
266
268
|
|
|
269
|
+
@calculate_execution_time(context="POST")
|
|
267
270
|
def post(self, path, data=None):
|
|
268
271
|
"""
|
|
269
272
|
POST method
|
|
@@ -277,6 +280,7 @@ class REST:
|
|
|
277
280
|
"""
|
|
278
281
|
return self._request("POST", path, data)
|
|
279
282
|
|
|
283
|
+
@calculate_execution_time(context="PUT")
|
|
280
284
|
def put(self, path, data=None):
|
|
281
285
|
"""
|
|
282
286
|
PUT method
|
|
@@ -290,6 +294,7 @@ class REST:
|
|
|
290
294
|
"""
|
|
291
295
|
return self._request("PUT", path, data)
|
|
292
296
|
|
|
297
|
+
@calculate_execution_time(context="PATCH")
|
|
293
298
|
def patch(self, path, data=None):
|
|
294
299
|
"""
|
|
295
300
|
PATCH method
|
|
@@ -308,6 +313,7 @@ class REST:
|
|
|
308
313
|
headers={"Content-type": "application/json-patch+json"},
|
|
309
314
|
)
|
|
310
315
|
|
|
316
|
+
@calculate_execution_time(context="DELETE")
|
|
311
317
|
def delete(self, path, data=None):
|
|
312
318
|
"""
|
|
313
319
|
DELETE method
|
|
@@ -15,7 +15,8 @@ To be used by OpenMetadata class
|
|
|
15
15
|
"""
|
|
16
16
|
from typing import Dict
|
|
17
17
|
|
|
18
|
-
from metadata.generated.schema.
|
|
18
|
+
from metadata.generated.schema.type.customProperty import PropertyType
|
|
19
|
+
from metadata.generated.schema.type.entityReference import EntityReference
|
|
19
20
|
from metadata.ingestion.models.custom_properties import (
|
|
20
21
|
CustomPropertyDataTypes,
|
|
21
22
|
CustomPropertyType,
|
|
@@ -54,16 +55,6 @@ class OMetaCustomPropertyMixin:
|
|
|
54
55
|
f"/metadata/types/name/{entity_type}?category=field"
|
|
55
56
|
)
|
|
56
57
|
|
|
57
|
-
# Get the data type of the custom property
|
|
58
|
-
if not ometa_custom_property.createCustomPropertyRequest.propertyType:
|
|
59
|
-
custom_property_type = self.get_custom_property_type(
|
|
60
|
-
data_type=ometa_custom_property.custom_property_type
|
|
61
|
-
)
|
|
62
|
-
property_type = PropertyType(id=custom_property_type.id, type="type")
|
|
63
|
-
ometa_custom_property.createCustomPropertyRequest.propertyType = (
|
|
64
|
-
property_type
|
|
65
|
-
)
|
|
66
|
-
|
|
67
58
|
resp = self.client.put(
|
|
68
59
|
f"/metadata/types/{entity_schema.get('id')}",
|
|
69
60
|
data=ometa_custom_property.createCustomPropertyRequest.json(),
|
|
@@ -78,3 +69,12 @@ class OMetaCustomPropertyMixin:
|
|
|
78
69
|
"""
|
|
79
70
|
resp = self.client.get(f"/metadata/types/name/{data_type.value}?category=field")
|
|
80
71
|
return CustomPropertyType(**resp)
|
|
72
|
+
|
|
73
|
+
def get_property_type_ref(self, data_type: CustomPropertyDataTypes) -> PropertyType:
|
|
74
|
+
"""
|
|
75
|
+
Get the PropertyType for custom properties
|
|
76
|
+
"""
|
|
77
|
+
custom_property_type = self.get_custom_property_type(data_type=data_type)
|
|
78
|
+
return PropertyType(
|
|
79
|
+
__root__=EntityReference(id=custom_property_type.id, type="type")
|
|
80
|
+
)
|
|
@@ -82,7 +82,7 @@ from metadata.ingestion.ometa.ometa_api import OpenMetadata
|
|
|
82
82
|
from metadata.ingestion.source.dashboard.dashboard_service import DashboardUsage
|
|
83
83
|
from metadata.ingestion.source.database.database_service import DataModelLink
|
|
84
84
|
from metadata.profiler.api.models import ProfilerResponse
|
|
85
|
-
from metadata.utils.
|
|
85
|
+
from metadata.utils.execution_time_tracker import calculate_execution_time
|
|
86
86
|
from metadata.utils.logger import get_log_name, ingestion_logger
|
|
87
87
|
|
|
88
88
|
logger = ingestion_logger()
|
|
@@ -129,7 +129,7 @@ class MetadataRestSink(Sink): # pylint: disable=too-many-public-methods
|
|
|
129
129
|
logger.debug(f"Processing Create request {type(record)}")
|
|
130
130
|
return self.write_create_request(record)
|
|
131
131
|
|
|
132
|
-
@calculate_execution_time
|
|
132
|
+
@calculate_execution_time(store=False)
|
|
133
133
|
def _run(self, record: Entity, *_, **__) -> Either[Any]:
|
|
134
134
|
"""
|
|
135
135
|
Default implementation for the single dispatch
|
|
@@ -661,7 +661,7 @@ class LookerSource(DashboardServiceSource):
|
|
|
661
661
|
],
|
|
662
662
|
# Dashboards are created from the UI directly. They are not linked to a project
|
|
663
663
|
# like LookML assets, but rather just organised in folders.
|
|
664
|
-
project=self.
|
|
664
|
+
project=self.get_project_name(dashboard_details),
|
|
665
665
|
sourceUrl=f"{clean_uri(self.service_connection.hostPort)}/dashboards/{dashboard_details.id}",
|
|
666
666
|
service=self.context.dashboard_service,
|
|
667
667
|
owner=self.get_owner_ref(dashboard_details=dashboard_details),
|
|
@@ -669,8 +669,7 @@ class LookerSource(DashboardServiceSource):
|
|
|
669
669
|
yield Either(right=dashboard_request)
|
|
670
670
|
self.register_record(dashboard_request=dashboard_request)
|
|
671
671
|
|
|
672
|
-
|
|
673
|
-
def _get_dashboard_project(dashboard_details: LookerDashboard) -> Optional[str]:
|
|
672
|
+
def get_project_name(self, dashboard_details: LookerDashboard) -> Optional[str]:
|
|
674
673
|
"""
|
|
675
674
|
Get dashboard project if the folder is informed
|
|
676
675
|
"""
|
|
@@ -680,7 +679,7 @@ class LookerSource(DashboardServiceSource):
|
|
|
680
679
|
logger.debug(
|
|
681
680
|
f"Cannot get folder name from dashboard [{dashboard_details.title}] - [{exc}]"
|
|
682
681
|
)
|
|
683
|
-
|
|
682
|
+
return None
|
|
684
683
|
|
|
685
684
|
@staticmethod
|
|
686
685
|
def _clean_table_name(table_name: str) -> str:
|
|
@@ -124,6 +124,10 @@ class MetabaseClient:
|
|
|
124
124
|
try:
|
|
125
125
|
resp_dashboard = self.client.get(f"/dashboard/{dashboard_id}")
|
|
126
126
|
if resp_dashboard:
|
|
127
|
+
# Small hack needed to support Metabase versions older than 0.48
|
|
128
|
+
# https://www.metabase.com/releases/metabase-48#fyi--breaking-changes
|
|
129
|
+
if "ordered_cards" in resp_dashboard:
|
|
130
|
+
resp_dashboard["dashcards"] = resp_dashboard["ordered_cards"]
|
|
127
131
|
return MetabaseDashboardDetails(**resp_dashboard)
|
|
128
132
|
except Exception:
|
|
129
133
|
logger.debug(traceback.format_exc())
|
|
@@ -178,7 +178,7 @@ class MetabaseSource(DashboardServiceSource):
|
|
|
178
178
|
Returns:
|
|
179
179
|
Iterable[CreateChartRequest]
|
|
180
180
|
"""
|
|
181
|
-
charts = dashboard_details.
|
|
181
|
+
charts = dashboard_details.dashcards
|
|
182
182
|
for chart in charts:
|
|
183
183
|
try:
|
|
184
184
|
chart_details = chart.card
|
|
@@ -225,7 +225,7 @@ class MetabaseSource(DashboardServiceSource):
|
|
|
225
225
|
if not db_service_name:
|
|
226
226
|
return
|
|
227
227
|
chart_list, dashboard_name = (
|
|
228
|
-
dashboard_details.
|
|
228
|
+
dashboard_details.dashcards,
|
|
229
229
|
str(dashboard_details.id),
|
|
230
230
|
)
|
|
231
231
|
for chart in chart_list:
|
|
@@ -324,8 +324,9 @@ class MetabaseSource(DashboardServiceSource):
|
|
|
324
324
|
self, chart_details: MetabaseChart, db_service_name: str, dashboard_name: str
|
|
325
325
|
) -> Iterable[Either[AddLineageRequest]]:
|
|
326
326
|
table = self.client.get_table(chart_details.table_id)
|
|
327
|
+
table_name = table.name or table.display_name
|
|
327
328
|
|
|
328
|
-
if table is None or
|
|
329
|
+
if table is None or table_name is None:
|
|
329
330
|
return
|
|
330
331
|
|
|
331
332
|
database_name = table.db.details.db if table.db and table.db.details else None
|
|
@@ -334,7 +335,7 @@ class MetabaseSource(DashboardServiceSource):
|
|
|
334
335
|
database=database_name,
|
|
335
336
|
service_name=db_service_name,
|
|
336
337
|
database_schema=table.table_schema,
|
|
337
|
-
table=
|
|
338
|
+
table=table_name,
|
|
338
339
|
)
|
|
339
340
|
|
|
340
341
|
to_fqn = fqn.build(
|
|
@@ -67,7 +67,7 @@ class MetabaseChart(BaseModel):
|
|
|
67
67
|
display: Optional[str]
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
class
|
|
70
|
+
class DashCard(BaseModel):
|
|
71
71
|
card: MetabaseChart
|
|
72
72
|
|
|
73
73
|
|
|
@@ -77,7 +77,7 @@ class MetabaseDashboardDetails(BaseModel):
|
|
|
77
77
|
"""
|
|
78
78
|
|
|
79
79
|
description: Optional[str]
|
|
80
|
-
|
|
80
|
+
dashcards: List[DashCard]
|
|
81
81
|
name: Optional[str]
|
|
82
82
|
id: int
|
|
83
83
|
collection_id: Optional[str]
|
|
@@ -152,6 +152,23 @@ class TableauSource(DashboardServiceSource):
|
|
|
152
152
|
include_tags=self.source_config.includeTags,
|
|
153
153
|
)
|
|
154
154
|
|
|
155
|
+
def _get_datamodel_sql_query(self, data_model: DataSource) -> Optional[str]:
|
|
156
|
+
"""
|
|
157
|
+
Method to fetch the custom sql query from the tableau datamodels
|
|
158
|
+
"""
|
|
159
|
+
try:
|
|
160
|
+
sql_queries = []
|
|
161
|
+
for table in data_model.upstreamTables or []:
|
|
162
|
+
for referenced_query in table.referencedByQueries or []:
|
|
163
|
+
sql_queries.append(referenced_query.query)
|
|
164
|
+
return "\n\n".join(sql_queries) or None
|
|
165
|
+
except Exception as exc:
|
|
166
|
+
logger.debug(traceback.format_exc())
|
|
167
|
+
logger.warning(
|
|
168
|
+
f"Error processing queries for datamodel [{data_model.id}]: {exc}"
|
|
169
|
+
)
|
|
170
|
+
return None
|
|
171
|
+
|
|
155
172
|
def yield_datamodel(
|
|
156
173
|
self, dashboard_details: TableauDashboard
|
|
157
174
|
) -> Iterable[Either[CreateDashboardDataModelRequest]]:
|
|
@@ -171,6 +188,7 @@ class TableauSource(DashboardServiceSource):
|
|
|
171
188
|
dataModelType=DataModelType.TableauDataModel.value,
|
|
172
189
|
serviceType=DashboardServiceType.Tableau.value,
|
|
173
190
|
columns=self.get_column_info(data_model),
|
|
191
|
+
sql=self._get_datamodel_sql_query(data_model=data_model),
|
|
174
192
|
)
|
|
175
193
|
yield Either(right=data_model_request)
|
|
176
194
|
self.register_record_datamodel(datamodel_request=data_model_request)
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"""
|
|
13
13
|
Source connection helper
|
|
14
14
|
"""
|
|
15
|
-
|
|
15
|
+
import traceback
|
|
16
16
|
from typing import Any
|
|
17
17
|
|
|
18
18
|
from pydantic import BaseModel
|
|
@@ -26,7 +26,14 @@ from metadata.generated.schema.security.credentials.gcpValues import (
|
|
|
26
26
|
SingleProjectId,
|
|
27
27
|
)
|
|
28
28
|
from metadata.ingestion.source.connections import get_connection
|
|
29
|
+
from metadata.ingestion.source.database.bigquery.queries import (
|
|
30
|
+
BIGQUERY_FOREIGN_CONSTRAINTS,
|
|
31
|
+
BIGQUERY_TABLE_CONSTRAINTS,
|
|
32
|
+
)
|
|
29
33
|
from metadata.utils.bigquery_utils import get_bigquery_client
|
|
34
|
+
from metadata.utils.logger import ingestion_logger
|
|
35
|
+
|
|
36
|
+
logger = ingestion_logger()
|
|
30
37
|
|
|
31
38
|
|
|
32
39
|
class InspectorWrapper(BaseModel):
|
|
@@ -64,3 +71,63 @@ def get_inspector_details(
|
|
|
64
71
|
inspector = inspect(engine)
|
|
65
72
|
|
|
66
73
|
return InspectorWrapper(client=client, engine=engine, inspector=inspector)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def get_pk_constraint(
|
|
77
|
+
self, connection, table_name, schema=None, **kw
|
|
78
|
+
): # pylint: disable=unused-argument
|
|
79
|
+
"""
|
|
80
|
+
This function overrides to get primary key constraint
|
|
81
|
+
"""
|
|
82
|
+
try:
|
|
83
|
+
table_constraints = connection.engine.execute(
|
|
84
|
+
BIGQUERY_TABLE_CONSTRAINTS.format(
|
|
85
|
+
project_id=connection.engine.url.host,
|
|
86
|
+
schema_name=schema,
|
|
87
|
+
table_name=table_name,
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
col_name = []
|
|
91
|
+
for table_constraint in table_constraints:
|
|
92
|
+
col_name.append(table_constraint.column_name)
|
|
93
|
+
return {"constrained_columns": tuple(col_name)}
|
|
94
|
+
except Exception as exc:
|
|
95
|
+
logger.debug(traceback.format_exc())
|
|
96
|
+
logger.warning(
|
|
97
|
+
f"Error while fetching primary key constraint error for table [{schema}.{table_name}]: {exc}"
|
|
98
|
+
)
|
|
99
|
+
return {"constrained_columns": []}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def get_foreign_keys(
|
|
103
|
+
self, connection, table_name, schema=None, **kw
|
|
104
|
+
): # pylint: disable=unused-argument
|
|
105
|
+
"""
|
|
106
|
+
This function overrides to get foreign key constraint
|
|
107
|
+
"""
|
|
108
|
+
try:
|
|
109
|
+
table_constraints = connection.engine.execute(
|
|
110
|
+
BIGQUERY_FOREIGN_CONSTRAINTS.format(
|
|
111
|
+
project_id=connection.engine.url.host,
|
|
112
|
+
schema_name=schema,
|
|
113
|
+
table_name=table_name,
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
col_name = []
|
|
117
|
+
for table_constraint in table_constraints:
|
|
118
|
+
col_name.append(
|
|
119
|
+
{
|
|
120
|
+
"name": table_constraint.name,
|
|
121
|
+
"referred_schema": table_constraint.referred_schema,
|
|
122
|
+
"referred_table": table_constraint.referred_table,
|
|
123
|
+
"constrained_columns": [table_constraint.constrained_columns],
|
|
124
|
+
"referred_columns": [table_constraint.referred_columns],
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
return col_name
|
|
128
|
+
except Exception as exc:
|
|
129
|
+
logger.debug(traceback.format_exc())
|
|
130
|
+
logger.warning(
|
|
131
|
+
f"Error while fetching foreign key constraint error for table [{schema}.{table_name}]: {exc}"
|
|
132
|
+
)
|
|
133
|
+
return []
|
|
@@ -56,7 +56,11 @@ from metadata.ingestion.api.steps import InvalidSourceException
|
|
|
56
56
|
from metadata.ingestion.models.ometa_classification import OMetaTagAndClassification
|
|
57
57
|
from metadata.ingestion.ometa.ometa_api import OpenMetadata
|
|
58
58
|
from metadata.ingestion.source.connections import get_test_connection_fn
|
|
59
|
-
from metadata.ingestion.source.database.bigquery.helper import
|
|
59
|
+
from metadata.ingestion.source.database.bigquery.helper import (
|
|
60
|
+
get_foreign_keys,
|
|
61
|
+
get_inspector_details,
|
|
62
|
+
get_pk_constraint,
|
|
63
|
+
)
|
|
60
64
|
from metadata.ingestion.source.database.bigquery.models import (
|
|
61
65
|
STORED_PROC_LANGUAGE_MAP,
|
|
62
66
|
BigQueryStoredProcedure,
|
|
@@ -194,6 +198,8 @@ def _build_formatted_table_id(table):
|
|
|
194
198
|
BigQueryDialect._build_formatted_table_id = ( # pylint: disable=protected-access
|
|
195
199
|
_build_formatted_table_id
|
|
196
200
|
)
|
|
201
|
+
BigQueryDialect.get_pk_constraint = get_pk_constraint
|
|
202
|
+
BigQueryDialect.get_foreign_keys = get_foreign_keys
|
|
197
203
|
|
|
198
204
|
|
|
199
205
|
class BigquerySource(
|
|
@@ -245,7 +251,9 @@ class BigquerySource(
|
|
|
245
251
|
test_connection_fn(
|
|
246
252
|
self.metadata, inspector_details.engine, self.service_connection
|
|
247
253
|
)
|
|
248
|
-
|
|
254
|
+
# GOOGLE_CREDENTIALS may not have been set,
|
|
255
|
+
# to avoid key error, we use `get` for dict
|
|
256
|
+
if os.environ.get(GOOGLE_CREDENTIALS):
|
|
249
257
|
self.temp_credentials_file_path.append(os.environ[GOOGLE_CREDENTIALS])
|
|
250
258
|
|
|
251
259
|
def query_table_names_and_types(
|
|
@@ -436,7 +444,8 @@ class BigquerySource(
|
|
|
436
444
|
inspector_details = get_inspector_details(
|
|
437
445
|
database_name=database_name, service_connection=self.service_connection
|
|
438
446
|
)
|
|
439
|
-
|
|
447
|
+
if os.environ.get(GOOGLE_CREDENTIALS):
|
|
448
|
+
self.temp_credentials_file_path.append(os.environ[GOOGLE_CREDENTIALS])
|
|
440
449
|
self.client = inspector_details.client
|
|
441
450
|
self.engine = inspector_details.engine
|
|
442
451
|
self.inspector = inspector_details.inspector
|
|
@@ -58,6 +58,28 @@ BIGQUERY_TABLE_AND_TYPE = textwrap.dedent(
|
|
|
58
58
|
"""
|
|
59
59
|
)
|
|
60
60
|
|
|
61
|
+
BIGQUERY_TABLE_CONSTRAINTS = textwrap.dedent(
|
|
62
|
+
"""
|
|
63
|
+
SELECT *
|
|
64
|
+
FROM `{project_id}`.{schema_name}.INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
|
|
65
|
+
WHERE table_name = '{table_name}' AND constraint_name LIKE '%pk$';
|
|
66
|
+
"""
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
BIGQUERY_FOREIGN_CONSTRAINTS = textwrap.dedent(
|
|
70
|
+
"""
|
|
71
|
+
SELECT
|
|
72
|
+
c.table_name AS referred_table,
|
|
73
|
+
r.table_schema as referred_schema,
|
|
74
|
+
r.constraint_name as name,
|
|
75
|
+
c.column_name as referred_columns,
|
|
76
|
+
c.column_name as constrained_columns
|
|
77
|
+
FROM `{project_id}`.{schema_name}.INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE c
|
|
78
|
+
JOIN `{project_id}`.{schema_name}.INFORMATION_SCHEMA.TABLE_CONSTRAINTS r ON c.constraint_name = r.constraint_name
|
|
79
|
+
WHERE r.constraint_type = 'FOREIGN KEY' AND r.table_name='{table_name}';
|
|
80
|
+
"""
|
|
81
|
+
)
|
|
82
|
+
|
|
61
83
|
BIGQUERY_GET_STORED_PROCEDURES = textwrap.dedent(
|
|
62
84
|
"""
|
|
63
85
|
SELECT
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Copyright 2024 Collate
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
# you may not use this file except in compliance with the License.
|
|
4
|
+
# You may obtain a copy of the License at
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
8
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
# See the License for the specific language governing permissions and
|
|
10
|
+
# limitations under the License.
|
|
11
|
+
"""A client for Google Cloud Bigtable that supports multiple projects."""
|
|
12
|
+
from functools import partial
|
|
13
|
+
from typing import List, Optional, Type
|
|
14
|
+
|
|
15
|
+
from google import auth
|
|
16
|
+
from google.cloud.bigtable import Client
|
|
17
|
+
|
|
18
|
+
NoProject = object()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class MultiProjectClient:
|
|
22
|
+
"""Google Cloud Client does not support ad-hoc project switching. This class wraps the client and allows
|
|
23
|
+
switching between projects. If no project is specified, the client will not have a project set and will try
|
|
24
|
+
to resolve it from ADC.
|
|
25
|
+
Example usage:
|
|
26
|
+
```
|
|
27
|
+
from google.cloud.bigtable import Client
|
|
28
|
+
client = MultiProjectClient(Client, project_ids=["project1", "project2"])
|
|
29
|
+
instances_project1 = client.list_instances("project1")
|
|
30
|
+
instances_project2 = client.list_instances("project2")
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def __init__(
|
|
34
|
+
self,
|
|
35
|
+
client_class: Type[Client],
|
|
36
|
+
project_ids: Optional[List[str]] = None,
|
|
37
|
+
**client_kwargs,
|
|
38
|
+
):
|
|
39
|
+
if project_ids:
|
|
40
|
+
self.clients = {
|
|
41
|
+
project_id: client_class(project=project_id, **client_kwargs)
|
|
42
|
+
for project_id in project_ids
|
|
43
|
+
}
|
|
44
|
+
else:
|
|
45
|
+
self.clients = {NoProject: client_class(**client_kwargs)}
|
|
46
|
+
|
|
47
|
+
def project_ids(self):
|
|
48
|
+
if NoProject in self.clients:
|
|
49
|
+
_, project_id = auth.default()
|
|
50
|
+
return [project_id]
|
|
51
|
+
return list(self.clients.keys())
|
|
52
|
+
|
|
53
|
+
def __getattr__(self, client_method):
|
|
54
|
+
"""Return the underlying client method as a partial function so we can inject the project_id."""
|
|
55
|
+
return partial(self._call, client_method)
|
|
56
|
+
|
|
57
|
+
def _call(self, method, project_id, *args, **kwargs):
|
|
58
|
+
"""Call the method on the client for the given project_id. The args and kwargs are passed through."""
|
|
59
|
+
client = self.clients.get(project_id, self.clients.get(NoProject))
|
|
60
|
+
if not client:
|
|
61
|
+
raise ValueError(f"Project {project_id} not found")
|
|
62
|
+
return getattr(client, method)(*args, **kwargs)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Copyright 2024 Collate
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
# you may not use this file except in compliance with the License.
|
|
4
|
+
# You may obtain a copy of the License at
|
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
8
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
# See the License for the specific language governing permissions and
|
|
10
|
+
# limitations under the License.
|
|
11
|
+
"""BigTable connection"""
|
|
12
|
+
from typing import List, Optional
|
|
13
|
+
|
|
14
|
+
from google.cloud.bigtable import Client
|
|
15
|
+
|
|
16
|
+
from metadata.generated.schema.entity.automations.workflow import (
|
|
17
|
+
Workflow as AutomationWorkflow,
|
|
18
|
+
)
|
|
19
|
+
from metadata.generated.schema.entity.services.connections.database.bigTableConnection import (
|
|
20
|
+
BigTableConnection,
|
|
21
|
+
)
|
|
22
|
+
from metadata.generated.schema.security.credentials.gcpValues import (
|
|
23
|
+
GcpCredentialsValues,
|
|
24
|
+
SingleProjectId,
|
|
25
|
+
)
|
|
26
|
+
from metadata.ingestion.connections.test_connections import (
|
|
27
|
+
SourceConnectionException,
|
|
28
|
+
test_connection_steps,
|
|
29
|
+
)
|
|
30
|
+
from metadata.ingestion.ometa.ometa_api import OpenMetadata
|
|
31
|
+
from metadata.ingestion.source.database.bigtable.client import MultiProjectClient
|
|
32
|
+
from metadata.utils.credentials import set_google_credentials
|
|
33
|
+
from metadata.utils.logger import ingestion_logger
|
|
34
|
+
|
|
35
|
+
logger = ingestion_logger()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def get_connection(connection: BigTableConnection):
|
|
39
|
+
set_google_credentials(connection.credentials)
|
|
40
|
+
project_ids = None
|
|
41
|
+
if isinstance(connection.credentials.gcpConfig, GcpCredentialsValues):
|
|
42
|
+
project_ids = (
|
|
43
|
+
[connection.credentials.gcpConfig.projectId.__root__]
|
|
44
|
+
if isinstance(connection.credentials.gcpConfig.projectId, SingleProjectId)
|
|
45
|
+
else connection.credentials.gcpConfig.projectId.__root__
|
|
46
|
+
)
|
|
47
|
+
# admin=True is required to list instances and tables
|
|
48
|
+
return MultiProjectClient(client_class=Client, project_ids=project_ids, admin=True)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def get_nested_index(lst: list, index: List[int], default=None):
|
|
52
|
+
try:
|
|
53
|
+
for i in index:
|
|
54
|
+
lst = lst[i]
|
|
55
|
+
return lst
|
|
56
|
+
except IndexError:
|
|
57
|
+
return default
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class Tester:
|
|
61
|
+
"""
|
|
62
|
+
A wrapper class that holds state. We need it because the different testing stages
|
|
63
|
+
are not independent of each other. For example, we need to list instances before we can list
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
def __init__(self, client: MultiProjectClient):
|
|
67
|
+
self.client = client
|
|
68
|
+
self.project_id = None
|
|
69
|
+
self.instance = None
|
|
70
|
+
self.table = None
|
|
71
|
+
|
|
72
|
+
def list_instances(self):
|
|
73
|
+
self.project_id = list(self.client.clients.keys())[0]
|
|
74
|
+
instances = list(self.client.list_instances(project_id=self.project_id))
|
|
75
|
+
self.instance = get_nested_index(instances, [0, 0])
|
|
76
|
+
|
|
77
|
+
def list_tables(self):
|
|
78
|
+
if not self.instance:
|
|
79
|
+
raise SourceConnectionException(
|
|
80
|
+
f"No instances found in project {self.project_id}"
|
|
81
|
+
)
|
|
82
|
+
tables = list(self.instance.list_tables())
|
|
83
|
+
self.table = tables[0]
|
|
84
|
+
|
|
85
|
+
def get_row(self):
|
|
86
|
+
if not self.table:
|
|
87
|
+
raise SourceConnectionException(
|
|
88
|
+
f"No tables found in project {self.instance.project_id} and instance {self.instance.instance_id}"
|
|
89
|
+
)
|
|
90
|
+
self.table.read_rows(limit=1)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def test_connection(
|
|
94
|
+
metadata: OpenMetadata,
|
|
95
|
+
client: MultiProjectClient,
|
|
96
|
+
service_connection: BigTableConnection,
|
|
97
|
+
automation_workflow: Optional[AutomationWorkflow] = None,
|
|
98
|
+
) -> None:
|
|
99
|
+
"""
|
|
100
|
+
Test connection. This can be executed either as part
|
|
101
|
+
of a metadata workflow or during an Automation Workflow
|
|
102
|
+
"""
|
|
103
|
+
tester = Tester(client)
|
|
104
|
+
|
|
105
|
+
test_fn = {
|
|
106
|
+
"GetInstances": tester.list_instances,
|
|
107
|
+
"GetTables": tester.list_tables,
|
|
108
|
+
"GetRows": tester.get_row,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
test_connection_steps(
|
|
112
|
+
metadata=metadata,
|
|
113
|
+
test_fn=test_fn,
|
|
114
|
+
service_type=service_connection.type.value,
|
|
115
|
+
automation_workflow=automation_workflow,
|
|
116
|
+
)
|