Skip to main content
Version: Next

Best Practices

Dataset Naming Helpers

The OpenLineage client provides a naming module with helper classes for constructing valid dataset names and namespaces according to OpenLineage's dataset naming specification. These helpers ensure consistent naming across different data platforms.

Each class implementing the DatasetNaming protocol takes platform-specific parameters and provides get_namespace() and get_name() methods that return properly formatted namespace and name strings.

Examples

from openlineage.client.naming.dataset import Snowflake
from openlineage.client.event_v2 import Dataset

# Create naming helper
naming = Snowflake(
organization_name="myorg",
account_name="myaccount",
database="mydb",
schema="myschema",
table="mytable"
)

# Get namespace and name
namespace = naming.get_namespace() # "snowflake://myorg-myaccount"
name = naming.get_name() # "mydb.myschema.mytable"

# Use in Dataset
dataset = Dataset(namespace=namespace, name=name)