Skip to content

Registration

Providers

Azure Blob Store

Register an Azure Blob Store provider.

Azure Blob Storage can be used as the storage component for Spark or the Featureform Pandas Runner.

Examples:

blob = ff.register_blob_store(
    name="azure-quickstart",
    container_name="my_company_container"
    root_path="custom/path/in/container"
    account_name=<azure_account_name>
    account_key=<azure_account_key>
    description="An azure blob store provider to store offline and inference data"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Azure blob store to be registered

required
container_name str

(Immutable) Azure container name

required
root_path str

(Immutable) A custom path in container to store data

required
account_name str

(Immutable) Azure account name

required
account_key str

(Mutable) Secret azure account key

required
description str

(Mutable) Description of Azure Blob provider to be registered

''
team str

(Mutable) The name of the team registering the filestore

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

None
properties dict

(Mutable) Optional grouping mechanism for resources

None

Returns:

Name Type Description
blob StorageProvider

Provider has all the functionality of OnlineProvider

BigQuery

Register a BigQuery provider.

Examples:

bigquery = ff.register_bigquery(
    name="bigquery-quickstart",
    description="A BigQuery deployment we created for the Featureform quickstart",
    project_id="quickstart-project",
    dataset_id="quickstart-dataset",
    credentials=GCPCredentials(...)
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of BigQuery provider to be registered

required
project_id str

(Immutable) The Project name in GCP

required
dataset_id str

(Immutable) The Dataset name in GCP under the Project Id

required
credentials GCPCredentials

(Mutable) GCP credentials to access BigQuery

required
description str

(Mutable) Description of BigQuery provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
bigquery OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_bigquery(
    self,
    name: str,
    project_id: str,
    dataset_id: str,
    credentials: GCPCredentials,
    credentials_path: str = "",
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a BigQuery provider.

    **Examples**:
    ```
    bigquery = ff.register_bigquery(
        name="bigquery-quickstart",
        description="A BigQuery deployment we created for the Featureform quickstart",
        project_id="quickstart-project",
        dataset_id="quickstart-dataset",
        credentials=GCPCredentials(...)
    )
    ```

    Args:
        name (str): (Immutable) Name of BigQuery provider to be registered
        project_id (str): (Immutable) The Project name in GCP
        dataset_id (str): (Immutable) The Dataset name in GCP under the Project Id
        credentials (GCPCredentials): (Mutable) GCP credentials to access BigQuery
        description (str): (Mutable) Description of BigQuery provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        bigquery (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)

    config = BigQueryConfig(
        project_id=project_id,
        dataset_id=dataset_id,
        credentials=credentials,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

Cassandra

Register a Cassandra provider.

Examples:

cassandra = ff.register_cassandra(
        name = "cassandra",
        description = "Example inference store",
        team = "Featureform",
        host = "0.0.0.0",
        port = 9042,
        username = "cassandra",
        password = "cassandra",
        consistency = "THREE",
        replication = 3
    )

Parameters:

Name Type Description Default
name str

(Immutable) Name of Cassandra provider to be registered

required
host str

(Immutable) DNS name of Cassandra

required
port str

(Mutable) Port

required
username str

(Mutable) Username

required
password str

(Mutable) Password

required
consistency str

(Mutable) Consistency

'THREE'
replication int

(Mutable) Replication

3
description str

(Mutable) Description of Cassandra provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
cassandra OnlineProvider

Provider

Source code in src/featureform/register.py
def register_cassandra(
    self,
    name: str,
    host: str,
    port: int,
    username: str,
    password: str,
    keyspace: str,
    consistency: str = "THREE",
    replication: int = 3,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Cassandra provider.

    **Examples**:
    ```
    cassandra = ff.register_cassandra(
            name = "cassandra",
            description = "Example inference store",
            team = "Featureform",
            host = "0.0.0.0",
            port = 9042,
            username = "cassandra",
            password = "cassandra",
            consistency = "THREE",
            replication = 3
        )
    ```

    Args:
        name (str): (Immutable) Name of Cassandra provider to be registered
        host (str): (Immutable) DNS name of Cassandra
        port (str): (Mutable) Port
        username (str): (Mutable) Username
        password (str): (Mutable) Password
        consistency (str): (Mutable) Consistency
        replication (int): (Mutable) Replication
        description (str): (Mutable) Description of Cassandra provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        cassandra (OnlineProvider): Provider
    """
    config = CassandraConfig(
        host=host,
        port=port,
        username=username,
        password=password,
        keyspace=keyspace,
        consistency=consistency,
        replication=replication,
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

DynamoDB

Register a DynamoDB provider.

Examples:

dynamodb = ff.register_dynamodb(
    name="dynamodb-quickstart",
    description="A Dynamodb deployment we created for the Featureform quickstart",
    credentials=aws_creds,
    region="us-east-1"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of DynamoDB provider to be registered

required
region str

(Immutable) Region to create dynamo tables

required
credentials AWSCredentials

(Mutable) AWS credentials with permissions to create DynamoDB tables

required
should_import_from_s3 bool

(Mutable) Determines whether feature materialization will occur via a direct import of data from S3 to new table (see docs for details)

False
description str

(Mutable) Description of DynamoDB provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
dynamodb OnlineProvider

Provider

Source code in src/featureform/register.py
def register_dynamodb(
    self,
    name: str,
    credentials: AWSCredentials,
    region: str,
    should_import_from_s3: bool = False,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a DynamoDB provider.

    **Examples**:
    ```
    dynamodb = ff.register_dynamodb(
        name="dynamodb-quickstart",
        description="A Dynamodb deployment we created for the Featureform quickstart",
        credentials=aws_creds,
        region="us-east-1"
    )
    ```

    Args:
        name (str): (Immutable) Name of DynamoDB provider to be registered
        region (str): (Immutable) Region to create dynamo tables
        credentials (AWSCredentials): (Mutable) AWS credentials with permissions to create DynamoDB tables
        should_import_from_s3 (bool): (Mutable) Determines whether feature materialization will occur via a direct import of data from S3 to new table (see [docs](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/S3DataImport.HowItWorks.html) for details)
        description (str): (Mutable) Description of DynamoDB provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        dynamodb (OnlineProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = DynamodbConfig(
        access_key=credentials.access_key,
        secret_key=credentials.secret_key,
        region=region,
        should_import_from_s3=should_import_from_s3,
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

Firestore

Register a Firestore provider.

Examples:

firestore = ff.register_firestore(
    name="firestore-quickstart",
    description="A Firestore deployment we created for the Featureform quickstart",
    project_id="quickstart-project",
    collection="quickstart-collection",
    credentials=ff.GCPCredentials(...)
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Firestore provider to be registered

required
project_id str

(Immutable) The Project name in GCP

required
collection str

(Immutable) The Collection name in Firestore under the given project ID

required
credentials GCPCredentials

(Mutable) GCP credentials to access Firestore

required
description str

(Mutable) Description of Firestore provider to be registered

''
team str

(Mutable) The name of the team registering the filestore

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
firestore OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_firestore(
    self,
    name: str,
    collection: str,
    project_id: str,
    credentials: GCPCredentials,
    credentials_path: str = "",
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Firestore provider.

    **Examples**:
    ```
    firestore = ff.register_firestore(
        name="firestore-quickstart",
        description="A Firestore deployment we created for the Featureform quickstart",
        project_id="quickstart-project",
        collection="quickstart-collection",
        credentials=ff.GCPCredentials(...)
    )
    ```

    Args:
        name (str): (Immutable) Name of Firestore provider to be registered
        project_id (str): (Immutable) The Project name in GCP
        collection (str): (Immutable) The Collection name in Firestore under the given project ID
        credentials (GCPCredentials): (Mutable) GCP credentials to access Firestore
        description (str): (Mutable) Description of Firestore provider to be registered
        team (str): (Mutable) The name of the team registering the filestore
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        firestore (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = FirestoreConfig(
        collection=collection,
        project_id=project_id,
        credentials=credentials,
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

Google Cloud Storage

Register a GCS store provider.

Examples:

gcs = ff.register_gcs(
    name="gcs-quickstart",
    credentials=ff.GCPCredentials(...),
    bucket_name="bucket_name",
    root_path="featureform/path/",
    description="An gcs store provider to store offline"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of GCS store to be registered

required
bucket_name str

(Immutable) The bucket name

required
root_path str

(Immutable) Custom path to be used by featureform

required
credentials GCPCredentials

(Mutable) GCP credentials to access the bucket

required
description str

(Mutable) Description of GCS provider to be registered

''
team str

(Mutable) The name of the team registering the filestore

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
gcs FileStoreProvider

Provider has all the functionality of OfflineProvider

Source code in src/featureform/register.py
def register_gcs(
    self,
    name: str,
    bucket_name: str,
    root_path: str,
    credentials: GCPCredentials,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a GCS store provider.

    **Examples**:
    ```
    gcs = ff.register_gcs(
        name="gcs-quickstart",
        credentials=ff.GCPCredentials(...),
        bucket_name="bucket_name",
        root_path="featureform/path/",
        description="An gcs store provider to store offline"
    )
    ```

    Args:
        name (str): (Immutable) Name of GCS store to be registered
        bucket_name (str): (Immutable) The bucket name
        root_path (str): (Immutable) Custom path to be used by featureform
        credentials (GCPCredentials): (Mutable) GCP credentials to access the bucket
        description (str): (Mutable) Description of GCS provider to be registered
        team (str): (Mutable) The name of the team registering the filestore
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        gcs (FileStoreProvider): Provider
            has all the functionality of OfflineProvider
    """
    tags, properties = set_tags_properties(tags, properties)

    if bucket_name == "":
        raise ValueError("bucket_name is required and cannot be empty string")

    bucket_name = bucket_name.replace("gs://", "")
    if "/" in bucket_name:
        raise ValueError(
            "bucket_name cannot contain '/'. bucket_name should be the name of the GCS bucket only."
        )

    gcs_config = GCSFileStoreConfig(
        bucket_name=bucket_name, bucket_path=root_path, credentials=credentials
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=gcs_config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return FileStoreProvider(self, provider, gcs_config, gcs_config.type())

HDFS

Register a HDFS store provider.

This has the functionality of an offline store and can be used as a parameter to a k8s or spark provider

Examples:

hdfs = ff.register_hdfs(
    name="hdfs-quickstart",
    host="<host>",
    port="<port>",
    path="<path>",
    username="<username>",
    description="An hdfs store provider to store offline"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of HDFS store to be registered

required
host str

(Immutable) The hostname for HDFS

required
path str

(Immutable) A storage path within HDFS

''
port str

(Mutable) The IPC port for the Namenode for HDFS. (Typically 8020 or 9000)

required
username str

(Mutable) A Username for HDFS

''
description str

(Mutable) Description of HDFS provider to be registered

''
team str

(Mutable) The name of the team registering HDFS

''

Returns:

Name Type Description
hdfs FileStoreProvider

Provider

Source code in src/featureform/register.py
def register_hdfs(
    self,
    name: str,
    host: str,
    port: str,
    username: str = "",
    path: str = "",
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a HDFS store provider.

    This has the functionality of an offline store and can be used as a parameter
    to a k8s or spark provider

    **Examples**:
    ```
    hdfs = ff.register_hdfs(
        name="hdfs-quickstart",
        host="<host>",
        port="<port>",
        path="<path>",
        username="<username>",
        description="An hdfs store provider to store offline"
    )
    ```

    Args:
        name (str): (Immutable) Name of HDFS store to be registered
        host (str): (Immutable) The hostname for HDFS
        path (str): (Immutable) A storage path within HDFS
        port (str): (Mutable) The IPC port for the Namenode for HDFS. (Typically 8020 or 9000)
        username (str): (Mutable) A Username for HDFS
        description (str): (Mutable) Description of HDFS provider to be registered
        team (str): (Mutable) The name of the team registering HDFS

    Returns:
        hdfs (FileStoreProvider): Provider
    """

    hdfs_config = HDFSConfig(host=host, port=port, path=path, username=username)

    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=hdfs_config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return FileStoreProvider(self, provider, hdfs_config, hdfs_config.type())

MongoDB

Register a MongoDB provider.

Examples:

mongodb = ff.register_mongodb(
    name="mongodb-quickstart",
    description="A MongoDB deployment",
    username="my_username",
    password="myPassword",
    database="featureform_database"
    host="my-mongodb.host.com",
    port="10225",
    throughput=10000
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of MongoDB provider to be registered

required
database str

(Immutable) MongoDB database

required
host str

(Immutable) MongoDB hostname

required
port str

(Immutable) MongoDB port

required
username str

(Mutable) MongoDB username

required
password str

(Mutable) MongoDB password

required
throughput int

(Mutable) The maximum RU limit for autoscaling in CosmosDB

1000
description str

(Mutable) Description of MongoDB provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
mongodb OnlineProvider

Provider

Source code in src/featureform/register.py
def register_mongodb(
    self,
    name: str,
    username: str,
    password: str,
    database: str,
    host: str,
    port: str,
    throughput: int = 1000,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a MongoDB provider.

    **Examples**:
    ```
    mongodb = ff.register_mongodb(
        name="mongodb-quickstart",
        description="A MongoDB deployment",
        username="my_username",
        password="myPassword",
        database="featureform_database"
        host="my-mongodb.host.com",
        port="10225",
        throughput=10000
    )
    ```

    Args:
        name (str): (Immutable) Name of MongoDB provider to be registered
        database (str): (Immutable) MongoDB database
        host (str): (Immutable) MongoDB hostname
        port (str): (Immutable) MongoDB port
        username (str): (Mutable) MongoDB username
        password (str): (Mutable) MongoDB password
        throughput (int): (Mutable) The maximum RU limit for autoscaling in CosmosDB
        description (str): (Mutable) Description of MongoDB provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        mongodb (OnlineProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = MongoDBConfig(
        username=username,
        password=password,
        host=host,
        port=port,
        database=database,
        throughput=throughput,
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

Pinecone

Register a Pinecone provider.

Examples:

pinecone = ff.register_pinecone(
    name="pinecone-quickstart",
    project_id="2g13ek7",
    environment="us-west4-gcp-free",
    api_key="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Pinecone provider to be registered

required
project_id str

(Immutable) Pinecone project id

required
environment str

(Immutable) Pinecone environment

required
api_key str

(Mutable) Pinecone api key

required
description str

(Mutable) Description of Pinecone provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
pinecone OnlineProvider

Provider

Source code in src/featureform/register.py
def register_pinecone(
    self,
    name: str,
    project_id: str,
    environment: str,
    api_key: str,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Pinecone provider.

    **Examples**:
    ```
    pinecone = ff.register_pinecone(
        name="pinecone-quickstart",
        project_id="2g13ek7",
        environment="us-west4-gcp-free",
        api_key="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    )
    ```

    Args:
        name (str): (Immutable) Name of Pinecone provider to be registered
        project_id (str): (Immutable) Pinecone project id
        environment (str): (Immutable) Pinecone environment
        api_key (str): (Mutable) Pinecone api key
        description (str): (Mutable) Description of Pinecone provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        pinecone (OnlineProvider): Provider
    """

    tags, properties = set_tags_properties(tags, properties)
    config = PineconeConfig(
        project_id=project_id, environment=environment, api_key=api_key
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

Postgres

Register a Postgres provider.

Examples:

postgres = ff.register_postgres(
    name="postgres-quickstart",
    description="A Postgres deployment we created for the Featureform quickstart",
    host="quickstart-postgres",  # The internal dns name for postgres
    port="5432",
    user="postgres",
    password="password", #pragma: allowlist secret
    database="postgres"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Postgres provider to be registered

required
host str

(Immutable) Hostname for Postgres

required
database str

(Immutable) Database

required
port str

(Mutable) Port

'5432'
user str

(Mutable) User

required
password str

(Mutable) Password

required
sslmode str

(Mutable) SSL mode

'disable'
description str

(Mutable) Description of Postgres provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
postgres OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_postgres(
    self,
    name: str,
    host: str,
    user: str,
    password: str,
    database: str,
    port: str = "5432",
    description: str = "",
    team: str = "",
    sslmode: str = "disable",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Postgres provider.

    **Examples**:
    ```
    postgres = ff.register_postgres(
        name="postgres-quickstart",
        description="A Postgres deployment we created for the Featureform quickstart",
        host="quickstart-postgres",  # The internal dns name for postgres
        port="5432",
        user="postgres",
        password="password", #pragma: allowlist secret
        database="postgres"
    )
    ```

    Args:
        name (str): (Immutable) Name of Postgres provider to be registered
        host (str): (Immutable) Hostname for Postgres
        database (str): (Immutable) Database
        port (str): (Mutable) Port
        user (str): (Mutable) User
        password (str): (Mutable) Password
        sslmode (str): (Mutable) SSL mode
        description (str): (Mutable) Description of Postgres provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        postgres (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = PostgresConfig(
        host=host,
        port=port,
        database=database,
        user=user,
        password=password,
        sslmode=sslmode,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags or [],
        properties=properties or {},
    )

    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

Redis

Register a Redis provider.

Examples:

redis = ff.register_redis(
    name="redis-quickstart",
    host="quickstart-redis",
    port=6379,
    password="password",
    description="A Redis deployment we created for the Featureform quickstart"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Redis provider to be registered

required
host str

(Immutable) Hostname for Redis

required
db str

(Immutable) Redis database number

0
port int

(Mutable) Redis port

6379
password str

(Mutable) Redis password

''
description str

(Mutable) Description of Redis provider to be registered

''
team str

(Mutable) Name of team

''
tags Optional[List[str]]

(Mutable) Optional grouping mechanism for resources

None
properties Optional[dict]

(Mutable) Optional grouping mechanism for resources

None

Returns:

Name Type Description
redis OnlineProvider

Provider

Source code in src/featureform/register.py
def register_redis(
    self,
    name: str,
    host: str,
    port: int = 6379,
    db: int = 0,
    password: str = "",
    description: str = "",
    team: str = "",
    tags: Optional[List[str]] = None,
    properties: Optional[dict] = None,
):
    """Register a Redis provider.

    **Examples**:
    ```
    redis = ff.register_redis(
        name="redis-quickstart",
        host="quickstart-redis",
        port=6379,
        password="password",
        description="A Redis deployment we created for the Featureform quickstart"
    )
    ```

    Args:
        name (str): (Immutable) Name of Redis provider to be registered
        host (str): (Immutable) Hostname for Redis
        db (str): (Immutable) Redis database number
        port (int): (Mutable) Redis port
        password (str): (Mutable) Redis password
        description (str): (Mutable) Description of Redis provider to be registered
        team (str): (Mutable) Name of team
        tags (Optional[List[str]]): (Mutable) Optional grouping mechanism for resources
        properties (Optional[dict]): (Mutable) Optional grouping mechanism for resources

    Returns:
        redis (OnlineProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = RedisConfig(host=host, port=port, password=password, db=db)
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

Redshift

Register a Redshift provider.

Examples:

redshift = ff.register_redshift(
    name="redshift-quickstart",
    description="A Redshift deployment we created for the Featureform quickstart",
    host="quickstart-redshift",  # The internal dns name for redshift
    port="5432",
    user="redshift",
    password="password", #pragma: allowlist secret
    database="dev"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Redshift provider to be registered

required
host str

(Immutable) Hostname for Redshift

required
database str

(Immutable) Redshift database

required
port str

(Mutable) Port

required
user str

(Mutable) User

required
password str

(Mutable) Redshift password

required
sslmode str

(Mutable) SSL mode

'disable'
description str

(Mutable) Description of Redshift provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
redshift OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_redshift(
    self,
    name: str,
    host: str,
    port: str,
    user: str,
    password: str,
    database: str,
    description: str = "",
    team: str = "",
    sslmode: str = "disable",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Redshift provider.

    **Examples**:
    ```
    redshift = ff.register_redshift(
        name="redshift-quickstart",
        description="A Redshift deployment we created for the Featureform quickstart",
        host="quickstart-redshift",  # The internal dns name for redshift
        port="5432",
        user="redshift",
        password="password", #pragma: allowlist secret
        database="dev"
    )
    ```

    Args:
        name (str): (Immutable) Name of Redshift provider to be registered
        host (str): (Immutable) Hostname for Redshift
        database (str): (Immutable) Redshift database
        port (str): (Mutable) Port
        user (str): (Mutable) User
        password (str): (Mutable) Redshift password
        sslmode (str): (Mutable) SSL mode
        description (str): (Mutable) Description of Redshift provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        redshift (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = RedshiftConfig(
        host=host,
        port=port,
        database=database,
        user=user,
        password=password,
        sslmode=sslmode,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

ClickHouse

Register a ClickHouse provider.

Examples:

clickhouse = ff.register_clickhouse(
    name="clickhouse-quickstart",
    description="A ClickHouse deployment we created for the Featureform quickstart",
    host="quickstart-clickhouse",  # The internal dns name for clickhouse
    port=9000,
    user="default",
    password="", #pragma: allowlist secret
    database="default"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of ClickHouse provider to be registered

required
host str

(Immutable) Hostname for ClickHouse

required
database str

(Immutable) ClickHouse database

required
port int

(Mutable) Port

9000
ssl bool

(Mutable) Enable SSL

False
user str

(Mutable) User

required
password str

(Mutable) ClickHouse password

required
description str

(Mutable) Description of ClickHouse provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
clickhouse OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_clickhouse(
    self,
    name: str,
    host: str,
    user: str,
    password: str,
    database: str,
    port: int = 9000,
    description: str = "",
    team: str = "",
    ssl: bool = False,
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a ClickHouse provider.

    **Examples**:
    ```
    clickhouse = ff.register_clickhouse(
        name="clickhouse-quickstart",
        description="A ClickHouse deployment we created for the Featureform quickstart",
        host="quickstart-clickhouse",  # The internal dns name for clickhouse
        port=9000,
        user="default",
        password="", #pragma: allowlist secret
        database="default"
    )
    ```

    Args:
        name (str): (Immutable) Name of ClickHouse provider to be registered
        host (str): (Immutable) Hostname for ClickHouse
        database (str): (Immutable) ClickHouse database
        port (int): (Mutable) Port
        ssl (bool): (Mutable) Enable SSL
        user (str): (Mutable) User
        password (str): (Mutable) ClickHouse password
        description (str): (Mutable) Description of ClickHouse provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        clickhouse (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = ClickHouseConfig(
        host=host,
        port=port,
        database=database,
        user=user,
        password=password,
        ssl=ssl,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

S3

Register a S3 store provider.

This has the functionality of an offline store and can be used as a parameter to a k8s or spark provider

Examples:

s3 = ff.register_s3(
    name="s3-quickstart",
    credentials=aws_creds,
    bucket_name="bucket_name",
    bucket_region=<bucket_region>,
    path="path/to/store/featureform_files/in/",
    description="An s3 store provider to store offline"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of S3 store to be registered

required
bucket_name str

(Immutable) AWS Bucket Name

required
bucket_region str

(Immutable) AWS region the bucket is located in

required
path str

(Immutable) The path used to store featureform files in

''
credentials AWSCredentials

(Mutable) AWS credentials to access the bucket

required
description str

(Mutable) Description of S3 provider to be registered

''
team str

(Mutable) The name of the team registering the filestore

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
s3 FileStoreProvider

Provider has all the functionality of OfflineProvider

Source code in src/featureform/register.py
def register_s3(
    self,
    name: str,
    credentials: AWSCredentials,
    bucket_region: str,
    bucket_name: str,
    path: str = "",
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a S3 store provider.

    This has the functionality of an offline store and can be used as a parameter
    to a k8s or spark provider

    **Examples**:
    ```
    s3 = ff.register_s3(
        name="s3-quickstart",
        credentials=aws_creds,
        bucket_name="bucket_name",
        bucket_region=<bucket_region>,
        path="path/to/store/featureform_files/in/",
        description="An s3 store provider to store offline"
    )
    ```

    Args:
        name (str): (Immutable) Name of S3 store to be registered
        bucket_name (str): (Immutable) AWS Bucket Name
        bucket_region (str): (Immutable) AWS region the bucket is located in
        path (str): (Immutable) The path used to store featureform files in
        credentials (AWSCredentials): (Mutable) AWS credentials to access the bucket
        description (str): (Mutable) Description of S3 provider to be registered
        team (str): (Mutable) The name of the team registering the filestore
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        s3 (FileStoreProvider): Provider
            has all the functionality of OfflineProvider
    """
    tags, properties = set_tags_properties(tags, properties)

    if bucket_name == "":
        raise ValueError("bucket_name is required and cannot be empty string")

    # TODO: add verification into S3StoreConfig
    bucket_name = bucket_name.replace("s3://", "").replace("s3a://", "")

    if "/" in bucket_name:
        raise ValueError(
            "bucket_name cannot contain '/'. bucket_name should be the name of the AWS S3 bucket only."
        )

    s3_config = S3StoreConfig(
        bucket_path=bucket_name,
        bucket_region=bucket_region,
        credentials=credentials,
        path=path,
    )

    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=s3_config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return FileStoreProvider(self, provider, s3_config, s3_config.type())

Snowflake

Current

Register a Snowflake provider.

Examples:

snowflake = ff.register_snowflake(
    name="snowflake-quickstart",
    username="snowflake",
    password="password", #pragma: allowlist secret
    account="account",
    organization="organization",
    database="snowflake",
    schema="PUBLIC",
    description="A Snowflake deployment we created for the Featureform quickstart"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Snowflake provider to be registered

required
account str

(Immutable) Account

required
organization str

(Immutable) Organization

required
database str

(Immutable) Database

required
schema str

(Immutable) Schema

'PUBLIC'
username str

(Mutable) Username

required
password str

(Mutable) Password

required
warehouse str

(Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.

''
role str

(Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session

''
description str

(Mutable) Description of Snowflake provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
snowflake OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_snowflake(
    self,
    name: str,
    username: str,
    password: str,
    account: str,
    organization: str,
    database: str,
    schema: str = "PUBLIC",
    description: str = "",
    team: str = "",
    warehouse: str = "",
    role: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Snowflake provider.

    **Examples**:
    ```
    snowflake = ff.register_snowflake(
        name="snowflake-quickstart",
        username="snowflake",
        password="password", #pragma: allowlist secret
        account="account",
        organization="organization",
        database="snowflake",
        schema="PUBLIC",
        description="A Snowflake deployment we created for the Featureform quickstart"
    )
    ```

    Args:
        name (str): (Immutable) Name of Snowflake provider to be registered
        account (str): (Immutable) Account
        organization (str): (Immutable) Organization
        database (str): (Immutable) Database
        schema (str): (Immutable) Schema
        username (str): (Mutable) Username
        password (str): (Mutable) Password
        warehouse (str): (Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.
        role (str): (Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session
        description (str): (Mutable) Description of Snowflake provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        snowflake (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = SnowflakeConfig(
        account=account,
        database=database,
        organization=organization,
        username=username,
        password=password,
        schema=schema,
        warehouse=warehouse,
        role=role,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

Legacy

Register a Snowflake provider using legacy credentials.

Examples:

snowflake = ff.register_snowflake_legacy(
    name="snowflake-quickstart",
    username="snowflake",
    password="password",
    account_locator="account-locator",
    database="snowflake",
    schema="PUBLIC",
    description="A Snowflake deployment we created for the Featureform quickstart"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Snowflake provider to be registered

required
account_locator str

(Immutable) Account Locator

required
schema str

(Immutable) Schema

'PUBLIC'
database str

(Immutable) Database

required
username str

(Mutable) Username

required
password str

(Mutable) Password

required
warehouse str

(Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.

''
role str

(Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session

''
description str

(Mutable) Description of Snowflake provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
snowflake OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_snowflake_legacy(
    self,
    name: str,
    username: str,
    password: str,
    account_locator: str,
    database: str,
    schema: str = "PUBLIC",
    description: str = "",
    team: str = "",
    warehouse: str = "",
    role: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Snowflake provider using legacy credentials.

    **Examples**:
    ```
    snowflake = ff.register_snowflake_legacy(
        name="snowflake-quickstart",
        username="snowflake",
        password="password",
        account_locator="account-locator",
        database="snowflake",
        schema="PUBLIC",
        description="A Snowflake deployment we created for the Featureform quickstart"
    )
    ```

    Args:
        name (str): (Immutable) Name of Snowflake provider to be registered
        account_locator (str): (Immutable) Account Locator
        schema (str): (Immutable) Schema
        database (str): (Immutable) Database
        username (str): (Mutable) Username
        password (str): (Mutable) Password
        warehouse (str): (Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.
        role (str): (Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session
        description (str): (Mutable) Description of Snowflake provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        snowflake (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = SnowflakeConfig(
        account_locator=account_locator,
        database=database,
        username=username,
        password=password,
        schema=schema,
        warehouse=warehouse,
        role=role,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

Weaviate

Register a Weaviate provider.

Examples:

weaviate = ff.register_weaviate(
    name="weaviate-quickstart",
    url="https://<CLUSTER NAME>.weaviate.network",
    api_key="<API KEY>"
    description="A Weaviate project for using embeddings in Featureform"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Weaviate provider to be registered

required
url str

(Immutable) Endpoint of Weaviate cluster, either in the cloud or via another deployment operation

required
api_key str

(Mutable) Weaviate api key

required
description str

(Mutable) Description of Weaviate provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
weaviate OnlineProvider

Provider

Source code in src/featureform/register.py
def register_weaviate(
    self,
    name: str,
    url: str,
    api_key: str,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Weaviate provider.

    **Examples**:
    ```
    weaviate = ff.register_weaviate(
        name="weaviate-quickstart",
        url="https://<CLUSTER NAME>.weaviate.network",
        api_key="<API KEY>"
        description="A Weaviate project for using embeddings in Featureform"
    )
    ```

    Args:
        name (str): (Immutable) Name of Weaviate provider to be registered
        url (str): (Immutable) Endpoint of Weaviate cluster, either in the cloud or via another deployment operation
        api_key (str): (Mutable) Weaviate api key
        description (str): (Mutable) Description of Weaviate provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        weaviate (OnlineProvider): Provider
    """
    config = WeaviateConfig(url=url, api_key=api_key)
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

Primary Sources

Register a SQL table as a primary data source.

Example

postgres = client.get_provider("my_postgres")
table =  postgres.register_table(
    name="transactions",
    variant="july_2023",
    table="transactions_table",
):

Parameters:

Name Type Description Default
name str

Name of table to be registered

required
variant str

Name of variant to be registered

''
table str

Name of SQL table

required
owner Union[str, UserRegistrar]

Owner

''
description str

Description of table to be registered

''

Returns:

Name Type Description
source ColumnSourceRegistrar

source

Source code in src/featureform/register.py
def register_table(
    self,
    name: str,
    table: str,
    variant: str = "",
    owner: Union[str, UserRegistrar] = "",
    description: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a SQL table as a primary data source.

    **Example**

    ```
    postgres = client.get_provider("my_postgres")
    table =  postgres.register_table(
        name="transactions",
        variant="july_2023",
        table="transactions_table",
    ):
    ```

    Args:
        name (str): Name of table to be registered
        variant (str): Name of variant to be registered
        table (str): Name of SQL table
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of table to be registered

    Returns:
        source (ColumnSourceRegistrar): source
    """
    return self.__registrar.register_primary_data(
        name=name,
        variant=variant,
        location=SQLTable(table),
        owner=owner,
        provider=self.name(),
        description=description,
        tags=tags,
        properties=properties,
    )

Transformations

featureform.register.ResourceClient

The resource client is used to retrieve information on specific resources (entities, providers, features, labels, training sets, models, users).

Parameters:

Name Type Description Default
host str

The hostname of the Featureform instance.

None
insecure bool

True if connecting to an insecure Featureform endpoint. False if using a self-signed or public TLS certificate

False
cert_path str

The path to a public certificate if using a self-signed certificate.

None

Using the Resource Client:

definitions.py
import featureform as ff
from featureform import ResourceClient

rc = ResourceClient("localhost:8000")

# example query:
redis = client.get_provider("redis-quickstart")

Source code in src/featureform/register.py
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
class ResourceClient:
    """
    The resource client is used to retrieve information on specific resources
    (entities, providers, features, labels, training sets, models, users).

    Args:
        host (str): The hostname of the Featureform instance.
        insecure (bool): True if connecting to an insecure Featureform endpoint. False if using a self-signed or public TLS certificate
        cert_path (str): The path to a public certificate if using a self-signed certificate.

    **Using the Resource Client:**
    ``` py title="definitions.py"
    import featureform as ff
    from featureform import ResourceClient

    rc = ResourceClient("localhost:8000")

    # example query:
    redis = client.get_provider("redis-quickstart")
    ```
    """

    def __init__(
        self, host=None, local=False, insecure=False, cert_path=None, dry_run=False
    ):
        if local:
            raise Exception(
                "Local mode is not supported in this version. Use featureform <= 1.12.0 for localmode"
            )

        # This line ensures that the warning is only raised if ResourceClient is instantiated directly
        # TODO: Remove this check once ServingClient is deprecated
        is_instantiated_directed = inspect.stack()[1].function != "__init__"
        if is_instantiated_directed:
            warnings.warn(
                "ResourceClient is deprecated and will be removed in future versions; use Client instead.",
                PendingDeprecationWarning,
            )
        self._dry_run = dry_run
        self._stub = None
        self.local = local

        if dry_run:
            return

        host = host or os.getenv("FEATUREFORM_HOST")
        if host is None:
            raise RuntimeError(
                "If not in local mode then `host` must be passed or the environment"
                " variable FEATUREFORM_HOST must be set."
            )
        if insecure:
            channel = insecure_channel(host)
        else:
            channel = secure_channel(host, cert_path)
        self._stub = GrpcClient(ff_grpc.ApiStub(channel))
        self._host = host

    def apply(self, asynchronous=False, verbose=False):
        """
        Apply all definitions, creating and retrieving all specified resources.

        ```python
        import featureform as ff
        client = ff.Client()

        ff.register_postgres(
            host="localhost",
            port=5432,
        )

        client.apply()
        ```

        Args:
            asynchronous (bool): If True, apply will return immediately and not wait for resources to be created. If False, apply will wait for resources to be created and print out the status of each resource.

        """

        try:
            resource_state = state()
            if resource_state.is_empty():
                print("No resources to apply")
                return

            print(f"Applying Run: {get_run()}")

            if self._dry_run:
                print(resource_state.sorted_list())
                return

            resource_state.create_all(
                self._stub, global_registrar.get_client_objects_for_resource()
            )

            if not asynchronous and self._stub:
                resources = resource_state.sorted_list()
                display_statuses(self._stub, resources, verbose=verbose)
        finally:
            if feature_flag.is_enabled("FF_GET_EQUIVALENT_VARIANTS", True):
                set_run("")
            clear_state()

    def get_user(self, name, local=False):
        """Get a user. Prints out name of user, and all resources associated with the user.

        **Examples:**

        ``` py title="Input"
        featureformer = rc.get_user("featureformer")
        ```

        ``` json title="Output"
        // get_user prints out formatted information on user
        USER NAME:                     featureformer
        -----------------------------------------------

        NAME                           VARIANT                        TYPE
        avg_transactions               quickstart                     feature
        fraudulent                     quickstart                     label
        fraud_training                 quickstart                     training set
        transactions                   kaggle                         source
        average_user_transaction       quickstart                     source
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(featureformer)
        ```

        ``` json title="Output"
        // get_user returns the User object

        name: "featureformer"
        features {
        name: "avg_transactions"
        variant: "quickstart"
        }
        labels {
        name: "fraudulent"
        variant: "quickstart"
        }
        trainingsets {
        name: "fraud_training"
        variant: "quickstart"
        }
        sources {
        name: "transactions"
        variant: "kaggle"
        }
        sources {
        name: "average_user_transaction"
        variant: "quickstart"
        }
        ```

        Args:
            name (str): Name of user to be retrieved

        Returns:
            user (User): User
        """
        return get_user_info(self._stub, name)

    def get_entity(self, name, local=False):
        """Get an entity. Prints out information on entity, and all resources associated with the entity.

        **Examples:**

        ``` py title="Input"
        entity = rc.get_entity("user")
        ```

        ``` json title="Output"
        // get_entity prints out formatted information on entity

        ENTITY NAME:                   user
        STATUS:                        NO_STATUS
        -----------------------------------------------

        NAME                           VARIANT                        TYPE
        avg_transactions               quickstart                     feature
        fraudulent                     quickstart                     label
        fraud_training                 quickstart                     training set
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(postgres)
        ```

        ``` json title="Output"
        // get_entity returns the Entity object

        name: "user"
        features {
            name: "avg_transactions"
            variant: "quickstart"
        }
        labels {
            name: "fraudulent"
            variant: "quickstart"
        }
        trainingsets {
            name: "fraud_training"
            variant: "quickstart"
        }
        ```
        """
        return get_entity_info(self._stub, name)

    def get_model(self, name, local=False) -> Model:
        """Get a model. Prints out information on model, and all resources associated with the model.

        Args:
            name (str): Name of model to be retrieved

        Returns:
            model (Model): Model
        """
        model = None
        model_proto = get_resource_info(self._stub, "model", name)
        if model_proto is not None:
            model = Model(model_proto.name, description="", tags=[], properties={})

        return model

    def get_provider(self, name, local=False):
        """Get a provider. Prints out information on provider, and all resources associated with the provider.

        **Examples:**

        ``` py title="Input"
        postgres = client.get_provider("postgres-quickstart")
        ```

        ``` json title="Output"
        // get_provider prints out formatted information on provider

        NAME:                          postgres-quickstart
        DESCRIPTION:                   A Postgres deployment we created for the Featureform quickstart
        TYPE:                          POSTGRES_OFFLINE
        SOFTWARE:                      postgres
        STATUS:                        NO_STATUS
        -----------------------------------------------
        SOURCES:
        NAME                           VARIANT
        transactions                   kaggle
        average_user_transaction       quickstart
        -----------------------------------------------
        FEATURES:
        NAME                           VARIANT
        -----------------------------------------------
        LABELS:
        NAME                           VARIANT
        fraudulent                     quickstart
        -----------------------------------------------
        TRAINING SETS:
        NAME                           VARIANT
        fraud_training                 quickstart
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(postgres)
        ```

        ``` json title="Output"
        // get_provider returns the Provider object

        name: "postgres-quickstart"
        description: "A Postgres deployment we created for the Featureform quickstart"
        type: "POSTGRES_OFFLINE"
        software: "postgres"
        serialized_config: "{\"Host\": \"quickstart-postgres\",
                            \"Port\": \"5432\",
                            \"Username\": \"postgres\",
                            \"Password\": \"password\",
                            \"Database\": \"postgres\"}"
        sources {
        name: "transactions"
        variant: "kaggle"
        }
        sources {
        name: "average_user_transaction"
        variant: "quickstart"
        }
        trainingsets {
        name: "fraud_training"
        variant: "quickstart"
        }
        labels {
        name: "fraudulent"
        variant: "quickstart"
        }
        ```

        Args:
            name (str): Name of provider to be retrieved

        Returns:
            provider (Provider): Provider
        """
        return get_provider_info(self._stub, name)

    def get_feature(self, name, variant):
        name_variant = metadata_pb2.NameVariant(name=name, variant=variant)
        feature = None
        for x in self._stub.GetFeatureVariants(iter([name_variant])):
            feature = x
            break

        return FeatureVariant(
            created=None,
            name=feature.name,
            variant=feature.variant,
            source=(feature.source.name, feature.source.variant),
            value_type=feature.type,
            entity=feature.entity,
            owner=feature.owner,
            provider=feature.provider,
            location=ResourceColumnMapping("", "", ""),
            description=feature.description,
            status=feature.status.Status._enum_type.values[feature.status.status].name,
        )

    def print_feature(self, name, variant=None, local=False):
        """Get a feature. Prints out information on feature, and all variants associated with the feature. If variant is included, print information on that specific variant and all resources associated with it.

        **Examples:**

        ``` py title="Input"
        avg_transactions = rc.get_feature("avg_transactions")
        ```

        ``` json title="Output"
        // get_feature prints out formatted information on feature

        NAME:                          avg_transactions
        STATUS:                        NO_STATUS
        -----------------------------------------------
        VARIANTS:
        quickstart                     default
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(avg_transactions)
        ```

        ``` json title="Output"
        // get_feature returns the Feature object

        name: "avg_transactions"
        default_variant: "quickstart"
        variants: "quickstart"
        ```

        ``` py title="Input"
        avg_transactions_variant = ff.get_feature("avg_transactions", "quickstart")
        ```

        ``` json title="Output"
        // get_feature with variant provided prints out formatted information on feature variant

        NAME:                          avg_transactions
        VARIANT:                       quickstart
        TYPE:                          float32
        ENTITY:                        user
        OWNER:                         featureformer
        PROVIDER:                      redis-quickstart
        STATUS:                        NO_STATUS
        -----------------------------------------------
        SOURCE:
        NAME                           VARIANT
        average_user_transaction       quickstart
        -----------------------------------------------
        TRAINING SETS:
        NAME                           VARIANT
        fraud_training                 quickstart
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(avg_transactions_variant)
        ```

        ``` json title="Output"
        // get_feature returns the FeatureVariant object

        name: "avg_transactions"
        variant: "quickstart"
        source {
        name: "average_user_transaction"
        variant: "quickstart"
        }
        type: "float32"
        entity: "user"
        created {
        seconds: 1658168552
        nanos: 142461900
        }
        owner: "featureformer"
        provider: "redis-quickstart"
        trainingsets {
        name: "fraud_training"
        variant: "quickstart"
        }
        columns {
        entity: "user_id"
        value: "avg_transaction_amt"
        }
        ```

        Args:
            name (str): Name of feature to be retrieved
            variant (str): Name of variant of feature

        Returns:
            feature (Union[Feature, FeatureVariant]): Feature or FeatureVariant
        """
        if not variant:
            return get_resource_info(self._stub, "feature", name)
        return get_feature_variant_info(self._stub, name, variant)

    def get_label(self, name, variant):
        name_variant = metadata_pb2.NameVariant(name=name, variant=variant)
        label = None
        for x in self._stub.GetLabelVariants(iter([name_variant])):
            label = x
            break

        return LabelVariant(
            name=label.name,
            variant=label.variant,
            source=(label.source.name, label.source.variant),
            value_type=label.type,
            entity=label.entity,
            owner=label.owner,
            provider=label.provider,
            location=ResourceColumnMapping("", "", ""),
            description=label.description,
            status=label.status.Status._enum_type.values[label.status.status].name,
        )

    def print_label(self, name, variant=None, local=False):
        """Get a label. Prints out information on label, and all variants associated with the label. If variant is included, print information on that specific variant and all resources associated with it.

        **Examples:**

        ``` py title="Input"
        fraudulent = rc.get_label("fraudulent")
        ```

        ``` json title="Output"
        // get_label prints out formatted information on label

        NAME:                          fraudulent
        STATUS:                        NO_STATUS
        -----------------------------------------------
        VARIANTS:
        quickstart                     default
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(fraudulent)
        ```

        ``` json title="Output"
        // get_label returns the Label object

        name: "fraudulent"
        default_variant: "quickstart"
        variants: "quickstart"
        ```

        ``` py title="Input"
        fraudulent_variant = ff.get_label("fraudulent", "quickstart")
        ```

        ``` json title="Output"
        // get_label with variant provided prints out formatted information on label variant

        NAME:                          fraudulent
        VARIANT:                       quickstart
        TYPE:                          bool
        ENTITY:                        user
        OWNER:                         featureformer
        PROVIDER:                      postgres-quickstart
        STATUS:                        NO_STATUS
        -----------------------------------------------
        SOURCE:
        NAME                           VARIANT
        transactions                   kaggle
        -----------------------------------------------
        TRAINING SETS:
        NAME                           VARIANT
        fraud_training                 quickstart
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(fraudulent_variant)
        ```

        ``` json title="Output"
        // get_label returns the LabelVariant object

        name: "fraudulent"
        variant: "quickstart"
        type: "bool"
        source {
        name: "transactions"
        variant: "kaggle"
        }
        entity: "user"
        created {
        seconds: 1658168552
        nanos: 154924300
        }
        owner: "featureformer"
        provider: "postgres-quickstart"
        trainingsets {
        name: "fraud_training"
        variant: "quickstart"
        }
        columns {
        entity: "customerid"
        value: "isfraud"
        }
        ```

        Args:
            name (str): Name of label to be retrieved
            variant (str): Name of variant of label

        Returns:
            label (Union[label, LabelVariant]): Label or LabelVariant
        """
        if not variant:
            return get_resource_info(self._stub, "label", name)
        return get_label_variant_info(self._stub, name, variant)

    def get_training_set(self, name, variant):
        name_variant = metadata_pb2.NameVariant(name=name, variant=variant)
        ts = None
        for x in self._stub.GetTrainingSetVariants(iter([name_variant])):
            ts = x
            break

        return TrainingSetVariant(
            created=None,
            name=ts.name,
            variant=ts.variant,
            owner=ts.owner,
            description=ts.description,
            status=ts.status.Status._enum_type.values[ts.status.status].name,
            label=(ts.label.name, ts.label.variant),
            features=[(f.name, f.variant) for f in ts.features],
            feature_lags=[],
            provider=ts.provider,
            # TODO: apply values from proto
            tags=[],
            properties={},
        )

    def print_training_set(self, name, variant=None, local=False):
        """Get a training set. Prints out information on training set, and all variants associated with the training set. If variant is included, print information on that specific variant and all resources associated with it.

        **Examples:**

        ``` py title="Input"
        fraud_training = rc.get_training_set("fraud_training")
        ```

        ``` json title="Output"
        // get_training_set prints out formatted information on training set

        NAME:                          fraud_training
        STATUS:                        NO_STATUS
        -----------------------------------------------
        VARIANTS:
        quickstart                     default
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(fraud_training)
        ```

        ``` json title="Output"
        // get_training_set returns the TrainingSet object

        name: "fraud_training"
        default_variant: "quickstart"
        variants: "quickstart"
        ```

        ``` py title="Input"
        fraudulent_variant = ff.get_training set("fraudulent", "quickstart")
        ```

        ``` json title="Output"
        // get_training_set with variant provided prints out formatted information on training set variant

        NAME:                          fraud_training
        VARIANT:                       quickstart
        OWNER:                         featureformer
        PROVIDER:                      postgres-quickstart
        STATUS:                        NO_STATUS
        -----------------------------------------------
        LABEL:
        NAME                           VARIANT
        fraudulent                     quickstart
        -----------------------------------------------
        FEATURES:
        NAME                           VARIANT
        avg_transactions               quickstart
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(fraudulent_variant)
        ```

        ``` json title="Output"
        // get_training_set returns the TrainingSetVariant object

        name: "fraud_training"
        variant: "quickstart"
        owner: "featureformer"
        created {
        seconds: 1658168552
        nanos: 157934800
        }
        provider: "postgres-quickstart"
        features {
        name: "avg_transactions"
        variant: "quickstart"
        }
        label {
        name: "fraudulent"
        variant: "quickstart"
        }
        ```

        Args:
            name (str): Name of training set to be retrieved
            variant (str): Name of variant of training set

        Returns:
            training_set (Union[TrainingSet, TrainingSetVariant]): TrainingSet or TrainingSetVariant
        """
        if not variant:
            return get_resource_info(self._stub, "training-set", name)
        return get_training_set_variant_info(self._stub, name, variant)

    def get_source(self, name, variant):
        name_variant = metadata_pb2.NameVariantRequest(
            name_variant=metadata_pb2.NameVariant(name=name, variant=variant)
        )
        source = None
        for x in self._stub.GetSourceVariants(iter([name_variant])):
            source = x
            break

        definition = self._get_source_definition(source)

        source_variant = SourceVariant(
            created=None,
            name=source.name,
            definition=definition,
            owner=source.owner,
            provider=source.provider,
            description=source.description,
            variant=source.variant,
            status=source.status.Status._enum_type.values[source.status.status].name,
            tags=[],
            properties={},
            source_text=(
                definition.source_text if type(definition) == DFTransformation else ""
            ),
        )
        return ColumnSourceRegistrar(self, source_variant)

    def _get_source_definition(self, source):
        if source.primaryData.table.name:
            return PrimaryData(SQLTable(source.primaryData.table.name))
        elif source.transformation:
            return self._get_transformation_definition(source)
        else:
            raise Exception(f"Invalid source type {source}")

    def _get_transformation_definition(self, source):
        if source.transformation.DFTransformation.query != bytes():
            transformation = source.transformation.DFTransformation
            return DFTransformation(
                query=transformation.query,
                inputs=[(input.name, input.variant) for input in transformation.inputs],
                source_text=transformation.source_text,
            )
        elif source.transformation.SQLTransformation.query != "":
            return SQLTransformation(source.transformation.SQLTransformation.query)
        else:
            raise Exception(f"Invalid transformation type {source}")

    def print_source(self, name, variant=None, local=False):
        """Get a source. Prints out information on source, and all variants associated with the source. If variant is included, print information on that specific variant and all resources associated with it.

        **Examples:**

        ``` py title="Input"
        transactions = rc.get_transactions("transactions")
        ```

        ``` json title="Output"
        // get_source prints out formatted information on source

        NAME:                          transactions
        STATUS:                        NO_STATUS
        -----------------------------------------------
        VARIANTS:
        kaggle                         default
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(transactions)
        ```

        ``` json title="Output"
        // get_source returns the Source object

        name: "transactions"
        default_variant: "kaggle"
        variants: "kaggle"
        ```

        ``` py title="Input"
        transactions_variant = rc.get_source("transactions", "kaggle")
        ```

        ``` json title="Output"
        // get_source with variant provided prints out formatted information on source variant

        NAME:                          transactions
        VARIANT:                       kaggle
        OWNER:                         featureformer
        DESCRIPTION:                   Fraud Dataset From Kaggle
        PROVIDER:                      postgres-quickstart
        STATUS:                        NO_STATUS
        -----------------------------------------------
        DEFINITION:
        TRANSFORMATION

        -----------------------------------------------
        SOURCES
        NAME                           VARIANT
        -----------------------------------------------
        PRIMARY DATA
        Transactions
        FEATURES:
        NAME                           VARIANT
        -----------------------------------------------
        LABELS:
        NAME                           VARIANT
        fraudulent                     quickstart
        -----------------------------------------------
        TRAINING SETS:
        NAME                           VARIANT
        fraud_training                 quickstart
        -----------------------------------------------
        ```

        ``` py title="Input"
        print(transactions_variant)
        ```

        ``` json title="Output"
        // get_source returns the SourceVariant object

        name: "transactions"
        variant: "kaggle"
        owner: "featureformer"
        description: "Fraud Dataset From Kaggle"
        provider: "postgres-quickstart"
        created {
        seconds: 1658168552
        nanos: 128768000
        }
        trainingsets {
        name: "fraud_training"
        variant: "quickstart"
        }
        labels {
        name: "fraudulent"
        variant: "quickstart"
        }
        primaryData {
        table {
            name: "Transactions"
        }
        }
        ```

        Args:
            name (str): Name of source to be retrieved
            variant (str): Name of variant of source

        Returns:
            source (Union[Source, SourceVariant]): Source or SourceVariant
        """
        if not variant:
            return get_resource_info(self._stub, "source", name)
        return get_source_variant_info(self._stub, name, variant)

    def list_features(self, local=False):
        """List all features.

        **Examples:**
        ``` py title="Input"
        features_list = rc.list_features()
        ```

        ``` json title="Output"
        // list_features prints out formatted information on all features

        NAME                           VARIANT                        STATUS
        user_age                       quickstart (default)           READY
        avg_transactions               quickstart (default)           READY
        avg_transactions               production                     CREATED
        ```

        ``` py title="Input"
        print(features_list)
        ```

        ``` json title="Output"
        // list_features returns a list of Feature objects

        [name: "user_age"
        default_variant: "quickstart"
        variants: "quickstart"
        , name: "avg_transactions"
        default_variant: "quickstart"
        variants: "quickstart"
        variants: "production"
        ]
        ```

        Returns:
            features (List[Feature]): List of Feature Objects
        """
        return list_name_variant_status(self._stub, "feature")

    def list_labels(self, local=False):
        """List all labels.

        **Examples:**
        ``` py title="Input"
        features_list = rc.list_labels()
        ```

        ``` json title="Output"
        // list_labels prints out formatted information on all labels

        NAME                           VARIANT                        STATUS
        user_age                       quickstart (default)           READY
        avg_transactions               quickstart (default)           READY
        avg_transactions               production                     CREATED
        ```

        ``` py title="Input"
        print(label_list)
        ```

        ``` json title="Output"
        // list_features returns a list of Feature objects

        [name: "user_age"
        default_variant: "quickstart"
        variants: "quickstart"
        , name: "avg_transactions"
        default_variant: "quickstart"
        variants: "quickstart"
        variants: "production"
        ]
        ```

        Returns:
            labels (List[Label]): List of Label Objects
        """
        return list_name_variant_status(self._stub, "label")

    def list_users(self, local=False):
        """List all users. Prints a list of all users.

        **Examples:**
        ``` py title="Input"
        users_list = rc.list_users()
        ```

        ``` json title="Output"
        // list_users prints out formatted information on all users

        NAME                           STATUS
        featureformer                  NO_STATUS
        featureformers_friend          CREATED
        ```

        ``` py title="Input"
        print(features_list)
        ```

        ``` json title="Output"
        // list_features returns a list of Feature objects

        [name: "featureformer"
        features {
        name: "avg_transactions"
        variant: "quickstart"
        }
        labels {
        name: "fraudulent"
        variant: "quickstart"
        }
        trainingsets {
        name: "fraud_training"
        variant: "quickstart"
        }
        sources {
        name: "transactions"
        variant: "kaggle"
        }
        sources {
        name: "average_user_transaction"
        variant: "quickstart"
        },
        name: "featureformers_friend"
        features {
        name: "user_age"
        variant: "production"
        }
        sources {
        name: "user_profiles"
        variant: "production"
        }
        ]
        ```

        Returns:
            users (List[User]): List of User Objects
        """
        return list_name_status(self._stub, "user")

    def list_entities(self, local=False):
        """List all entities. Prints a list of all entities.

        **Examples:**
        ``` py title="Input"
        entities = rc.list_entities()
        ```

        ``` json title="Output"
        // list_entities prints out formatted information on all entities

        NAME                           STATUS
        user                           CREATED
        transaction                    CREATED
        ```

        ``` py title="Input"
        print(features_list)
        ```

        ``` json title="Output"
        // list_entities returns a list of Entity objects

        [name: "user"
        features {
        name: "avg_transactions"
        variant: "quickstart"
        }
        features {
        name: "avg_transactions"
        variant: "production"
        }
        features {
        name: "user_age"
        variant: "quickstart"
        }
        labels {
        name: "fraudulent"
        variant: "quickstart"
        }
        trainingsets {
        name: "fraud_training"
        variant: "quickstart"
        }
        ,
        name: "transaction"
        features {
        name: "amount_spent"
        variant: "production"
        }
        ]
        ```

        Returns:
            entities (List[Entity]): List of Entity Objects
        """
        return list_name_status(self._stub, "entity")

    def list_sources(self, local=False):
        """List all sources. Prints a list of all sources.

        **Examples:**
        ``` py title="Input"
        sources_list = rc.list_sources()
        ```

        ``` json title="Output"
        // list_sources prints out formatted information on all sources

        NAME                           VARIANT                        STATUS                         DESCRIPTION
        average_user_transaction       quickstart (default)           NO_STATUS                      the average transaction amount for a user
        transactions                   kaggle (default)               NO_STATUS                      Fraud Dataset From Kaggle
        ```

        ``` py title="Input"
        print(sources_list)
        ```

        ``` json title="Output"
        // list_sources returns a list of Source objects

        [name: "average_user_transaction"
        default_variant: "quickstart"
        variants: "quickstart"
        , name: "transactions"
        default_variant: "kaggle"
        variants: "kaggle"
        ]
        ```

        Returns:
            sources (List[Source]): List of Source Objects
        """
        return list_name_variant_status_desc(self._stub, "source")

    def list_training_sets(self, local=False):
        """List all training sets. Prints a list of all training sets.

        **Examples:**
        ``` py title="Input"
        training_sets_list = rc.list_training_sets()
        ```

        ``` json title="Output"
        // list_training_sets prints out formatted information on all training sets

        NAME                           VARIANT                        STATUS                         DESCRIPTION
        fraud_training                 quickstart (default)           READY                          Training set for fraud detection.
        fraud_training                 v2                             CREATED                        Improved training set for fraud detection.
        recommender                    v1 (default)                   CREATED                        Training set for recommender system.
        ```

        ``` py title="Input"
        print(training_sets_list)
        ```

        ``` json title="Output"
        // list_training_sets returns a list of TrainingSet objects

        [name: "fraud_training"
        default_variant: "quickstart"
        variants: "quickstart", "v2",
        name: "recommender"
        default_variant: "v1"
        variants: "v1"
        ]
        ```

        Returns:
            training_sets (List[TrainingSet]): List of TrainingSet Objects
        """
        return list_name_variant_status_desc(self._stub, "training-set")

    def list_models(self, local=False) -> List[Model]:
        """List all models. Prints a list of all models.

        Returns:
            models (List[Model]): List of Model Objects
        """
        model_protos = list_name(self._stub, "model")
        # TODO: apply values from proto
        models = [Model(proto.name, tags=[], properties={}) for proto in model_protos]

        return models

    def list_providers(self, local=False):
        """List all providers. Prints a list of all providers.

        **Examples:**
        ``` py title="Input"
        providers_list = rc.list_providers()
        ```

        ``` json title="Output"
        // list_providers prints out formatted information on all providers

        NAME                           STATUS                         DESCRIPTION
        redis-quickstart               CREATED                      A Redis deployment we created for the Featureform quickstart
        postgres-quickstart            CREATED                      A Postgres deployment we created for the Featureform quickst
        ```

        ``` py title="Input"
        print(providers_list)
        ```

        ``` json title="Output"
        // list_providers returns a list of Providers objects

        [name: "redis-quickstart"
        description: "A Redis deployment we created for the Featureform quickstart"
        type: "REDIS_ONLINE"
        software: "redis"
        serialized_config: "{\"Addr\": \"quickstart-redis:6379\", \"Password\": \"\", \"DB\": 0}"
        features {
        name: "avg_transactions"
        variant: "quickstart"
        }
        features {
        name: "avg_transactions"
        variant: "production"
        }
        features {
        name: "user_age"
        variant: "quickstart"
        }
        , name: "postgres-quickstart"
        description: "A Postgres deployment we created for the Featureform quickstart"
        type: "POSTGRES_OFFLINE"
        software: "postgres"
        serialized_config: "{\"Host\": \"quickstart-postgres\", \"Port\": \"5432\", \"Username\": \"postgres\", \"Password\": \"password\", \"Database\": \"postgres\"}"
        sources {
        name: "transactions"
        variant: "kaggle"
        }
        sources {
        name: "average_user_transaction"
        variant: "quickstart"
        }
        trainingsets {
        name: "fraud_training"
        variant: "quickstart"
        }
        labels {
        name: "fraudulent"
        variant: "quickstart"
        }
        ]
        ```

        Returns:
            providers (List[Provider]): List of Provider Objects
        """
        return list_name_status_desc(self._stub, "provider")

    def search(self, raw_query, local=False):
        """Search for registered resources. Prints a list of results.

        **Examples:**
        ``` py title="Input"
        providers_list = rc.search("transact")
        ```

        ``` json title="Output"
        // search prints out formatted information on all matches

        NAME                           VARIANT            TYPE
        avg_transactions               default            Source
        ```
        """
        if type(raw_query) != str or len(raw_query) == 0:
            raise Exception("query must be string and cannot be empty")
        processed_query = raw_query.translate({ord(i): None for i in ".,-@!*#"})
        return search(processed_query, self._host)

apply(asynchronous=False, verbose=False)

Apply all definitions, creating and retrieving all specified resources.

import featureform as ff
client = ff.Client()

ff.register_postgres(
    host="localhost",
    port=5432,
)

client.apply()

Parameters:

Name Type Description Default
asynchronous bool

If True, apply will return immediately and not wait for resources to be created. If False, apply will wait for resources to be created and print out the status of each resource.

False
Source code in src/featureform/register.py
def apply(self, asynchronous=False, verbose=False):
    """
    Apply all definitions, creating and retrieving all specified resources.

    ```python
    import featureform as ff
    client = ff.Client()

    ff.register_postgres(
        host="localhost",
        port=5432,
    )

    client.apply()
    ```

    Args:
        asynchronous (bool): If True, apply will return immediately and not wait for resources to be created. If False, apply will wait for resources to be created and print out the status of each resource.

    """

    try:
        resource_state = state()
        if resource_state.is_empty():
            print("No resources to apply")
            return

        print(f"Applying Run: {get_run()}")

        if self._dry_run:
            print(resource_state.sorted_list())
            return

        resource_state.create_all(
            self._stub, global_registrar.get_client_objects_for_resource()
        )

        if not asynchronous and self._stub:
            resources = resource_state.sorted_list()
            display_statuses(self._stub, resources, verbose=verbose)
    finally:
        if feature_flag.is_enabled("FF_GET_EQUIVALENT_VARIANTS", True):
            set_run("")
        clear_state()

get_entity(name, local=False)

Get an entity. Prints out information on entity, and all resources associated with the entity.

Examples:

Input
entity = rc.get_entity("user")
Output
// get_entity prints out formatted information on entity

ENTITY NAME:                   user
STATUS:                        NO_STATUS
-----------------------------------------------

NAME                           VARIANT                        TYPE
avg_transactions               quickstart                     feature
fraudulent                     quickstart                     label
fraud_training                 quickstart                     training set
-----------------------------------------------
Input
print(postgres)
Output
// get_entity returns the Entity object

name: "user"
features {
    name: "avg_transactions"
    variant: "quickstart"
}
labels {
    name: "fraudulent"
    variant: "quickstart"
}
trainingsets {
    name: "fraud_training"
    variant: "quickstart"
}
Source code in src/featureform/register.py
def get_entity(self, name, local=False):
    """Get an entity. Prints out information on entity, and all resources associated with the entity.

    **Examples:**

    ``` py title="Input"
    entity = rc.get_entity("user")
    ```

    ``` json title="Output"
    // get_entity prints out formatted information on entity

    ENTITY NAME:                   user
    STATUS:                        NO_STATUS
    -----------------------------------------------

    NAME                           VARIANT                        TYPE
    avg_transactions               quickstart                     feature
    fraudulent                     quickstart                     label
    fraud_training                 quickstart                     training set
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(postgres)
    ```

    ``` json title="Output"
    // get_entity returns the Entity object

    name: "user"
    features {
        name: "avg_transactions"
        variant: "quickstart"
    }
    labels {
        name: "fraudulent"
        variant: "quickstart"
    }
    trainingsets {
        name: "fraud_training"
        variant: "quickstart"
    }
    ```
    """
    return get_entity_info(self._stub, name)

get_model(name, local=False)

Get a model. Prints out information on model, and all resources associated with the model.

Parameters:

Name Type Description Default
name str

Name of model to be retrieved

required

Returns:

Name Type Description
model Model

Model

Source code in src/featureform/register.py
def get_model(self, name, local=False) -> Model:
    """Get a model. Prints out information on model, and all resources associated with the model.

    Args:
        name (str): Name of model to be retrieved

    Returns:
        model (Model): Model
    """
    model = None
    model_proto = get_resource_info(self._stub, "model", name)
    if model_proto is not None:
        model = Model(model_proto.name, description="", tags=[], properties={})

    return model

get_provider(name, local=False)

Get a provider. Prints out information on provider, and all resources associated with the provider.

Examples:

Input
postgres = client.get_provider("postgres-quickstart")
Output
// get_provider prints out formatted information on provider

NAME:                          postgres-quickstart
DESCRIPTION:                   A Postgres deployment we created for the Featureform quickstart
TYPE:                          POSTGRES_OFFLINE
SOFTWARE:                      postgres
STATUS:                        NO_STATUS
-----------------------------------------------
SOURCES:
NAME                           VARIANT
transactions                   kaggle
average_user_transaction       quickstart
-----------------------------------------------
FEATURES:
NAME                           VARIANT
-----------------------------------------------
LABELS:
NAME                           VARIANT
fraudulent                     quickstart
-----------------------------------------------
TRAINING SETS:
NAME                           VARIANT
fraud_training                 quickstart
-----------------------------------------------
Input
print(postgres)
Output
// get_provider returns the Provider object

name: "postgres-quickstart"
description: "A Postgres deployment we created for the Featureform quickstart"
type: "POSTGRES_OFFLINE"
software: "postgres"
serialized_config: "{"Host": "quickstart-postgres",
                    "Port": "5432",
                    "Username": "postgres",
                    "Password": "password",
                    "Database": "postgres"}"
sources {
name: "transactions"
variant: "kaggle"
}
sources {
name: "average_user_transaction"
variant: "quickstart"
}
trainingsets {
name: "fraud_training"
variant: "quickstart"
}
labels {
name: "fraudulent"
variant: "quickstart"
}

Parameters:

Name Type Description Default
name str

Name of provider to be retrieved

required

Returns:

Name Type Description
provider Provider

Provider

Source code in src/featureform/register.py
def get_provider(self, name, local=False):
    """Get a provider. Prints out information on provider, and all resources associated with the provider.

    **Examples:**

    ``` py title="Input"
    postgres = client.get_provider("postgres-quickstart")
    ```

    ``` json title="Output"
    // get_provider prints out formatted information on provider

    NAME:                          postgres-quickstart
    DESCRIPTION:                   A Postgres deployment we created for the Featureform quickstart
    TYPE:                          POSTGRES_OFFLINE
    SOFTWARE:                      postgres
    STATUS:                        NO_STATUS
    -----------------------------------------------
    SOURCES:
    NAME                           VARIANT
    transactions                   kaggle
    average_user_transaction       quickstart
    -----------------------------------------------
    FEATURES:
    NAME                           VARIANT
    -----------------------------------------------
    LABELS:
    NAME                           VARIANT
    fraudulent                     quickstart
    -----------------------------------------------
    TRAINING SETS:
    NAME                           VARIANT
    fraud_training                 quickstart
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(postgres)
    ```

    ``` json title="Output"
    // get_provider returns the Provider object

    name: "postgres-quickstart"
    description: "A Postgres deployment we created for the Featureform quickstart"
    type: "POSTGRES_OFFLINE"
    software: "postgres"
    serialized_config: "{\"Host\": \"quickstart-postgres\",
                        \"Port\": \"5432\",
                        \"Username\": \"postgres\",
                        \"Password\": \"password\",
                        \"Database\": \"postgres\"}"
    sources {
    name: "transactions"
    variant: "kaggle"
    }
    sources {
    name: "average_user_transaction"
    variant: "quickstart"
    }
    trainingsets {
    name: "fraud_training"
    variant: "quickstart"
    }
    labels {
    name: "fraudulent"
    variant: "quickstart"
    }
    ```

    Args:
        name (str): Name of provider to be retrieved

    Returns:
        provider (Provider): Provider
    """
    return get_provider_info(self._stub, name)

get_user(name, local=False)

Get a user. Prints out name of user, and all resources associated with the user.

Examples:

Input
featureformer = rc.get_user("featureformer")
Output
// get_user prints out formatted information on user
USER NAME:                     featureformer
-----------------------------------------------

NAME                           VARIANT                        TYPE
avg_transactions               quickstart                     feature
fraudulent                     quickstart                     label
fraud_training                 quickstart                     training set
transactions                   kaggle                         source
average_user_transaction       quickstart                     source
-----------------------------------------------
Input
print(featureformer)
Output
// get_user returns the User object

name: "featureformer"
features {
name: "avg_transactions"
variant: "quickstart"
}
labels {
name: "fraudulent"
variant: "quickstart"
}
trainingsets {
name: "fraud_training"
variant: "quickstart"
}
sources {
name: "transactions"
variant: "kaggle"
}
sources {
name: "average_user_transaction"
variant: "quickstart"
}

Parameters:

Name Type Description Default
name str

Name of user to be retrieved

required

Returns:

Name Type Description
user User

User

Source code in src/featureform/register.py
def get_user(self, name, local=False):
    """Get a user. Prints out name of user, and all resources associated with the user.

    **Examples:**

    ``` py title="Input"
    featureformer = rc.get_user("featureformer")
    ```

    ``` json title="Output"
    // get_user prints out formatted information on user
    USER NAME:                     featureformer
    -----------------------------------------------

    NAME                           VARIANT                        TYPE
    avg_transactions               quickstart                     feature
    fraudulent                     quickstart                     label
    fraud_training                 quickstart                     training set
    transactions                   kaggle                         source
    average_user_transaction       quickstart                     source
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(featureformer)
    ```

    ``` json title="Output"
    // get_user returns the User object

    name: "featureformer"
    features {
    name: "avg_transactions"
    variant: "quickstart"
    }
    labels {
    name: "fraudulent"
    variant: "quickstart"
    }
    trainingsets {
    name: "fraud_training"
    variant: "quickstart"
    }
    sources {
    name: "transactions"
    variant: "kaggle"
    }
    sources {
    name: "average_user_transaction"
    variant: "quickstart"
    }
    ```

    Args:
        name (str): Name of user to be retrieved

    Returns:
        user (User): User
    """
    return get_user_info(self._stub, name)

list_entities(local=False)

List all entities. Prints a list of all entities.

Examples:

Input
entities = rc.list_entities()

Output
// list_entities prints out formatted information on all entities

NAME                           STATUS
user                           CREATED
transaction                    CREATED
Input
print(features_list)
Output
// list_entities returns a list of Entity objects

[name: "user"
features {
name: "avg_transactions"
variant: "quickstart"
}
features {
name: "avg_transactions"
variant: "production"
}
features {
name: "user_age"
variant: "quickstart"
}
labels {
name: "fraudulent"
variant: "quickstart"
}
trainingsets {
name: "fraud_training"
variant: "quickstart"
}
,
name: "transaction"
features {
name: "amount_spent"
variant: "production"
}
]

Returns:

Name Type Description
entities List[Entity]

List of Entity Objects

Source code in src/featureform/register.py
def list_entities(self, local=False):
    """List all entities. Prints a list of all entities.

    **Examples:**
    ``` py title="Input"
    entities = rc.list_entities()
    ```

    ``` json title="Output"
    // list_entities prints out formatted information on all entities

    NAME                           STATUS
    user                           CREATED
    transaction                    CREATED
    ```

    ``` py title="Input"
    print(features_list)
    ```

    ``` json title="Output"
    // list_entities returns a list of Entity objects

    [name: "user"
    features {
    name: "avg_transactions"
    variant: "quickstart"
    }
    features {
    name: "avg_transactions"
    variant: "production"
    }
    features {
    name: "user_age"
    variant: "quickstart"
    }
    labels {
    name: "fraudulent"
    variant: "quickstart"
    }
    trainingsets {
    name: "fraud_training"
    variant: "quickstart"
    }
    ,
    name: "transaction"
    features {
    name: "amount_spent"
    variant: "production"
    }
    ]
    ```

    Returns:
        entities (List[Entity]): List of Entity Objects
    """
    return list_name_status(self._stub, "entity")

list_features(local=False)

List all features.

Examples:

Input
features_list = rc.list_features()

Output
// list_features prints out formatted information on all features

NAME                           VARIANT                        STATUS
user_age                       quickstart (default)           READY
avg_transactions               quickstart (default)           READY
avg_transactions               production                     CREATED
Input
print(features_list)
Output
// list_features returns a list of Feature objects

[name: "user_age"
default_variant: "quickstart"
variants: "quickstart"
, name: "avg_transactions"
default_variant: "quickstart"
variants: "quickstart"
variants: "production"
]

Returns:

Name Type Description
features List[Feature]

List of Feature Objects

Source code in src/featureform/register.py
def list_features(self, local=False):
    """List all features.

    **Examples:**
    ``` py title="Input"
    features_list = rc.list_features()
    ```

    ``` json title="Output"
    // list_features prints out formatted information on all features

    NAME                           VARIANT                        STATUS
    user_age                       quickstart (default)           READY
    avg_transactions               quickstart (default)           READY
    avg_transactions               production                     CREATED
    ```

    ``` py title="Input"
    print(features_list)
    ```

    ``` json title="Output"
    // list_features returns a list of Feature objects

    [name: "user_age"
    default_variant: "quickstart"
    variants: "quickstart"
    , name: "avg_transactions"
    default_variant: "quickstart"
    variants: "quickstart"
    variants: "production"
    ]
    ```

    Returns:
        features (List[Feature]): List of Feature Objects
    """
    return list_name_variant_status(self._stub, "feature")

list_labels(local=False)

List all labels.

Examples:

Input
features_list = rc.list_labels()

Output
// list_labels prints out formatted information on all labels

NAME                           VARIANT                        STATUS
user_age                       quickstart (default)           READY
avg_transactions               quickstart (default)           READY
avg_transactions               production                     CREATED
Input
print(label_list)
Output
// list_features returns a list of Feature objects

[name: "user_age"
default_variant: "quickstart"
variants: "quickstart"
, name: "avg_transactions"
default_variant: "quickstart"
variants: "quickstart"
variants: "production"
]

Returns:

Name Type Description
labels List[Label]

List of Label Objects

Source code in src/featureform/register.py
def list_labels(self, local=False):
    """List all labels.

    **Examples:**
    ``` py title="Input"
    features_list = rc.list_labels()
    ```

    ``` json title="Output"
    // list_labels prints out formatted information on all labels

    NAME                           VARIANT                        STATUS
    user_age                       quickstart (default)           READY
    avg_transactions               quickstart (default)           READY
    avg_transactions               production                     CREATED
    ```

    ``` py title="Input"
    print(label_list)
    ```

    ``` json title="Output"
    // list_features returns a list of Feature objects

    [name: "user_age"
    default_variant: "quickstart"
    variants: "quickstart"
    , name: "avg_transactions"
    default_variant: "quickstart"
    variants: "quickstart"
    variants: "production"
    ]
    ```

    Returns:
        labels (List[Label]): List of Label Objects
    """
    return list_name_variant_status(self._stub, "label")

list_models(local=False)

List all models. Prints a list of all models.

Returns:

Name Type Description
models List[Model]

List of Model Objects

Source code in src/featureform/register.py
def list_models(self, local=False) -> List[Model]:
    """List all models. Prints a list of all models.

    Returns:
        models (List[Model]): List of Model Objects
    """
    model_protos = list_name(self._stub, "model")
    # TODO: apply values from proto
    models = [Model(proto.name, tags=[], properties={}) for proto in model_protos]

    return models

list_providers(local=False)

List all providers. Prints a list of all providers.

Examples:

Input
providers_list = rc.list_providers()

Output
// list_providers prints out formatted information on all providers

NAME                           STATUS                         DESCRIPTION
redis-quickstart               CREATED                      A Redis deployment we created for the Featureform quickstart
postgres-quickstart            CREATED                      A Postgres deployment we created for the Featureform quickst
Input
print(providers_list)
Output
// list_providers returns a list of Providers objects

[name: "redis-quickstart"
description: "A Redis deployment we created for the Featureform quickstart"
type: "REDIS_ONLINE"
software: "redis"
serialized_config: "{"Addr": "quickstart-redis:6379", "Password": "", "DB": 0}"
features {
name: "avg_transactions"
variant: "quickstart"
}
features {
name: "avg_transactions"
variant: "production"
}
features {
name: "user_age"
variant: "quickstart"
}
, name: "postgres-quickstart"
description: "A Postgres deployment we created for the Featureform quickstart"
type: "POSTGRES_OFFLINE"
software: "postgres"
serialized_config: "{"Host": "quickstart-postgres", "Port": "5432", "Username": "postgres", "Password": "password", "Database": "postgres"}"
sources {
name: "transactions"
variant: "kaggle"
}
sources {
name: "average_user_transaction"
variant: "quickstart"
}
trainingsets {
name: "fraud_training"
variant: "quickstart"
}
labels {
name: "fraudulent"
variant: "quickstart"
}
]

Returns:

Name Type Description
providers List[Provider]

List of Provider Objects

Source code in src/featureform/register.py
def list_providers(self, local=False):
    """List all providers. Prints a list of all providers.

    **Examples:**
    ``` py title="Input"
    providers_list = rc.list_providers()
    ```

    ``` json title="Output"
    // list_providers prints out formatted information on all providers

    NAME                           STATUS                         DESCRIPTION
    redis-quickstart               CREATED                      A Redis deployment we created for the Featureform quickstart
    postgres-quickstart            CREATED                      A Postgres deployment we created for the Featureform quickst
    ```

    ``` py title="Input"
    print(providers_list)
    ```

    ``` json title="Output"
    // list_providers returns a list of Providers objects

    [name: "redis-quickstart"
    description: "A Redis deployment we created for the Featureform quickstart"
    type: "REDIS_ONLINE"
    software: "redis"
    serialized_config: "{\"Addr\": \"quickstart-redis:6379\", \"Password\": \"\", \"DB\": 0}"
    features {
    name: "avg_transactions"
    variant: "quickstart"
    }
    features {
    name: "avg_transactions"
    variant: "production"
    }
    features {
    name: "user_age"
    variant: "quickstart"
    }
    , name: "postgres-quickstart"
    description: "A Postgres deployment we created for the Featureform quickstart"
    type: "POSTGRES_OFFLINE"
    software: "postgres"
    serialized_config: "{\"Host\": \"quickstart-postgres\", \"Port\": \"5432\", \"Username\": \"postgres\", \"Password\": \"password\", \"Database\": \"postgres\"}"
    sources {
    name: "transactions"
    variant: "kaggle"
    }
    sources {
    name: "average_user_transaction"
    variant: "quickstart"
    }
    trainingsets {
    name: "fraud_training"
    variant: "quickstart"
    }
    labels {
    name: "fraudulent"
    variant: "quickstart"
    }
    ]
    ```

    Returns:
        providers (List[Provider]): List of Provider Objects
    """
    return list_name_status_desc(self._stub, "provider")

list_sources(local=False)

List all sources. Prints a list of all sources.

Examples:

Input
sources_list = rc.list_sources()

Output
// list_sources prints out formatted information on all sources

NAME                           VARIANT                        STATUS                         DESCRIPTION
average_user_transaction       quickstart (default)           NO_STATUS                      the average transaction amount for a user
transactions                   kaggle (default)               NO_STATUS                      Fraud Dataset From Kaggle
Input
print(sources_list)
Output
// list_sources returns a list of Source objects

[name: "average_user_transaction"
default_variant: "quickstart"
variants: "quickstart"
, name: "transactions"
default_variant: "kaggle"
variants: "kaggle"
]

Returns:

Name Type Description
sources List[Source]

List of Source Objects

Source code in src/featureform/register.py
def list_sources(self, local=False):
    """List all sources. Prints a list of all sources.

    **Examples:**
    ``` py title="Input"
    sources_list = rc.list_sources()
    ```

    ``` json title="Output"
    // list_sources prints out formatted information on all sources

    NAME                           VARIANT                        STATUS                         DESCRIPTION
    average_user_transaction       quickstart (default)           NO_STATUS                      the average transaction amount for a user
    transactions                   kaggle (default)               NO_STATUS                      Fraud Dataset From Kaggle
    ```

    ``` py title="Input"
    print(sources_list)
    ```

    ``` json title="Output"
    // list_sources returns a list of Source objects

    [name: "average_user_transaction"
    default_variant: "quickstart"
    variants: "quickstart"
    , name: "transactions"
    default_variant: "kaggle"
    variants: "kaggle"
    ]
    ```

    Returns:
        sources (List[Source]): List of Source Objects
    """
    return list_name_variant_status_desc(self._stub, "source")

list_training_sets(local=False)

List all training sets. Prints a list of all training sets.

Examples:

Input
training_sets_list = rc.list_training_sets()

Output
// list_training_sets prints out formatted information on all training sets

NAME                           VARIANT                        STATUS                         DESCRIPTION
fraud_training                 quickstart (default)           READY                          Training set for fraud detection.
fraud_training                 v2                             CREATED                        Improved training set for fraud detection.
recommender                    v1 (default)                   CREATED                        Training set for recommender system.
Input
print(training_sets_list)
Output
// list_training_sets returns a list of TrainingSet objects

[name: "fraud_training"
default_variant: "quickstart"
variants: "quickstart", "v2",
name: "recommender"
default_variant: "v1"
variants: "v1"
]

Returns:

Name Type Description
training_sets List[TrainingSet]

List of TrainingSet Objects

Source code in src/featureform/register.py
def list_training_sets(self, local=False):
    """List all training sets. Prints a list of all training sets.

    **Examples:**
    ``` py title="Input"
    training_sets_list = rc.list_training_sets()
    ```

    ``` json title="Output"
    // list_training_sets prints out formatted information on all training sets

    NAME                           VARIANT                        STATUS                         DESCRIPTION
    fraud_training                 quickstart (default)           READY                          Training set for fraud detection.
    fraud_training                 v2                             CREATED                        Improved training set for fraud detection.
    recommender                    v1 (default)                   CREATED                        Training set for recommender system.
    ```

    ``` py title="Input"
    print(training_sets_list)
    ```

    ``` json title="Output"
    // list_training_sets returns a list of TrainingSet objects

    [name: "fraud_training"
    default_variant: "quickstart"
    variants: "quickstart", "v2",
    name: "recommender"
    default_variant: "v1"
    variants: "v1"
    ]
    ```

    Returns:
        training_sets (List[TrainingSet]): List of TrainingSet Objects
    """
    return list_name_variant_status_desc(self._stub, "training-set")

list_users(local=False)

List all users. Prints a list of all users.

Examples:

Input
users_list = rc.list_users()

Output
// list_users prints out formatted information on all users

NAME                           STATUS
featureformer                  NO_STATUS
featureformers_friend          CREATED
Input
print(features_list)
Output
// list_features returns a list of Feature objects

[name: "featureformer"
features {
name: "avg_transactions"
variant: "quickstart"
}
labels {
name: "fraudulent"
variant: "quickstart"
}
trainingsets {
name: "fraud_training"
variant: "quickstart"
}
sources {
name: "transactions"
variant: "kaggle"
}
sources {
name: "average_user_transaction"
variant: "quickstart"
},
name: "featureformers_friend"
features {
name: "user_age"
variant: "production"
}
sources {
name: "user_profiles"
variant: "production"
}
]

Returns:

Name Type Description
users List[User]

List of User Objects

Source code in src/featureform/register.py
def list_users(self, local=False):
    """List all users. Prints a list of all users.

    **Examples:**
    ``` py title="Input"
    users_list = rc.list_users()
    ```

    ``` json title="Output"
    // list_users prints out formatted information on all users

    NAME                           STATUS
    featureformer                  NO_STATUS
    featureformers_friend          CREATED
    ```

    ``` py title="Input"
    print(features_list)
    ```

    ``` json title="Output"
    // list_features returns a list of Feature objects

    [name: "featureformer"
    features {
    name: "avg_transactions"
    variant: "quickstart"
    }
    labels {
    name: "fraudulent"
    variant: "quickstart"
    }
    trainingsets {
    name: "fraud_training"
    variant: "quickstart"
    }
    sources {
    name: "transactions"
    variant: "kaggle"
    }
    sources {
    name: "average_user_transaction"
    variant: "quickstart"
    },
    name: "featureformers_friend"
    features {
    name: "user_age"
    variant: "production"
    }
    sources {
    name: "user_profiles"
    variant: "production"
    }
    ]
    ```

    Returns:
        users (List[User]): List of User Objects
    """
    return list_name_status(self._stub, "user")

print_feature(name, variant=None, local=False)

Get a feature. Prints out information on feature, and all variants associated with the feature. If variant is included, print information on that specific variant and all resources associated with it.

Examples:

Input
avg_transactions = rc.get_feature("avg_transactions")
Output
// get_feature prints out formatted information on feature

NAME:                          avg_transactions
STATUS:                        NO_STATUS
-----------------------------------------------
VARIANTS:
quickstart                     default
-----------------------------------------------
Input
print(avg_transactions)
Output
// get_feature returns the Feature object

name: "avg_transactions"
default_variant: "quickstart"
variants: "quickstart"
Input
avg_transactions_variant = ff.get_feature("avg_transactions", "quickstart")
Output
// get_feature with variant provided prints out formatted information on feature variant

NAME:                          avg_transactions
VARIANT:                       quickstart
TYPE:                          float32
ENTITY:                        user
OWNER:                         featureformer
PROVIDER:                      redis-quickstart
STATUS:                        NO_STATUS
-----------------------------------------------
SOURCE:
NAME                           VARIANT
average_user_transaction       quickstart
-----------------------------------------------
TRAINING SETS:
NAME                           VARIANT
fraud_training                 quickstart
-----------------------------------------------
Input
print(avg_transactions_variant)
Output
// get_feature returns the FeatureVariant object

name: "avg_transactions"
variant: "quickstart"
source {
name: "average_user_transaction"
variant: "quickstart"
}
type: "float32"
entity: "user"
created {
seconds: 1658168552
nanos: 142461900
}
owner: "featureformer"
provider: "redis-quickstart"
trainingsets {
name: "fraud_training"
variant: "quickstart"
}
columns {
entity: "user_id"
value: "avg_transaction_amt"
}

Parameters:

Name Type Description Default
name str

Name of feature to be retrieved

required
variant str

Name of variant of feature

None

Returns:

Name Type Description
feature Union[Feature, FeatureVariant]

Feature or FeatureVariant

Source code in src/featureform/register.py
def print_feature(self, name, variant=None, local=False):
    """Get a feature. Prints out information on feature, and all variants associated with the feature. If variant is included, print information on that specific variant and all resources associated with it.

    **Examples:**

    ``` py title="Input"
    avg_transactions = rc.get_feature("avg_transactions")
    ```

    ``` json title="Output"
    // get_feature prints out formatted information on feature

    NAME:                          avg_transactions
    STATUS:                        NO_STATUS
    -----------------------------------------------
    VARIANTS:
    quickstart                     default
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(avg_transactions)
    ```

    ``` json title="Output"
    // get_feature returns the Feature object

    name: "avg_transactions"
    default_variant: "quickstart"
    variants: "quickstart"
    ```

    ``` py title="Input"
    avg_transactions_variant = ff.get_feature("avg_transactions", "quickstart")
    ```

    ``` json title="Output"
    // get_feature with variant provided prints out formatted information on feature variant

    NAME:                          avg_transactions
    VARIANT:                       quickstart
    TYPE:                          float32
    ENTITY:                        user
    OWNER:                         featureformer
    PROVIDER:                      redis-quickstart
    STATUS:                        NO_STATUS
    -----------------------------------------------
    SOURCE:
    NAME                           VARIANT
    average_user_transaction       quickstart
    -----------------------------------------------
    TRAINING SETS:
    NAME                           VARIANT
    fraud_training                 quickstart
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(avg_transactions_variant)
    ```

    ``` json title="Output"
    // get_feature returns the FeatureVariant object

    name: "avg_transactions"
    variant: "quickstart"
    source {
    name: "average_user_transaction"
    variant: "quickstart"
    }
    type: "float32"
    entity: "user"
    created {
    seconds: 1658168552
    nanos: 142461900
    }
    owner: "featureformer"
    provider: "redis-quickstart"
    trainingsets {
    name: "fraud_training"
    variant: "quickstart"
    }
    columns {
    entity: "user_id"
    value: "avg_transaction_amt"
    }
    ```

    Args:
        name (str): Name of feature to be retrieved
        variant (str): Name of variant of feature

    Returns:
        feature (Union[Feature, FeatureVariant]): Feature or FeatureVariant
    """
    if not variant:
        return get_resource_info(self._stub, "feature", name)
    return get_feature_variant_info(self._stub, name, variant)

print_label(name, variant=None, local=False)

Get a label. Prints out information on label, and all variants associated with the label. If variant is included, print information on that specific variant and all resources associated with it.

Examples:

Input
fraudulent = rc.get_label("fraudulent")
Output
// get_label prints out formatted information on label

NAME:                          fraudulent
STATUS:                        NO_STATUS
-----------------------------------------------
VARIANTS:
quickstart                     default
-----------------------------------------------
Input
print(fraudulent)
Output
// get_label returns the Label object

name: "fraudulent"
default_variant: "quickstart"
variants: "quickstart"
Input
fraudulent_variant = ff.get_label("fraudulent", "quickstart")
Output
// get_label with variant provided prints out formatted information on label variant

NAME:                          fraudulent
VARIANT:                       quickstart
TYPE:                          bool
ENTITY:                        user
OWNER:                         featureformer
PROVIDER:                      postgres-quickstart
STATUS:                        NO_STATUS
-----------------------------------------------
SOURCE:
NAME                           VARIANT
transactions                   kaggle
-----------------------------------------------
TRAINING SETS:
NAME                           VARIANT
fraud_training                 quickstart
-----------------------------------------------
Input
print(fraudulent_variant)
Output
// get_label returns the LabelVariant object

name: "fraudulent"
variant: "quickstart"
type: "bool"
source {
name: "transactions"
variant: "kaggle"
}
entity: "user"
created {
seconds: 1658168552
nanos: 154924300
}
owner: "featureformer"
provider: "postgres-quickstart"
trainingsets {
name: "fraud_training"
variant: "quickstart"
}
columns {
entity: "customerid"
value: "isfraud"
}

Parameters:

Name Type Description Default
name str

Name of label to be retrieved

required
variant str

Name of variant of label

None

Returns:

Name Type Description
label Union[label, LabelVariant]

Label or LabelVariant

Source code in src/featureform/register.py
def print_label(self, name, variant=None, local=False):
    """Get a label. Prints out information on label, and all variants associated with the label. If variant is included, print information on that specific variant and all resources associated with it.

    **Examples:**

    ``` py title="Input"
    fraudulent = rc.get_label("fraudulent")
    ```

    ``` json title="Output"
    // get_label prints out formatted information on label

    NAME:                          fraudulent
    STATUS:                        NO_STATUS
    -----------------------------------------------
    VARIANTS:
    quickstart                     default
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(fraudulent)
    ```

    ``` json title="Output"
    // get_label returns the Label object

    name: "fraudulent"
    default_variant: "quickstart"
    variants: "quickstart"
    ```

    ``` py title="Input"
    fraudulent_variant = ff.get_label("fraudulent", "quickstart")
    ```

    ``` json title="Output"
    // get_label with variant provided prints out formatted information on label variant

    NAME:                          fraudulent
    VARIANT:                       quickstart
    TYPE:                          bool
    ENTITY:                        user
    OWNER:                         featureformer
    PROVIDER:                      postgres-quickstart
    STATUS:                        NO_STATUS
    -----------------------------------------------
    SOURCE:
    NAME                           VARIANT
    transactions                   kaggle
    -----------------------------------------------
    TRAINING SETS:
    NAME                           VARIANT
    fraud_training                 quickstart
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(fraudulent_variant)
    ```

    ``` json title="Output"
    // get_label returns the LabelVariant object

    name: "fraudulent"
    variant: "quickstart"
    type: "bool"
    source {
    name: "transactions"
    variant: "kaggle"
    }
    entity: "user"
    created {
    seconds: 1658168552
    nanos: 154924300
    }
    owner: "featureformer"
    provider: "postgres-quickstart"
    trainingsets {
    name: "fraud_training"
    variant: "quickstart"
    }
    columns {
    entity: "customerid"
    value: "isfraud"
    }
    ```

    Args:
        name (str): Name of label to be retrieved
        variant (str): Name of variant of label

    Returns:
        label (Union[label, LabelVariant]): Label or LabelVariant
    """
    if not variant:
        return get_resource_info(self._stub, "label", name)
    return get_label_variant_info(self._stub, name, variant)

print_source(name, variant=None, local=False)

Get a source. Prints out information on source, and all variants associated with the source. If variant is included, print information on that specific variant and all resources associated with it.

Examples:

Input
transactions = rc.get_transactions("transactions")
Output
// get_source prints out formatted information on source

NAME:                          transactions
STATUS:                        NO_STATUS
-----------------------------------------------
VARIANTS:
kaggle                         default
-----------------------------------------------
Input
print(transactions)
Output
// get_source returns the Source object

name: "transactions"
default_variant: "kaggle"
variants: "kaggle"
Input
transactions_variant = rc.get_source("transactions", "kaggle")
Output
// get_source with variant provided prints out formatted information on source variant

NAME:                          transactions
VARIANT:                       kaggle
OWNER:                         featureformer
DESCRIPTION:                   Fraud Dataset From Kaggle
PROVIDER:                      postgres-quickstart
STATUS:                        NO_STATUS
-----------------------------------------------
DEFINITION:
TRANSFORMATION

-----------------------------------------------
SOURCES
NAME                           VARIANT
-----------------------------------------------
PRIMARY DATA
Transactions
FEATURES:
NAME                           VARIANT
-----------------------------------------------
LABELS:
NAME                           VARIANT
fraudulent                     quickstart
-----------------------------------------------
TRAINING SETS:
NAME                           VARIANT
fraud_training                 quickstart
-----------------------------------------------
Input
print(transactions_variant)
Output
// get_source returns the SourceVariant object

name: "transactions"
variant: "kaggle"
owner: "featureformer"
description: "Fraud Dataset From Kaggle"
provider: "postgres-quickstart"
created {
seconds: 1658168552
nanos: 128768000
}
trainingsets {
name: "fraud_training"
variant: "quickstart"
}
labels {
name: "fraudulent"
variant: "quickstart"
}
primaryData {
table {
    name: "Transactions"
}
}

Parameters:

Name Type Description Default
name str

Name of source to be retrieved

required
variant str

Name of variant of source

None

Returns:

Name Type Description
source Union[Source, SourceVariant]

Source or SourceVariant

Source code in src/featureform/register.py
def print_source(self, name, variant=None, local=False):
    """Get a source. Prints out information on source, and all variants associated with the source. If variant is included, print information on that specific variant and all resources associated with it.

    **Examples:**

    ``` py title="Input"
    transactions = rc.get_transactions("transactions")
    ```

    ``` json title="Output"
    // get_source prints out formatted information on source

    NAME:                          transactions
    STATUS:                        NO_STATUS
    -----------------------------------------------
    VARIANTS:
    kaggle                         default
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(transactions)
    ```

    ``` json title="Output"
    // get_source returns the Source object

    name: "transactions"
    default_variant: "kaggle"
    variants: "kaggle"
    ```

    ``` py title="Input"
    transactions_variant = rc.get_source("transactions", "kaggle")
    ```

    ``` json title="Output"
    // get_source with variant provided prints out formatted information on source variant

    NAME:                          transactions
    VARIANT:                       kaggle
    OWNER:                         featureformer
    DESCRIPTION:                   Fraud Dataset From Kaggle
    PROVIDER:                      postgres-quickstart
    STATUS:                        NO_STATUS
    -----------------------------------------------
    DEFINITION:
    TRANSFORMATION

    -----------------------------------------------
    SOURCES
    NAME                           VARIANT
    -----------------------------------------------
    PRIMARY DATA
    Transactions
    FEATURES:
    NAME                           VARIANT
    -----------------------------------------------
    LABELS:
    NAME                           VARIANT
    fraudulent                     quickstart
    -----------------------------------------------
    TRAINING SETS:
    NAME                           VARIANT
    fraud_training                 quickstart
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(transactions_variant)
    ```

    ``` json title="Output"
    // get_source returns the SourceVariant object

    name: "transactions"
    variant: "kaggle"
    owner: "featureformer"
    description: "Fraud Dataset From Kaggle"
    provider: "postgres-quickstart"
    created {
    seconds: 1658168552
    nanos: 128768000
    }
    trainingsets {
    name: "fraud_training"
    variant: "quickstart"
    }
    labels {
    name: "fraudulent"
    variant: "quickstart"
    }
    primaryData {
    table {
        name: "Transactions"
    }
    }
    ```

    Args:
        name (str): Name of source to be retrieved
        variant (str): Name of variant of source

    Returns:
        source (Union[Source, SourceVariant]): Source or SourceVariant
    """
    if not variant:
        return get_resource_info(self._stub, "source", name)
    return get_source_variant_info(self._stub, name, variant)

print_training_set(name, variant=None, local=False)

Get a training set. Prints out information on training set, and all variants associated with the training set. If variant is included, print information on that specific variant and all resources associated with it.

Examples:

Input
fraud_training = rc.get_training_set("fraud_training")
Output
// get_training_set prints out formatted information on training set

NAME:                          fraud_training
STATUS:                        NO_STATUS
-----------------------------------------------
VARIANTS:
quickstart                     default
-----------------------------------------------
Input
print(fraud_training)
Output
// get_training_set returns the TrainingSet object

name: "fraud_training"
default_variant: "quickstart"
variants: "quickstart"
Input
fraudulent_variant = ff.get_training set("fraudulent", "quickstart")
Output
// get_training_set with variant provided prints out formatted information on training set variant

NAME:                          fraud_training
VARIANT:                       quickstart
OWNER:                         featureformer
PROVIDER:                      postgres-quickstart
STATUS:                        NO_STATUS
-----------------------------------------------
LABEL:
NAME                           VARIANT
fraudulent                     quickstart
-----------------------------------------------
FEATURES:
NAME                           VARIANT
avg_transactions               quickstart
-----------------------------------------------
Input
print(fraudulent_variant)
Output
// get_training_set returns the TrainingSetVariant object

name: "fraud_training"
variant: "quickstart"
owner: "featureformer"
created {
seconds: 1658168552
nanos: 157934800
}
provider: "postgres-quickstart"
features {
name: "avg_transactions"
variant: "quickstart"
}
label {
name: "fraudulent"
variant: "quickstart"
}

Parameters:

Name Type Description Default
name str

Name of training set to be retrieved

required
variant str

Name of variant of training set

None

Returns:

Name Type Description
training_set Union[TrainingSet, TrainingSetVariant]

TrainingSet or TrainingSetVariant

Source code in src/featureform/register.py
def print_training_set(self, name, variant=None, local=False):
    """Get a training set. Prints out information on training set, and all variants associated with the training set. If variant is included, print information on that specific variant and all resources associated with it.

    **Examples:**

    ``` py title="Input"
    fraud_training = rc.get_training_set("fraud_training")
    ```

    ``` json title="Output"
    // get_training_set prints out formatted information on training set

    NAME:                          fraud_training
    STATUS:                        NO_STATUS
    -----------------------------------------------
    VARIANTS:
    quickstart                     default
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(fraud_training)
    ```

    ``` json title="Output"
    // get_training_set returns the TrainingSet object

    name: "fraud_training"
    default_variant: "quickstart"
    variants: "quickstart"
    ```

    ``` py title="Input"
    fraudulent_variant = ff.get_training set("fraudulent", "quickstart")
    ```

    ``` json title="Output"
    // get_training_set with variant provided prints out formatted information on training set variant

    NAME:                          fraud_training
    VARIANT:                       quickstart
    OWNER:                         featureformer
    PROVIDER:                      postgres-quickstart
    STATUS:                        NO_STATUS
    -----------------------------------------------
    LABEL:
    NAME                           VARIANT
    fraudulent                     quickstart
    -----------------------------------------------
    FEATURES:
    NAME                           VARIANT
    avg_transactions               quickstart
    -----------------------------------------------
    ```

    ``` py title="Input"
    print(fraudulent_variant)
    ```

    ``` json title="Output"
    // get_training_set returns the TrainingSetVariant object

    name: "fraud_training"
    variant: "quickstart"
    owner: "featureformer"
    created {
    seconds: 1658168552
    nanos: 157934800
    }
    provider: "postgres-quickstart"
    features {
    name: "avg_transactions"
    variant: "quickstart"
    }
    label {
    name: "fraudulent"
    variant: "quickstart"
    }
    ```

    Args:
        name (str): Name of training set to be retrieved
        variant (str): Name of variant of training set

    Returns:
        training_set (Union[TrainingSet, TrainingSetVariant]): TrainingSet or TrainingSetVariant
    """
    if not variant:
        return get_resource_info(self._stub, "training-set", name)
    return get_training_set_variant_info(self._stub, name, variant)

search(raw_query, local=False)

Search for registered resources. Prints a list of results.

Examples:

Input
providers_list = rc.search("transact")

Output
// search prints out formatted information on all matches

NAME                           VARIANT            TYPE
avg_transactions               default            Source
Source code in src/featureform/register.py
def search(self, raw_query, local=False):
    """Search for registered resources. Prints a list of results.

    **Examples:**
    ``` py title="Input"
    providers_list = rc.search("transact")
    ```

    ``` json title="Output"
    // search prints out formatted information on all matches

    NAME                           VARIANT            TYPE
    avg_transactions               default            Source
    ```
    """
    if type(raw_query) != str or len(raw_query) == 0:
        raise Exception("query must be string and cannot be empty")
    processed_query = raw_query.translate({ord(i): None for i in ".,-@!*#"})
    return search(processed_query, self._host)

featureform.register.Registrar

These functions are used to register new resources and retrieving existing resources. Retrieved resources can be used to register additional resources.

definitions.py
import featureform as ff

# e.g. registering a new provider
redis = ff.register_redis(
    name="redis-quickstart",
    host="quickstart-redis",  # The internal dns name for redis
    port=6379,
    description="A Redis deployment we created for the Featureform quickstart"
)
Source code in src/featureform/register.py
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
class Registrar:
    """These functions are used to register new resources and retrieving existing resources.
    Retrieved resources can be used to register additional resources.

    ``` py title="definitions.py"
    import featureform as ff

    # e.g. registering a new provider
    redis = ff.register_redis(
        name="redis-quickstart",
        host="quickstart-redis",  # The internal dns name for redis
        port=6379,
        description="A Redis deployment we created for the Featureform quickstart"
    )
    ```
    """

    def __init__(self):
        self.__state = ResourceState()
        self.__resources = []
        self.__default_owner = ""
        self.__variant_prefix = ""
        if feature_flag.is_enabled("FF_GET_EQUIVALENT_VARIANTS", True):
            self.__run = get_current_timestamp_variant(self.__variant_prefix)
        else:
            self.__run = get_random_name()

        """
        maps client objects (feature object, label object, source decorators) to their resource in the event we want 
        to update the client object after the resource was created

        Introduced for timestamp variants where updates during a resource create ensures that the client object
        has the correct variant when being used as a dependency other resources
        """
        self.__client_obj_to_resource_map = {}

    def add_resource(self, resource):
        self.__resources.append(resource)

    def map_client_object_to_resource(
        self, client_obj, resource_variant: ResourceVariant
    ):
        self.__client_obj_to_resource_map[resource_variant.to_key()] = client_obj

    def get_client_objects_for_resource(self):
        return self.__client_obj_to_resource_map

    def get_resources(self):
        return self.__resources

    def register_user(
        self, name: str, tags: List[str] = [], properties: dict = {}
    ) -> UserRegistrar:
        """Register a user.

        Args:
            name (str): User to be registered.

        Returns:
            UserRegistrar: User
        """
        user = User(name=name, tags=tags, properties=properties)
        self.__resources.append(user)
        return UserRegistrar(self, user)

    def set_default_owner(self, user: str):
        """Set default owner.

        Args:
            user (str): User to be set as default owner of resources.
        """
        self.__default_owner = user

    def default_owner(self) -> str:
        return self.__default_owner

    def must_get_default_owner(self) -> str:
        owner = self.default_owner()
        if owner == "":
            raise ValueError("Owner must be set or a default owner must be specified.")
        return owner

    def set_variant_prefix(self, variant_prefix: str = ""):
        """Set variant prefix.

        Args:
            variant_prefix (str): variant prefix to be set.
        """
        self.__variant_prefix = variant_prefix
        self.set_run()

    def set_run(self, run: str = ""):
        """

        **Example 1**: Using set_run() without arguments will generate a random run name.
        ``` py
        import featureform as ff
        ff.set_run()

        postgres.register_table(
            name="transactions",
            table="transactions_table",
        )

        # Applying will register the source as name=transactions, variant=<randomly-generated>

        ```

        **Example 2**: Using set_run() with arguments will set the variant to the provided name.
        ``` py
        import featureform as ff
        ff.set_run("last_30_days")

        postgres.register_table(
            name="transactions",
            table="transactions_table",
        )

        # Applying will register the source as name=transactions, variant=last_30_days
        ```

        **Example 3**: Generated and set variant names can be used together
        ``` py
        import featureform as ff
        ff.set_run()

        file = spark.register_file(
            name="transactions",
            path="my/transactions.parquet",
            variant="last_30_days"
        )

        @spark.df_transformation(inputs=[file]):
        def customer_count(transactions):
            return transactions.groupBy("CustomerID").count()


        # Applying without a variant for the dataframe transformation will result in
        # the transactions source having a variant of last_30_days and the transformation
        # having a randomly generated variant
        ```

        **Example 4**: This also works within SQL Transformations
        ``` py
        import featureform as ff
        ff.set_run("last_30_days")

        @postgres.sql_transformation():
        def my_transformation():
            return "SELECT CustomerID, Amount FROM {{ transactions }}"

        # The variant will be autofilled so the SQL query is returned as:
        # "SELECT CustomerID, Amount FROM {{ transactions.last_30_days }}"
        ```

        Args:
            run (str): Name of a run to be set.
        """
        if run == "":
            if feature_flag.is_enabled("FF_GET_EQUIVALENT_VARIANTS", True):
                self.__run = get_current_timestamp_variant(self.__variant_prefix)
            else:
                self.__run = get_random_name()
        else:
            self.__run = run

    def get_run(self) -> str:
        """
        Get the current run name.

        **Examples**:
        ``` py
        import featureform as ff

        client = ff.Client()
        f = client.features(("avg_transaction_amount", ff.get_run()), {"user": "123"})

        ```

        Returns:
            run: The name of the current run
        """
        return self.__run

    def get_source(self, name, variant, local=False):
        """
        get_source() can be used to get a reference to an already registered primary source or transformation.
        The returned object can be used to register features and labels or be extended off of to create additional
        transformations.

        **Examples**:

        Registering a transformation from an existing source.
        ``` py
        spark = ff.get_spark("prod-spark")
        transactions = ff.get_source("transactions","kaggle")

        @spark.df_transformation(inputs=[transactions]):
        def customer_count(transactions):
            return transactions.groupBy("CustomerID").count()
        ```

        Registering a feature from an existing source.
        ``` py
        transactions = ff.get_source("transactions","kaggle")

        transactions.register_resources(
            entity=user,
            entity_column="customerid",
            labels=[
                {"name": "fraudulent", "variant": "quickstart", "column": "isfraud", "type": "bool"},
            ],
        )
        ```

        Args:
            name (str): Name of source to be retrieved
            variant (str): Name of variant of source to be retrieved
            local (bool): If localmode is being used

        Returns:
            source (ColumnSourceRegistrar): Source
        """
        if local:
            raise Exception(
                "Localmode is not supported; please try featureform <= 1.12.0"
            )
        else:
            mock_definition = PrimaryData(location=SQLTable(name=""))
            mock_source = SourceVariant(
                created=None,
                name=name,
                variant=variant,
                definition=mock_definition,
                owner="",
                provider="",
                description="",
                tags=[],
                properties={},
            )
            return ColumnSourceRegistrar(self, mock_source)

    def get_redis(self, name):
        """Get a Redis provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        redis = ff.get_redis("redis-quickstart")

        average_user_transaction.register_resources(
            entity=user,
            entity_column="user_id",
            inference_store=redis,
            features=[
                {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
            ],
        )
        ```

        Args:
            name (str): Name of Redis provider to be retrieved

        Returns:
            redis (OnlineProvider): Provider
        """
        mock_config = RedisConfig(host="", port=123, password="", db=123)
        mock_provider = Provider(
            name=name, function="ONLINE", description="", team="", config=mock_config
        )
        return OnlineProvider(self, mock_provider)

    def get_dynamodb(self, name: str):
        """Get a DynamoDB provider. The returned object can be used as an inference store in feature registration.

        **Examples**:
        ``` py
        dynamodb = ff.get_dynamodb("dynamodb-quickstart")

        @ff.entity
        class User:
            avg_transactions = ff.Feature(
                average_user_transaction[["user_id", "avg_transaction_amt"]],
                type=ff.Float32,
                inference_store=dynamodb,
            )
        ```

        Args:
            name (str): Name of DynamoDB provider to be retrieved

        Returns:
            dynamodb (OnlineProvider): Provider
        """
        mock_config = DynamodbConfig(
            region="", access_key="", secret_key="", should_import_from_s3=False
        )
        mock_provider = Provider(
            name=name, function="ONLINE", description="", team="", config=mock_config
        )
        return OnlineProvider(self, mock_provider)

    def get_mongodb(self, name: str):
        """Get a MongoDB provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        mongodb = ff.get_mongodb("mongodb-quickstart")

        average_user_transaction.register_resources(
            entity=user,
            entity_column="user_id",
            inference_store=mongodb,
            features=[
                {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
            ],
        )
        ```

        Args:
            name (str): Name of MongoDB provider to be retrieved

        Returns:
            mongodb (OnlineProvider): Provider
        """
        mock_config = MongoDBConfig(
            username="", password="", host="", port="", database="", throughput=1
        )
        mock_provider = Provider(
            name=name, function="ONLINE", description="", team="", config=mock_config
        )
        return OnlineProvider(self, mock_provider)

    def get_blob_store(self, name):
        """Get an Azure Blob provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        azure_blob = ff.get_blob_store("azure-blob-quickstart")

        average_user_transaction.register_resources(
            entity=user,
            entity_column="user_id",
            inference_store=azure_blob,
            features=[
                {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
            ],
        )
        ```

        Args:
            name (str): Name of Azure blob provider to be retrieved

        Returns:
            azure_blob (FileStoreProvider): Provider
        """
        fake_azure_config = AzureFileStoreConfig(
            account_name="", account_key="", container_name="", root_path=""
        )
        fake_config = OnlineBlobConfig(
            store_type="AZURE", store_config=fake_azure_config.config()
        )
        mock_provider = Provider(
            name=name, function="ONLINE", description="", team="", config=fake_config
        )
        return FileStoreProvider(self, mock_provider, fake_config, "AZURE")

    def get_postgres(self, name):
        """Get a Postgres provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        postgres = ff.get_postgres("postgres-quickstart")
        transactions = postgres.register_table(
            name="transactions",
            variant="kaggle",
            description="Fraud Dataset From Kaggle",
            table="Transactions",  # This is the table's name in Postgres
        )
        ```

        Args:
            name (str): Name of Postgres provider to be retrieved

        Returns:
            postgres (OfflineSQLProvider): Provider
        """
        mock_config = PostgresConfig(
            host="",
            port="",
            database="",
            user="",
            password="",
            sslmode="",
        )
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineSQLProvider(self, mock_provider)

    def get_clickhouse(self, name):
        """Get a ClickHouse provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        clickhouse = ff.get_clickhouse("clickhouse-quickstart")
        transactions = clickhouse.register_table(
            name="transactions",
            variant="kaggle",
            description="Fraud Dataset From Kaggle",
            table="Transactions",  # This is the table's name in ClickHouse
        )
        ```

        Args:
            name (str): Name of ClickHouse provider to be retrieved

        Returns:
            clickhouse (OfflineSQLProvider): Provider
        """
        mock_config = ClickHouseConfig(
            host="",
            port=9000,
            database="",
            user="",
            password="",
            ssl=False,
        )
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineSQLProvider(self, mock_provider)

    def get_snowflake(self, name):
        """Get a Snowflake provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        snowflake = ff.get_snowflake("snowflake-quickstart")
        transactions = snowflake.register_table(
            name="transactions",
            variant="kaggle",
            description="Fraud Dataset From Kaggle",
            table="Transactions",  # This is the table's name in Postgres
        )
        ```

        Args:
            name (str): Name of Snowflake provider to be retrieved

        Returns:
            snowflake (OfflineSQLProvider): Provider
        """
        mock_config = SnowflakeConfig(
            account="ff_fake",
            database="ff_fake",
            organization="ff_fake",
            username="ff_fake",
            password="ff_fake",
            schema="ff_fake",
        )
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineSQLProvider(self, mock_provider)

    def get_snowflake_legacy(self, name: str):
        """Get a Snowflake provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        snowflake = ff.get_snowflake_legacy("snowflake-quickstart")
        transactions = snowflake.register_table(
            name="transactions",
            variant="kaggle",
            description="Fraud Dataset From Kaggle",
            table="Transactions",  # This is the table's name in Postgres
        )
        ```

        Args:
            name (str): Name of Snowflake provider to be retrieved

        Returns:
            snowflake_legacy (OfflineSQLProvider): Provider
        """
        mock_config = SnowflakeConfig(
            account_locator="ff_fake",
            database="ff_fake",
            username="ff_fake",
            password="ff_fake",
            schema="ff_fake",
            warehouse="ff_fake",
            role="ff_fake",
        )
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineSQLProvider(self, mock_provider)

    def get_redshift(self, name):
        """Get a Redshift provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        redshift = ff.get_redshift("redshift-quickstart")
        transactions = redshift.register_table(
            name="transactions",
            variant="kaggle",
            description="Fraud Dataset From Kaggle",
            table="Transactions",  # This is the table's name in Postgres
        )
        ```

        Args:
            name (str): Name of Redshift provider to be retrieved

        Returns:
            redshift (OfflineSQLProvider): Provider
        """
        mock_config = RedshiftConfig(
            host="", port="5439", database="", user="", password="", sslmode=""
        )
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineSQLProvider(self, mock_provider)

    def get_bigquery(self, name):
        """Get a BigQuery provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        bigquery = ff.get_bigquery("bigquery-quickstart")
        transactions = bigquery.register_table(
            name="transactions",
            variant="kaggle",
            description="Fraud Dataset From Kaggle",
            table="Transactions",  # This is the table's name in BigQuery
        )
        ```

        Args:
            name (str): Name of BigQuery provider to be retrieved

        Returns:
            bigquery (OfflineSQLProvider): Provider
        """
        mock_config = BigQueryConfig(
            project_id="mock_project",
            dataset_id="mock_dataset",
            credentials=GCPCredentials(
                project_id="mock_project",
                credentials_path="client/tests/test_files/bigquery_dummy_credentials.json",
            ),
        )
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineSQLProvider(self, mock_provider)

    def get_spark(self, name):
        """Get a Spark provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py
        spark = ff.get_spark("spark-quickstart")
        transactions = spark.register_file(
            name="transactions",
            variant="kaggle",
            description="Fraud Dataset From Kaggle",
            file_path="s3://bucket/path/to/file/transactions.parquet",  # This is the path to file
        )
        ```

        Args:
            name (str): Name of Spark provider to be retrieved

        Returns:
            spark (OfflineSQLProvider): Provider
        """
        mock_config = SparkConfig(
            executor_type="", executor_config={}, store_type="", store_config={}
        )
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineSparkProvider(self, mock_provider)

    def get_kubernetes(self, name):
        """
        Get a k8s provider. The returned object can be used to register additional resources.

        **Examples**:
        ``` py

        k8s = ff.get_kubernetes("k8s-azure-quickstart")
        transactions = k8s.register_file(
            name="transactions",
            variant="kaggle",
            description="Fraud Dataset From Kaggle",
            path="path/to/blob",
        )
        ```

        Args:
            name (str): Name of k8s provider to be retrieved

        Returns:
            k8s (OfflineK8sProvider): Provider
        """
        mock_config = K8sConfig(store_type="", store_config={})
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineK8sProvider(self, mock_provider)

    def get_s3(self, name):
        """
        Get a S3 provider. The returned object can be used with other providers such as Spark and Databricks.

        **Examples**:

        ``` py

        s3 = ff.get_s3("s3-quickstart")
        spark = ff.register_spark(
            name=f"spark-emr-s3",
            description="A Spark deployment we created for the Featureform quickstart",
            team="featureform-team",
            executor=emr,
            filestore=s3,
        )
        ```

        Args:
            name (str): Name of S3 to be retrieved

        Returns:
            s3 (FileStore): Provider
        """
        provider = Provider(
            name=name,
            function="OFFLINE",
            description="description",
            team="team",
            config=s3_config,
        )
        return FileStoreProvider(
            registrar=self,
            provider=provider,
            config=s3_config,
            store_type=s3_config.type(),
        )

    def get_gcs(self, name):
        filePath = "provider/connection/mock_credentials.json"
        fake_creds = GCPCredentials(project_id="id", credentials_path=filePath)
        mock_config = GCSFileStoreConfig(
            bucket_name="", bucket_path="", credentials=fake_creds
        )
        mock_provider = Provider(
            name=name, function="OFFLINE", description="", team="", config=mock_config
        )
        return OfflineK8sProvider(self, mock_provider)

    def _create_mock_creds_file(self, filename, json_data):
        with open(filename, "w") as f:
            json.dumps(json_data, f)

    def get_entity(self, name: str):
        """Get an entity. The returned object can be used to register additional resources.

        **Examples**:

        ``` py
        entity = get_entity("user")
        transactions.register_resources(
            entity=entity,
            entity_column="customerid",
            labels=[
                {"name": "fraudulent", "variant": "quickstart", "column": "isfraud", "type": "bool"},
            ],
        )
        ```

        Args:
            name (str): Name of entity to be retrieved
        Returns:
            entity (EntityRegistrar): Entity
        """
        fakeEntity = Entity(
            name=name, description="", status="", tags=[], properties={}
        )
        return EntityRegistrar(self, fakeEntity)

    def register_redis(
        self,
        name: str,
        host: str,
        port: int = 6379,
        db: int = 0,
        password: str = "",
        description: str = "",
        team: str = "",
        tags: Optional[List[str]] = None,
        properties: Optional[dict] = None,
    ):
        """Register a Redis provider.

        **Examples**:
        ```
        redis = ff.register_redis(
            name="redis-quickstart",
            host="quickstart-redis",
            port=6379,
            password="password",
            description="A Redis deployment we created for the Featureform quickstart"
        )
        ```

        Args:
            name (str): (Immutable) Name of Redis provider to be registered
            host (str): (Immutable) Hostname for Redis
            db (str): (Immutable) Redis database number
            port (int): (Mutable) Redis port
            password (str): (Mutable) Redis password
            description (str): (Mutable) Description of Redis provider to be registered
            team (str): (Mutable) Name of team
            tags (Optional[List[str]]): (Mutable) Optional grouping mechanism for resources
            properties (Optional[dict]): (Mutable) Optional grouping mechanism for resources

        Returns:
            redis (OnlineProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = RedisConfig(host=host, port=port, password=password, db=db)
        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OnlineProvider(self, provider)

    def register_pinecone(
        self,
        name: str,
        project_id: str,
        environment: str,
        api_key: str,
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Pinecone provider.

        **Examples**:
        ```
        pinecone = ff.register_pinecone(
            name="pinecone-quickstart",
            project_id="2g13ek7",
            environment="us-west4-gcp-free",
            api_key="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        )
        ```

        Args:
            name (str): (Immutable) Name of Pinecone provider to be registered
            project_id (str): (Immutable) Pinecone project id
            environment (str): (Immutable) Pinecone environment
            api_key (str): (Mutable) Pinecone api key
            description (str): (Mutable) Description of Pinecone provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            pinecone (OnlineProvider): Provider
        """

        tags, properties = set_tags_properties(tags, properties)
        config = PineconeConfig(
            project_id=project_id, environment=environment, api_key=api_key
        )
        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OnlineProvider(self, provider)

    def register_weaviate(
        self,
        name: str,
        url: str,
        api_key: str,
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Weaviate provider.

        **Examples**:
        ```
        weaviate = ff.register_weaviate(
            name="weaviate-quickstart",
            url="https://<CLUSTER NAME>.weaviate.network",
            api_key="<API KEY>"
            description="A Weaviate project for using embeddings in Featureform"
        )
        ```

        Args:
            name (str): (Immutable) Name of Weaviate provider to be registered
            url (str): (Immutable) Endpoint of Weaviate cluster, either in the cloud or via another deployment operation
            api_key (str): (Mutable) Weaviate api key
            description (str): (Mutable) Description of Weaviate provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            weaviate (OnlineProvider): Provider
        """
        config = WeaviateConfig(url=url, api_key=api_key)
        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OnlineProvider(self, provider)

    def register_qdrant(
        self,
        name: str,
        grpc_host: str,
        api_key: str = "",
        use_tls: bool = False,
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Qdrant provider.

        **Examples**:
        ```
        qdrant = ff.register_qdrant(
            name="qdrant-quickstart",
            grpc_host="xyz-example.eu-central.aws.cloud.qdrant.io:6334",
            api_key="<API KEY>",
            use_tls=True,
            description="A Qdrant project for using embeddings in Featureform"
        )
        ```

        Args:
            name (str): (Immutable) Name of Qdrant provider to be registered
            url (str): (Immutable) gRPC host of the Qdrant cluster, either in the cloud or via local deployment.
            api_key (str): (Mutable) Qdrant API key.
            use_tls (bool): (Immutable) Whether to use TLS for the connection.
            description (str): (Mutable) Description of Qdrant provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            qdrant (OnlineProvider): Provider
        """
        config = QdrantConfig(grpc_host=grpc_host, api_key=api_key, use_tls=use_tls)
        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OnlineProvider(self, provider)

    def register_blob_store(
        self,
        name: str,
        account_name: str,
        account_key: str,
        container_name: str,
        root_path: str,
        description: str = "",
        team: str = "",
        tags=None,
        properties=None,
    ):
        """Register an Azure Blob Store provider.

        Azure Blob Storage can be used as the storage component for Spark or the Featureform Pandas Runner.

        **Examples**:
        ```
        blob = ff.register_blob_store(
            name="azure-quickstart",
            container_name="my_company_container"
            root_path="custom/path/in/container"
            account_name=<azure_account_name>
            account_key=<azure_account_key>
            description="An azure blob store provider to store offline and inference data"
        )
        ```

        Args:
            name (str): (Immutable) Name of Azure blob store to be registered
            container_name (str): (Immutable) Azure container name
            root_path (str): (Immutable) A custom path in container to store data
            account_name (str): (Immutable) Azure account name
            account_key (str):  (Mutable) Secret azure account key
            description (str): (Mutable) Description of Azure Blob provider to be registered
            team (str): (Mutable) The name of the team registering the filestore
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            blob (StorageProvider): Provider
                has all the functionality of OnlineProvider
        """

        tags, properties = set_tags_properties(tags, properties)

        container_name = container_name.replace("abfss://", "")
        if "/" in container_name:
            raise ValueError(
                "container_name cannot contain '/'. container_name should be the name of the Azure Blobstore container only."
            )

        azure_config = AzureFileStoreConfig(
            account_name=account_name,
            account_key=account_key,
            container_name=container_name,
            root_path=root_path,
        )
        config = OnlineBlobConfig(
            store_type="AZURE", store_config=azure_config.config()
        )

        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return FileStoreProvider(self, provider, azure_config, "AZURE")

    def register_s3(
        self,
        name: str,
        credentials: AWSCredentials,
        bucket_region: str,
        bucket_name: str,
        path: str = "",
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a S3 store provider.

        This has the functionality of an offline store and can be used as a parameter
        to a k8s or spark provider

        **Examples**:
        ```
        s3 = ff.register_s3(
            name="s3-quickstart",
            credentials=aws_creds,
            bucket_name="bucket_name",
            bucket_region=<bucket_region>,
            path="path/to/store/featureform_files/in/",
            description="An s3 store provider to store offline"
        )
        ```

        Args:
            name (str): (Immutable) Name of S3 store to be registered
            bucket_name (str): (Immutable) AWS Bucket Name
            bucket_region (str): (Immutable) AWS region the bucket is located in
            path (str): (Immutable) The path used to store featureform files in
            credentials (AWSCredentials): (Mutable) AWS credentials to access the bucket
            description (str): (Mutable) Description of S3 provider to be registered
            team (str): (Mutable) The name of the team registering the filestore
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            s3 (FileStoreProvider): Provider
                has all the functionality of OfflineProvider
        """
        tags, properties = set_tags_properties(tags, properties)

        if bucket_name == "":
            raise ValueError("bucket_name is required and cannot be empty string")

        # TODO: add verification into S3StoreConfig
        bucket_name = bucket_name.replace("s3://", "").replace("s3a://", "")

        if "/" in bucket_name:
            raise ValueError(
                "bucket_name cannot contain '/'. bucket_name should be the name of the AWS S3 bucket only."
            )

        s3_config = S3StoreConfig(
            bucket_path=bucket_name,
            bucket_region=bucket_region,
            credentials=credentials,
            path=path,
        )

        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=s3_config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return FileStoreProvider(self, provider, s3_config, s3_config.type())

    def register_gcs(
        self,
        name: str,
        bucket_name: str,
        root_path: str,
        credentials: GCPCredentials,
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a GCS store provider.

        **Examples**:
        ```
        gcs = ff.register_gcs(
            name="gcs-quickstart",
            credentials=ff.GCPCredentials(...),
            bucket_name="bucket_name",
            root_path="featureform/path/",
            description="An gcs store provider to store offline"
        )
        ```

        Args:
            name (str): (Immutable) Name of GCS store to be registered
            bucket_name (str): (Immutable) The bucket name
            root_path (str): (Immutable) Custom path to be used by featureform
            credentials (GCPCredentials): (Mutable) GCP credentials to access the bucket
            description (str): (Mutable) Description of GCS provider to be registered
            team (str): (Mutable) The name of the team registering the filestore
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            gcs (FileStoreProvider): Provider
                has all the functionality of OfflineProvider
        """
        tags, properties = set_tags_properties(tags, properties)

        if bucket_name == "":
            raise ValueError("bucket_name is required and cannot be empty string")

        bucket_name = bucket_name.replace("gs://", "")
        if "/" in bucket_name:
            raise ValueError(
                "bucket_name cannot contain '/'. bucket_name should be the name of the GCS bucket only."
            )

        gcs_config = GCSFileStoreConfig(
            bucket_name=bucket_name, bucket_path=root_path, credentials=credentials
        )
        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=gcs_config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return FileStoreProvider(self, provider, gcs_config, gcs_config.type())

    def register_hdfs(
        self,
        name: str,
        host: str,
        port: str,
        username: str = "",
        path: str = "",
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a HDFS store provider.

        This has the functionality of an offline store and can be used as a parameter
        to a k8s or spark provider

        **Examples**:
        ```
        hdfs = ff.register_hdfs(
            name="hdfs-quickstart",
            host="<host>",
            port="<port>",
            path="<path>",
            username="<username>",
            description="An hdfs store provider to store offline"
        )
        ```

        Args:
            name (str): (Immutable) Name of HDFS store to be registered
            host (str): (Immutable) The hostname for HDFS
            path (str): (Immutable) A storage path within HDFS
            port (str): (Mutable) The IPC port for the Namenode for HDFS. (Typically 8020 or 9000)
            username (str): (Mutable) A Username for HDFS
            description (str): (Mutable) Description of HDFS provider to be registered
            team (str): (Mutable) The name of the team registering HDFS

        Returns:
            hdfs (FileStoreProvider): Provider
        """

        hdfs_config = HDFSConfig(host=host, port=port, path=path, username=username)

        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=hdfs_config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return FileStoreProvider(self, provider, hdfs_config, hdfs_config.type())

    # TODO: Set Deprecation Warning For Credentials Path
    def register_firestore(
        self,
        name: str,
        collection: str,
        project_id: str,
        credentials: GCPCredentials,
        credentials_path: str = "",
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Firestore provider.

        **Examples**:
        ```
        firestore = ff.register_firestore(
            name="firestore-quickstart",
            description="A Firestore deployment we created for the Featureform quickstart",
            project_id="quickstart-project",
            collection="quickstart-collection",
            credentials=ff.GCPCredentials(...)
        )
        ```

        Args:
            name (str): (Immutable) Name of Firestore provider to be registered
            project_id (str): (Immutable) The Project name in GCP
            collection (str): (Immutable) The Collection name in Firestore under the given project ID
            credentials (GCPCredentials): (Mutable) GCP credentials to access Firestore
            description (str): (Mutable) Description of Firestore provider to be registered
            team (str): (Mutable) The name of the team registering the filestore
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            firestore (OfflineSQLProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = FirestoreConfig(
            collection=collection,
            project_id=project_id,
            credentials=credentials,
        )
        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OnlineProvider(self, provider)

    # TODO: Check these fields
    def register_cassandra(
        self,
        name: str,
        host: str,
        port: int,
        username: str,
        password: str,
        keyspace: str,
        consistency: str = "THREE",
        replication: int = 3,
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Cassandra provider.

        **Examples**:
        ```
        cassandra = ff.register_cassandra(
                name = "cassandra",
                description = "Example inference store",
                team = "Featureform",
                host = "0.0.0.0",
                port = 9042,
                username = "cassandra",
                password = "cassandra",
                consistency = "THREE",
                replication = 3
            )
        ```

        Args:
            name (str): (Immutable) Name of Cassandra provider to be registered
            host (str): (Immutable) DNS name of Cassandra
            port (str): (Mutable) Port
            username (str): (Mutable) Username
            password (str): (Mutable) Password
            consistency (str): (Mutable) Consistency
            replication (int): (Mutable) Replication
            description (str): (Mutable) Description of Cassandra provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            cassandra (OnlineProvider): Provider
        """
        config = CassandraConfig(
            host=host,
            port=port,
            username=username,
            password=password,
            keyspace=keyspace,
            consistency=consistency,
            replication=replication,
        )
        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OnlineProvider(self, provider)

    def register_dynamodb(
        self,
        name: str,
        credentials: AWSCredentials,
        region: str,
        should_import_from_s3: bool = False,
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a DynamoDB provider.

        **Examples**:
        ```
        dynamodb = ff.register_dynamodb(
            name="dynamodb-quickstart",
            description="A Dynamodb deployment we created for the Featureform quickstart",
            credentials=aws_creds,
            region="us-east-1"
        )
        ```

        Args:
            name (str): (Immutable) Name of DynamoDB provider to be registered
            region (str): (Immutable) Region to create dynamo tables
            credentials (AWSCredentials): (Mutable) AWS credentials with permissions to create DynamoDB tables
            should_import_from_s3 (bool): (Mutable) Determines whether feature materialization will occur via a direct import of data from S3 to new table (see [docs](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/S3DataImport.HowItWorks.html) for details)
            description (str): (Mutable) Description of DynamoDB provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            dynamodb (OnlineProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = DynamodbConfig(
            access_key=credentials.access_key,
            secret_key=credentials.secret_key,
            region=region,
            should_import_from_s3=should_import_from_s3,
        )
        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OnlineProvider(self, provider)

    def register_mongodb(
        self,
        name: str,
        username: str,
        password: str,
        database: str,
        host: str,
        port: str,
        throughput: int = 1000,
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a MongoDB provider.

        **Examples**:
        ```
        mongodb = ff.register_mongodb(
            name="mongodb-quickstart",
            description="A MongoDB deployment",
            username="my_username",
            password="myPassword",
            database="featureform_database"
            host="my-mongodb.host.com",
            port="10225",
            throughput=10000
        )
        ```

        Args:
            name (str): (Immutable) Name of MongoDB provider to be registered
            database (str): (Immutable) MongoDB database
            host (str): (Immutable) MongoDB hostname
            port (str): (Immutable) MongoDB port
            username (str): (Mutable) MongoDB username
            password (str): (Mutable) MongoDB password
            throughput (int): (Mutable) The maximum RU limit for autoscaling in CosmosDB
            description (str): (Mutable) Description of MongoDB provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            mongodb (OnlineProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = MongoDBConfig(
            username=username,
            password=password,
            host=host,
            port=port,
            database=database,
            throughput=throughput,
        )
        provider = Provider(
            name=name,
            function="ONLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OnlineProvider(self, provider)

    def register_snowflake_legacy(
        self,
        name: str,
        username: str,
        password: str,
        account_locator: str,
        database: str,
        schema: str = "PUBLIC",
        description: str = "",
        team: str = "",
        warehouse: str = "",
        role: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Snowflake provider using legacy credentials.

        **Examples**:
        ```
        snowflake = ff.register_snowflake_legacy(
            name="snowflake-quickstart",
            username="snowflake",
            password="password",
            account_locator="account-locator",
            database="snowflake",
            schema="PUBLIC",
            description="A Snowflake deployment we created for the Featureform quickstart"
        )
        ```

        Args:
            name (str): (Immutable) Name of Snowflake provider to be registered
            account_locator (str): (Immutable) Account Locator
            schema (str): (Immutable) Schema
            database (str): (Immutable) Database
            username (str): (Mutable) Username
            password (str): (Mutable) Password
            warehouse (str): (Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.
            role (str): (Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session
            description (str): (Mutable) Description of Snowflake provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            snowflake (OfflineSQLProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = SnowflakeConfig(
            account_locator=account_locator,
            database=database,
            username=username,
            password=password,
            schema=schema,
            warehouse=warehouse,
            role=role,
        )
        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OfflineSQLProvider(self, provider)

    # TODO: Recheck mutable fields
    def register_snowflake(
        self,
        name: str,
        username: str,
        password: str,
        account: str,
        organization: str,
        database: str,
        schema: str = "PUBLIC",
        description: str = "",
        team: str = "",
        warehouse: str = "",
        role: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Snowflake provider.

        **Examples**:
        ```
        snowflake = ff.register_snowflake(
            name="snowflake-quickstart",
            username="snowflake",
            password="password", #pragma: allowlist secret
            account="account",
            organization="organization",
            database="snowflake",
            schema="PUBLIC",
            description="A Snowflake deployment we created for the Featureform quickstart"
        )
        ```

        Args:
            name (str): (Immutable) Name of Snowflake provider to be registered
            account (str): (Immutable) Account
            organization (str): (Immutable) Organization
            database (str): (Immutable) Database
            schema (str): (Immutable) Schema
            username (str): (Mutable) Username
            password (str): (Mutable) Password
            warehouse (str): (Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.
            role (str): (Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session
            description (str): (Mutable) Description of Snowflake provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            snowflake (OfflineSQLProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = SnowflakeConfig(
            account=account,
            database=database,
            organization=organization,
            username=username,
            password=password,
            schema=schema,
            warehouse=warehouse,
            role=role,
        )
        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OfflineSQLProvider(self, provider)

    def register_postgres(
        self,
        name: str,
        host: str,
        user: str,
        password: str,
        database: str,
        port: str = "5432",
        description: str = "",
        team: str = "",
        sslmode: str = "disable",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Postgres provider.

        **Examples**:
        ```
        postgres = ff.register_postgres(
            name="postgres-quickstart",
            description="A Postgres deployment we created for the Featureform quickstart",
            host="quickstart-postgres",  # The internal dns name for postgres
            port="5432",
            user="postgres",
            password="password", #pragma: allowlist secret
            database="postgres"
        )
        ```

        Args:
            name (str): (Immutable) Name of Postgres provider to be registered
            host (str): (Immutable) Hostname for Postgres
            database (str): (Immutable) Database
            port (str): (Mutable) Port
            user (str): (Mutable) User
            password (str): (Mutable) Password
            sslmode (str): (Mutable) SSL mode
            description (str): (Mutable) Description of Postgres provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            postgres (OfflineSQLProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = PostgresConfig(
            host=host,
            port=port,
            database=database,
            user=user,
            password=password,
            sslmode=sslmode,
        )
        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=config,
            tags=tags or [],
            properties=properties or {},
        )

        self.__resources.append(provider)
        return OfflineSQLProvider(self, provider)

    def register_clickhouse(
        self,
        name: str,
        host: str,
        user: str,
        password: str,
        database: str,
        port: int = 9000,
        description: str = "",
        team: str = "",
        ssl: bool = False,
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a ClickHouse provider.

        **Examples**:
        ```
        clickhouse = ff.register_clickhouse(
            name="clickhouse-quickstart",
            description="A ClickHouse deployment we created for the Featureform quickstart",
            host="quickstart-clickhouse",  # The internal dns name for clickhouse
            port=9000,
            user="default",
            password="", #pragma: allowlist secret
            database="default"
        )
        ```

        Args:
            name (str): (Immutable) Name of ClickHouse provider to be registered
            host (str): (Immutable) Hostname for ClickHouse
            database (str): (Immutable) ClickHouse database
            port (int): (Mutable) Port
            ssl (bool): (Mutable) Enable SSL
            user (str): (Mutable) User
            password (str): (Mutable) ClickHouse password
            description (str): (Mutable) Description of ClickHouse provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            clickhouse (OfflineSQLProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = ClickHouseConfig(
            host=host,
            port=port,
            database=database,
            user=user,
            password=password,
            ssl=ssl,
        )
        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OfflineSQLProvider(self, provider)

    def register_redshift(
        self,
        name: str,
        host: str,
        port: str,
        user: str,
        password: str,
        database: str,
        description: str = "",
        team: str = "",
        sslmode: str = "disable",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Redshift provider.

        **Examples**:
        ```
        redshift = ff.register_redshift(
            name="redshift-quickstart",
            description="A Redshift deployment we created for the Featureform quickstart",
            host="quickstart-redshift",  # The internal dns name for redshift
            port="5432",
            user="redshift",
            password="password", #pragma: allowlist secret
            database="dev"
        )
        ```

        Args:
            name (str): (Immutable) Name of Redshift provider to be registered
            host (str): (Immutable) Hostname for Redshift
            database (str): (Immutable) Redshift database
            port (str): (Mutable) Port
            user (str): (Mutable) User
            password (str): (Mutable) Redshift password
            sslmode (str): (Mutable) SSL mode
            description (str): (Mutable) Description of Redshift provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            redshift (OfflineSQLProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = RedshiftConfig(
            host=host,
            port=port,
            database=database,
            user=user,
            password=password,
            sslmode=sslmode,
        )
        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OfflineSQLProvider(self, provider)

    # TODO: Add deprecated warning for credentials_path
    def register_bigquery(
        self,
        name: str,
        project_id: str,
        dataset_id: str,
        credentials: GCPCredentials,
        credentials_path: str = "",
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a BigQuery provider.

        **Examples**:
        ```
        bigquery = ff.register_bigquery(
            name="bigquery-quickstart",
            description="A BigQuery deployment we created for the Featureform quickstart",
            project_id="quickstart-project",
            dataset_id="quickstart-dataset",
            credentials=GCPCredentials(...)
        )
        ```

        Args:
            name (str): (Immutable) Name of BigQuery provider to be registered
            project_id (str): (Immutable) The Project name in GCP
            dataset_id (str): (Immutable) The Dataset name in GCP under the Project Id
            credentials (GCPCredentials): (Mutable) GCP credentials to access BigQuery
            description (str): (Mutable) Description of BigQuery provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            bigquery (OfflineSQLProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)

        config = BigQueryConfig(
            project_id=project_id,
            dataset_id=dataset_id,
            credentials=credentials,
        )
        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OfflineSQLProvider(self, provider)

    def register_spark(
        self,
        name: str,
        executor: ExecutorCredentials,
        filestore: FileStoreProvider,
        description: str = "",
        team: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Spark on Executor provider.

        **Examples**:
        ```
        spark = ff.register_spark(
            name="spark-quickstart",
            description="A Spark deployment we created for the Featureform quickstart",
            team="featureform-team",
            executor=databricks,
            filestore=azure_blob_store
        )
        ```

        Args:
            name (str): (Immutable) Name of Spark provider to be registered
            executor (ExecutorCredentials): (Mutable) An Executor Provider used for the compute power
            filestore (FileStoreProvider): (Mutable) A FileStoreProvider used for storage of data
            description (str): (Mutable) Description of Spark provider to be registered
            team (str): (Mutable) Name of team
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources

        Returns:
            spark (OfflineSparkProvider): Provider
        """
        tags, properties = set_tags_properties(tags, properties)
        config = SparkConfig(
            executor_type=executor.type(),
            executor_config=executor.config(),
            store_type=filestore.store_type(),
            store_config=filestore.config(),
        )

        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OfflineSparkProvider(self, provider)

    # TODO: Change things to either filestore or store
    def register_k8s(
        self,
        name: str,
        store: FileStoreProvider,
        description: str = "",
        team: str = "",
        docker_image: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """
        Register an offline store provider to run on Featureform's own k8s deployment.
        **Examples**:
        ```
        spark = ff.register_k8s(
            name="k8s",
            store=AzureBlobStore(),
            docker_image="my-repo/image:version"
        )
        ```

        Args:
            name (str): (Immutable) Name of provider
            store (FileStoreProvider): (Mutable) Reference to registered file store provider
            docker_image (str): (Mutable) A custom docker image using the base image featureformcom/k8s_runner
            description (str): (Mutable) Description of primary data to be registered
            team (str): (Mutable) A string parameter describing the team that owns the provider
            tags (List[str]): (Mutable) Optional grouping mechanism for resources
            properties (dict): (Mutable) Optional grouping mechanism for resources
        """

        tags, properties = set_tags_properties(tags, properties)
        config = K8sConfig(
            store_type=store.store_type(),
            store_config=store.config(),
            docker_image=docker_image,
        )

        provider = Provider(
            name=name,
            function="OFFLINE",
            description=description,
            team=team,
            config=config,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(provider)
        return OfflineK8sProvider(self, provider)

    def register_primary_data(
        self,
        name: str,
        location: Location,
        provider: Union[str, OfflineProvider],
        tags: List[str],
        properties: dict,
        variant: str = "",
        owner: Union[str, UserRegistrar] = "",
        description: str = "",
    ):
        """Register a primary data source.

        Args:
            name (str): Name of source
            variant (str): Name of variant
            location (Location): Location of primary data
            provider (Union[str, OfflineProvider]): Provider
            owner (Union[str, UserRegistrar]): Owner
            description (str): Description of primary data to be registered

        Returns:
            source (ColumnSourceRegistrar): Source
        """
        if not isinstance(owner, str):
            owner = owner.name()
        if owner == "":
            owner = self.must_get_default_owner()
        if variant == "":
            variant = self.__run
        if not isinstance(provider, str):
            provider = provider.name()
        source = SourceVariant(
            created=None,
            name=name,
            variant=variant,
            definition=PrimaryData(location=location),
            owner=owner,
            provider=provider,
            description=description,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(source)
        column_source_registrar = ColumnSourceRegistrar(self, source)
        self.map_client_object_to_resource(column_source_registrar, source)
        return column_source_registrar

    def register_sql_transformation(
        self,
        name: str,
        query: str,
        provider: Union[str, OfflineProvider],
        variant: str = "",
        owner: Union[str, UserRegistrar] = "",
        description: str = "",
        schedule: str = "",
        args: K8sArgs = None,
        inputs: Union[List[NameVariant], List[str], List[ColumnSourceRegistrar]] = None,
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a SQL transformation source.

        Args:
            name (str): Name of source
            variant (str): Name of variant
            query (str): SQL query
            provider (Union[str, OfflineProvider]): Provider
            owner (Union[str, UserRegistrar]): Owner
            description (str): Description of primary data to be registered
            schedule (str): Kubernetes CronJob schedule string ("* * * * *")
            args (K8sArgs): Additional transformation arguments
            tags (List[str]): Optional grouping mechanism for resources
            properties (dict): Optional grouping mechanism for resources

        Returns:
            source (ColumnSourceRegistrar): Source
        """
        if not isinstance(owner, str):
            owner = owner.name()
        if owner == "":
            owner = self.must_get_default_owner()
        if variant == "":
            variant = self.__run
        if not isinstance(provider, str):
            provider = provider.name()
        source = SourceVariant(
            created=None,
            name=name,
            variant=variant,
            definition=SQLTransformation(query, args),
            owner=owner,
            schedule=schedule,
            provider=provider,
            description=description,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(source)
        return ColumnSourceRegistrar(self, source)

    def sql_transformation(
        self,
        provider: Union[str, OfflineProvider],
        variant: str = "",
        name: str = "",
        schedule: str = "",
        owner: Union[str, UserRegistrar] = "",
        inputs: Union[List[NameVariant], List[str], List[ColumnSourceRegistrar]] = None,
        description: str = "",
        args: K8sArgs = None,
        tags: List[str] = [],
        properties: dict = {},
    ):
        """SQL transformation decorator.

        Args:
            variant (str): Name of variant
            provider (Union[str, OfflineProvider]): Provider
            name (str): Name of source
            schedule (str): Kubernetes CronJob schedule string ("* * * * *")
            owner (Union[str, UserRegistrar]): Owner
            inputs (list): Inputs to transformation
            description (str): Description of SQL transformation
            args (K8sArgs): Additional transformation arguments
            tags (List[str]): Optional grouping mechanism for resources
            properties (dict): Optional grouping mechanism for resources

        Returns:
            decorator (SQLTransformationDecorator): decorator
        """
        if not isinstance(owner, str):
            owner = owner.name()
        if owner == "":
            owner = self.must_get_default_owner()
        if variant == "":
            variant = self.__run
        if not isinstance(provider, str):
            provider = provider.name()
        decorator = SQLTransformationDecorator(
            registrar=self,
            name=name,
            run=self.__run,
            variant=variant,
            provider=provider,
            schedule=schedule,
            owner=owner,
            description=description,
            inputs=inputs,
            args=args,
            tags=tags,
            properties=properties,
        )
        return decorator

    def register_df_transformation(
        self,
        name: str,
        query: str,
        provider: Union[str, OfflineProvider],
        variant: str = "",
        owner: Union[str, UserRegistrar] = "",
        description: str = "",
        inputs: list = [],
        schedule: str = "",
        args: K8sArgs = None,
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a Dataframe transformation source.

        Args:
            name (str): Name of source
            variant (str): Name of variant
            query (str): SQL query
            provider (Union[str, OfflineProvider]): Provider
            name (str): Name of source
            owner (Union[str, UserRegistrar]): Owner
            description (str): Description of SQL transformation
            inputs (list): Inputs to transformation
            schedule (str): Kubernetes CronJob schedule string ("* * * * *")
            args (K8sArgs): Additional transformation arguments
            tags (List[str]): Optional grouping mechanism for resources
            properties (dict): Optional grouping mechanism for resources

        Returns:
            source (ColumnSourceRegistrar): Source
        """
        if not isinstance(owner, str):
            owner = owner.name()
        if owner == "":
            owner = self.must_get_default_owner()
        if variant == "":
            variant = self.__run
        if not isinstance(provider, str):
            provider = provider.name()
        source = SourceVariant(
            created=None,
            name=name,
            variant=variant,
            definition=DFTransformation(query, inputs, args),
            owner=owner,
            schedule=schedule,
            provider=provider,
            description=description,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(source)
        return ColumnSourceRegistrar(self, source)

    def df_transformation(
        self,
        provider: Union[str, OfflineProvider],
        tags: List[str],
        properties: dict,
        variant: str = "",
        name: str = "",
        owner: Union[str, UserRegistrar] = "",
        description: str = "",
        inputs: Union[List[NameVariant], List[str], List[ColumnSourceRegistrar]] = [],
        args: K8sArgs = None,
    ):
        """Dataframe transformation decorator.

        Args:
            variant (str): Name of variant
            provider (Union[str, OfflineProvider]): Provider
            name (str): Name of source
            owner (Union[str, UserRegistrar]): Owner
            description (str): Description of SQL transformation
            inputs (list): Inputs to transformation
            args (K8sArgs): Additional transformation arguments
            tags (List[str]): Optional grouping mechanism for resources
            properties (dict): Optional grouping mechanism for resources

        Returns:
            decorator (DFTransformationDecorator): decorator
        """

        if not isinstance(owner, str):
            owner = owner.name()
        if owner == "":
            owner = self.must_get_default_owner()
        if variant == "":
            variant = self.__run
        if not isinstance(provider, str):
            provider = provider.name()
        if not isinstance(inputs, list):
            raise ValueError("Dataframe transformation inputs must be a list")
        for i, nv in enumerate(inputs):
            if isinstance(nv, str):  # TODO remove this functionality
                inputs[i] = (nv, self.__run)
            elif isinstance(nv, tuple):
                try:
                    self._verify_tuple(nv)
                except TypeError as e:
                    transformation_message = f"'{name}:{variant}'"
                    if name == "":
                        transformation_message = f"with '{variant}' variant"

                    raise TypeError(
                        f"DF transformation {transformation_message} requires correct inputs "
                        f" '{nv}' is not a valid tuple: {e}"
                    )
                if inputs[i][1] == "":
                    inputs[i] = (inputs[i][0], self.__run)

        decorator = DFTransformationDecorator(
            registrar=self,
            name=name,
            variant=variant,
            provider=provider,
            owner=owner,
            description=description,
            inputs=inputs,
            args=args,
            tags=tags,
            properties=properties,
        )
        return decorator

    def _verify_tuple(self, nv_tuple):
        if not isinstance(nv_tuple, tuple):
            raise TypeError(f"not a tuple; received: '{type(nv_tuple).__name__}' type")

        if len(nv_tuple) != 2:
            raise TypeError(
                "Tuple must be of length 2, got length {}".format(len(nv_tuple))
            )
        if len(nv_tuple) == 2:
            not_string_tuples = not (
                isinstance(nv_tuple[0], str) and isinstance(nv_tuple[1], str)
            )
            if not_string_tuples:
                first_position_type = type(nv_tuple[0]).__name__
                second_position_type = type(nv_tuple[1]).__name__
                raise TypeError(
                    f"Tuple must be of type (str, str); got ({first_position_type}, {second_position_type})"
                )

    def ondemand_feature(
        self,
        fn=None,
        *,
        tags: List[str] = [],
        properties: dict = {},
        variant: str = "",
        name: str = "",
        owner: Union[str, UserRegistrar] = "",
        description: str = "",
    ):
        """On Demand Feature decorator.

        **Examples**
        ```python
        import featureform as ff

        @ff.ondemand_feature()
        def avg_user_transactions(client, params, entities):
            pass
        ```

        Args:
            variant (str): Name of variant
            name (str): Name of source
            owner (Union[str, UserRegistrar]): Owner
            description (str): Description of on demand feature
            tags (List[str]): Optional grouping mechanism for resources
            properties (dict): Optional grouping mechanism for resources

        Returns:
            decorator (OnDemandFeature): decorator

        """

        if not isinstance(owner, str):
            owner = owner.name()
        if owner == "":
            owner = self.must_get_default_owner()
        if variant == "":
            variant = self.__run
        decorator = OnDemandFeatureVariant(
            name=name,
            variant=variant,
            owner=owner,
            description=description,
            tags=tags or [],
            properties=properties or {},
        )

        self.__resources.append(decorator)

        if fn is None:
            return decorator
        else:
            return decorator(fn)

    def state(self):
        for resource in self.__resources:
            try:
                self.__state.add(resource)

            except ResourceRedefinedError:
                raise
            except Exception as e:
                resource_variant = (
                    f" ({resource.variant})" if hasattr(resource, "variant") else ""
                )
                raise Exception(
                    f"Could not add apply {resource.name}{resource_variant}: {e}"
                )
        self.__resources = []
        return self.__state

    def clear_state(self):
        self.__state = ResourceState()
        self.__client_obj_to_resource_map = {}
        self.__resources = []

    def get_state(self):
        """
        Get the state of the resources to be registered.

        Returns:
            resources (List[str]): List of resources to be registered ex. "{type} - {name} ({variant})"
        """
        if len(self.__resources) == 0:
            return "No resources to be registered"

        resources = [["Type", "Name", "Variant"]]
        for resource in self.__resources:
            if hasattr(resource, "variant"):
                resources.append(
                    [resource.__class__.__name__, resource.name, resource.variant]
                )
            else:
                resources.append([resource.__class__.__name__, resource.name, ""])

        print("Resources to be registered:")
        self.__print_state(resources)

    def __print_state(self, data):
        # Calculate the maximum width for each column
        max_widths = [max(len(str(item)) for item in col) for col in zip(*data)]

        # Format the table headers
        headers = " | ".join(
            f"{header:{width}}" for header, width in zip(data[0], max_widths)
        )

        # Generate the separator line
        separator = "-" * len(headers)

        # Format the table rows
        rows = [
            f" | ".join(f"{data[i][j]:{max_widths[j]}}" for j in range(len(data[i])))
            for i in range(1, len(data))
        ]

        # Combine the headers, separator, and rows
        table = headers + "\n" + separator + "\n" + "\n".join(rows)

        print(table)

    def register_entity(
        self,
        name: str,
        description: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register an entity.

        **Examples**:
        ``` py
            user = ff.register_entity("user")
        ```

        Args:
            name (str): Name of entity to be registered
            description (str): Description of entity to be registered
            tags (List[str]): Optional grouping mechanism for resources
            properties (dict): Optional grouping mechanism for resources

        Returns:
            entity (EntityRegistrar): Entity
        """
        entity = Entity(
            name=name,
            description=description,
            status="",
            tags=tags,
            properties=properties,
        )
        self.__resources.append(entity)
        return EntityRegistrar(self, entity)

    def register_column_resources(
        self,
        source: Union[
            NameVariant,
            SourceRegistrar,
            SQLTransformationDecorator,
            DFTransformationDecorator,
        ],
        entity: Union[str, EntityRegistrar],
        entity_column: str,
        owner: Union[str, UserRegistrar] = "",
        inference_store: Union[str, OnlineProvider, FileStoreProvider] = "",
        features: List[ColumnMapping] = None,
        labels: List[ColumnMapping] = None,
        timestamp_column: str = "",
        description: str = "",
        schedule: str = "",
        client_object=None,
    ):
        """Create features and labels from a source. Used in the register_resources function.

        Args:
            source (Union[NameVariant, SourceRegistrar, SQLTransformationDecorator]): Source of features, labels, entity
            entity (Union[str, EntityRegistrar]): Entity
            entity_column (str): Column of entity in source
            owner (Union[str, UserRegistrar]): Owner
            inference_store (Union[str, OnlineProvider]): Online provider
            features (List[ColumnMapping]): List of ColumnMapping objects (dictionaries containing the keys: name, variant, column, resource_type)
            labels (List[ColumnMapping]): List of ColumnMapping objects (dictionaries containing the keys: name, variant, column, resource_type)
            description (str): Description
            schedule (str): Kubernetes CronJob schedule string ("* * * * *")

        Returns:
            resource (ResourceRegistrar): resource
        """

        if (
            type(inference_store) == FileStoreProvider
            and inference_store.store_type() in NON_INFERENCE_STORES
        ):
            raise Exception(
                f"cannot use '{inference_store.store_type()}' as an inference store."
            )

        if features is None:
            features = []
        if labels is None:
            labels = []
        if len(features) == 0 and len(labels) == 0:
            raise ValueError("No features or labels set")
        if isinstance(source, tuple) and source[1] == "":
            source = source[0], self.__run
        if not isinstance(entity, str):
            entity = entity.name()
        if not isinstance(inference_store, str):
            inference_store = inference_store.name()
        if not isinstance(owner, str):
            owner = owner.name()
        if owner == "":
            owner = self.must_get_default_owner()
        feature_resources = []
        label_resources = []
        for feature in features:
            variant = feature.get("variant", "")
            if variant == "":
                variant = self.__run
            if not ScalarType.has_value(feature["type"]) and not isinstance(
                feature["type"], ScalarType
            ):
                raise ValueError(
                    f"Invalid type for feature {feature['name']} ({variant}). Must be a ScalarType or one of {ScalarType.get_values()}"
                )
            if isinstance(feature["type"], ScalarType):
                feature["type"] = feature["type"].value
            desc = feature.get("description", "")
            feature_tags = feature.get("tags", [])
            feature_properties = feature.get("properties", {})
            additional_Parameters = self._get_additional_parameters(ondemand_feature)
            is_embedding = feature.get("is_embedding", False)
            dims = feature.get("dims", 0)
            value_type = ScalarType(feature["type"])
            if dims > 0:
                value_type = VectorType(value_type, dims, is_embedding)
            resource = FeatureVariant(
                created=None,
                name=feature["name"],
                variant=variant,
                source=source,
                value_type=value_type,
                entity=entity,
                owner=owner,
                provider=inference_store,
                description=desc,
                schedule=schedule,
                location=ResourceColumnMapping(
                    entity=entity_column,
                    value=feature["column"],
                    timestamp=timestamp_column,
                ),
                tags=feature_tags,
                properties=feature_properties,
                additional_parameters=additional_Parameters,
            )
            self.__resources.append(resource)
            self.map_client_object_to_resource(client_object, resource)
            feature_resources.append(resource)

        for label in labels:
            variant = label.get("variant", "")
            if variant == "":
                variant = self.__run
            if not ScalarType.has_value(label["type"]) and not isinstance(
                label["type"], ScalarType
            ):
                raise ValueError(
                    f"Invalid type for label {label['name']} ({variant}). Must be a ScalarType or one of {ScalarType.get_values()}"
                )
            if isinstance(label["type"], ScalarType):
                label["type"] = label["type"].value
            desc = label.get("description", "")
            label_tags = label.get("tags", [])
            label_properties = label.get("properties", {})
            resource = LabelVariant(
                name=label["name"],
                variant=variant,
                source=source,
                value_type=label["type"],
                entity=entity,
                owner=owner,
                provider=inference_store,
                description=desc,
                location=ResourceColumnMapping(
                    entity=entity_column,
                    value=label["column"],
                    timestamp=timestamp_column,
                ),
                tags=label_tags,
                properties=label_properties,
            )
            self.__resources.append(resource)
            self.map_client_object_to_resource(client_object, resource)
            label_resources.append(resource)
        return ResourceRegistrar(self, features, labels)

    def _get_additional_parameters(self, feature):
        return OndemandFeatureParameters(definition="() => REGISTER")

    def __get_feature_nv(self, features, run):
        feature_nv_list = []
        feature_lags = []
        for feature in features:
            if isinstance(feature, str):
                feature_nv_list.append((feature, run))
            elif isinstance(feature, dict):
                lag = feature.get("lag")
                if "variant" not in feature:
                    feature["variant"] = run
                if lag:
                    required_lag_keys = set(["lag", "feature", "variant"])
                    received_lag_keys = set(feature.keys())
                    if (
                        required_lag_keys.intersection(received_lag_keys)
                        != required_lag_keys
                    ):
                        raise ValueError(
                            f"feature lags require 'lag', 'feature', 'variant' fields. Received: {feature.keys()}"
                        )

                    if not isinstance(lag, timedelta):
                        raise ValueError(
                            f"the lag, '{lag}', needs to be of type 'datetime.timedelta'. Received: {type(lag)}."
                        )

                    feature_name_variant = (feature["feature"], feature["variant"])
                    if feature_name_variant not in feature_nv_list:
                        feature_nv_list.append(feature_name_variant)

                    lag_name = f"{feature['feature']}_{feature['variant']}_lag_{lag}"
                    sanitized_lag_name = (
                        lag_name.replace(" ", "").replace(",", "_").replace(":", "_")
                    )
                    feature["name"] = feature.get("name", sanitized_lag_name)

                    feature_lags.append(feature)
                else:
                    feature_nv = (feature["name"], feature["variant"])
                    feature_nv_list.append(feature_nv)
            elif isinstance(feature, list):
                feature_nv, feature_lags_list = self.__get_feature_nv(feature, run)
                if len(feature_nv) != 0:
                    feature_nv_list.extend(feature_nv)

                if len(feature_lags_list) != 0:
                    feature_lags.extend(feature_lags_list)
            else:
                feature_nv_list.append(feature)

        return feature_nv_list, feature_lags

    def register_training_set(
        self,
        name: str,
        variant: str = "",
        features: Union[
            list, List[FeatureColumnResource], MultiFeatureColumnResource
        ] = [],
        label: Union[NameVariant, LabelColumnResource] = ("", ""),
        resources: list = [],
        owner: Union[str, UserRegistrar] = "",
        description: str = "",
        schedule: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a training set.

        **Example**:
        ```
        ff.register_training_set(
            name="my_training_set",
            label=("label", "v1"),
            features=[("feature1", "v1"), ("feature2", "v1")],
        )
        ```

        Args:
            name (str): Name of training set to be registered
            variant (str): Name of variant to be registered
            label (NameVariant): Label of training set
            features (List[NameVariant]): Features of training set
            resources (List[Resource]): A list of previously registered resources
            owner (Union[str, UserRegistrar]): Owner
            description (str): Description of training set to be registered
            schedule (str): Kubernetes CronJob schedule string ("* * * * *")
            tags (List[str]): Optional grouping mechanism for resources
            properties (dict): Optional grouping mechanism for resources

        Returns:
            resource (ResourceRegistrar): resource
        """
        if not isinstance(owner, str):
            owner = owner.name()
        if owner == "":
            owner = self.must_get_default_owner()
        if variant == "":
            variant = self.__run

        if not isinstance(features, (list, MultiFeatureColumnResource)):
            raise ValueError(
                f"Invalid features type: {type(features)} "
                "Features must be entered as a list of name-variant tuples (e.g. [('feature1', 'quickstart'), ('feature2', 'quickstart')]) or a list of FeatureColumnResource instances."
            )
        if not isinstance(label, (tuple, str, LabelColumnResource)):
            raise ValueError(
                f"Invalid label type: {type(label)} "
                "Label must be entered as a name-variant tuple (e.g. ('fraudulent', 'quickstart')), a resource name, or an instance of LabelColumnResource."
            )

        for resource in resources:
            features += resource.features()
            resource_label = resource.label()
            # label == () if it is NOT manually entered
            if label == ("", ""):
                label = resource_label
            # Elif: If label was updated to store resource_label it will not check the following elif
            elif resource_label != ():
                raise ValueError("A training set can only have one label")

        features, feature_lags = self.__get_feature_nv(features, self.__run)
        if label == ():
            raise ValueError("Label must be set")
        if features == []:
            raise ValueError("A training-set must have atleast one feature")
        if isinstance(label, str):
            label = (label, self.__run)
        if not isinstance(label, LabelColumnResource) and label[1] == "":
            label = (label[0], self.__run)

        processed_features = []
        for feature in features:
            if isinstance(feature, tuple) and feature[1] == "":
                feature = (feature[0], self.__run)
            processed_features.append(feature)
        resource = TrainingSetVariant(
            created=None,
            name=name,
            variant=variant,
            description=description,
            owner=owner,
            schedule=schedule,
            label=label,
            features=processed_features,
            feature_lags=feature_lags,
            tags=tags,
            properties=properties,
        )
        self.__resources.append(resource)
        return resource

    def register_model(
        self, name: str, tags: List[str] = [], properties: dict = {}
    ) -> Model:
        """Register a model.

        Args:
            name (str): Model to be registered
            tags (List[str]): Optional grouping mechanism for resources
            properties (dict): Optional grouping mechanism for resources

        Returns:
            ModelRegistrar: Model
        """
        model = Model(name, description="", tags=tags, properties=properties)
        self.__resources.append(model)
        return model

df_transformation(provider, tags, properties, variant='', name='', owner='', description='', inputs=[], args=None)

Dataframe transformation decorator.

Parameters:

Name Type Description Default
variant str

Name of variant

''
provider Union[str, OfflineProvider]

Provider

required
name str

Name of source

''
owner Union[str, UserRegistrar]

Owner

''
description str

Description of SQL transformation

''
inputs list

Inputs to transformation

[]
args K8sArgs

Additional transformation arguments

None
tags List[str]

Optional grouping mechanism for resources

required
properties dict

Optional grouping mechanism for resources

required

Returns:

Name Type Description
decorator DFTransformationDecorator

decorator

Source code in src/featureform/register.py
def df_transformation(
    self,
    provider: Union[str, OfflineProvider],
    tags: List[str],
    properties: dict,
    variant: str = "",
    name: str = "",
    owner: Union[str, UserRegistrar] = "",
    description: str = "",
    inputs: Union[List[NameVariant], List[str], List[ColumnSourceRegistrar]] = [],
    args: K8sArgs = None,
):
    """Dataframe transformation decorator.

    Args:
        variant (str): Name of variant
        provider (Union[str, OfflineProvider]): Provider
        name (str): Name of source
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of SQL transformation
        inputs (list): Inputs to transformation
        args (K8sArgs): Additional transformation arguments
        tags (List[str]): Optional grouping mechanism for resources
        properties (dict): Optional grouping mechanism for resources

    Returns:
        decorator (DFTransformationDecorator): decorator
    """

    if not isinstance(owner, str):
        owner = owner.name()
    if owner == "":
        owner = self.must_get_default_owner()
    if variant == "":
        variant = self.__run
    if not isinstance(provider, str):
        provider = provider.name()
    if not isinstance(inputs, list):
        raise ValueError("Dataframe transformation inputs must be a list")
    for i, nv in enumerate(inputs):
        if isinstance(nv, str):  # TODO remove this functionality
            inputs[i] = (nv, self.__run)
        elif isinstance(nv, tuple):
            try:
                self._verify_tuple(nv)
            except TypeError as e:
                transformation_message = f"'{name}:{variant}'"
                if name == "":
                    transformation_message = f"with '{variant}' variant"

                raise TypeError(
                    f"DF transformation {transformation_message} requires correct inputs "
                    f" '{nv}' is not a valid tuple: {e}"
                )
            if inputs[i][1] == "":
                inputs[i] = (inputs[i][0], self.__run)

    decorator = DFTransformationDecorator(
        registrar=self,
        name=name,
        variant=variant,
        provider=provider,
        owner=owner,
        description=description,
        inputs=inputs,
        args=args,
        tags=tags,
        properties=properties,
    )
    return decorator

get_bigquery(name)

Get a BigQuery provider. The returned object can be used to register additional resources.

Examples:

bigquery = ff.get_bigquery("bigquery-quickstart")
transactions = bigquery.register_table(
    name="transactions",
    variant="kaggle",
    description="Fraud Dataset From Kaggle",
    table="Transactions",  # This is the table's name in BigQuery
)

Parameters:

Name Type Description Default
name str

Name of BigQuery provider to be retrieved

required

Returns:

Name Type Description
bigquery OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def get_bigquery(self, name):
    """Get a BigQuery provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    bigquery = ff.get_bigquery("bigquery-quickstart")
    transactions = bigquery.register_table(
        name="transactions",
        variant="kaggle",
        description="Fraud Dataset From Kaggle",
        table="Transactions",  # This is the table's name in BigQuery
    )
    ```

    Args:
        name (str): Name of BigQuery provider to be retrieved

    Returns:
        bigquery (OfflineSQLProvider): Provider
    """
    mock_config = BigQueryConfig(
        project_id="mock_project",
        dataset_id="mock_dataset",
        credentials=GCPCredentials(
            project_id="mock_project",
            credentials_path="client/tests/test_files/bigquery_dummy_credentials.json",
        ),
    )
    mock_provider = Provider(
        name=name, function="OFFLINE", description="", team="", config=mock_config
    )
    return OfflineSQLProvider(self, mock_provider)

get_blob_store(name)

Get an Azure Blob provider. The returned object can be used to register additional resources.

Examples:

azure_blob = ff.get_blob_store("azure-blob-quickstart")

average_user_transaction.register_resources(
    entity=user,
    entity_column="user_id",
    inference_store=azure_blob,
    features=[
        {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
    ],
)

Parameters:

Name Type Description Default
name str

Name of Azure blob provider to be retrieved

required

Returns:

Name Type Description
azure_blob FileStoreProvider

Provider

Source code in src/featureform/register.py
def get_blob_store(self, name):
    """Get an Azure Blob provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    azure_blob = ff.get_blob_store("azure-blob-quickstart")

    average_user_transaction.register_resources(
        entity=user,
        entity_column="user_id",
        inference_store=azure_blob,
        features=[
            {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
        ],
    )
    ```

    Args:
        name (str): Name of Azure blob provider to be retrieved

    Returns:
        azure_blob (FileStoreProvider): Provider
    """
    fake_azure_config = AzureFileStoreConfig(
        account_name="", account_key="", container_name="", root_path=""
    )
    fake_config = OnlineBlobConfig(
        store_type="AZURE", store_config=fake_azure_config.config()
    )
    mock_provider = Provider(
        name=name, function="ONLINE", description="", team="", config=fake_config
    )
    return FileStoreProvider(self, mock_provider, fake_config, "AZURE")

get_clickhouse(name)

Get a ClickHouse provider. The returned object can be used to register additional resources.

Examples:

clickhouse = ff.get_clickhouse("clickhouse-quickstart")
transactions = clickhouse.register_table(
    name="transactions",
    variant="kaggle",
    description="Fraud Dataset From Kaggle",
    table="Transactions",  # This is the table's name in ClickHouse
)

Parameters:

Name Type Description Default
name str

Name of ClickHouse provider to be retrieved

required

Returns:

Name Type Description
clickhouse OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def get_clickhouse(self, name):
    """Get a ClickHouse provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    clickhouse = ff.get_clickhouse("clickhouse-quickstart")
    transactions = clickhouse.register_table(
        name="transactions",
        variant="kaggle",
        description="Fraud Dataset From Kaggle",
        table="Transactions",  # This is the table's name in ClickHouse
    )
    ```

    Args:
        name (str): Name of ClickHouse provider to be retrieved

    Returns:
        clickhouse (OfflineSQLProvider): Provider
    """
    mock_config = ClickHouseConfig(
        host="",
        port=9000,
        database="",
        user="",
        password="",
        ssl=False,
    )
    mock_provider = Provider(
        name=name, function="OFFLINE", description="", team="", config=mock_config
    )
    return OfflineSQLProvider(self, mock_provider)

get_dynamodb(name)

Get a DynamoDB provider. The returned object can be used as an inference store in feature registration.

Examples:

dynamodb = ff.get_dynamodb("dynamodb-quickstart")

@ff.entity
class User:
    avg_transactions = ff.Feature(
        average_user_transaction[["user_id", "avg_transaction_amt"]],
        type=ff.Float32,
        inference_store=dynamodb,
    )

Parameters:

Name Type Description Default
name str

Name of DynamoDB provider to be retrieved

required

Returns:

Name Type Description
dynamodb OnlineProvider

Provider

Source code in src/featureform/register.py
def get_dynamodb(self, name: str):
    """Get a DynamoDB provider. The returned object can be used as an inference store in feature registration.

    **Examples**:
    ``` py
    dynamodb = ff.get_dynamodb("dynamodb-quickstart")

    @ff.entity
    class User:
        avg_transactions = ff.Feature(
            average_user_transaction[["user_id", "avg_transaction_amt"]],
            type=ff.Float32,
            inference_store=dynamodb,
        )
    ```

    Args:
        name (str): Name of DynamoDB provider to be retrieved

    Returns:
        dynamodb (OnlineProvider): Provider
    """
    mock_config = DynamodbConfig(
        region="", access_key="", secret_key="", should_import_from_s3=False
    )
    mock_provider = Provider(
        name=name, function="ONLINE", description="", team="", config=mock_config
    )
    return OnlineProvider(self, mock_provider)

get_entity(name)

Get an entity. The returned object can be used to register additional resources.

Examples:

entity = get_entity("user")
transactions.register_resources(
    entity=entity,
    entity_column="customerid",
    labels=[
        {"name": "fraudulent", "variant": "quickstart", "column": "isfraud", "type": "bool"},
    ],
)

Parameters:

Name Type Description Default
name str

Name of entity to be retrieved

required

Returns: entity (EntityRegistrar): Entity

Source code in src/featureform/register.py
def get_entity(self, name: str):
    """Get an entity. The returned object can be used to register additional resources.

    **Examples**:

    ``` py
    entity = get_entity("user")
    transactions.register_resources(
        entity=entity,
        entity_column="customerid",
        labels=[
            {"name": "fraudulent", "variant": "quickstart", "column": "isfraud", "type": "bool"},
        ],
    )
    ```

    Args:
        name (str): Name of entity to be retrieved
    Returns:
        entity (EntityRegistrar): Entity
    """
    fakeEntity = Entity(
        name=name, description="", status="", tags=[], properties={}
    )
    return EntityRegistrar(self, fakeEntity)

get_kubernetes(name)

Get a k8s provider. The returned object can be used to register additional resources.

Examples:

k8s = ff.get_kubernetes("k8s-azure-quickstart")
transactions = k8s.register_file(
    name="transactions",
    variant="kaggle",
    description="Fraud Dataset From Kaggle",
    path="path/to/blob",
)

Parameters:

Name Type Description Default
name str

Name of k8s provider to be retrieved

required

Returns:

Name Type Description
k8s OfflineK8sProvider

Provider

Source code in src/featureform/register.py
def get_kubernetes(self, name):
    """
    Get a k8s provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py

    k8s = ff.get_kubernetes("k8s-azure-quickstart")
    transactions = k8s.register_file(
        name="transactions",
        variant="kaggle",
        description="Fraud Dataset From Kaggle",
        path="path/to/blob",
    )
    ```

    Args:
        name (str): Name of k8s provider to be retrieved

    Returns:
        k8s (OfflineK8sProvider): Provider
    """
    mock_config = K8sConfig(store_type="", store_config={})
    mock_provider = Provider(
        name=name, function="OFFLINE", description="", team="", config=mock_config
    )
    return OfflineK8sProvider(self, mock_provider)

get_mongodb(name)

Get a MongoDB provider. The returned object can be used to register additional resources.

Examples:

mongodb = ff.get_mongodb("mongodb-quickstart")

average_user_transaction.register_resources(
    entity=user,
    entity_column="user_id",
    inference_store=mongodb,
    features=[
        {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
    ],
)

Parameters:

Name Type Description Default
name str

Name of MongoDB provider to be retrieved

required

Returns:

Name Type Description
mongodb OnlineProvider

Provider

Source code in src/featureform/register.py
def get_mongodb(self, name: str):
    """Get a MongoDB provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    mongodb = ff.get_mongodb("mongodb-quickstart")

    average_user_transaction.register_resources(
        entity=user,
        entity_column="user_id",
        inference_store=mongodb,
        features=[
            {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
        ],
    )
    ```

    Args:
        name (str): Name of MongoDB provider to be retrieved

    Returns:
        mongodb (OnlineProvider): Provider
    """
    mock_config = MongoDBConfig(
        username="", password="", host="", port="", database="", throughput=1
    )
    mock_provider = Provider(
        name=name, function="ONLINE", description="", team="", config=mock_config
    )
    return OnlineProvider(self, mock_provider)

get_postgres(name)

Get a Postgres provider. The returned object can be used to register additional resources.

Examples:

postgres = ff.get_postgres("postgres-quickstart")
transactions = postgres.register_table(
    name="transactions",
    variant="kaggle",
    description="Fraud Dataset From Kaggle",
    table="Transactions",  # This is the table's name in Postgres
)

Parameters:

Name Type Description Default
name str

Name of Postgres provider to be retrieved

required

Returns:

Name Type Description
postgres OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def get_postgres(self, name):
    """Get a Postgres provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    postgres = ff.get_postgres("postgres-quickstart")
    transactions = postgres.register_table(
        name="transactions",
        variant="kaggle",
        description="Fraud Dataset From Kaggle",
        table="Transactions",  # This is the table's name in Postgres
    )
    ```

    Args:
        name (str): Name of Postgres provider to be retrieved

    Returns:
        postgres (OfflineSQLProvider): Provider
    """
    mock_config = PostgresConfig(
        host="",
        port="",
        database="",
        user="",
        password="",
        sslmode="",
    )
    mock_provider = Provider(
        name=name, function="OFFLINE", description="", team="", config=mock_config
    )
    return OfflineSQLProvider(self, mock_provider)

get_redis(name)

Get a Redis provider. The returned object can be used to register additional resources.

Examples:

redis = ff.get_redis("redis-quickstart")

average_user_transaction.register_resources(
    entity=user,
    entity_column="user_id",
    inference_store=redis,
    features=[
        {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
    ],
)

Parameters:

Name Type Description Default
name str

Name of Redis provider to be retrieved

required

Returns:

Name Type Description
redis OnlineProvider

Provider

Source code in src/featureform/register.py
def get_redis(self, name):
    """Get a Redis provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    redis = ff.get_redis("redis-quickstart")

    average_user_transaction.register_resources(
        entity=user,
        entity_column="user_id",
        inference_store=redis,
        features=[
            {"name": "avg_transactions", "variant": "quickstart", "column": "avg_transaction_amt", "type": "float32"},
        ],
    )
    ```

    Args:
        name (str): Name of Redis provider to be retrieved

    Returns:
        redis (OnlineProvider): Provider
    """
    mock_config = RedisConfig(host="", port=123, password="", db=123)
    mock_provider = Provider(
        name=name, function="ONLINE", description="", team="", config=mock_config
    )
    return OnlineProvider(self, mock_provider)

get_redshift(name)

Get a Redshift provider. The returned object can be used to register additional resources.

Examples:

redshift = ff.get_redshift("redshift-quickstart")
transactions = redshift.register_table(
    name="transactions",
    variant="kaggle",
    description="Fraud Dataset From Kaggle",
    table="Transactions",  # This is the table's name in Postgres
)

Parameters:

Name Type Description Default
name str

Name of Redshift provider to be retrieved

required

Returns:

Name Type Description
redshift OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def get_redshift(self, name):
    """Get a Redshift provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    redshift = ff.get_redshift("redshift-quickstart")
    transactions = redshift.register_table(
        name="transactions",
        variant="kaggle",
        description="Fraud Dataset From Kaggle",
        table="Transactions",  # This is the table's name in Postgres
    )
    ```

    Args:
        name (str): Name of Redshift provider to be retrieved

    Returns:
        redshift (OfflineSQLProvider): Provider
    """
    mock_config = RedshiftConfig(
        host="", port="5439", database="", user="", password="", sslmode=""
    )
    mock_provider = Provider(
        name=name, function="OFFLINE", description="", team="", config=mock_config
    )
    return OfflineSQLProvider(self, mock_provider)

get_run()

Get the current run name.

Examples:

import featureform as ff

client = ff.Client()
f = client.features(("avg_transaction_amount", ff.get_run()), {"user": "123"})

Returns:

Name Type Description
run str

The name of the current run

Source code in src/featureform/register.py
def get_run(self) -> str:
    """
    Get the current run name.

    **Examples**:
    ``` py
    import featureform as ff

    client = ff.Client()
    f = client.features(("avg_transaction_amount", ff.get_run()), {"user": "123"})

    ```

    Returns:
        run: The name of the current run
    """
    return self.__run

get_s3(name)

Get a S3 provider. The returned object can be used with other providers such as Spark and Databricks.

Examples:

s3 = ff.get_s3("s3-quickstart")
spark = ff.register_spark(
    name=f"spark-emr-s3",
    description="A Spark deployment we created for the Featureform quickstart",
    team="featureform-team",
    executor=emr,
    filestore=s3,
)

Parameters:

Name Type Description Default
name str

Name of S3 to be retrieved

required

Returns:

Name Type Description
s3 FileStore

Provider

Source code in src/featureform/register.py
def get_s3(self, name):
    """
    Get a S3 provider. The returned object can be used with other providers such as Spark and Databricks.

    **Examples**:

    ``` py

    s3 = ff.get_s3("s3-quickstart")
    spark = ff.register_spark(
        name=f"spark-emr-s3",
        description="A Spark deployment we created for the Featureform quickstart",
        team="featureform-team",
        executor=emr,
        filestore=s3,
    )
    ```

    Args:
        name (str): Name of S3 to be retrieved

    Returns:
        s3 (FileStore): Provider
    """
    provider = Provider(
        name=name,
        function="OFFLINE",
        description="description",
        team="team",
        config=s3_config,
    )
    return FileStoreProvider(
        registrar=self,
        provider=provider,
        config=s3_config,
        store_type=s3_config.type(),
    )

get_snowflake(name)

Get a Snowflake provider. The returned object can be used to register additional resources.

Examples:

snowflake = ff.get_snowflake("snowflake-quickstart")
transactions = snowflake.register_table(
    name="transactions",
    variant="kaggle",
    description="Fraud Dataset From Kaggle",
    table="Transactions",  # This is the table's name in Postgres
)

Parameters:

Name Type Description Default
name str

Name of Snowflake provider to be retrieved

required

Returns:

Name Type Description
snowflake OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def get_snowflake(self, name):
    """Get a Snowflake provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    snowflake = ff.get_snowflake("snowflake-quickstart")
    transactions = snowflake.register_table(
        name="transactions",
        variant="kaggle",
        description="Fraud Dataset From Kaggle",
        table="Transactions",  # This is the table's name in Postgres
    )
    ```

    Args:
        name (str): Name of Snowflake provider to be retrieved

    Returns:
        snowflake (OfflineSQLProvider): Provider
    """
    mock_config = SnowflakeConfig(
        account="ff_fake",
        database="ff_fake",
        organization="ff_fake",
        username="ff_fake",
        password="ff_fake",
        schema="ff_fake",
    )
    mock_provider = Provider(
        name=name, function="OFFLINE", description="", team="", config=mock_config
    )
    return OfflineSQLProvider(self, mock_provider)

get_snowflake_legacy(name)

Get a Snowflake provider. The returned object can be used to register additional resources.

Examples:

snowflake = ff.get_snowflake_legacy("snowflake-quickstart")
transactions = snowflake.register_table(
    name="transactions",
    variant="kaggle",
    description="Fraud Dataset From Kaggle",
    table="Transactions",  # This is the table's name in Postgres
)

Parameters:

Name Type Description Default
name str

Name of Snowflake provider to be retrieved

required

Returns:

Name Type Description
snowflake_legacy OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def get_snowflake_legacy(self, name: str):
    """Get a Snowflake provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    snowflake = ff.get_snowflake_legacy("snowflake-quickstart")
    transactions = snowflake.register_table(
        name="transactions",
        variant="kaggle",
        description="Fraud Dataset From Kaggle",
        table="Transactions",  # This is the table's name in Postgres
    )
    ```

    Args:
        name (str): Name of Snowflake provider to be retrieved

    Returns:
        snowflake_legacy (OfflineSQLProvider): Provider
    """
    mock_config = SnowflakeConfig(
        account_locator="ff_fake",
        database="ff_fake",
        username="ff_fake",
        password="ff_fake",
        schema="ff_fake",
        warehouse="ff_fake",
        role="ff_fake",
    )
    mock_provider = Provider(
        name=name, function="OFFLINE", description="", team="", config=mock_config
    )
    return OfflineSQLProvider(self, mock_provider)

get_source(name, variant, local=False)

get_source() can be used to get a reference to an already registered primary source or transformation. The returned object can be used to register features and labels or be extended off of to create additional transformations.

Examples:

Registering a transformation from an existing source.

spark = ff.get_spark("prod-spark")
transactions = ff.get_source("transactions","kaggle")

@spark.df_transformation(inputs=[transactions]):
def customer_count(transactions):
    return transactions.groupBy("CustomerID").count()

Registering a feature from an existing source.

transactions = ff.get_source("transactions","kaggle")

transactions.register_resources(
    entity=user,
    entity_column="customerid",
    labels=[
        {"name": "fraudulent", "variant": "quickstart", "column": "isfraud", "type": "bool"},
    ],
)

Parameters:

Name Type Description Default
name str

Name of source to be retrieved

required
variant str

Name of variant of source to be retrieved

required
local bool

If localmode is being used

False

Returns:

Name Type Description
source ColumnSourceRegistrar

Source

Source code in src/featureform/register.py
def get_source(self, name, variant, local=False):
    """
    get_source() can be used to get a reference to an already registered primary source or transformation.
    The returned object can be used to register features and labels or be extended off of to create additional
    transformations.

    **Examples**:

    Registering a transformation from an existing source.
    ``` py
    spark = ff.get_spark("prod-spark")
    transactions = ff.get_source("transactions","kaggle")

    @spark.df_transformation(inputs=[transactions]):
    def customer_count(transactions):
        return transactions.groupBy("CustomerID").count()
    ```

    Registering a feature from an existing source.
    ``` py
    transactions = ff.get_source("transactions","kaggle")

    transactions.register_resources(
        entity=user,
        entity_column="customerid",
        labels=[
            {"name": "fraudulent", "variant": "quickstart", "column": "isfraud", "type": "bool"},
        ],
    )
    ```

    Args:
        name (str): Name of source to be retrieved
        variant (str): Name of variant of source to be retrieved
        local (bool): If localmode is being used

    Returns:
        source (ColumnSourceRegistrar): Source
    """
    if local:
        raise Exception(
            "Localmode is not supported; please try featureform <= 1.12.0"
        )
    else:
        mock_definition = PrimaryData(location=SQLTable(name=""))
        mock_source = SourceVariant(
            created=None,
            name=name,
            variant=variant,
            definition=mock_definition,
            owner="",
            provider="",
            description="",
            tags=[],
            properties={},
        )
        return ColumnSourceRegistrar(self, mock_source)

get_spark(name)

Get a Spark provider. The returned object can be used to register additional resources.

Examples:

spark = ff.get_spark("spark-quickstart")
transactions = spark.register_file(
    name="transactions",
    variant="kaggle",
    description="Fraud Dataset From Kaggle",
    file_path="s3://bucket/path/to/file/transactions.parquet",  # This is the path to file
)

Parameters:

Name Type Description Default
name str

Name of Spark provider to be retrieved

required

Returns:

Name Type Description
spark OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def get_spark(self, name):
    """Get a Spark provider. The returned object can be used to register additional resources.

    **Examples**:
    ``` py
    spark = ff.get_spark("spark-quickstart")
    transactions = spark.register_file(
        name="transactions",
        variant="kaggle",
        description="Fraud Dataset From Kaggle",
        file_path="s3://bucket/path/to/file/transactions.parquet",  # This is the path to file
    )
    ```

    Args:
        name (str): Name of Spark provider to be retrieved

    Returns:
        spark (OfflineSQLProvider): Provider
    """
    mock_config = SparkConfig(
        executor_type="", executor_config={}, store_type="", store_config={}
    )
    mock_provider = Provider(
        name=name, function="OFFLINE", description="", team="", config=mock_config
    )
    return OfflineSparkProvider(self, mock_provider)

get_state()

Get the state of the resources to be registered.

Returns:

Name Type Description
resources List[str]

List of resources to be registered ex. "{type} - {name} ({variant})"

Source code in src/featureform/register.py
def get_state(self):
    """
    Get the state of the resources to be registered.

    Returns:
        resources (List[str]): List of resources to be registered ex. "{type} - {name} ({variant})"
    """
    if len(self.__resources) == 0:
        return "No resources to be registered"

    resources = [["Type", "Name", "Variant"]]
    for resource in self.__resources:
        if hasattr(resource, "variant"):
            resources.append(
                [resource.__class__.__name__, resource.name, resource.variant]
            )
        else:
            resources.append([resource.__class__.__name__, resource.name, ""])

    print("Resources to be registered:")
    self.__print_state(resources)

ondemand_feature(fn=None, *, tags=[], properties={}, variant='', name='', owner='', description='')

On Demand Feature decorator.

Examples

import featureform as ff

@ff.ondemand_feature()
def avg_user_transactions(client, params, entities):
    pass

Parameters:

Name Type Description Default
variant str

Name of variant

''
name str

Name of source

''
owner Union[str, UserRegistrar]

Owner

''
description str

Description of on demand feature

''
tags List[str]

Optional grouping mechanism for resources

[]
properties dict

Optional grouping mechanism for resources

{}

Returns:

Name Type Description
decorator OnDemandFeature

decorator

Source code in src/featureform/register.py
def ondemand_feature(
    self,
    fn=None,
    *,
    tags: List[str] = [],
    properties: dict = {},
    variant: str = "",
    name: str = "",
    owner: Union[str, UserRegistrar] = "",
    description: str = "",
):
    """On Demand Feature decorator.

    **Examples**
    ```python
    import featureform as ff

    @ff.ondemand_feature()
    def avg_user_transactions(client, params, entities):
        pass
    ```

    Args:
        variant (str): Name of variant
        name (str): Name of source
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of on demand feature
        tags (List[str]): Optional grouping mechanism for resources
        properties (dict): Optional grouping mechanism for resources

    Returns:
        decorator (OnDemandFeature): decorator

    """

    if not isinstance(owner, str):
        owner = owner.name()
    if owner == "":
        owner = self.must_get_default_owner()
    if variant == "":
        variant = self.__run
    decorator = OnDemandFeatureVariant(
        name=name,
        variant=variant,
        owner=owner,
        description=description,
        tags=tags or [],
        properties=properties or {},
    )

    self.__resources.append(decorator)

    if fn is None:
        return decorator
    else:
        return decorator(fn)

register_bigquery(name, project_id, dataset_id, credentials, credentials_path='', description='', team='', tags=[], properties={})

Register a BigQuery provider.

Examples:

bigquery = ff.register_bigquery(
    name="bigquery-quickstart",
    description="A BigQuery deployment we created for the Featureform quickstart",
    project_id="quickstart-project",
    dataset_id="quickstart-dataset",
    credentials=GCPCredentials(...)
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of BigQuery provider to be registered

required
project_id str

(Immutable) The Project name in GCP

required
dataset_id str

(Immutable) The Dataset name in GCP under the Project Id

required
credentials GCPCredentials

(Mutable) GCP credentials to access BigQuery

required
description str

(Mutable) Description of BigQuery provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
bigquery OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_bigquery(
    self,
    name: str,
    project_id: str,
    dataset_id: str,
    credentials: GCPCredentials,
    credentials_path: str = "",
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a BigQuery provider.

    **Examples**:
    ```
    bigquery = ff.register_bigquery(
        name="bigquery-quickstart",
        description="A BigQuery deployment we created for the Featureform quickstart",
        project_id="quickstart-project",
        dataset_id="quickstart-dataset",
        credentials=GCPCredentials(...)
    )
    ```

    Args:
        name (str): (Immutable) Name of BigQuery provider to be registered
        project_id (str): (Immutable) The Project name in GCP
        dataset_id (str): (Immutable) The Dataset name in GCP under the Project Id
        credentials (GCPCredentials): (Mutable) GCP credentials to access BigQuery
        description (str): (Mutable) Description of BigQuery provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        bigquery (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)

    config = BigQueryConfig(
        project_id=project_id,
        dataset_id=dataset_id,
        credentials=credentials,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

register_blob_store(name, account_name, account_key, container_name, root_path, description='', team='', tags=None, properties=None)

Register an Azure Blob Store provider.

Azure Blob Storage can be used as the storage component for Spark or the Featureform Pandas Runner.

Examples:

blob = ff.register_blob_store(
    name="azure-quickstart",
    container_name="my_company_container"
    root_path="custom/path/in/container"
    account_name=<azure_account_name>
    account_key=<azure_account_key>
    description="An azure blob store provider to store offline and inference data"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Azure blob store to be registered

required
container_name str

(Immutable) Azure container name

required
root_path str

(Immutable) A custom path in container to store data

required
account_name str

(Immutable) Azure account name

required
account_key str

(Mutable) Secret azure account key

required
description str

(Mutable) Description of Azure Blob provider to be registered

''
team str

(Mutable) The name of the team registering the filestore

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

None
properties dict

(Mutable) Optional grouping mechanism for resources

None

Returns:

Name Type Description
blob StorageProvider

Provider has all the functionality of OnlineProvider

Source code in src/featureform/register.py
def register_blob_store(
    self,
    name: str,
    account_name: str,
    account_key: str,
    container_name: str,
    root_path: str,
    description: str = "",
    team: str = "",
    tags=None,
    properties=None,
):
    """Register an Azure Blob Store provider.

    Azure Blob Storage can be used as the storage component for Spark or the Featureform Pandas Runner.

    **Examples**:
    ```
    blob = ff.register_blob_store(
        name="azure-quickstart",
        container_name="my_company_container"
        root_path="custom/path/in/container"
        account_name=<azure_account_name>
        account_key=<azure_account_key>
        description="An azure blob store provider to store offline and inference data"
    )
    ```

    Args:
        name (str): (Immutable) Name of Azure blob store to be registered
        container_name (str): (Immutable) Azure container name
        root_path (str): (Immutable) A custom path in container to store data
        account_name (str): (Immutable) Azure account name
        account_key (str):  (Mutable) Secret azure account key
        description (str): (Mutable) Description of Azure Blob provider to be registered
        team (str): (Mutable) The name of the team registering the filestore
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        blob (StorageProvider): Provider
            has all the functionality of OnlineProvider
    """

    tags, properties = set_tags_properties(tags, properties)

    container_name = container_name.replace("abfss://", "")
    if "/" in container_name:
        raise ValueError(
            "container_name cannot contain '/'. container_name should be the name of the Azure Blobstore container only."
        )

    azure_config = AzureFileStoreConfig(
        account_name=account_name,
        account_key=account_key,
        container_name=container_name,
        root_path=root_path,
    )
    config = OnlineBlobConfig(
        store_type="AZURE", store_config=azure_config.config()
    )

    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return FileStoreProvider(self, provider, azure_config, "AZURE")

register_cassandra(name, host, port, username, password, keyspace, consistency='THREE', replication=3, description='', team='', tags=[], properties={})

Register a Cassandra provider.

Examples:

cassandra = ff.register_cassandra(
        name = "cassandra",
        description = "Example inference store",
        team = "Featureform",
        host = "0.0.0.0",
        port = 9042,
        username = "cassandra",
        password = "cassandra",
        consistency = "THREE",
        replication = 3
    )

Parameters:

Name Type Description Default
name str

(Immutable) Name of Cassandra provider to be registered

required
host str

(Immutable) DNS name of Cassandra

required
port str

(Mutable) Port

required
username str

(Mutable) Username

required
password str

(Mutable) Password

required
consistency str

(Mutable) Consistency

'THREE'
replication int

(Mutable) Replication

3
description str

(Mutable) Description of Cassandra provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
cassandra OnlineProvider

Provider

Source code in src/featureform/register.py
def register_cassandra(
    self,
    name: str,
    host: str,
    port: int,
    username: str,
    password: str,
    keyspace: str,
    consistency: str = "THREE",
    replication: int = 3,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Cassandra provider.

    **Examples**:
    ```
    cassandra = ff.register_cassandra(
            name = "cassandra",
            description = "Example inference store",
            team = "Featureform",
            host = "0.0.0.0",
            port = 9042,
            username = "cassandra",
            password = "cassandra",
            consistency = "THREE",
            replication = 3
        )
    ```

    Args:
        name (str): (Immutable) Name of Cassandra provider to be registered
        host (str): (Immutable) DNS name of Cassandra
        port (str): (Mutable) Port
        username (str): (Mutable) Username
        password (str): (Mutable) Password
        consistency (str): (Mutable) Consistency
        replication (int): (Mutable) Replication
        description (str): (Mutable) Description of Cassandra provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        cassandra (OnlineProvider): Provider
    """
    config = CassandraConfig(
        host=host,
        port=port,
        username=username,
        password=password,
        keyspace=keyspace,
        consistency=consistency,
        replication=replication,
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

register_clickhouse(name, host, user, password, database, port=9000, description='', team='', ssl=False, tags=[], properties={})

Register a ClickHouse provider.

Examples:

clickhouse = ff.register_clickhouse(
    name="clickhouse-quickstart",
    description="A ClickHouse deployment we created for the Featureform quickstart",
    host="quickstart-clickhouse",  # The internal dns name for clickhouse
    port=9000,
    user="default",
    password="", #pragma: allowlist secret
    database="default"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of ClickHouse provider to be registered

required
host str

(Immutable) Hostname for ClickHouse

required
database str

(Immutable) ClickHouse database

required
port int

(Mutable) Port

9000
ssl bool

(Mutable) Enable SSL

False
user str

(Mutable) User

required
password str

(Mutable) ClickHouse password

required
description str

(Mutable) Description of ClickHouse provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
clickhouse OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_clickhouse(
    self,
    name: str,
    host: str,
    user: str,
    password: str,
    database: str,
    port: int = 9000,
    description: str = "",
    team: str = "",
    ssl: bool = False,
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a ClickHouse provider.

    **Examples**:
    ```
    clickhouse = ff.register_clickhouse(
        name="clickhouse-quickstart",
        description="A ClickHouse deployment we created for the Featureform quickstart",
        host="quickstart-clickhouse",  # The internal dns name for clickhouse
        port=9000,
        user="default",
        password="", #pragma: allowlist secret
        database="default"
    )
    ```

    Args:
        name (str): (Immutable) Name of ClickHouse provider to be registered
        host (str): (Immutable) Hostname for ClickHouse
        database (str): (Immutable) ClickHouse database
        port (int): (Mutable) Port
        ssl (bool): (Mutable) Enable SSL
        user (str): (Mutable) User
        password (str): (Mutable) ClickHouse password
        description (str): (Mutable) Description of ClickHouse provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        clickhouse (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = ClickHouseConfig(
        host=host,
        port=port,
        database=database,
        user=user,
        password=password,
        ssl=ssl,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

register_column_resources(source, entity, entity_column, owner='', inference_store='', features=None, labels=None, timestamp_column='', description='', schedule='', client_object=None)

Create features and labels from a source. Used in the register_resources function.

Parameters:

Name Type Description Default
source Union[NameVariant, SourceRegistrar, SQLTransformationDecorator]

Source of features, labels, entity

required
entity Union[str, EntityRegistrar]

Entity

required
entity_column str

Column of entity in source

required
owner Union[str, UserRegistrar]

Owner

''
inference_store Union[str, OnlineProvider]

Online provider

''
features List[ColumnMapping]

List of ColumnMapping objects (dictionaries containing the keys: name, variant, column, resource_type)

None
labels List[ColumnMapping]

List of ColumnMapping objects (dictionaries containing the keys: name, variant, column, resource_type)

None
description str

Description

''
schedule str

Kubernetes CronJob schedule string (" * * * ")

''

Returns:

Name Type Description
resource ResourceRegistrar

resource

Source code in src/featureform/register.py
def register_column_resources(
    self,
    source: Union[
        NameVariant,
        SourceRegistrar,
        SQLTransformationDecorator,
        DFTransformationDecorator,
    ],
    entity: Union[str, EntityRegistrar],
    entity_column: str,
    owner: Union[str, UserRegistrar] = "",
    inference_store: Union[str, OnlineProvider, FileStoreProvider] = "",
    features: List[ColumnMapping] = None,
    labels: List[ColumnMapping] = None,
    timestamp_column: str = "",
    description: str = "",
    schedule: str = "",
    client_object=None,
):
    """Create features and labels from a source. Used in the register_resources function.

    Args:
        source (Union[NameVariant, SourceRegistrar, SQLTransformationDecorator]): Source of features, labels, entity
        entity (Union[str, EntityRegistrar]): Entity
        entity_column (str): Column of entity in source
        owner (Union[str, UserRegistrar]): Owner
        inference_store (Union[str, OnlineProvider]): Online provider
        features (List[ColumnMapping]): List of ColumnMapping objects (dictionaries containing the keys: name, variant, column, resource_type)
        labels (List[ColumnMapping]): List of ColumnMapping objects (dictionaries containing the keys: name, variant, column, resource_type)
        description (str): Description
        schedule (str): Kubernetes CronJob schedule string ("* * * * *")

    Returns:
        resource (ResourceRegistrar): resource
    """

    if (
        type(inference_store) == FileStoreProvider
        and inference_store.store_type() in NON_INFERENCE_STORES
    ):
        raise Exception(
            f"cannot use '{inference_store.store_type()}' as an inference store."
        )

    if features is None:
        features = []
    if labels is None:
        labels = []
    if len(features) == 0 and len(labels) == 0:
        raise ValueError("No features or labels set")
    if isinstance(source, tuple) and source[1] == "":
        source = source[0], self.__run
    if not isinstance(entity, str):
        entity = entity.name()
    if not isinstance(inference_store, str):
        inference_store = inference_store.name()
    if not isinstance(owner, str):
        owner = owner.name()
    if owner == "":
        owner = self.must_get_default_owner()
    feature_resources = []
    label_resources = []
    for feature in features:
        variant = feature.get("variant", "")
        if variant == "":
            variant = self.__run
        if not ScalarType.has_value(feature["type"]) and not isinstance(
            feature["type"], ScalarType
        ):
            raise ValueError(
                f"Invalid type for feature {feature['name']} ({variant}). Must be a ScalarType or one of {ScalarType.get_values()}"
            )
        if isinstance(feature["type"], ScalarType):
            feature["type"] = feature["type"].value
        desc = feature.get("description", "")
        feature_tags = feature.get("tags", [])
        feature_properties = feature.get("properties", {})
        additional_Parameters = self._get_additional_parameters(ondemand_feature)
        is_embedding = feature.get("is_embedding", False)
        dims = feature.get("dims", 0)
        value_type = ScalarType(feature["type"])
        if dims > 0:
            value_type = VectorType(value_type, dims, is_embedding)
        resource = FeatureVariant(
            created=None,
            name=feature["name"],
            variant=variant,
            source=source,
            value_type=value_type,
            entity=entity,
            owner=owner,
            provider=inference_store,
            description=desc,
            schedule=schedule,
            location=ResourceColumnMapping(
                entity=entity_column,
                value=feature["column"],
                timestamp=timestamp_column,
            ),
            tags=feature_tags,
            properties=feature_properties,
            additional_parameters=additional_Parameters,
        )
        self.__resources.append(resource)
        self.map_client_object_to_resource(client_object, resource)
        feature_resources.append(resource)

    for label in labels:
        variant = label.get("variant", "")
        if variant == "":
            variant = self.__run
        if not ScalarType.has_value(label["type"]) and not isinstance(
            label["type"], ScalarType
        ):
            raise ValueError(
                f"Invalid type for label {label['name']} ({variant}). Must be a ScalarType or one of {ScalarType.get_values()}"
            )
        if isinstance(label["type"], ScalarType):
            label["type"] = label["type"].value
        desc = label.get("description", "")
        label_tags = label.get("tags", [])
        label_properties = label.get("properties", {})
        resource = LabelVariant(
            name=label["name"],
            variant=variant,
            source=source,
            value_type=label["type"],
            entity=entity,
            owner=owner,
            provider=inference_store,
            description=desc,
            location=ResourceColumnMapping(
                entity=entity_column,
                value=label["column"],
                timestamp=timestamp_column,
            ),
            tags=label_tags,
            properties=label_properties,
        )
        self.__resources.append(resource)
        self.map_client_object_to_resource(client_object, resource)
        label_resources.append(resource)
    return ResourceRegistrar(self, features, labels)

register_df_transformation(name, query, provider, variant='', owner='', description='', inputs=[], schedule='', args=None, tags=[], properties={})

Register a Dataframe transformation source.

Parameters:

Name Type Description Default
name str

Name of source

required
variant str

Name of variant

''
query str

SQL query

required
provider Union[str, OfflineProvider]

Provider

required
name str

Name of source

required
owner Union[str, UserRegistrar]

Owner

''
description str

Description of SQL transformation

''
inputs list

Inputs to transformation

[]
schedule str

Kubernetes CronJob schedule string (" * * * ")

''
args K8sArgs

Additional transformation arguments

None
tags List[str]

Optional grouping mechanism for resources

[]
properties dict

Optional grouping mechanism for resources

{}

Returns:

Name Type Description
source ColumnSourceRegistrar

Source

Source code in src/featureform/register.py
def register_df_transformation(
    self,
    name: str,
    query: str,
    provider: Union[str, OfflineProvider],
    variant: str = "",
    owner: Union[str, UserRegistrar] = "",
    description: str = "",
    inputs: list = [],
    schedule: str = "",
    args: K8sArgs = None,
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Dataframe transformation source.

    Args:
        name (str): Name of source
        variant (str): Name of variant
        query (str): SQL query
        provider (Union[str, OfflineProvider]): Provider
        name (str): Name of source
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of SQL transformation
        inputs (list): Inputs to transformation
        schedule (str): Kubernetes CronJob schedule string ("* * * * *")
        args (K8sArgs): Additional transformation arguments
        tags (List[str]): Optional grouping mechanism for resources
        properties (dict): Optional grouping mechanism for resources

    Returns:
        source (ColumnSourceRegistrar): Source
    """
    if not isinstance(owner, str):
        owner = owner.name()
    if owner == "":
        owner = self.must_get_default_owner()
    if variant == "":
        variant = self.__run
    if not isinstance(provider, str):
        provider = provider.name()
    source = SourceVariant(
        created=None,
        name=name,
        variant=variant,
        definition=DFTransformation(query, inputs, args),
        owner=owner,
        schedule=schedule,
        provider=provider,
        description=description,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(source)
    return ColumnSourceRegistrar(self, source)

register_dynamodb(name, credentials, region, should_import_from_s3=False, description='', team='', tags=[], properties={})

Register a DynamoDB provider.

Examples:

dynamodb = ff.register_dynamodb(
    name="dynamodb-quickstart",
    description="A Dynamodb deployment we created for the Featureform quickstart",
    credentials=aws_creds,
    region="us-east-1"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of DynamoDB provider to be registered

required
region str

(Immutable) Region to create dynamo tables

required
credentials AWSCredentials

(Mutable) AWS credentials with permissions to create DynamoDB tables

required
should_import_from_s3 bool

(Mutable) Determines whether feature materialization will occur via a direct import of data from S3 to new table (see docs for details)

False
description str

(Mutable) Description of DynamoDB provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
dynamodb OnlineProvider

Provider

Source code in src/featureform/register.py
def register_dynamodb(
    self,
    name: str,
    credentials: AWSCredentials,
    region: str,
    should_import_from_s3: bool = False,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a DynamoDB provider.

    **Examples**:
    ```
    dynamodb = ff.register_dynamodb(
        name="dynamodb-quickstart",
        description="A Dynamodb deployment we created for the Featureform quickstart",
        credentials=aws_creds,
        region="us-east-1"
    )
    ```

    Args:
        name (str): (Immutable) Name of DynamoDB provider to be registered
        region (str): (Immutable) Region to create dynamo tables
        credentials (AWSCredentials): (Mutable) AWS credentials with permissions to create DynamoDB tables
        should_import_from_s3 (bool): (Mutable) Determines whether feature materialization will occur via a direct import of data from S3 to new table (see [docs](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/S3DataImport.HowItWorks.html) for details)
        description (str): (Mutable) Description of DynamoDB provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        dynamodb (OnlineProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = DynamodbConfig(
        access_key=credentials.access_key,
        secret_key=credentials.secret_key,
        region=region,
        should_import_from_s3=should_import_from_s3,
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

register_entity(name, description='', tags=[], properties={})

Register an entity.

Examples:

    user = ff.register_entity("user")

Parameters:

Name Type Description Default
name str

Name of entity to be registered

required
description str

Description of entity to be registered

''
tags List[str]

Optional grouping mechanism for resources

[]
properties dict

Optional grouping mechanism for resources

{}

Returns:

Name Type Description
entity EntityRegistrar

Entity

Source code in src/featureform/register.py
def register_entity(
    self,
    name: str,
    description: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register an entity.

    **Examples**:
    ``` py
        user = ff.register_entity("user")
    ```

    Args:
        name (str): Name of entity to be registered
        description (str): Description of entity to be registered
        tags (List[str]): Optional grouping mechanism for resources
        properties (dict): Optional grouping mechanism for resources

    Returns:
        entity (EntityRegistrar): Entity
    """
    entity = Entity(
        name=name,
        description=description,
        status="",
        tags=tags,
        properties=properties,
    )
    self.__resources.append(entity)
    return EntityRegistrar(self, entity)

register_firestore(name, collection, project_id, credentials, credentials_path='', description='', team='', tags=[], properties={})

Register a Firestore provider.

Examples:

firestore = ff.register_firestore(
    name="firestore-quickstart",
    description="A Firestore deployment we created for the Featureform quickstart",
    project_id="quickstart-project",
    collection="quickstart-collection",
    credentials=ff.GCPCredentials(...)
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Firestore provider to be registered

required
project_id str

(Immutable) The Project name in GCP

required
collection str

(Immutable) The Collection name in Firestore under the given project ID

required
credentials GCPCredentials

(Mutable) GCP credentials to access Firestore

required
description str

(Mutable) Description of Firestore provider to be registered

''
team str

(Mutable) The name of the team registering the filestore

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
firestore OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_firestore(
    self,
    name: str,
    collection: str,
    project_id: str,
    credentials: GCPCredentials,
    credentials_path: str = "",
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Firestore provider.

    **Examples**:
    ```
    firestore = ff.register_firestore(
        name="firestore-quickstart",
        description="A Firestore deployment we created for the Featureform quickstart",
        project_id="quickstart-project",
        collection="quickstart-collection",
        credentials=ff.GCPCredentials(...)
    )
    ```

    Args:
        name (str): (Immutable) Name of Firestore provider to be registered
        project_id (str): (Immutable) The Project name in GCP
        collection (str): (Immutable) The Collection name in Firestore under the given project ID
        credentials (GCPCredentials): (Mutable) GCP credentials to access Firestore
        description (str): (Mutable) Description of Firestore provider to be registered
        team (str): (Mutable) The name of the team registering the filestore
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        firestore (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = FirestoreConfig(
        collection=collection,
        project_id=project_id,
        credentials=credentials,
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

register_gcs(name, bucket_name, root_path, credentials, description='', team='', tags=[], properties={})

Register a GCS store provider.

Examples:

gcs = ff.register_gcs(
    name="gcs-quickstart",
    credentials=ff.GCPCredentials(...),
    bucket_name="bucket_name",
    root_path="featureform/path/",
    description="An gcs store provider to store offline"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of GCS store to be registered

required
bucket_name str

(Immutable) The bucket name

required
root_path str

(Immutable) Custom path to be used by featureform

required
credentials GCPCredentials

(Mutable) GCP credentials to access the bucket

required
description str

(Mutable) Description of GCS provider to be registered

''
team str

(Mutable) The name of the team registering the filestore

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
gcs FileStoreProvider

Provider has all the functionality of OfflineProvider

Source code in src/featureform/register.py
def register_gcs(
    self,
    name: str,
    bucket_name: str,
    root_path: str,
    credentials: GCPCredentials,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a GCS store provider.

    **Examples**:
    ```
    gcs = ff.register_gcs(
        name="gcs-quickstart",
        credentials=ff.GCPCredentials(...),
        bucket_name="bucket_name",
        root_path="featureform/path/",
        description="An gcs store provider to store offline"
    )
    ```

    Args:
        name (str): (Immutable) Name of GCS store to be registered
        bucket_name (str): (Immutable) The bucket name
        root_path (str): (Immutable) Custom path to be used by featureform
        credentials (GCPCredentials): (Mutable) GCP credentials to access the bucket
        description (str): (Mutable) Description of GCS provider to be registered
        team (str): (Mutable) The name of the team registering the filestore
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        gcs (FileStoreProvider): Provider
            has all the functionality of OfflineProvider
    """
    tags, properties = set_tags_properties(tags, properties)

    if bucket_name == "":
        raise ValueError("bucket_name is required and cannot be empty string")

    bucket_name = bucket_name.replace("gs://", "")
    if "/" in bucket_name:
        raise ValueError(
            "bucket_name cannot contain '/'. bucket_name should be the name of the GCS bucket only."
        )

    gcs_config = GCSFileStoreConfig(
        bucket_name=bucket_name, bucket_path=root_path, credentials=credentials
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=gcs_config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return FileStoreProvider(self, provider, gcs_config, gcs_config.type())

register_hdfs(name, host, port, username='', path='', description='', team='', tags=[], properties={})

Register a HDFS store provider.

This has the functionality of an offline store and can be used as a parameter to a k8s or spark provider

Examples:

hdfs = ff.register_hdfs(
    name="hdfs-quickstart",
    host="<host>",
    port="<port>",
    path="<path>",
    username="<username>",
    description="An hdfs store provider to store offline"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of HDFS store to be registered

required
host str

(Immutable) The hostname for HDFS

required
path str

(Immutable) A storage path within HDFS

''
port str

(Mutable) The IPC port for the Namenode for HDFS. (Typically 8020 or 9000)

required
username str

(Mutable) A Username for HDFS

''
description str

(Mutable) Description of HDFS provider to be registered

''
team str

(Mutable) The name of the team registering HDFS

''

Returns:

Name Type Description
hdfs FileStoreProvider

Provider

Source code in src/featureform/register.py
def register_hdfs(
    self,
    name: str,
    host: str,
    port: str,
    username: str = "",
    path: str = "",
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a HDFS store provider.

    This has the functionality of an offline store and can be used as a parameter
    to a k8s or spark provider

    **Examples**:
    ```
    hdfs = ff.register_hdfs(
        name="hdfs-quickstart",
        host="<host>",
        port="<port>",
        path="<path>",
        username="<username>",
        description="An hdfs store provider to store offline"
    )
    ```

    Args:
        name (str): (Immutable) Name of HDFS store to be registered
        host (str): (Immutable) The hostname for HDFS
        path (str): (Immutable) A storage path within HDFS
        port (str): (Mutable) The IPC port for the Namenode for HDFS. (Typically 8020 or 9000)
        username (str): (Mutable) A Username for HDFS
        description (str): (Mutable) Description of HDFS provider to be registered
        team (str): (Mutable) The name of the team registering HDFS

    Returns:
        hdfs (FileStoreProvider): Provider
    """

    hdfs_config = HDFSConfig(host=host, port=port, path=path, username=username)

    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=hdfs_config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return FileStoreProvider(self, provider, hdfs_config, hdfs_config.type())

register_k8s(name, store, description='', team='', docker_image='', tags=[], properties={})

Register an offline store provider to run on Featureform's own k8s deployment. Examples:

spark = ff.register_k8s(
    name="k8s",
    store=AzureBlobStore(),
    docker_image="my-repo/image:version"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of provider

required
store FileStoreProvider

(Mutable) Reference to registered file store provider

required
docker_image str

(Mutable) A custom docker image using the base image featureformcom/k8s_runner

''
description str

(Mutable) Description of primary data to be registered

''
team str

(Mutable) A string parameter describing the team that owns the provider

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}
Source code in src/featureform/register.py
def register_k8s(
    self,
    name: str,
    store: FileStoreProvider,
    description: str = "",
    team: str = "",
    docker_image: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """
    Register an offline store provider to run on Featureform's own k8s deployment.
    **Examples**:
    ```
    spark = ff.register_k8s(
        name="k8s",
        store=AzureBlobStore(),
        docker_image="my-repo/image:version"
    )
    ```

    Args:
        name (str): (Immutable) Name of provider
        store (FileStoreProvider): (Mutable) Reference to registered file store provider
        docker_image (str): (Mutable) A custom docker image using the base image featureformcom/k8s_runner
        description (str): (Mutable) Description of primary data to be registered
        team (str): (Mutable) A string parameter describing the team that owns the provider
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources
    """

    tags, properties = set_tags_properties(tags, properties)
    config = K8sConfig(
        store_type=store.store_type(),
        store_config=store.config(),
        docker_image=docker_image,
    )

    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineK8sProvider(self, provider)

register_model(name, tags=[], properties={})

Register a model.

Parameters:

Name Type Description Default
name str

Model to be registered

required
tags List[str]

Optional grouping mechanism for resources

[]
properties dict

Optional grouping mechanism for resources

{}

Returns:

Name Type Description
ModelRegistrar Model

Model

Source code in src/featureform/register.py
def register_model(
    self, name: str, tags: List[str] = [], properties: dict = {}
) -> Model:
    """Register a model.

    Args:
        name (str): Model to be registered
        tags (List[str]): Optional grouping mechanism for resources
        properties (dict): Optional grouping mechanism for resources

    Returns:
        ModelRegistrar: Model
    """
    model = Model(name, description="", tags=tags, properties=properties)
    self.__resources.append(model)
    return model

register_mongodb(name, username, password, database, host, port, throughput=1000, description='', team='', tags=[], properties={})

Register a MongoDB provider.

Examples:

mongodb = ff.register_mongodb(
    name="mongodb-quickstart",
    description="A MongoDB deployment",
    username="my_username",
    password="myPassword",
    database="featureform_database"
    host="my-mongodb.host.com",
    port="10225",
    throughput=10000
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of MongoDB provider to be registered

required
database str

(Immutable) MongoDB database

required
host str

(Immutable) MongoDB hostname

required
port str

(Immutable) MongoDB port

required
username str

(Mutable) MongoDB username

required
password str

(Mutable) MongoDB password

required
throughput int

(Mutable) The maximum RU limit for autoscaling in CosmosDB

1000
description str

(Mutable) Description of MongoDB provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
mongodb OnlineProvider

Provider

Source code in src/featureform/register.py
def register_mongodb(
    self,
    name: str,
    username: str,
    password: str,
    database: str,
    host: str,
    port: str,
    throughput: int = 1000,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a MongoDB provider.

    **Examples**:
    ```
    mongodb = ff.register_mongodb(
        name="mongodb-quickstart",
        description="A MongoDB deployment",
        username="my_username",
        password="myPassword",
        database="featureform_database"
        host="my-mongodb.host.com",
        port="10225",
        throughput=10000
    )
    ```

    Args:
        name (str): (Immutable) Name of MongoDB provider to be registered
        database (str): (Immutable) MongoDB database
        host (str): (Immutable) MongoDB hostname
        port (str): (Immutable) MongoDB port
        username (str): (Mutable) MongoDB username
        password (str): (Mutable) MongoDB password
        throughput (int): (Mutable) The maximum RU limit for autoscaling in CosmosDB
        description (str): (Mutable) Description of MongoDB provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        mongodb (OnlineProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = MongoDBConfig(
        username=username,
        password=password,
        host=host,
        port=port,
        database=database,
        throughput=throughput,
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

register_pinecone(name, project_id, environment, api_key, description='', team='', tags=[], properties={})

Register a Pinecone provider.

Examples:

pinecone = ff.register_pinecone(
    name="pinecone-quickstart",
    project_id="2g13ek7",
    environment="us-west4-gcp-free",
    api_key="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Pinecone provider to be registered

required
project_id str

(Immutable) Pinecone project id

required
environment str

(Immutable) Pinecone environment

required
api_key str

(Mutable) Pinecone api key

required
description str

(Mutable) Description of Pinecone provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
pinecone OnlineProvider

Provider

Source code in src/featureform/register.py
def register_pinecone(
    self,
    name: str,
    project_id: str,
    environment: str,
    api_key: str,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Pinecone provider.

    **Examples**:
    ```
    pinecone = ff.register_pinecone(
        name="pinecone-quickstart",
        project_id="2g13ek7",
        environment="us-west4-gcp-free",
        api_key="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    )
    ```

    Args:
        name (str): (Immutable) Name of Pinecone provider to be registered
        project_id (str): (Immutable) Pinecone project id
        environment (str): (Immutable) Pinecone environment
        api_key (str): (Mutable) Pinecone api key
        description (str): (Mutable) Description of Pinecone provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        pinecone (OnlineProvider): Provider
    """

    tags, properties = set_tags_properties(tags, properties)
    config = PineconeConfig(
        project_id=project_id, environment=environment, api_key=api_key
    )
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

register_postgres(name, host, user, password, database, port='5432', description='', team='', sslmode='disable', tags=[], properties={})

Register a Postgres provider.

Examples:

postgres = ff.register_postgres(
    name="postgres-quickstart",
    description="A Postgres deployment we created for the Featureform quickstart",
    host="quickstart-postgres",  # The internal dns name for postgres
    port="5432",
    user="postgres",
    password="password", #pragma: allowlist secret
    database="postgres"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Postgres provider to be registered

required
host str

(Immutable) Hostname for Postgres

required
database str

(Immutable) Database

required
port str

(Mutable) Port

'5432'
user str

(Mutable) User

required
password str

(Mutable) Password

required
sslmode str

(Mutable) SSL mode

'disable'
description str

(Mutable) Description of Postgres provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
postgres OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_postgres(
    self,
    name: str,
    host: str,
    user: str,
    password: str,
    database: str,
    port: str = "5432",
    description: str = "",
    team: str = "",
    sslmode: str = "disable",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Postgres provider.

    **Examples**:
    ```
    postgres = ff.register_postgres(
        name="postgres-quickstart",
        description="A Postgres deployment we created for the Featureform quickstart",
        host="quickstart-postgres",  # The internal dns name for postgres
        port="5432",
        user="postgres",
        password="password", #pragma: allowlist secret
        database="postgres"
    )
    ```

    Args:
        name (str): (Immutable) Name of Postgres provider to be registered
        host (str): (Immutable) Hostname for Postgres
        database (str): (Immutable) Database
        port (str): (Mutable) Port
        user (str): (Mutable) User
        password (str): (Mutable) Password
        sslmode (str): (Mutable) SSL mode
        description (str): (Mutable) Description of Postgres provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        postgres (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = PostgresConfig(
        host=host,
        port=port,
        database=database,
        user=user,
        password=password,
        sslmode=sslmode,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags or [],
        properties=properties or {},
    )

    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

register_primary_data(name, location, provider, tags, properties, variant='', owner='', description='')

Register a primary data source.

Parameters:

Name Type Description Default
name str

Name of source

required
variant str

Name of variant

''
location Location

Location of primary data

required
provider Union[str, OfflineProvider]

Provider

required
owner Union[str, UserRegistrar]

Owner

''
description str

Description of primary data to be registered

''

Returns:

Name Type Description
source ColumnSourceRegistrar

Source

Source code in src/featureform/register.py
def register_primary_data(
    self,
    name: str,
    location: Location,
    provider: Union[str, OfflineProvider],
    tags: List[str],
    properties: dict,
    variant: str = "",
    owner: Union[str, UserRegistrar] = "",
    description: str = "",
):
    """Register a primary data source.

    Args:
        name (str): Name of source
        variant (str): Name of variant
        location (Location): Location of primary data
        provider (Union[str, OfflineProvider]): Provider
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of primary data to be registered

    Returns:
        source (ColumnSourceRegistrar): Source
    """
    if not isinstance(owner, str):
        owner = owner.name()
    if owner == "":
        owner = self.must_get_default_owner()
    if variant == "":
        variant = self.__run
    if not isinstance(provider, str):
        provider = provider.name()
    source = SourceVariant(
        created=None,
        name=name,
        variant=variant,
        definition=PrimaryData(location=location),
        owner=owner,
        provider=provider,
        description=description,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(source)
    column_source_registrar = ColumnSourceRegistrar(self, source)
    self.map_client_object_to_resource(column_source_registrar, source)
    return column_source_registrar

register_qdrant(name, grpc_host, api_key='', use_tls=False, description='', team='', tags=[], properties={})

Register a Qdrant provider.

Examples:

qdrant = ff.register_qdrant(
    name="qdrant-quickstart",
    grpc_host="xyz-example.eu-central.aws.cloud.qdrant.io:6334",
    api_key="<API KEY>",
    use_tls=True,
    description="A Qdrant project for using embeddings in Featureform"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Qdrant provider to be registered

required
url str

(Immutable) gRPC host of the Qdrant cluster, either in the cloud or via local deployment.

required
api_key str

(Mutable) Qdrant API key.

''
use_tls bool

(Immutable) Whether to use TLS for the connection.

False
description str

(Mutable) Description of Qdrant provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
qdrant OnlineProvider

Provider

Source code in src/featureform/register.py
def register_qdrant(
    self,
    name: str,
    grpc_host: str,
    api_key: str = "",
    use_tls: bool = False,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Qdrant provider.

    **Examples**:
    ```
    qdrant = ff.register_qdrant(
        name="qdrant-quickstart",
        grpc_host="xyz-example.eu-central.aws.cloud.qdrant.io:6334",
        api_key="<API KEY>",
        use_tls=True,
        description="A Qdrant project for using embeddings in Featureform"
    )
    ```

    Args:
        name (str): (Immutable) Name of Qdrant provider to be registered
        url (str): (Immutable) gRPC host of the Qdrant cluster, either in the cloud or via local deployment.
        api_key (str): (Mutable) Qdrant API key.
        use_tls (bool): (Immutable) Whether to use TLS for the connection.
        description (str): (Mutable) Description of Qdrant provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        qdrant (OnlineProvider): Provider
    """
    config = QdrantConfig(grpc_host=grpc_host, api_key=api_key, use_tls=use_tls)
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

register_redis(name, host, port=6379, db=0, password='', description='', team='', tags=None, properties=None)

Register a Redis provider.

Examples:

redis = ff.register_redis(
    name="redis-quickstart",
    host="quickstart-redis",
    port=6379,
    password="password",
    description="A Redis deployment we created for the Featureform quickstart"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Redis provider to be registered

required
host str

(Immutable) Hostname for Redis

required
db str

(Immutable) Redis database number

0
port int

(Mutable) Redis port

6379
password str

(Mutable) Redis password

''
description str

(Mutable) Description of Redis provider to be registered

''
team str

(Mutable) Name of team

''
tags Optional[List[str]]

(Mutable) Optional grouping mechanism for resources

None
properties Optional[dict]

(Mutable) Optional grouping mechanism for resources

None

Returns:

Name Type Description
redis OnlineProvider

Provider

Source code in src/featureform/register.py
def register_redis(
    self,
    name: str,
    host: str,
    port: int = 6379,
    db: int = 0,
    password: str = "",
    description: str = "",
    team: str = "",
    tags: Optional[List[str]] = None,
    properties: Optional[dict] = None,
):
    """Register a Redis provider.

    **Examples**:
    ```
    redis = ff.register_redis(
        name="redis-quickstart",
        host="quickstart-redis",
        port=6379,
        password="password",
        description="A Redis deployment we created for the Featureform quickstart"
    )
    ```

    Args:
        name (str): (Immutable) Name of Redis provider to be registered
        host (str): (Immutable) Hostname for Redis
        db (str): (Immutable) Redis database number
        port (int): (Mutable) Redis port
        password (str): (Mutable) Redis password
        description (str): (Mutable) Description of Redis provider to be registered
        team (str): (Mutable) Name of team
        tags (Optional[List[str]]): (Mutable) Optional grouping mechanism for resources
        properties (Optional[dict]): (Mutable) Optional grouping mechanism for resources

    Returns:
        redis (OnlineProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = RedisConfig(host=host, port=port, password=password, db=db)
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

register_redshift(name, host, port, user, password, database, description='', team='', sslmode='disable', tags=[], properties={})

Register a Redshift provider.

Examples:

redshift = ff.register_redshift(
    name="redshift-quickstart",
    description="A Redshift deployment we created for the Featureform quickstart",
    host="quickstart-redshift",  # The internal dns name for redshift
    port="5432",
    user="redshift",
    password="password", #pragma: allowlist secret
    database="dev"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Redshift provider to be registered

required
host str

(Immutable) Hostname for Redshift

required
database str

(Immutable) Redshift database

required
port str

(Mutable) Port

required
user str

(Mutable) User

required
password str

(Mutable) Redshift password

required
sslmode str

(Mutable) SSL mode

'disable'
description str

(Mutable) Description of Redshift provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
redshift OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_redshift(
    self,
    name: str,
    host: str,
    port: str,
    user: str,
    password: str,
    database: str,
    description: str = "",
    team: str = "",
    sslmode: str = "disable",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Redshift provider.

    **Examples**:
    ```
    redshift = ff.register_redshift(
        name="redshift-quickstart",
        description="A Redshift deployment we created for the Featureform quickstart",
        host="quickstart-redshift",  # The internal dns name for redshift
        port="5432",
        user="redshift",
        password="password", #pragma: allowlist secret
        database="dev"
    )
    ```

    Args:
        name (str): (Immutable) Name of Redshift provider to be registered
        host (str): (Immutable) Hostname for Redshift
        database (str): (Immutable) Redshift database
        port (str): (Mutable) Port
        user (str): (Mutable) User
        password (str): (Mutable) Redshift password
        sslmode (str): (Mutable) SSL mode
        description (str): (Mutable) Description of Redshift provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        redshift (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = RedshiftConfig(
        host=host,
        port=port,
        database=database,
        user=user,
        password=password,
        sslmode=sslmode,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

register_s3(name, credentials, bucket_region, bucket_name, path='', description='', team='', tags=[], properties={})

Register a S3 store provider.

This has the functionality of an offline store and can be used as a parameter to a k8s or spark provider

Examples:

s3 = ff.register_s3(
    name="s3-quickstart",
    credentials=aws_creds,
    bucket_name="bucket_name",
    bucket_region=<bucket_region>,
    path="path/to/store/featureform_files/in/",
    description="An s3 store provider to store offline"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of S3 store to be registered

required
bucket_name str

(Immutable) AWS Bucket Name

required
bucket_region str

(Immutable) AWS region the bucket is located in

required
path str

(Immutable) The path used to store featureform files in

''
credentials AWSCredentials

(Mutable) AWS credentials to access the bucket

required
description str

(Mutable) Description of S3 provider to be registered

''
team str

(Mutable) The name of the team registering the filestore

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
s3 FileStoreProvider

Provider has all the functionality of OfflineProvider

Source code in src/featureform/register.py
def register_s3(
    self,
    name: str,
    credentials: AWSCredentials,
    bucket_region: str,
    bucket_name: str,
    path: str = "",
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a S3 store provider.

    This has the functionality of an offline store and can be used as a parameter
    to a k8s or spark provider

    **Examples**:
    ```
    s3 = ff.register_s3(
        name="s3-quickstart",
        credentials=aws_creds,
        bucket_name="bucket_name",
        bucket_region=<bucket_region>,
        path="path/to/store/featureform_files/in/",
        description="An s3 store provider to store offline"
    )
    ```

    Args:
        name (str): (Immutable) Name of S3 store to be registered
        bucket_name (str): (Immutable) AWS Bucket Name
        bucket_region (str): (Immutable) AWS region the bucket is located in
        path (str): (Immutable) The path used to store featureform files in
        credentials (AWSCredentials): (Mutable) AWS credentials to access the bucket
        description (str): (Mutable) Description of S3 provider to be registered
        team (str): (Mutable) The name of the team registering the filestore
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        s3 (FileStoreProvider): Provider
            has all the functionality of OfflineProvider
    """
    tags, properties = set_tags_properties(tags, properties)

    if bucket_name == "":
        raise ValueError("bucket_name is required and cannot be empty string")

    # TODO: add verification into S3StoreConfig
    bucket_name = bucket_name.replace("s3://", "").replace("s3a://", "")

    if "/" in bucket_name:
        raise ValueError(
            "bucket_name cannot contain '/'. bucket_name should be the name of the AWS S3 bucket only."
        )

    s3_config = S3StoreConfig(
        bucket_path=bucket_name,
        bucket_region=bucket_region,
        credentials=credentials,
        path=path,
    )

    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=s3_config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return FileStoreProvider(self, provider, s3_config, s3_config.type())

register_snowflake(name, username, password, account, organization, database, schema='PUBLIC', description='', team='', warehouse='', role='', tags=[], properties={})

Register a Snowflake provider.

Examples:

snowflake = ff.register_snowflake(
    name="snowflake-quickstart",
    username="snowflake",
    password="password", #pragma: allowlist secret
    account="account",
    organization="organization",
    database="snowflake",
    schema="PUBLIC",
    description="A Snowflake deployment we created for the Featureform quickstart"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Snowflake provider to be registered

required
account str

(Immutable) Account

required
organization str

(Immutable) Organization

required
database str

(Immutable) Database

required
schema str

(Immutable) Schema

'PUBLIC'
username str

(Mutable) Username

required
password str

(Mutable) Password

required
warehouse str

(Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.

''
role str

(Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session

''
description str

(Mutable) Description of Snowflake provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
snowflake OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_snowflake(
    self,
    name: str,
    username: str,
    password: str,
    account: str,
    organization: str,
    database: str,
    schema: str = "PUBLIC",
    description: str = "",
    team: str = "",
    warehouse: str = "",
    role: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Snowflake provider.

    **Examples**:
    ```
    snowflake = ff.register_snowflake(
        name="snowflake-quickstart",
        username="snowflake",
        password="password", #pragma: allowlist secret
        account="account",
        organization="organization",
        database="snowflake",
        schema="PUBLIC",
        description="A Snowflake deployment we created for the Featureform quickstart"
    )
    ```

    Args:
        name (str): (Immutable) Name of Snowflake provider to be registered
        account (str): (Immutable) Account
        organization (str): (Immutable) Organization
        database (str): (Immutable) Database
        schema (str): (Immutable) Schema
        username (str): (Mutable) Username
        password (str): (Mutable) Password
        warehouse (str): (Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.
        role (str): (Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session
        description (str): (Mutable) Description of Snowflake provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        snowflake (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = SnowflakeConfig(
        account=account,
        database=database,
        organization=organization,
        username=username,
        password=password,
        schema=schema,
        warehouse=warehouse,
        role=role,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

register_snowflake_legacy(name, username, password, account_locator, database, schema='PUBLIC', description='', team='', warehouse='', role='', tags=[], properties={})

Register a Snowflake provider using legacy credentials.

Examples:

snowflake = ff.register_snowflake_legacy(
    name="snowflake-quickstart",
    username="snowflake",
    password="password",
    account_locator="account-locator",
    database="snowflake",
    schema="PUBLIC",
    description="A Snowflake deployment we created for the Featureform quickstart"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Snowflake provider to be registered

required
account_locator str

(Immutable) Account Locator

required
schema str

(Immutable) Schema

'PUBLIC'
database str

(Immutable) Database

required
username str

(Mutable) Username

required
password str

(Mutable) Password

required
warehouse str

(Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.

''
role str

(Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session

''
description str

(Mutable) Description of Snowflake provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
snowflake OfflineSQLProvider

Provider

Source code in src/featureform/register.py
def register_snowflake_legacy(
    self,
    name: str,
    username: str,
    password: str,
    account_locator: str,
    database: str,
    schema: str = "PUBLIC",
    description: str = "",
    team: str = "",
    warehouse: str = "",
    role: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Snowflake provider using legacy credentials.

    **Examples**:
    ```
    snowflake = ff.register_snowflake_legacy(
        name="snowflake-quickstart",
        username="snowflake",
        password="password",
        account_locator="account-locator",
        database="snowflake",
        schema="PUBLIC",
        description="A Snowflake deployment we created for the Featureform quickstart"
    )
    ```

    Args:
        name (str): (Immutable) Name of Snowflake provider to be registered
        account_locator (str): (Immutable) Account Locator
        schema (str): (Immutable) Schema
        database (str): (Immutable) Database
        username (str): (Mutable) Username
        password (str): (Mutable) Password
        warehouse (str): (Mutable) Specifies the virtual warehouse to use by default for queries, loading, etc.
        role (str): (Mutable) Specifies the role to use by default for accessing Snowflake objects in the client session
        description (str): (Mutable) Description of Snowflake provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        snowflake (OfflineSQLProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = SnowflakeConfig(
        account_locator=account_locator,
        database=database,
        username=username,
        password=password,
        schema=schema,
        warehouse=warehouse,
        role=role,
    )
    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSQLProvider(self, provider)

register_spark(name, executor, filestore, description='', team='', tags=[], properties={})

Register a Spark on Executor provider.

Examples:

spark = ff.register_spark(
    name="spark-quickstart",
    description="A Spark deployment we created for the Featureform quickstart",
    team="featureform-team",
    executor=databricks,
    filestore=azure_blob_store
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Spark provider to be registered

required
executor ExecutorCredentials

(Mutable) An Executor Provider used for the compute power

required
filestore FileStoreProvider

(Mutable) A FileStoreProvider used for storage of data

required
description str

(Mutable) Description of Spark provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
spark OfflineSparkProvider

Provider

Source code in src/featureform/register.py
def register_spark(
    self,
    name: str,
    executor: ExecutorCredentials,
    filestore: FileStoreProvider,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Spark on Executor provider.

    **Examples**:
    ```
    spark = ff.register_spark(
        name="spark-quickstart",
        description="A Spark deployment we created for the Featureform quickstart",
        team="featureform-team",
        executor=databricks,
        filestore=azure_blob_store
    )
    ```

    Args:
        name (str): (Immutable) Name of Spark provider to be registered
        executor (ExecutorCredentials): (Mutable) An Executor Provider used for the compute power
        filestore (FileStoreProvider): (Mutable) A FileStoreProvider used for storage of data
        description (str): (Mutable) Description of Spark provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        spark (OfflineSparkProvider): Provider
    """
    tags, properties = set_tags_properties(tags, properties)
    config = SparkConfig(
        executor_type=executor.type(),
        executor_config=executor.config(),
        store_type=filestore.store_type(),
        store_config=filestore.config(),
    )

    provider = Provider(
        name=name,
        function="OFFLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OfflineSparkProvider(self, provider)

register_sql_transformation(name, query, provider, variant='', owner='', description='', schedule='', args=None, inputs=None, tags=[], properties={})

Register a SQL transformation source.

Parameters:

Name Type Description Default
name str

Name of source

required
variant str

Name of variant

''
query str

SQL query

required
provider Union[str, OfflineProvider]

Provider

required
owner Union[str, UserRegistrar]

Owner

''
description str

Description of primary data to be registered

''
schedule str

Kubernetes CronJob schedule string (" * * * ")

''
args K8sArgs

Additional transformation arguments

None
tags List[str]

Optional grouping mechanism for resources

[]
properties dict

Optional grouping mechanism for resources

{}

Returns:

Name Type Description
source ColumnSourceRegistrar

Source

Source code in src/featureform/register.py
def register_sql_transformation(
    self,
    name: str,
    query: str,
    provider: Union[str, OfflineProvider],
    variant: str = "",
    owner: Union[str, UserRegistrar] = "",
    description: str = "",
    schedule: str = "",
    args: K8sArgs = None,
    inputs: Union[List[NameVariant], List[str], List[ColumnSourceRegistrar]] = None,
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a SQL transformation source.

    Args:
        name (str): Name of source
        variant (str): Name of variant
        query (str): SQL query
        provider (Union[str, OfflineProvider]): Provider
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of primary data to be registered
        schedule (str): Kubernetes CronJob schedule string ("* * * * *")
        args (K8sArgs): Additional transformation arguments
        tags (List[str]): Optional grouping mechanism for resources
        properties (dict): Optional grouping mechanism for resources

    Returns:
        source (ColumnSourceRegistrar): Source
    """
    if not isinstance(owner, str):
        owner = owner.name()
    if owner == "":
        owner = self.must_get_default_owner()
    if variant == "":
        variant = self.__run
    if not isinstance(provider, str):
        provider = provider.name()
    source = SourceVariant(
        created=None,
        name=name,
        variant=variant,
        definition=SQLTransformation(query, args),
        owner=owner,
        schedule=schedule,
        provider=provider,
        description=description,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(source)
    return ColumnSourceRegistrar(self, source)

register_training_set(name, variant='', features=[], label=('', ''), resources=[], owner='', description='', schedule='', tags=[], properties={})

Register a training set.

Example:

ff.register_training_set(
    name="my_training_set",
    label=("label", "v1"),
    features=[("feature1", "v1"), ("feature2", "v1")],
)

Parameters:

Name Type Description Default
name str

Name of training set to be registered

required
variant str

Name of variant to be registered

''
label NameVariant

Label of training set

('', '')
features List[NameVariant]

Features of training set

[]
resources List[Resource]

A list of previously registered resources

[]
owner Union[str, UserRegistrar]

Owner

''
description str

Description of training set to be registered

''
schedule str

Kubernetes CronJob schedule string (" * * * ")

''
tags List[str]

Optional grouping mechanism for resources

[]
properties dict

Optional grouping mechanism for resources

{}

Returns:

Name Type Description
resource ResourceRegistrar

resource

Source code in src/featureform/register.py
def register_training_set(
    self,
    name: str,
    variant: str = "",
    features: Union[
        list, List[FeatureColumnResource], MultiFeatureColumnResource
    ] = [],
    label: Union[NameVariant, LabelColumnResource] = ("", ""),
    resources: list = [],
    owner: Union[str, UserRegistrar] = "",
    description: str = "",
    schedule: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a training set.

    **Example**:
    ```
    ff.register_training_set(
        name="my_training_set",
        label=("label", "v1"),
        features=[("feature1", "v1"), ("feature2", "v1")],
    )
    ```

    Args:
        name (str): Name of training set to be registered
        variant (str): Name of variant to be registered
        label (NameVariant): Label of training set
        features (List[NameVariant]): Features of training set
        resources (List[Resource]): A list of previously registered resources
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of training set to be registered
        schedule (str): Kubernetes CronJob schedule string ("* * * * *")
        tags (List[str]): Optional grouping mechanism for resources
        properties (dict): Optional grouping mechanism for resources

    Returns:
        resource (ResourceRegistrar): resource
    """
    if not isinstance(owner, str):
        owner = owner.name()
    if owner == "":
        owner = self.must_get_default_owner()
    if variant == "":
        variant = self.__run

    if not isinstance(features, (list, MultiFeatureColumnResource)):
        raise ValueError(
            f"Invalid features type: {type(features)} "
            "Features must be entered as a list of name-variant tuples (e.g. [('feature1', 'quickstart'), ('feature2', 'quickstart')]) or a list of FeatureColumnResource instances."
        )
    if not isinstance(label, (tuple, str, LabelColumnResource)):
        raise ValueError(
            f"Invalid label type: {type(label)} "
            "Label must be entered as a name-variant tuple (e.g. ('fraudulent', 'quickstart')), a resource name, or an instance of LabelColumnResource."
        )

    for resource in resources:
        features += resource.features()
        resource_label = resource.label()
        # label == () if it is NOT manually entered
        if label == ("", ""):
            label = resource_label
        # Elif: If label was updated to store resource_label it will not check the following elif
        elif resource_label != ():
            raise ValueError("A training set can only have one label")

    features, feature_lags = self.__get_feature_nv(features, self.__run)
    if label == ():
        raise ValueError("Label must be set")
    if features == []:
        raise ValueError("A training-set must have atleast one feature")
    if isinstance(label, str):
        label = (label, self.__run)
    if not isinstance(label, LabelColumnResource) and label[1] == "":
        label = (label[0], self.__run)

    processed_features = []
    for feature in features:
        if isinstance(feature, tuple) and feature[1] == "":
            feature = (feature[0], self.__run)
        processed_features.append(feature)
    resource = TrainingSetVariant(
        created=None,
        name=name,
        variant=variant,
        description=description,
        owner=owner,
        schedule=schedule,
        label=label,
        features=processed_features,
        feature_lags=feature_lags,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(resource)
    return resource

register_user(name, tags=[], properties={})

Register a user.

Parameters:

Name Type Description Default
name str

User to be registered.

required

Returns:

Name Type Description
UserRegistrar UserRegistrar

User

Source code in src/featureform/register.py
def register_user(
    self, name: str, tags: List[str] = [], properties: dict = {}
) -> UserRegistrar:
    """Register a user.

    Args:
        name (str): User to be registered.

    Returns:
        UserRegistrar: User
    """
    user = User(name=name, tags=tags, properties=properties)
    self.__resources.append(user)
    return UserRegistrar(self, user)

register_weaviate(name, url, api_key, description='', team='', tags=[], properties={})

Register a Weaviate provider.

Examples:

weaviate = ff.register_weaviate(
    name="weaviate-quickstart",
    url="https://<CLUSTER NAME>.weaviate.network",
    api_key="<API KEY>"
    description="A Weaviate project for using embeddings in Featureform"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Weaviate provider to be registered

required
url str

(Immutable) Endpoint of Weaviate cluster, either in the cloud or via another deployment operation

required
api_key str

(Mutable) Weaviate api key

required
description str

(Mutable) Description of Weaviate provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
weaviate OnlineProvider

Provider

Source code in src/featureform/register.py
def register_weaviate(
    self,
    name: str,
    url: str,
    api_key: str,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Weaviate provider.

    **Examples**:
    ```
    weaviate = ff.register_weaviate(
        name="weaviate-quickstart",
        url="https://<CLUSTER NAME>.weaviate.network",
        api_key="<API KEY>"
        description="A Weaviate project for using embeddings in Featureform"
    )
    ```

    Args:
        name (str): (Immutable) Name of Weaviate provider to be registered
        url (str): (Immutable) Endpoint of Weaviate cluster, either in the cloud or via another deployment operation
        api_key (str): (Mutable) Weaviate api key
        description (str): (Mutable) Description of Weaviate provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        weaviate (OnlineProvider): Provider
    """
    config = WeaviateConfig(url=url, api_key=api_key)
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)

set_default_owner(user)

Set default owner.

Parameters:

Name Type Description Default
user str

User to be set as default owner of resources.

required
Source code in src/featureform/register.py
def set_default_owner(self, user: str):
    """Set default owner.

    Args:
        user (str): User to be set as default owner of resources.
    """
    self.__default_owner = user

set_run(run='')

Example 1: Using set_run() without arguments will generate a random run name.

import featureform as ff
ff.set_run()

postgres.register_table(
    name="transactions",
    table="transactions_table",
)

# Applying will register the source as name=transactions, variant=<randomly-generated>

Example 2: Using set_run() with arguments will set the variant to the provided name.

import featureform as ff
ff.set_run("last_30_days")

postgres.register_table(
    name="transactions",
    table="transactions_table",
)

# Applying will register the source as name=transactions, variant=last_30_days

Example 3: Generated and set variant names can be used together

import featureform as ff
ff.set_run()

file = spark.register_file(
    name="transactions",
    path="my/transactions.parquet",
    variant="last_30_days"
)

@spark.df_transformation(inputs=[file]):
def customer_count(transactions):
    return transactions.groupBy("CustomerID").count()


# Applying without a variant for the dataframe transformation will result in
# the transactions source having a variant of last_30_days and the transformation
# having a randomly generated variant

Example 4: This also works within SQL Transformations

import featureform as ff
ff.set_run("last_30_days")

@postgres.sql_transformation():
def my_transformation():
    return "SELECT CustomerID, Amount FROM {{ transactions }}"

# The variant will be autofilled so the SQL query is returned as:
# "SELECT CustomerID, Amount FROM {{ transactions.last_30_days }}"

Parameters:

Name Type Description Default
run str

Name of a run to be set.

''
Source code in src/featureform/register.py
def set_run(self, run: str = ""):
    """

    **Example 1**: Using set_run() without arguments will generate a random run name.
    ``` py
    import featureform as ff
    ff.set_run()

    postgres.register_table(
        name="transactions",
        table="transactions_table",
    )

    # Applying will register the source as name=transactions, variant=<randomly-generated>

    ```

    **Example 2**: Using set_run() with arguments will set the variant to the provided name.
    ``` py
    import featureform as ff
    ff.set_run("last_30_days")

    postgres.register_table(
        name="transactions",
        table="transactions_table",
    )

    # Applying will register the source as name=transactions, variant=last_30_days
    ```

    **Example 3**: Generated and set variant names can be used together
    ``` py
    import featureform as ff
    ff.set_run()

    file = spark.register_file(
        name="transactions",
        path="my/transactions.parquet",
        variant="last_30_days"
    )

    @spark.df_transformation(inputs=[file]):
    def customer_count(transactions):
        return transactions.groupBy("CustomerID").count()


    # Applying without a variant for the dataframe transformation will result in
    # the transactions source having a variant of last_30_days and the transformation
    # having a randomly generated variant
    ```

    **Example 4**: This also works within SQL Transformations
    ``` py
    import featureform as ff
    ff.set_run("last_30_days")

    @postgres.sql_transformation():
    def my_transformation():
        return "SELECT CustomerID, Amount FROM {{ transactions }}"

    # The variant will be autofilled so the SQL query is returned as:
    # "SELECT CustomerID, Amount FROM {{ transactions.last_30_days }}"
    ```

    Args:
        run (str): Name of a run to be set.
    """
    if run == "":
        if feature_flag.is_enabled("FF_GET_EQUIVALENT_VARIANTS", True):
            self.__run = get_current_timestamp_variant(self.__variant_prefix)
        else:
            self.__run = get_random_name()
    else:
        self.__run = run

set_variant_prefix(variant_prefix='')

Set variant prefix.

Parameters:

Name Type Description Default
variant_prefix str

variant prefix to be set.

''
Source code in src/featureform/register.py
def set_variant_prefix(self, variant_prefix: str = ""):
    """Set variant prefix.

    Args:
        variant_prefix (str): variant prefix to be set.
    """
    self.__variant_prefix = variant_prefix
    self.set_run()

sql_transformation(provider, variant='', name='', schedule='', owner='', inputs=None, description='', args=None, tags=[], properties={})

SQL transformation decorator.

Parameters:

Name Type Description Default
variant str

Name of variant

''
provider Union[str, OfflineProvider]

Provider

required
name str

Name of source

''
schedule str

Kubernetes CronJob schedule string (" * * * ")

''
owner Union[str, UserRegistrar]

Owner

''
inputs list

Inputs to transformation

None
description str

Description of SQL transformation

''
args K8sArgs

Additional transformation arguments

None
tags List[str]

Optional grouping mechanism for resources

[]
properties dict

Optional grouping mechanism for resources

{}

Returns:

Name Type Description
decorator SQLTransformationDecorator

decorator

Source code in src/featureform/register.py
def sql_transformation(
    self,
    provider: Union[str, OfflineProvider],
    variant: str = "",
    name: str = "",
    schedule: str = "",
    owner: Union[str, UserRegistrar] = "",
    inputs: Union[List[NameVariant], List[str], List[ColumnSourceRegistrar]] = None,
    description: str = "",
    args: K8sArgs = None,
    tags: List[str] = [],
    properties: dict = {},
):
    """SQL transformation decorator.

    Args:
        variant (str): Name of variant
        provider (Union[str, OfflineProvider]): Provider
        name (str): Name of source
        schedule (str): Kubernetes CronJob schedule string ("* * * * *")
        owner (Union[str, UserRegistrar]): Owner
        inputs (list): Inputs to transformation
        description (str): Description of SQL transformation
        args (K8sArgs): Additional transformation arguments
        tags (List[str]): Optional grouping mechanism for resources
        properties (dict): Optional grouping mechanism for resources

    Returns:
        decorator (SQLTransformationDecorator): decorator
    """
    if not isinstance(owner, str):
        owner = owner.name()
    if owner == "":
        owner = self.must_get_default_owner()
    if variant == "":
        variant = self.__run
    if not isinstance(provider, str):
        provider = provider.name()
    decorator = SQLTransformationDecorator(
        registrar=self,
        name=name,
        run=self.__run,
        variant=variant,
        provider=provider,
        schedule=schedule,
        owner=owner,
        description=description,
        inputs=inputs,
        args=args,
        tags=tags,
        properties=properties,
    )
    return decorator

featureform.register.OfflineSQLProvider

Bases: OfflineProvider

Source code in src/featureform/register.py
class OfflineSQLProvider(OfflineProvider):
    def __init__(self, registrar, provider):
        super().__init__(registrar, provider)
        self.__registrar = registrar
        self.__provider = provider

    def register_table(
        self,
        name: str,
        table: str,
        variant: str = "",
        owner: Union[str, UserRegistrar] = "",
        description: str = "",
        tags: List[str] = [],
        properties: dict = {},
    ):
        """Register a SQL table as a primary data source.

        **Example**

        ```
        postgres = client.get_provider("my_postgres")
        table =  postgres.register_table(
            name="transactions",
            variant="july_2023",
            table="transactions_table",
        ):
        ```

        Args:
            name (str): Name of table to be registered
            variant (str): Name of variant to be registered
            table (str): Name of SQL table
            owner (Union[str, UserRegistrar]): Owner
            description (str): Description of table to be registered

        Returns:
            source (ColumnSourceRegistrar): source
        """
        return self.__registrar.register_primary_data(
            name=name,
            variant=variant,
            location=SQLTable(table),
            owner=owner,
            provider=self.name(),
            description=description,
            tags=tags,
            properties=properties,
        )

    def sql_transformation(
        self,
        owner: Union[str, UserRegistrar] = "",
        variant: str = "",
        name: str = "",
        schedule: str = "",
        description: str = "",
        inputs: list = None,
        tags: List[str] = [],
        properties: dict = {},
    ):
        """
        Register a SQL transformation source.

        The name of the function is the name of the resulting source.

        Sources for the transformation can be specified by adding the Name and Variant in brackets '{{ name.variant }}'.
        The correct source is substituted when the query is run.

        **Examples**:

        ``` py
        postgres = client.get_provider("my_postgres")
        @postgres.sql_transformation(variant="quickstart")
        def average_user_transaction():
            return "SELECT CustomerID as user_id, avg(TransactionAmount) as avg_transaction_amt from {{transactions.v1}} GROUP BY user_id"
        ```

        Args:
            name (str): Name of source
            variant (str): Name of variant
            schedule (str): The frequency at which the transformation is run as a cron expression
            owner (Union[str, UserRegistrar]): Owner
            description (str): Description of primary data to be registered
            inputs (list): A list of Source NameVariant Tuples to input into the transformation


        Returns:
            source (ColumnSourceRegistrar): Source
        """
        return self.__registrar.sql_transformation(
            name=name,
            variant=variant,
            owner=owner,
            schedule=schedule,
            provider=self.name(),
            description=description,
            inputs=inputs,
            tags=tags,
            properties=properties,
        )

register_table(name, table, variant='', owner='', description='', tags=[], properties={})

Register a SQL table as a primary data source.

Example

postgres = client.get_provider("my_postgres")
table =  postgres.register_table(
    name="transactions",
    variant="july_2023",
    table="transactions_table",
):

Parameters:

Name Type Description Default
name str

Name of table to be registered

required
variant str

Name of variant to be registered

''
table str

Name of SQL table

required
owner Union[str, UserRegistrar]

Owner

''
description str

Description of table to be registered

''

Returns:

Name Type Description
source ColumnSourceRegistrar

source

Source code in src/featureform/register.py
def register_table(
    self,
    name: str,
    table: str,
    variant: str = "",
    owner: Union[str, UserRegistrar] = "",
    description: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a SQL table as a primary data source.

    **Example**

    ```
    postgres = client.get_provider("my_postgres")
    table =  postgres.register_table(
        name="transactions",
        variant="july_2023",
        table="transactions_table",
    ):
    ```

    Args:
        name (str): Name of table to be registered
        variant (str): Name of variant to be registered
        table (str): Name of SQL table
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of table to be registered

    Returns:
        source (ColumnSourceRegistrar): source
    """
    return self.__registrar.register_primary_data(
        name=name,
        variant=variant,
        location=SQLTable(table),
        owner=owner,
        provider=self.name(),
        description=description,
        tags=tags,
        properties=properties,
    )

sql_transformation(owner='', variant='', name='', schedule='', description='', inputs=None, tags=[], properties={})

Register a SQL transformation source.

The name of the function is the name of the resulting source.

Sources for the transformation can be specified by adding the Name and Variant in brackets '{{ name.variant }}'. The correct source is substituted when the query is run.

Examples:

postgres = client.get_provider("my_postgres")
@postgres.sql_transformation(variant="quickstart")
def average_user_transaction():
    return "SELECT CustomerID as user_id, avg(TransactionAmount) as avg_transaction_amt from {{transactions.v1}} GROUP BY user_id"

Parameters:

Name Type Description Default
name str

Name of source

''
variant str

Name of variant

''
schedule str

The frequency at which the transformation is run as a cron expression

''
owner Union[str, UserRegistrar]

Owner

''
description str

Description of primary data to be registered

''
inputs list

A list of Source NameVariant Tuples to input into the transformation

None

Returns:

Name Type Description
source ColumnSourceRegistrar

Source

Source code in src/featureform/register.py
def sql_transformation(
    self,
    owner: Union[str, UserRegistrar] = "",
    variant: str = "",
    name: str = "",
    schedule: str = "",
    description: str = "",
    inputs: list = None,
    tags: List[str] = [],
    properties: dict = {},
):
    """
    Register a SQL transformation source.

    The name of the function is the name of the resulting source.

    Sources for the transformation can be specified by adding the Name and Variant in brackets '{{ name.variant }}'.
    The correct source is substituted when the query is run.

    **Examples**:

    ``` py
    postgres = client.get_provider("my_postgres")
    @postgres.sql_transformation(variant="quickstart")
    def average_user_transaction():
        return "SELECT CustomerID as user_id, avg(TransactionAmount) as avg_transaction_amt from {{transactions.v1}} GROUP BY user_id"
    ```

    Args:
        name (str): Name of source
        variant (str): Name of variant
        schedule (str): The frequency at which the transformation is run as a cron expression
        owner (Union[str, UserRegistrar]): Owner
        description (str): Description of primary data to be registered
        inputs (list): A list of Source NameVariant Tuples to input into the transformation


    Returns:
        source (ColumnSourceRegistrar): Source
    """
    return self.__registrar.sql_transformation(
        name=name,
        variant=variant,
        owner=owner,
        schedule=schedule,
        provider=self.name(),
        description=description,
        inputs=inputs,
        tags=tags,
        properties=properties,
    )

featureform.register.ColumnSourceRegistrar

Bases: SourceRegistrar

Source code in src/featureform/register.py
class ColumnSourceRegistrar(SourceRegistrar):
    def __getitem__(self, columns: List[str]):
        col_len = len(columns)
        if col_len < 2:
            raise Exception(
                f"Expected 2 columns, but found {col_len}. Missing entity and/or source columns"
            )
        elif col_len > 3:
            raise Exception(
                f"Found unrecognized columns {', '.join(columns[3:])}. Expected 2 required columns and an optional 3rd timestamp column"
            )
        return (self.registrar(), self, columns)

    def register_resources(
        self,
        entity: Union[str, EntityRegistrar],
        entity_column: str,
        owner: Union[str, UserRegistrar] = "",
        inference_store: Union[str, OnlineProvider, FileStoreProvider] = "",
        features: List[ColumnMapping] = None,
        labels: List[ColumnMapping] = None,
        timestamp_column: str = "",
        description: str = "",
        schedule: str = "",
    ):
        """
        Registers a features and/or labels that can be used in training sets or served.

        **Examples**:
        ``` py
        average_user_transaction.register_resources(
            entity=user,
            entity_column="CustomerID",
            inference_store=local,
            features=[
                {"name": "avg_transactions", "variant": "quickstart", "column": "TransactionAmount", "type": "float32"},
            ],
        )
        ```

        Args:
            entity (Union[str, EntityRegistrar]): The name to reference the entity by when serving features
            entity_column (str): The name of the column in the source to be used as the entity
            owner (Union[str, UserRegistrar]): The owner of the resource(s)
            inference_store (Union[str, OnlineProvider, FileStoreProvider]): Where to store the materialized feature for serving. (Use the local provider in Localmode)
            features (List[ColumnMapping]): A list of column mappings to define the features
            labels (List[ColumnMapping]): A list of column mappings to define the labels
            timestamp_column: (str): The name of an optional timestamp column in the dataset. Will be used to match the features and labels with point-in-time correctness

        Returns:
            registrar (ResourceRegister): Registrar
        """
        return self.registrar().register_column_resources(
            source=self,
            entity=entity,
            entity_column=entity_column,
            owner=owner,
            inference_store=inference_store,
            features=features,
            labels=labels,
            timestamp_column=timestamp_column,
            description=description,
            schedule=schedule,
            client_object=self,
        )

register_resources(entity, entity_column, owner='', inference_store='', features=None, labels=None, timestamp_column='', description='', schedule='')

Registers a features and/or labels that can be used in training sets or served.

Examples:

average_user_transaction.register_resources(
    entity=user,
    entity_column="CustomerID",
    inference_store=local,
    features=[
        {"name": "avg_transactions", "variant": "quickstart", "column": "TransactionAmount", "type": "float32"},
    ],
)

Parameters:

Name Type Description Default
entity Union[str, EntityRegistrar]

The name to reference the entity by when serving features

required
entity_column str

The name of the column in the source to be used as the entity

required
owner Union[str, UserRegistrar]

The owner of the resource(s)

''
inference_store Union[str, OnlineProvider, FileStoreProvider]

Where to store the materialized feature for serving. (Use the local provider in Localmode)

''
features List[ColumnMapping]

A list of column mappings to define the features

None
labels List[ColumnMapping]

A list of column mappings to define the labels

None
timestamp_column str

(str): The name of an optional timestamp column in the dataset. Will be used to match the features and labels with point-in-time correctness

''

Returns:

Name Type Description
registrar ResourceRegister

Registrar

Source code in src/featureform/register.py
def register_resources(
    self,
    entity: Union[str, EntityRegistrar],
    entity_column: str,
    owner: Union[str, UserRegistrar] = "",
    inference_store: Union[str, OnlineProvider, FileStoreProvider] = "",
    features: List[ColumnMapping] = None,
    labels: List[ColumnMapping] = None,
    timestamp_column: str = "",
    description: str = "",
    schedule: str = "",
):
    """
    Registers a features and/or labels that can be used in training sets or served.

    **Examples**:
    ``` py
    average_user_transaction.register_resources(
        entity=user,
        entity_column="CustomerID",
        inference_store=local,
        features=[
            {"name": "avg_transactions", "variant": "quickstart", "column": "TransactionAmount", "type": "float32"},
        ],
    )
    ```

    Args:
        entity (Union[str, EntityRegistrar]): The name to reference the entity by when serving features
        entity_column (str): The name of the column in the source to be used as the entity
        owner (Union[str, UserRegistrar]): The owner of the resource(s)
        inference_store (Union[str, OnlineProvider, FileStoreProvider]): Where to store the materialized feature for serving. (Use the local provider in Localmode)
        features (List[ColumnMapping]): A list of column mappings to define the features
        labels (List[ColumnMapping]): A list of column mappings to define the labels
        timestamp_column: (str): The name of an optional timestamp column in the dataset. Will be used to match the features and labels with point-in-time correctness

    Returns:
        registrar (ResourceRegister): Registrar
    """
    return self.registrar().register_column_resources(
        source=self,
        entity=entity,
        entity_column=entity_column,
        owner=owner,
        inference_store=inference_store,
        features=features,
        labels=labels,
        timestamp_column=timestamp_column,
        description=description,
        schedule=schedule,
        client_object=self,
    )

Qdrant

Register a Qdrant provider.

Examples:

qdrant = ff.register_qdrant(
    name="qdrant-quickstart",
    grpc_host="xyz-example.eu-central.aws.cloud.qdrant.io:6334",
    api_key="<API KEY>",
    use_tls=True,
    description="A Qdrant project for using embeddings in Featureform"
)

Parameters:

Name Type Description Default
name str

(Immutable) Name of Qdrant provider to be registered

required
url str

(Immutable) gRPC host of the Qdrant cluster, either in the cloud or via local deployment.

required
api_key str

(Mutable) Qdrant API key.

''
use_tls bool

(Immutable) Whether to use TLS for the connection.

False
description str

(Mutable) Description of Qdrant provider to be registered

''
team str

(Mutable) Name of team

''
tags List[str]

(Mutable) Optional grouping mechanism for resources

[]
properties dict

(Mutable) Optional grouping mechanism for resources

{}

Returns:

Name Type Description
qdrant OnlineProvider

Provider

Source code in src/featureform/register.py
def register_qdrant(
    self,
    name: str,
    grpc_host: str,
    api_key: str = "",
    use_tls: bool = False,
    description: str = "",
    team: str = "",
    tags: List[str] = [],
    properties: dict = {},
):
    """Register a Qdrant provider.

    **Examples**:
    ```
    qdrant = ff.register_qdrant(
        name="qdrant-quickstart",
        grpc_host="xyz-example.eu-central.aws.cloud.qdrant.io:6334",
        api_key="<API KEY>",
        use_tls=True,
        description="A Qdrant project for using embeddings in Featureform"
    )
    ```

    Args:
        name (str): (Immutable) Name of Qdrant provider to be registered
        url (str): (Immutable) gRPC host of the Qdrant cluster, either in the cloud or via local deployment.
        api_key (str): (Mutable) Qdrant API key.
        use_tls (bool): (Immutable) Whether to use TLS for the connection.
        description (str): (Mutable) Description of Qdrant provider to be registered
        team (str): (Mutable) Name of team
        tags (List[str]): (Mutable) Optional grouping mechanism for resources
        properties (dict): (Mutable) Optional grouping mechanism for resources

    Returns:
        qdrant (OnlineProvider): Provider
    """
    config = QdrantConfig(grpc_host=grpc_host, api_key=api_key, use_tls=use_tls)
    provider = Provider(
        name=name,
        function="ONLINE",
        description=description,
        team=team,
        config=config,
        tags=tags,
        properties=properties,
    )
    self.__resources.append(provider)
    return OnlineProvider(self, provider)