Skip to main content
The outerproduct.connector module provides three connector classes for loading structured data from external sources into OuterProduct. Each connector returns a server-backed Dataset object that you can pass directly to op.reasoning.fit() or a Trainer, with no intermediate download or local processing required. For local files and in-memory frames, build a Dataset with op.LocalDataset.from_*(...).upload() instead.
For all external connectors (S3, Snowflake, and Databricks), your cloud credentials are never passed through the SDK. You store them once in the OuterProduct Console under Connectors, and the SDK references them by the name you assigned. The OuterProduct backend uses those stored credentials at training and inference time.

Local files and in-memory data

Local files and in-memory frames are not connectors. Stage them with op.LocalDataset, which runs the presigned-URL upload and returns a Dataset; no Console setup or credential is required.
import outerproduct as op

dataset = op.LocalDataset.from_csv("customers.csv").upload()

model = op.reasoning.fit(dataset, task=op.Binclass(label_column="churn")).wait()
LocalDataset builds from CSV, Parquet, pandas, polars, or NumPy via from_csv / from_parquet / from_pandas / from_polars / from_numpy; .upload() (or .aupload() for async) returns the Dataset. See the Dataset reference for the full API.

S3Connector

op.S3Connector references data files stored in Amazon S3. You supply the name of a pre-configured S3 credential from the OuterProduct Console, and the backend reads your data at training time using a cross-account IAM role, so no AWS access keys are required in your code.
1

Add an S3 credential in the Console

Log in to console.outerproduct.com, navigate to Connectors, and click New Connector. Select S3, enter your bucket details, and follow the wizard to attach the OuterProduct trust policy to a role in your AWS account.
2

Use the credential name in the SDK

Pass the name you gave the connector to S3Connector(connector_credential_name=...). The backend resolves the stored credentials automatically.
import outerproduct as op

connector = op.S3Connector(connector_credential_name="prod-aws", region="us-east-1")
dataset = connector.table("s3://my-bucket/data/customers.parquet")

model = op.reasoning.fit(dataset, task=op.Binclass(label_column="churn")).wait()

Constructor

op.S3Connector(connector_credential_name=None, region=None)
connector_credential_name
str
The name of the S3 credential stored in the OuterProduct Console. This name maps to the IAM role that OuterProduct uses to access your bucket.
region
str | None
default:"None"
The AWS region where your S3 bucket resides (e.g. "us-east-1"). If omitted, OuterProduct will attempt to infer the region from the bucket.

Methods

.table(uri) -> Dataset

Returns a server-backed Dataset pointing at an S3 object.
uri
str
required
The fully-qualified S3 URI of the file to load (e.g. "s3://my-bucket/data/customers.parquet"). CSV and Parquet formats are supported.
Dataset
Dataset
A server-backed Dataset object referencing the specified S3 path. The data is read by the OuterProduct backend at training time.

SnowflakeConnector

op.SnowflakeConnector references tables stored in Snowflake. You provide your account details and the name of a stored Snowflake credential, and the backend reads the table using a Programmatic Access Token (PAT) that you registered in the Console, so no PAT appears in your SDK code.
1

Add a Snowflake credential in the Console

Log in to console.outerproduct.com, navigate to Connectors, and click New Connector. Select Snowflake and paste your account details and a Programmatic Access Token. To generate a PAT, open Snowsight and go to Governance & Security → Users & roles, select your user, and choose Programmatic access tokens → Generate new token.
2

Use the credential name in the SDK

Pass the connector name to SnowflakeConnector(connector_credential_name=...) along with your account and database details. The backend resolves the stored PAT automatically.
import outerproduct as op

connector = op.SnowflakeConnector(
    account="xy12345",
    database="MYDB",
    schema_name="PUBLIC",
    warehouse="COMPUTE_WH",
    connector_credential_name="prod-snowflake",
)
dataset = connector.table("CUSTOMERS")

model = op.reasoning.fit(dataset, task=op.Binclass(label_column="churn")).wait()

Constructor

op.SnowflakeConnector(account, database, schema_name, warehouse, connector_credential_name=None)
account
str
required
Your Snowflake account identifier (e.g. "xy12345" or "xy12345.us-east-1"). Find this in Snowsight under Admin → Accounts.
database
str
required
The name of the Snowflake database that contains the target table.
schema_name
str
required
The schema within the database where the target table lives (e.g. "PUBLIC").
warehouse
str
required
The Snowflake virtual warehouse to use when reading data (e.g. "COMPUTE_WH").
connector_credential_name
str
The name of the Snowflake credential stored in the OuterProduct Console. The backend uses this credential to authenticate against Snowflake at training time.

Methods

.table(table_name) -> Dataset

Returns a server-backed Dataset pointing at a Snowflake table.
table_name
str
required
The name of the Snowflake table to load from the database and schema specified in the constructor (e.g. "CUSTOMERS").
Dataset
Dataset
A server-backed Dataset object referencing the specified Snowflake table. The data is read by the OuterProduct backend at training time.

DatabricksConnector

op.DatabricksConnector references tables in a Databricks SQL warehouse or cluster. You provide the workspace hostname and SQL warehouse path along with the name of a stored Databricks credential; no personal access token is passed through the SDK.
1

Add a Databricks credential in the Console

Log in to console.outerproduct.com, navigate to Connectors, and click New Connector. Select Databricks and paste your workspace credentials. To create a personal access token, open your Databricks account, go to Settings → Developer → Access tokens, and click Generate new token, choosing Other APIs as the token type.
2

Use the credential name in the SDK

Pass the connector name to DatabricksConnector(connector_credential_name=...) along with your workspace and warehouse details. The backend resolves the stored token automatically.
import outerproduct as op

connector = op.DatabricksConnector(
    server_hostname="adb-123.azuredatabricks.net",
    http_path="/sql/1.0/warehouses/abc",
    schema_name="default",
    catalog="main",
    connector_credential_name="prod-databricks",
)
dataset = connector.table("customers")

model = op.reasoning.fit(dataset, task=op.Binclass(label_column="churn")).wait()

Constructor

op.DatabricksConnector(server_hostname, http_path, schema_name, catalog, connector_credential_name=None)
server_hostname
str
required
The hostname of your Databricks workspace (e.g. "adb-123.azuredatabricks.net"). Find this in the Databricks UI under Settings → Workspace → URL.
http_path
str
required
The HTTP path of the SQL warehouse or cluster to use (e.g. "/sql/1.0/warehouses/abc"). Find this in your warehouse’s Connection details tab.
schema_name
str
required
The schema (database) within the Unity Catalog or Hive metastore where the target table lives (e.g. "default").
catalog
str
required
The Unity Catalog catalog name that contains the target schema and table (e.g. "main").
connector_credential_name
str
The name of the Databricks credential stored in the OuterProduct Console. The backend uses this personal access token to authenticate against Databricks at training time.

Methods

.table(table_name) -> Dataset

Returns a server-backed Dataset pointing at a Databricks table.
table_name
str
required
The name of the table to load from the catalog and schema specified in the constructor (e.g. "customers").
Dataset
Dataset
A server-backed Dataset object referencing the specified Databricks table. The data is read by the OuterProduct backend at training time.