Preset
Important Capabilities
Capability | Status | Notes |
---|---|---|
Detect Deleted Entities | ✅ | Enabled by default via stateful ingestion |
Domains | ✅ | Enabled by domain config to assign domain_key |
Table-Level Lineage | ✅ | Supported by default |
Variation of the Superset plugin that works with Preset.io (Apache Superset SaaS).
CLI based Ingestion
Starter Recipe
Check out the following recipe to get started with ingestion! See below for full configuration options.
For general pointers on writing and running a recipe, see our main recipe guide.
source:
type: preset
config:
# Coordinates
connect_uri: Preset workspace URL
manager_uri: https://api.app.preset.io
# Credentials
api_key: API key
api_secret: API secret
database_alias:
example_name_1: business_name_1
example_name_2: business_name_2
sink:
# sink configs
Config Details
- Options
- Schema
Note that a .
is used to denote nested fields in the YAML recipe.
Field | Description |
---|---|
api_key string | Preset.io API key. |
api_secret string | Preset.io API secret. |
chart_pattern AllowDenyPattern | Patterns for selecting chart names that are to be included Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True} |
connect_uri string | Preset workspace URL. Default: |
dashboard_pattern AllowDenyPattern | Patterns for selecting dashboard names that are to be included Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True} |
database_alias map(str,string) | |
database_pattern AllowDenyPattern | Regex patterns for databases to filter in ingestion. Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True} |
dataset_pattern AllowDenyPattern | Regex patterns for dataset to filter in ingestion. Default: {'allow': ['.*'], 'deny': [], 'ignoreCase': True} |
display_uri string | optional URL to use in links (if connect_uri is only for ingestion) |
ingest_charts boolean | Enable to ingest charts. Default: True |
ingest_dashboards boolean | Enable to ingest dashboards. Default: True |
ingest_datasets boolean | Enable to ingest datasets. Default: False |
manager_uri string | Preset.io API URL Default: https://api.app.preset.io |
max_threads integer | Max parallelism for API calls. Defaults to cpuCount or 40 |
options object | Default: {} |
password string | Superset password. |
platform_instance string | The instance of the platform that all assets produced by this recipe belong to. This should be unique within the platform. See https://docs.datahub.com/docs/platform-instances/ for more details. |
provider string | Superset provider. Default: db |
timeout integer | Timeout of single API call to superset. Default: 10 |
username string | Superset username. |
env string | Environment to use in namespace when constructing URNs Default: PROD |
domain map(str,AllowDenyPattern) | A class to store allow deny regexes |
domain. key .allowarray | List of regex patterns to include in ingestion Default: ['.*'] |
domain. key .allow.stringstring | |
domain. key .ignoreCaseboolean | Whether to ignore case sensitivity during pattern matching. Default: True |
domain. key .denyarray | List of regex patterns to exclude from ingestion. Default: [] |
domain. key .deny.stringstring | |
stateful_ingestion StatefulStaleMetadataRemovalConfig | Preset Stateful Ingestion Config. |
stateful_ingestion.enabled boolean | Whether or not to enable stateful ingest. Default: True if a pipeline_name is set and either a datahub-rest sink or datahub_api is specified, otherwise False Default: False |
stateful_ingestion.fail_safe_threshold number | Prevents large amount of soft deletes & the state from committing from accidental changes to the source configuration if the relative change percent in entities compared to the previous state is above the 'fail_safe_threshold'. Default: 75.0 |
stateful_ingestion.remove_stale_metadata boolean | Soft-deletes the entities present in the last successful run but missing in the current run with stateful_ingestion enabled. Default: True |
The JSONSchema for this configuration is inlined below.
{
"title": "PresetConfig",
"description": "Base configuration class for stateful ingestion for source configs to inherit from.",
"type": "object",
"properties": {
"platform_instance": {
"title": "Platform Instance",
"description": "The instance of the platform that all assets produced by this recipe belong to. This should be unique within the platform. See https://docs.datahub.com/docs/platform-instances/ for more details.",
"type": "string"
},
"env": {
"title": "Env",
"description": "Environment to use in namespace when constructing URNs",
"default": "PROD",
"type": "string"
},
"stateful_ingestion": {
"title": "Stateful Ingestion",
"description": "Preset Stateful Ingestion Config.",
"allOf": [
{
"$ref": "#/definitions/StatefulStaleMetadataRemovalConfig"
}
]
},
"connect_uri": {
"title": "Connect Uri",
"description": "Preset workspace URL.",
"default": "",
"type": "string"
},
"display_uri": {
"title": "Display Uri",
"description": "optional URL to use in links (if `connect_uri` is only for ingestion)",
"type": "string"
},
"domain": {
"title": "Domain",
"description": "Regex patterns for tables to filter to assign domain_key. ",
"default": {},
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/AllowDenyPattern"
}
},
"dataset_pattern": {
"title": "Dataset Pattern",
"description": "Regex patterns for dataset to filter in ingestion.",
"default": {
"allow": [
".*"
],
"deny": [],
"ignoreCase": true
},
"allOf": [
{
"$ref": "#/definitions/AllowDenyPattern"
}
]
},
"chart_pattern": {
"title": "Chart Pattern",
"description": "Patterns for selecting chart names that are to be included",
"default": {
"allow": [
".*"
],
"deny": [],
"ignoreCase": true
},
"allOf": [
{
"$ref": "#/definitions/AllowDenyPattern"
}
]
},
"dashboard_pattern": {
"title": "Dashboard Pattern",
"description": "Patterns for selecting dashboard names that are to be included",
"default": {
"allow": [
".*"
],
"deny": [],
"ignoreCase": true
},
"allOf": [
{
"$ref": "#/definitions/AllowDenyPattern"
}
]
},
"database_pattern": {
"title": "Database Pattern",
"description": "Regex patterns for databases to filter in ingestion.",
"default": {
"allow": [
".*"
],
"deny": [],
"ignoreCase": true
},
"allOf": [
{
"$ref": "#/definitions/AllowDenyPattern"
}
]
},
"username": {
"title": "Username",
"description": "Superset username.",
"type": "string"
},
"password": {
"title": "Password",
"description": "Superset password.",
"type": "string"
},
"ingest_dashboards": {
"title": "Ingest Dashboards",
"description": "Enable to ingest dashboards.",
"default": true,
"type": "boolean"
},
"ingest_charts": {
"title": "Ingest Charts",
"description": "Enable to ingest charts.",
"default": true,
"type": "boolean"
},
"ingest_datasets": {
"title": "Ingest Datasets",
"description": "Enable to ingest datasets.",
"default": false,
"type": "boolean"
},
"provider": {
"title": "Provider",
"description": "Superset provider.",
"default": "db",
"type": "string"
},
"options": {
"title": "Options",
"default": {},
"type": "object"
},
"timeout": {
"title": "Timeout",
"description": "Timeout of single API call to superset.",
"default": 10,
"type": "integer"
},
"max_threads": {
"title": "Max Threads",
"description": "Max parallelism for API calls. Defaults to cpuCount or 40",
"type": "integer"
},
"database_alias": {
"title": "Database Alias",
"description": "Can be used to change mapping for database names in superset to what you have in datahub",
"default": {},
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"manager_uri": {
"title": "Manager Uri",
"description": "Preset.io API URL",
"default": "https://api.app.preset.io",
"type": "string"
},
"api_key": {
"title": "Api Key",
"description": "Preset.io API key.",
"type": "string"
},
"api_secret": {
"title": "Api Secret",
"description": "Preset.io API secret.",
"type": "string"
}
},
"definitions": {
"DynamicTypedStateProviderConfig": {
"title": "DynamicTypedStateProviderConfig",
"type": "object",
"properties": {
"type": {
"title": "Type",
"description": "The type of the state provider to use. For DataHub use `datahub`",
"type": "string"
},
"config": {
"title": "Config",
"description": "The configuration required for initializing the state provider. Default: The datahub_api config if set at pipeline level. Otherwise, the default DatahubClientConfig. See the defaults (https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/src/datahub/ingestion/graph/client.py#L19).",
"default": {},
"type": "object"
}
},
"required": [
"type"
],
"additionalProperties": false
},
"StatefulStaleMetadataRemovalConfig": {
"title": "StatefulStaleMetadataRemovalConfig",
"description": "Base specialized config for Stateful Ingestion with stale metadata removal capability.",
"type": "object",
"properties": {
"enabled": {
"title": "Enabled",
"description": "Whether or not to enable stateful ingest. Default: True if a pipeline_name is set and either a datahub-rest sink or `datahub_api` is specified, otherwise False",
"default": false,
"type": "boolean"
},
"remove_stale_metadata": {
"title": "Remove Stale Metadata",
"description": "Soft-deletes the entities present in the last successful run but missing in the current run with stateful_ingestion enabled.",
"default": true,
"type": "boolean"
},
"fail_safe_threshold": {
"title": "Fail Safe Threshold",
"description": "Prevents large amount of soft deletes & the state from committing from accidental changes to the source configuration if the relative change percent in entities compared to the previous state is above the 'fail_safe_threshold'.",
"default": 75.0,
"minimum": 0.0,
"maximum": 100.0,
"type": "number"
}
},
"additionalProperties": false
},
"AllowDenyPattern": {
"title": "AllowDenyPattern",
"description": "A class to store allow deny regexes",
"type": "object",
"properties": {
"allow": {
"title": "Allow",
"description": "List of regex patterns to include in ingestion",
"default": [
".*"
],
"type": "array",
"items": {
"type": "string"
}
},
"deny": {
"title": "Deny",
"description": "List of regex patterns to exclude from ingestion.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"ignoreCase": {
"title": "Ignorecase",
"description": "Whether to ignore case sensitivity during pattern matching.",
"default": true,
"type": "boolean"
}
},
"additionalProperties": false
}
}
}
If you were using database_alias
in one of your other ingestions to rename your databases to something else based on business needs you can rename them in superset also
source:
type: preset
config:
# Coordinates
connect_uri: Preset workspace URL
manager_uri: https://api.app.preset.io
# Credentials
api_key: API key
api_secret: API secret
database_alias:
example_name_1: business_name_1
example_name_2: business_name_2
sink:
# sink configs
Code Coordinates
- Class Name:
datahub.ingestion.source.preset.PresetSource
- Browse on GitHub
Questions
If you've got any questions on configuring ingestion for Preset, feel free to ping us on our Slack.
Is this page helpful?