Skip to content

datarobot-oss/datarobot-agent-skills / skills/datarobot-data-preparation

datarobot-data-preparation

Verified

Tools and guidance for data upload, dataset management, data validation, and preparing data for DataRobot projects. Use when uploading datasets, managing data, or validating data for DataRobot.

FileKindSize
SKILL.mdskill md7.3 KB
scripts/upload_dataset.pyexecutablescript2.4 KB

scripts/upload_dataset.py

View on GitHub
#!/usr/bin/env python3
# Copyright (c) 2026 DataRobot, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""
Upload a dataset file to DataRobot.

Usage:
    python upload_dataset.py <file_path> <dataset_name> [use_case_id]

Supports CSV, Parquet, and other formats. Optionally links the dataset to
an existing Use Case so it isn't orphaned in the DataRobot UI.

Note: the upload is a blocking call that returns only after server-side
ingestion completes (default max_wait=600 seconds) — run it with an adequate
timeout or in the background; for large files call upload_dataset() with a
larger max_wait (the CLI uses the 600s default).
"""

import json
import os
import sys

import datarobot as dr


def upload_dataset(
    file_path: str,
    dataset_name: str,
    use_case_id: str | None = None,
    max_wait: int = 600,
) -> dict:
    """
    Upload a dataset file to DataRobot.

    Args:
        file_path: Path to the dataset file (CSV, Parquet, etc.)
        dataset_name: Name for the dataset
        use_case_id: Optional existing Use Case ID to link the dataset to
        max_wait: Seconds to wait for server-side ingestion (raise for large files)

    Returns:
        Dataset information including dataset_id
    """
    # Initialize client
    dr.Client()

    if not os.path.exists(file_path):
        raise FileNotFoundError(f"File not found: {file_path}")

    use_cases = [dr.UseCase.get(use_case_id)] if use_case_id else None

    # Upload dataset (create_from_file has no name parameter; rename after)
    dataset = dr.Dataset.create_from_file(
        file_path=file_path, use_cases=use_cases, max_wait=max_wait
    )
    if dataset_name:
        dataset.modify(name=dataset_name)

    return {
        "dataset_id": dataset.id,
        "dataset_name": dataset.name,
        "row_count": dataset.row_count,
        "column_count": len(dataset.get_all_features()),
        "file_path": file_path,
        "use_case_id": use_case_id,
    }


if __name__ == "__main__":
    if len(sys.argv) < 3:
        print(
            "Usage: python upload_dataset.py <file_path> <dataset_name> [use_case_id]",
            file=sys.stderr,
        )
        sys.exit(1)

    file_path = sys.argv[1]
    dataset_name = sys.argv[2]
    use_case_id = sys.argv[3] if len(sys.argv) > 3 else None

    result = upload_dataset(file_path, dataset_name, use_case_id)
    print(json.dumps(result, indent=2))
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall