ayushjoshi2012's picture
Update README.md
7d1d803 verified
|
Raw History Blame Contribute Delete
10.1 kB
---
license: cc-by-nc-4.0
task_categories:
- text-generation
- question-answering
language:
- en
tags:
- code-generation
- codemods
- api-migration
- breaking-changes
- refactoring
- ast-transformations
- agents
pretty_name: "Enterprise API Breaking Changes & SDK Migration Diffs"
size_categories:
- n>1K
configs:
- config_name: default
data_files: "data/train.parquet"
---
# Enterprise API Breaking Changes & SDK Migration Diffs (Community Edition)
<p align="center">
<img src="./dataset_product_cover_1024.png" alt="Dataset Banner" width="700">
</p>
A curated dataset of breaking changes, compiler/runtime diagnostics, unified codemod patch diffs, and verification suites covering **Python, TypeScript/JavaScript, and Go**. Specifically engineered for training automated code repair models, AST codemod engines, DevSecOps agents, and software migration copilots.
Each record represents an end-to-end migration lifecycle:
$$\text{Deprecated Code} \longrightarrow \text{Compiler/Runtime Error} \longrightarrow \text{Architectural Reasoning} \longrightarrow \text{Unified Codemod Diff} \longrightarrow \text{Verification Test}$$
---
## Dataset Splits & Commercial Licensing
| Split | Records | Format | Primary Use Case | License |
| :--- | :--- | :--- | :--- | :--- |
| **Community Evaluation** (This Repo) | 250 | Parquet | Benchmarking, zero-shot evaluation, academic research | **CC BY-NC 4.0** |
| **Enterprise Commercial Corpus** | 2,500 | Parquet + JSONL | Full fine-tuning (SFT/LoRA/DPO), proprietary copilot integration | **Commercial Enterprise License** |
### Complete Enterprise Package (2,500 Records)
For commercial model fine-tuning, automated pull-request bot deployment, or integrating AST refactoring tools without non-commercial restrictions:
👉 **[Purchase Enterprise Commercial License via Dodo Payments](https://checkout.dodopayments.com/buy/pdt_0Nr7oeLBUeikL9WKxpLvI)**
* **Instant Automated Delivery:** Immediate access to `enterprise_api_migrations_v1.parquet` and `.jsonl`.
* **Perpetual Commercial Grant:** Complete indemnity for model training, weights redistribution, and commercial SaaS deployment.
---
## Dataset Schema
Each entry contains 9 structured fields:
```json
{
"migration_id": "MIG-2026-SQLALCHEMY-9112",
"ecosystem": "Python",
"package_name": "sqlalchemy",
"breaking_version_transition": "1.4.x -> 2.0.x",
"deprecated_code_snippet": "from sqlalchemy import Column, Integer, String\n\nclass User(Base):\n __tablename__ = 'users'\n id = Column(Integer, primary_key=True)\n name = Column(String)",
"runtime_error_or_warning": "DeprecationWarning: The Column class is deprecated and will be removed in a future version. Use mapped_column instead.",
"migration_reasoning": "The upstream API broke due to the deprecation of the Column class in favor of mapped_column. To migrate, replace all instances of Column with mapped_column and update type annotations to use Mapped.",
"codemod_patch_diff": "--- a/sqlalchemy_model.py\n+++ b/sqlalchemy_model.py\n@@ -1,7 +1,7 @@\n from sqlalchemy import mapped_column, Mapped, Integer, String\n-class User(Base):\n- __tablename__ = 'users'\n- id = Column(Integer, primary_key=True)\n- name = Column(String)\n+class User(Base):\n+ __tablename__ = 'users'\n+ id: Mapped[int] = mapped_column(Integer, primary_key=True)\n+ name: Mapped[str] = mapped_column(String)",
"verification_test": "import pytest\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\nfrom sqlalchemy_model import Base, User\n\ndef test_migrated_model():\n engine = create_engine('sqlite:///:memory:')\n Base.metadata.create_all(engine)\n Session = sessionmaker(bind=engine)\n session = Session()\n user = User(name='John Doe')\n session.add(user)\n session.commit()\n assert session.query(User).first().name == 'John Doe'"
}
```
### Field Definitions
| Field | Type | Description |
| :--- | :--- | :--- |
| `migration_id` | `string` | Unique tracking identifier for the migration trace (e.g., `MIG-2026-NEXT-4174`). |
| `ecosystem` | `string` | Primary runtime ecosystem and programming language (`Python`, `TypeScript`, `Go`). |
| `package_name` | `string` | Specific upstream library, framework, or runtime undergoing migration (e.g., `next`, `react`, `sqlalchemy`, `pydantic`, `gin`, `vite`, `aws-sdk-go-v2`). |
| `breaking_version_transition` | `string` | Version boundary introducing breaking changes (e.g., `13.x (Pages) -> 14.x/15.x (App Router)`, `18.x -> 19.x`, `1.4.x -> 2.0.x`). |
| `deprecated_code_snippet` | `string` | Complete, executable source code snippet relying on legacy APIs, obsolete decorators, or deprecated patterns. |
| `runtime_error_or_warning` | `string` | The exact compiler error, TypeScript diagnostic, or runtime deprecation warning emitted under the modern version. |
| `migration_reasoning` | `string` | Structural root-cause analysis detailing why the upstream API broke and outlining the AST refactoring strategy. |
| `codemod_patch_diff` | `string` | Minimal, unified git patch diff (`--- a/`, `+++ b/`, `@@ ... @@`) transforming deprecated patterns into modern idioms. |
| `verification_test` | `string` | Executable unit test verifying that the migrated code runs cleanly on the modern runtime environment. |
---
### Core Migration Taxonomies Covered
* **Next.js (`13.x Pages` -> `14.x/15.x App Router`)**
* Replacing `pages/api` routes with standard `export async function POST(req: Request)` route handlers.
* Migrating `getStaticPaths` to `generateStaticParams`.
* Replacing `getServerSideProps` and `getStaticProps` with React async Server Components and direct `fetch()`.
* Replacing `next/head` with the unified `export const metadata` API.
* Adding the mandatory `'use client'` directive to components consuming interactive hooks (`useState`, `useEffect`).
* **React (`18.x` -> `19.x`)**
* Simplifying Context usage from `<Context.Provider value={x}>` to direct `<Context value={x}>`.
* Deprecating `React.forwardRef` in favor of standard component `ref` props.
* Replacing `useFormState` (from `react-dom`) and `useOptimistic` with the unified `useActionState` hook.
* Eliminating legacy component lifecycle methods (`UNSAFE_componentWillMount`) and string refs in favor of `constructor` / `componentDidMount` and `createRef`.
* **Python Pydantic (`1.10.x` -> `2.x`)**
* Migrating legacy `@root_validator` and `@validator` decorators to `@model_validator(mode='before'|'after')` and `@field_validator`.
* Refactoring inner `class Config` configurations to `model_config = ConfigDict(...)`.
* Replacing deprecated serialization methods `.dict()` and `.json()` with `.model_dump()` and `.model_dump_json()`.
* Moving from `GenericModel` to direct `BaseModel` generic parameterization.
* **SQLAlchemy (`1.4.x` -> `2.0.x`)**
* Replacing legacy `Column()` definitions with typed `Mapped[T]` and `mapped_column()` declarative mappings.
* Replacing the legacy ORM query interface (`session.query(Model).filter(...)`) with 2.0 executable queries (`session.scalars(select(Model).where(...))`).
* Removing `sessionmaker(autocommit=True)` to enforce explicit transaction management with `session.commit()`.
* Enforcing explicit `text('SELECT ...')` constructs instead of passing raw string queries to `.execute()`.
* Migrating model base classes from `declarative_base()` factory calls to subclassing `DeclarativeBase` directly.
* **Go Standard Library & Generics (`Go 1.17` -> `Go 1.18+`)**
* Replacing custom interface type switches and `interface{}` sorting with `constraints.Ordered` type parameters.
* Replacing reflection-based map key loops with the generic `maps.Keys(m)` function.
* Using the `golang.org/x/exp/slices` / `slices` package for generic containment and sorting operations.
* Migrating generic storage containers from `interface{}` casting to parametric types (`Container[T any]`).
* **Go Gin Engine (`v1.8.x` -> `v1.9.x+`)**
* Requiring `ctx := c.Copy()` before spawning background goroutines to prevent memory corruption from recycled context pools.
* Enforcing explicit `c.Next()` continuation or `c.AbortWithStatus(...)` termination in middleware.
* Requiring `engine.SetTrustedProxies(...)` to mitigate IP spoofing when calling `c.ClientIP()`.
* Updating struct tags to comply with strict `binding.Validator` v10 structural JSON validation rules.
* **TypeScript Tooling & Bundlers (`Vite 4` -> `5`, `Rollup 4`, `Axios 0.27` -> `1.x`)**
* Updating Rollup 4 plugin hooks (`resolveId`, `transform`) from synchronous return values to async promises returning `{ id }` or `{ code, map }` objects.
* Removing the leading tilde prefix (`~`) in Sass/Less `@import` paths in favor of direct module imports or configured path aliases.
* Changing `worker.format` defaults from `'iife'` to `'es'`.
* Updating Axios imports from default imports to named/ESM-compatible exports (`import { Axios } from 'axios'`).
* Migrating Axios proxy configurations from `{ host, port, auth }` objects to full URL strings.
* **AWS SDK for Go (`v1.x` -> `v2.x`)**
* Enforcing mandatory `context.Context` parameters as the first argument in all client SDK calls (`svc.ListBuckets(ctx, ...)` instead of `svc.ListBuckets(nil)`).
* Moving primitive pointer helpers (`aws.String`, `aws.Int64`) to the `aws-sdk-go-v2/aws` module path.
* Migrating client instantiation to `config.LoadDefaultConfig(ctx)` and `s3.NewFromConfig(cfg)`.
---
## Quickstart
```python
from datasets import load_dataset
#Load Community Evaluation Split
dataset = load_dataset("ayushjoshi2012/enterprise-api-migrations-codemod-diffs", split="train")
sample = dataset[0]
print(f"Migration: {sample['migration_id']} | {sample['package_name']} ({sample['breaking_version_transition']})")
print(f"\n--- Deprecated Code ---\n{sample['deprecated_code_snippet']}")
print(f"\n--- Runtime Warning / Error ---\n{sample['runtime_error_or_warning']}")
print(f"\n--- Unified Codemod Diff ---\n{sample['codemod_patch_diff']}")
```