migration_id large_stringlengths 17 31 | ecosystem large_stringclasses 3
values | package_name large_stringclasses 13
values | breaking_version_transition large_stringclasses 12
values | deprecated_code_snippet large_stringlengths 54 573 | runtime_error_or_warning large_stringlengths 50 864 | migration_reasoning large_stringlengths 277 778 | codemod_patch_diff large_stringlengths 132 949 | verification_test large_stringlengths 199 1.56k |
|---|---|---|---|---|---|---|---|---|
MIG-2026-PRISMA-9335 | TypeScript | prisma | 4.x -> 5.x | import { PrismaClient } from '@prisma/client'; const prisma = new PrismaClient({ binaryTarget: 'default' }); | Error: The `binaryTarget` option is no longer supported. Please use the `library` or `wasm` target instead. | The Prisma 5.x release removes the default binary engine type in favor of library and wasm targets. This change requires updating the PrismaClient initialization to explicitly specify the target. The `binaryTarget` option is deprecated and replaced with `target` option which accepts either 'library' or 'wasm' as valid ... | --- a/index.ts
+++ b/index.ts
@@ -1,7 +1,7 @@
import { PrismaClient } from '@prisma/client';
-const prisma = new PrismaClient({ binaryTarget: 'default' });
+const prisma = new PrismaClient({ target: 'library' });
// Example usage
prisma.user.findMany().then(users => console.log(users)) | import { test, expect } from '@jest/globals';
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient({ target: 'library' });
test('Prisma client initialization', async () => {
await prisma.user.findMany();
expect(prisma._dmmf).toBeDefined();
}); |
MIG-2026-POLARS-4574 | Python | polars | 0.19.x -> 1.x | import polars as pl
df = pl.DataFrame({'foo': [1, 2, 3], 'bar': [4, 5, 6]})
pivoted_df = df.pivot('foo', 'bar', 'baz') | TypeError: pivot() missing 1 required positional argument: 'values'
File "<stdin>", line 3, in <module>
pivoted_df = df.pivot('foo', 'bar', 'baz') | The pivot API in polars 0.19.x used positional arguments for index, columns, and values. However, in polars 1.x, the pivot API has been refactored to use strict kwargs for index, columns, and values. This change was made to improve the readability and consistency of the API. To migrate, users need to update their code ... | --- a/old_code.py
+++ b/new_code.py
@@ -2,7 +2,7 @@
import polars as pl
df = pl.DataFrame({'foo': [1, 2, 3], 'bar': [4, 5, 6]})
-pivoted_df = df.pivot('foo', 'bar', 'baz')
+pivoted_df = df.pivot(index='foo', columns='bar', values='baz') | import pytest
import polars as pl
def test_pivot_migration():
df = pl.DataFrame({'foo': [1, 2, 3], 'bar': [4, 5, 6], 'baz': [7, 8, 9]})
pivoted_df = df.pivot(index='foo', columns='bar', values='baz')
assert pivoted_df.shape == (3, 3)
test_pivot_migration() |
MIG-2026-REACT-1867 | TypeScript | react | 18.x -> 19.x | import { forwardRef } from 'react';
const MyButton = forwardRef((props, ref) => {
return <button ref={ref} {...props} />;
}); | Warning: `forwardRef` is deprecated. Use `ref` as a prop instead.
at MyButton (./MyButton.tsx:3:24)
at App (./App.tsx:10:20) | The `forwardRef` function has been deprecated in React 19.x in favor of passing the `ref` directly as a standard component prop. This change allows for more flexibility and better support for advanced use cases. The migration involves replacing all occurrences of `forwardRef` with the new `ref` prop syntax. | --- a/MyButton.tsx
+++ b/MyButton.tsx
@@ -1,6 +1,6 @@
import { useRef } from 'react';
-
-const MyButton = forwardRef((props, ref) => {
- return <button ref={ref} {...props} />;
-});
+const MyButton = ({ ref,...props }) => {
+ return <button ref={ref} {...props} />;
+}; | import { render } from '@testing-library/react';
import { MyButton } from './MyButton';
test('MyButton renders correctly', () => {
const { getByRole } = render(<MyButton>Click me!</MyButton>);
expect(getByRole('button')).toBeInTheDocument();
}); |
MIG-2026-PRISMA-4678 | TypeScript | prisma | 4.x -> 5.x | const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient();
prisma.$use(async (params, next) => {
// Middleware implementation
return next(params);
}); | Error: The `$use` method has been deprecated in favor of `$extends`. Please update your middleware to use the new API. | The upstream API broke due to a significant overhaul of the Prisma extension system. The `$use` method, which was used to register middleware, has been deprecated in favor of `$extends`, which provides a more flexible and powerful way to extend the Prisma client. The new API allows for more fine-grained control over th... | --- a/index.ts
+++ b/index.ts
@@ -1,7 +1,7 @@
const { PrismaClient } = require('@prisma/client');
-
-const prisma = new PrismaClient();
-prisma.$use(async (params, next) => {
- // Middleware implementation
- return next(params);
-});
+class MyPrismaClient extends PrismaClient {
+ async $extends() {
+ // Middlewa... | import { test, expect } from '@jest/globals';
import { PrismaClient } from '@prisma/client';
class MyPrismaClient extends PrismaClient {
async $extends() {
// Middleware implementation
}
}
test('Patched code runs cleanly on modern runtime', async () => {
const prisma = new MyPrismaClient();
await prisma.$... |
MIG-2026-VITE-3995 | TypeScript | vite | 4.x -> 5.x | import { createServer } from 'vite';
const server = createServer({
root: './',
server: {
port: 3000,
open: true,
},
build: {
outDir: 'dist',
minify: 'esbuild',
},
});
server.listen(); | warning: '--esm' and '--no-esm' flags are deprecated and have no effect in Vite 5.x. Please remove them from your scripts.
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './node_modules/vite/dist/node/chunks/dep-3a877708.js' is not defined by 'exports' in /home/user/project/node_modules/vite/package.json | The breaking change from Vite 4.x to 5.x is due to the deprecation of CommonJS (CJS) Node API build in favor of ES Module (ESM) only. The `createServer` method's signature has changed to support ESM, and the `build.outDir` option now defaults to 'dist' if not provided. The `--esm` and `--no-esm` flags are also deprecat... | --- a/index.ts
+++ b/index.ts
@@ -1,10 +1,10 @@
import { createServer } from 'vite';
-
-const server = createServer({
- root: './',
- server: {
- port: 3000,
- open: true,
- },
- build: {
- outDir: 'dist',
- minify: 'esbuild',
- },
-});
+const server = createServer({
+ root: './',
+ server: {
+ p... | import { describe, expect, it } from 'vitest';
describe('Vite server', () => {
it('should create server with ESM syntax', async () => {
const server = await import('vite').then((vite) => vite.createServer({
root: './',
server: {
port: 3000,
open: true,
},
build: {
m... |
MIG-2026-SQLALCHEMY-3324 | Python | sqlalchemy | 1.4.x -> 2.0.x | from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
email = Column(... | DeprecationWarning: The 'query' method is deprecated and will be removed in a future version. Use 'select' instead. | The upstream API broke due to the removal of the legacy Query API in sqlalchemy 2.0.x. The 'query' method has been replaced by the 'select' method. This change requires a systematic refactoring strategy to update all occurrences of the deprecated 'query' method to use the new 'select' method. The 'select' method return... | --- a/example.py
+++ b/example.py
@@ -15,7 +15,7 @@
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
-from sqlalchemy import select
+
Base = declarative_base()
@@ -23,7 +23,7 @@
class User(Base):
__... | import pytest
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import select
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
... |
MIG-2026-LANGCHAIN-1409 | Python | langchain | 0.1.x -> 0.2.x/0.3.x | from langchain.document_loaders import PyPDFLoader
loader = PyPDFLoader()
print(loader.load_document('example.pdf')) | ImportError: cannot import name 'PyPDFLoader' from 'langchain.document_loaders' | The upstream API broke due to the modularization of the document loader. PyPDFLoader was moved from langchain.document_loaders to langchain_community to improve maintainability and scalability. The migration requires updating the import statement to reflect the new location of PyPDFLoader. | --- a/example.py
+++ b/example.py
@@ -1,3 +1,3 @@
-from langchain.document_loaders import PyPDFLoader
+from langchain_community.document_loaders import PyPDFLoader
loader = PyPDFLoader()
print(loader.load_document('example.pdf')) | import pytest
from langchain_community.document_loaders import PyPDFLoader
def test_load_document():
loader = PyPDFLoader()
document = loader.load_document('example.pdf')
assert document is not None
test_load_document() |
MIG-2026-LANGCHAIN-3455 | Python | langchain | 0.1.x -> 0.2.x/0.3.x | from langchain.callbacks import BaseCallbackHandler
class MyCallbackHandler(BaseCallbackHandler):
def __init__(self, model, **kwargs):
super().__init__(model, **kwargs)
def on_start(self):
print('Starting callback')
def on_end(self):
print('Ending callback') | DeprecationWarning: BaseCallbackHandler has been moved to langchain_core.callbacks. Please update your imports.
TypeError: __init__() missing 1 required positional argument: 'callback_manager' | The upstream API broke due to the refactoring of the callback handler system. The BaseCallbackHandler class has been moved from langchain.callbacks to langchain_core.callbacks, and its signature has been modified to require a callback_manager argument. This change allows for more flexibility and customization of the ca... | --- a/my_callback_handler.py
+++ b/my_callback_handler.py
@@ -1,7 +1,7 @@
-from langchain.callbacks import BaseCallbackHandler
+from langchain_core.callbacks import BaseCallbackHandler
class MyCallbackHandler(BaseCallbackHandler):
- def __init__(self, model, **kwargs):
+ def __init__(self, callback_manager, mo... | import pytest
from my_callback_handler import MyCallbackHandler
from langchain_core.callbacks import CallbackManager
def test_my_callback_handler():
callback_manager = CallbackManager()
my_callback_handler = MyCallbackHandler(callback_manager, 'model')
my_callback_handler.on_start()
my_callback_handler... |
MIG-2026-POLARS-5478 | Python | polars | 0.19.x -> 1.x | import polars as pl
df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
print(df.rolling_mean(window_size=2))
print(df.rolling_std(window_size=2)) | DeprecationWarning: `rolling_mean` and `rolling_std` are deprecated and will be removed in a future version. Use `df.rolling(window_size=2).mean()` and `df.rolling(window_size=2).std()` instead. | The upstream API break occurred due to the deprecation of the `rolling_mean` and `rolling_std` methods in favor of a more consistent and flexible `df.rolling()` context. This change allows for more complex rolling window operations and improved performance. The refactoring strategy involves replacing the deprecated met... | --- a/deprecated_code.py
+++ b/migrated_code.py
@@ -1,6 +1,6 @@
import polars as pl
-df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
-print(df.rolling_mean(window_size=2))
-print(df.rolling_std(window_size=2))
+df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
+print(df.rolling(2).mean())
+print(df.rolling(2).... | import pytest
import polars as pl
def test_rolling_mean_std():
df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
result_mean = df.rolling(2).mean()
result_std = df.rolling(2).std()
assert result_mean['A'].to_list() == [None, 1.5, 2.5]
assert result_std['A'].to_list() == [None, 0.5, 0.5]
asser... |
MIG-2026-VITE-4805 | TypeScript | vite | 4.x -> 5.x | import { createServer } from 'vite'; const server = createServer({ root: 'src', server: { port: 3000 } }); server.listen(); | warning: 'createServer' is deprecated. Use 'createViteServer' instead.
error TS2794: Expected 1-2 arguments, but got 3. | The upstream API broke due to the deprecation of the Node.js 14/16 runtime engine and the CJS Node API build in favor of ESM only. The createServer function signature changed to createViteServer, which now requires an options object with a 'root' property. The server option is now a separate property within the options... | --- a/src/index.ts
+++ b/src/index.ts
@@ -1,5 +1,5 @@
-import { createServer } from 'vite';
+import { createViteServer } from 'vite';
const options = { root: 'src', server: { port: 3000 } };
-const server = createServer(options);
+const server = createViteServer(options);
server.listen(); | import { describe, expect, it } from 'vitest';
import { createViteServer } from 'vite';
describe('vite server', () => {
it('should create a server', async () => {
const options = { root: 'src', server: { port: 3000 } };
const server = createViteServer(options);
await server.listen();
expect(server.htt... |
MIG-2026-AWSSDKGOV2-5492 | Go | aws-sdk-go-v2 | v1.x -> v2.x | func main() {
svc := s3.New(aws.NewConfig())
params := &s3.ListBucketsInput{}
result, err := svc.ListBuckets(params)
if err!= nil {
panic(err)
}
fmt.Println(result)
} | cannot use svc.ListBuckets(params) (type *s3.ListBucketsOutput, error) as type (*s3.ListBucketsOutput, error) in assignment: wrong argument type for ListBuckets method
got context.Context, *s3.ListBucketsInput
want *s3.ListBucketsInput | The AWS SDK for Go v2.x introduces a mandatory context parameter as the first argument for all SDK API operations. This change is intended to improve the handling of concurrent requests and cancellations. To migrate, we need to modify the function calls to include a context.Context object as the first argument. This re... | --- a/main.go
+++ b/main.go
@@ -1,9 +1,10 @@
func main() {
- svc := s3.New(aws.NewConfig())
+ ctx := context.Background()
+ svc := s3.New(aws.NewConfig())
params := &s3.ListBucketsInput{}
- result, err := svc.ListBuckets(params)
+ result, err := svc.ListBuckets(ctx, params)
if err!= nil {
... | package main
import (
"context"
"testing"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
func TestListBuckets(t *testing.T) {
ctx := context.Background()
svc := s3.New(aws.NewConfig())
params := &s3.ListBucketsInput{}
result, err := svc.ListBuckets(ctx, params)
if err!= nil {
t.Fa... |
MIG-2026-REACT-8426 | TypeScript | react | 18.x -> 19.x | import React from 'react';
const FancyButton = React.forwardRef((props, ref) => (
<button ref={ref} className="FancyButton">
{props.children}
</button>
)); | Warning: `forwardRef` is deprecated. Use `ref` as a prop instead. | The `forwardRef` function has been deprecated in React 19.x. Instead of using `forwardRef`, we should pass the `ref` directly as a standard component prop. This change allows for better support of future React features and improved performance. To migrate, we need to replace all occurrences of `forwardRef` with the new... | --- a/FancyButton.tsx
+++ b/FancyButton.tsx
@@ -1,7 +1,7 @@
import React from 'react';
-
-const FancyButton = React.forwardRef((props, ref) => (
+const FancyButton = ({ children, ...props }, ref) => (
<button ref={ref} className="FancyButton">
{children}
</button>
-));
+), [ref]); | import React from 'react';
import { render, fireEvent, waitFor } from '@testing-library/react';
test('FancyButton renders correctly', async () => {
const { getByText } = render(<FancyButton>Click me</FancyButton>);
const button = getByText('Click me');
expect(button).toBeInTheDocument();
});
test('FancyButton han... |
MIG-2026-LANGCHAIN-2317 | Python | langchain | 0.1.x -> 0.2.x/0.3.x | from langchain.document_loaders import PyPDFLoader
document_loader = PyPDFLoader()
print(document_loader.load_pdf("example.pdf")) | ImportError: cannot import name 'PyPDFLoader' from 'langchain.document_loaders' | The breaking change occurred due to the modularization of document loaders. In langchain 0.1.x, PyPDFLoader was part of the langchain.document_loaders module. However, in langchain 0.2.x and 0.3.x, it has been moved to the langchain_community package. This change requires updating the import statement to use the new lo... | --- a/example.py
+++ b/example.py
@@ -1,4 +1,4 @@
-from langchain.document_loaders import PyPDFLoader
+from langchain_community import PyPDFLoader
document_loader = PyPDFLoader()
print(document_loader.load_pdf("example.pdf")) | import pytest
from langchain_community import PyPDFLoader
def test_py_pdf_loader():
document_loader = PyPDFLoader()
assert document_loader.load_pdf("example.pdf") is not None
test_py_pdf_loader() |
MIG-2026-POLARS-8578 | Python | polars | 0.19.x -> 1.x | import polars as pl
df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
df.write_json('output.json', json_lines=True) | DeprecationWarning: The 'json_lines' parameter is deprecated and will be removed in a future version. Use 'row_oriented' instead.
df.write_json('output.json', json_lines=True)
FutureWarning: The 'write_json' method will change its default behavior in a future version. Use 'row_oriented' to maintain the current behavi... | The upstream API broke due to a change in the default behavior of the 'write_json' method. In version 0.19.x, the 'json_lines' parameter controlled the output format. However, in version 1.x, the 'row_oriented' parameter is used instead. The 'json_lines' parameter is deprecated and will be removed in a future version. ... | --- a/example.py
+++ b/example.py
@@ -1,5 +1,5 @@
import polars as pl
-
df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
-df.write_json('output.json', json_lines=True)
+df.write_json('output.json', row_oriented=True) | import pytest
import polars as pl
def test_write_json():
df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
df.write_json('output.json', row_oriented=True)
assert True
test_write_json() |
MIG-2026-GIN-1567 | Go | gin | v1.8.x -> v1.9.x+ | func main() {
gin.SetMode(gin.ReleaseMode)
r := gin.New()
r.GET("/", func(c *gin.Context) {
go func() {
// Accessing c without copying
c.JSON(200, gin.H{ "message": "Hello World" })
}()
})
r.Run()
} | panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x10b9e3b]
goroutine 5 [running]:
github.com/gin-gonic/gin.(*Context).JSON(0x0, 0xc00013e010, 0xc000100030)
github.com/gin-gonic/gin/context.go:373 +0x6b | The breaking change introduced in gin v1.9.x+ involves the recycling of memory for the Context object. In v1.8.x, the Context object was not recycled, and its memory was valid throughout the request-response cycle. However, in v1.9.x+, the Context object is recycled after each request, and its memory becomes invalid. T... | --- a/main.go
+++ b/main.go
@@ -5,7 +5,7 @@
func main() {
gin.SetMode(gin.ReleaseMode)
r := gin.New()
- r.GET("/", func(c *gin.Context) {
+ r.GET("/", func(c *gin.Context) {
ctx := c.Copy()
go func() {
// Accessing ctx, which is a copy of c
ctx.JSON(200, gin.H{ "message": "Hello World" })
}()
})
r.Run(... | package main
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
)
func TestContextCopy(t *testing.T) {
r := gin.New()
r.GET("/", func(c *gin.Context) {
ctx := c.Copy()
go func() {
ctx.JSON(200, gin.H{ "message": "Hello World" })
}()
})
w := httptest.NewRecorder()
r.ServeH... |
MIG-2026-GOSTANDARDLIBRARY-9586 | Go | go-standard-library | Go 1.17 -> Go 1.18+ (Generics) | func contains(s []string, e string) bool {
for _, a := range s {
if a == e {
return true
}
}
return false
}
func main() {
s := []string{"a", "b", "c"}
if contains(s, "b") {
fmt.Println("Found")
}
} | warning: `golang.org/x/exp/slices` is deprecated: Use `sort.Slice` or `sort.Search` instead
# command-line-arguments
./main.go:4:6: undefined: slices.Contains | The Go 1.18 release introduced Generics, which allowed for more expressive and efficient data structures. However, this change led to the deprecation of certain functions in the `golang.org/x/exp/slices` package. To migrate, we need to replace these deprecated functions with their equivalents in the standard library. I... | --- a/main.go
+++ b/main.go
@@ -1,13 +1,11 @@
func contains(s []string, e string) bool {
- for _, a := range s {
- if a == e {
- return true
- }
- }
- return false
+ i := sort.SearchStrings(s, e)
+ return i!= len(s) && s[i] == e
}
func main() {
s := []string{"a", "b", "c"}
if contains(s, "b") {
fmt.Println... | package main
import (
"fmt"
"sort"
"testing"
)
func contains(s []string, e string) bool {
i := sort.SearchStrings(s, e)
return i!= len(s) && s[i] == e
}
func TestContains(t *testing.T) {
s := []string{"a", "b", "c"}
if!contains(s, "b") {
t.Errorf("Expected to find 'b'")
}
if contains(s, "d") {
t.Errorf(... |
MIG-2026-NEXT-1684 | TypeScript | next | 13.x (Pages) -> 14.x/15.x (App Router) | import Head from 'next/head';
function HomePage() {
return (
<>
<Head>
<title>Home Page</title>
</Head>
<h1>Welcome to my website</h1>
</>
);
} | Warning: `next/head` is deprecated. Please use the Metadata API instead.
Error: Cannot find module 'next/head' or its corresponding type declarations | The `next/head` component has been deprecated in favor of the Metadata API, which provides a more flexible and efficient way to manage metadata in Next.js applications. The new API allows for static and dynamic metadata, making it easier to optimize and customize the metadata for each page. To migrate, we need to repla... | --- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -1,7 +1,7 @@
import type { AppProps } from 'next/app';
-import Head from 'next/head';
+import { metadata } from 'next';
function MyApp({ Component, pageProps }: AppProps) {
- return (
- <>
- <Head>
- <title>My App</title>
- </Head>
- <Component ... | import { render } from '@testing-library/react';
import { MyApp } from '../pages/_app';
import { metadata } from 'next';
describe('MyApp', () => {
it('renders correctly', () => {
const { getByText } = render(<MyApp Component={() => <div>Hello World</div>} pageProps={{}} />);
expect(getByText('Hello World')).... |
MIG-2026-VITE-5456 | TypeScript | vite | 4.x -> 5.x | import { rollup } from 'rollup';
const bundle = await rollup({
input: 'src/main.js',
plugins: [
{
name: 'example',
resolveId(id) {
if (id === 'virtual-module') return id;
return null;
},
transform(code, id) {
if (id === 'virtual-module') return { code: 'export def... | Error: The 'resolveId' hook should return a promise that resolves to an ID, or null if it can't be resolved. The 'transform' hook should return a promise that resolves to an object with a 'code' property, or null if no transformation is needed. | The Rollup 4 migration introduces changes to the 'resolveId' and 'transform' hooks. In Rollup 3, these hooks were synchronous, but in Rollup 4, they are asynchronous and return promises. To migrate, we need to update the 'resolveId' and 'transform' hooks to return promises. We can use the 'async/await' syntax to make t... | --- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,13 +1,15 @@
import { rollup } from 'rollup';
-
const bundle = await rollup({
input: 'src/main.js',
plugins: [
{
name: 'example',
- resolveId(id) {
- if (id === 'virtual-module') return id;
- return null;
- },
- transfor... | import { describe, expect, it } from 'vitest';
describe('Rollup 4 migration test', () => {
it('should resolve and transform virtual module', async () => {
const bundle = await rollup({
input: 'src/main.js',
plugins: [
{
name: 'example',
async resolveId(id) {
if ... |
MIG-2026-SQLALCHEMY-7312 | Python | sqlalchemy | 1.4.x -> 2.0.x | from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String) | DeprecationWarning: declarative_base() is deprecated since version 2.0.0. Use declarative_base() as a base class instead. | The declarative_base() function has been deprecated in favor of subclassing DeclarativeBase. This change was made to improve the flexibility and customization of the base class. The new approach allows for easier extension and modification of the base class, which is beneficial for large-scale applications. The migrati... | --- a/models.py
+++ b/models.py
@@ -1,5 +1,5 @@
-from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import DeclarativeBase
-Base = declarative_base()
+class Base(DeclarativeBase):
+ pass
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name... | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import Base, User
def test_user_model():
engine = create_engine('sqlite:///:memory:')
Session = sessionmaker(bind=engine)
session = Session()
Base.metadata.create_all(engine)
user = User(name='Joh... |
MIG-2026-NEXT-4231 | TypeScript | next | 13.x (Pages) -> 14.x/15.x (App Router) | import { GetServerSideProps } from 'next';
const HomePage = () => {
return <div>Welcome to my homepage!</div>;
};
export const getServerSideProps: GetServerSideProps = async (context) => {
const data = await fetch('https://api.example.com/data');
const jsonData = await data.json();
return {
props: {
... | Error: getServerSideProps is not a valid export in Next.js 14.x and later. Use Server Components and direct fetch() instead. | The upstream API broke because Next.js 14.x and later introduce a new App Router, which replaces the traditional Pages architecture. As a result, getServerSideProps is no longer a valid export. To migrate, we need to replace getServerSideProps with async Server Components and direct fetch(). This involves refactoring t... | --- a/pages/home.tsx
+++ b/app/page.tsx
@@ -1,17 +1,17 @@
-import { GetServerSideProps } from 'next';
+import { Suspense } from 'react';
+import useClientRequest from '../hooks/useClientRequest';
-const HomePage = () => {
+const HomePage = async () => {
return (
<div>
- Welcome to my homepage!
+ <Su... | import { render, waitFor } from '@testing-library/react';
import { HomePage } from '../app/page';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
import { json } from '../utils/json';
const server = setupServer(
rest.get('https://api.example.com/data', (req, res, ctx) => {
return res(ctx.jso... |
MIG-2026-NEXT-8856 | TypeScript | next | 13.x (Pages) -> 14.x/15.x (App Router) | export async function getStaticPaths() { return { paths: [], fallback: false }; } | Warning: getStaticPaths is deprecated. Please use generateStaticParams instead. | The getStaticPaths function has been replaced by generateStaticParams to support the App Router in Next.js 14.x/15.x. The new function allows for more flexible and dynamic static path generation. The upstream API broke to accommodate the new App Router architecture, which requires a different approach to static path ge... | --- a/layout/page.tsx
+++ b/layout/page.tsx
@@ -1,7 +1,7 @@
export async function getStaticPaths() {
- return { paths: [], fallback: false };
+ return { params: {} };
}
-export async function getStaticPaths() {
+export async function generateStaticParams() {
// updated implementation
} | import {describe, expect, it} from '@jest/globals';
describe('generateStaticParams', () => {
it('should return an object with a params property', async () => {
const result = await generateStaticParams();
expect(result).toHaveProperty('params');
});
}); |
MIG-2026-SQLALCHEMY-2272 | Python | sqlalchemy | 1.4.x -> 2.0.x | from sqlalchemy import create_engine
engine = create_engine('postgresql://user:password@host:port/dbname')
result = engine.execute('SELECT 1')
print(result.scalar()) | DeprecationWarning: The 'execute()' method of 'Engine' object is deprecated and will be removed in version 2.0.0. Use 'execute()' method of 'Connection' object instead.
result = engine.execute('SELECT 1') | The upstream API broke due to the deprecation of raw string execution in sqlalchemy 2.0.x. The 'execute()' method of 'Engine' object is no longer allowed to execute raw SQL strings directly. Instead, the 'text()' construct must be used to create a 'Text' object, which can then be executed using the 'execute()' method o... | --- a/deprecated_code.py
+++ b/migrated_code.py
@@ -1,6 +1,7 @@
from sqlalchemy import create_engine, text
engine = create_engine('postgresql://user:password@host:port/dbname')
+with engine.connect() as connection:
- result = engine.execute('SELECT 1')
+ result = connection.execute(text('SELECT 1'))
print(... | import pytest
from sqlalchemy import create_engine, text
def test_migrated_code():
engine = create_engine('postgresql://user:password@host:port/dbname')
with engine.connect() as connection:
result = connection.execute(text('SELECT 1'))
assert result.scalar() == 1
def test_deprecated_code():
... |
MIG-2026-PRISMA-1053 | TypeScript | prisma | 4.x -> 5.x | const result = await prisma.user.findMany({ where: { jsonField: { equals: null } } }); | error TS2322: Type 'null' is not assignable to type 'JsonNull | Null | DbNull'.
Type 'null' is not assignable to type 'JsonNull'. | In Prisma 5.x, the JSON null filtering syntax has changed to distinguish between JsonNull, Null, and DbNull. The `equals` filter now requires a specific type, whereas in Prisma 4.x, `null` was implicitly accepted. To migrate, we need to replace `null` with the correct type, which in this case is `JsonNull`. This change... | --- a/models.ts
+++ b/models.ts
@@ -10,7 +10,7 @@
const result = await prisma.user.findMany({
where: {
- jsonField: { equals: null }
+ jsonField: { equals: JsonNull }
}
}); | import { test, expect } from '@jest/globals';
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
-test('deprecated code', async () => {
+test('migrated code', async () => {
const result = await prisma.user.findMany({
where: {
jsonField: { equals: JsonNull }
}
});
... |
MIG-2026-AXIOS-1870 | TypeScript | axios | 0.27.x -> 1.x | const axios = require('axios');
axios.get('https://example.com', {
proxy: {
host: '127.0.0.1',
port: 8080,
auth: {
username: 'user',
password: 'pass'
}
}
}); | TypeError: 'proxy' option must be a string or an object with 'url' property, not an object with 'host', 'port', and 'auth' properties | The upstream API broke due to a change in the proxy configuration object structure. In axios 0.27.x, the proxy configuration object had a loose structure, allowing 'host', 'port', and 'auth' properties. However, in axios 1.x, the proxy configuration object must have a 'url' property or be a string. This change was made... | --- a/test.js
+++ b/test.js
@@ -1,10 +1,10 @@
const axios = require('axios');
-axios.get('https://example.com', {
- proxy: {
- host: '127.0.0.1',
- port: 8080,
- auth: {
- username: 'user',
- password: 'pass'
- }
- }
+axios.get('https://example.com', {
+ proxy: 'http://user:pass@127.0.0.1:8080... | import axios from 'axios';
import { describe, expect, it } from '@jest/globals';
describe('axios proxy configuration', () => {
it('should make a successful request with the new proxy configuration', async () => {
const response = await axios.get('https://example.com', {
proxy: 'http://user:pass@127.0.0.1:80... |
MIG-2026-PYDANTIC-9703 | Python | pydantic | 1.10.x -> 2.x | from pydantic import BaseModel
class User(BaseModel):
id: int
name: str
user = User(id=1, name='John Doe')
print(user.dict())
print(user.json()) | DeprecationWarning: `model.dict()` and `model.json()` are deprecated in pydantic 2.x. Use `model.model_dump()` and `model.model_dump_json()` instead. | The upstream API broke due to a major overhaul of the pydantic library, introducing a more consistent and efficient way of serializing models. The `dict()` and `json()` methods have been replaced by `model_dump()` and `model_dump_json()` to provide more control over the serialization process. This change requires a sys... | --- a/example.py
+++ b/example.py
@@ -5,7 +5,7 @@
class User(BaseModel):
id: int
name: str
-
-user = User(id=1, name='John Doe')
-print(user.dict())
-print(user.json())
+user = User(id=1, name='John Doe')
+print(user.model_dump())
+print(user.model_dump_json()) | import pytest
from pydantic import BaseModel
class User(BaseModel):
id: int
name: str
@pytest.mark.parametrize("input_data, expected_output", [
({'id': 1, 'name': 'John Doe'}, {'id': 1, 'name': 'John Doe'})
])
def test_model_dump(input_data, expected_output):
user = User(**input_data)
assert user.... |
MIG-2026-SQLALCHEMY-7821 | Python | sqlalchemy | 1.4.x -> 2.0.x | from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String) | DeprecationWarning: declarative_base() is deprecated since version 2.0.0. Please use DeclarativeBase instead. | The declarative_base() function has been deprecated in favor of subclassing DeclarativeBase. This change allows for more flexibility and customization in the base class. The new approach also provides better support for typing and other features. To migrate, replace the declarative_base() call with a subclass of Declar... | --- a/example.py
+++ b/example.py
@@ -1,7 +1,7 @@
from sqlalchemy.ext.declarative import DeclarativeBase
-from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy import Column, Integer, String
-Base = declarative_base()
+class Base(DeclarativeBase):
pass
class User(Base):
__tablename__ =... | import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from example import Base, User
def test_user_model():
engine = create_engine('sqlite:///:memory:')
Base.metadata.create_all(engine)
Session = sessionmaker(bind=engine)
session = Session()
user = User(name='Jo... |
MIG-2026-CELERY-3399 | Python | celery | 4.x -> 5.x | from celery import Celery
app = Celery('tasks', broker='amqp://guest:guest@localhost//')
CELERY_BROKER_URL = 'amqp://guest:guest@localhost//'
app.conf.update({
'CELERY_BROKER_URL': CELERY_BROKER_URL
}) | DeprecationWarning: CELERY_BROKER_URL setting is deprecated and will be removed in Celery 6.0. Use broker_url instead. | The upstream API broke due to the deprecation of the CELERY_BROKER_URL setting in favor of the broker_url setting. This change was made to improve the consistency of the Celery configuration API. To migrate, we need to replace all occurrences of CELERY_BROKER_URL with broker_url. We also need to update the Celery confi... | --- a/tasks.py
+++ b/tasks.py
@@ -1,7 +1,7 @@
from celery import Celery
-app = Celery('tasks', broker='amqp://guest:guest@localhost//')
-CELERY_BROKER_URL = 'amqp://guest:guest@localhost//'
-app.conf.update({
- 'CELERY_BROKER_URL': CELERY_BROKER_URL
+app = Celery('tasks', broker_url='amqp://guest:guest@localhost//'... | import pytest
from celery import Celery
app = Celery('tasks', broker_url='amqp://guest:guest@localhost//')
def test_broker_url_setting():
assert app.conf.broker_url == 'amqp://guest:guest@localhost//'
def test_celery_app_creation():
assert isinstance(app, Celery)
pytest.main([__file__]) |
MIG-2026-GOSTANDARDLIBRARY-9253 | Go | go-standard-library | Go 1.17 -> Go 1.18+ (Generics) | type Ordered interface { Less_than(other Ordered) bool }
func isOrdered[T any](slice []T, less func(T, T) bool) bool {
for i := 0; i < len(slice); i++ {
for j := i + 1; j < len(slice); j++ {
if !less(slice[i], slice[j]) {
return false
}
}
}
return true... | go: go-standard-library package: found sql.Open in go-standard-library
# command-line-arguments
./main.go:10:13: Less_than is not a type in constraints package | The introduction of generics in Go 1.18+ allows for more expressive and type-safe code. The constraints package provides a set of pre-defined constraints that can be used to restrict type parameters. In this case, the custom Ordered interface can be replaced with the constraints.Ordered type, which provides a more stan... | --- a/main.go
+++ b/main.go
@@ -1,11 +1,11 @@
-type Ordered interface { Less_than(other Ordered) bool }
+import (
+ "golang.org/dl/v2/constraints"
+)
func isOrdered[T any](slice []T, less func(T, T) bool) bool {
- for i := 0; i < len(slice); i++ {
- for j := i + 1; j < len(slice); j++ {
- if !l... | package main
import (
"reflect"
"testing"
)
type testStruct struct{}
func TestIsOrdered(t *testing.T) {
type args struct {
slice []testStruct
less func(testStruct, testStruct) bool
}
tests := []struct {
name string
args args
want bool
}{
{
... |
MIG-2026-SQLALCHEMY-3992 | Python | sqlalchemy | 1.4.x -> 2.0.x | from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String) | DeprecationWarning: declarative_base() is deprecated since version 2.0.0. Please use DeclarativeBase instead. | The upstream API broke due to the deprecation of the declarative_base() factory in favor of subclassing DeclarativeBase. This change was made to improve the flexibility and customizability of SQLAlchemy's declarative base. The migration strategy involves replacing the deprecated declarative_base() factory with the new ... | --- a/user.py
+++ b/user.py
@@ -1,5 +1,5 @@
-from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import DeclarativeBase
-Base = declarative_base()
+Base = DeclarativeBase()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String) | import pytest
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.orm import sessionmaker, DeclarativeBase
from sqlalchemy.ext.declarative import declarative_base
Base = DeclarativeBase()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Colum... |
MIG-2026-VITE-7328 | TypeScript | vite | 4.x -> 5.x | import { rollup } from 'rollup';
const config = {
plugins: [
{
name: 'my-plugin',
resolveId(id) {
return id;
},
transform(code, id) {
return { code, map: null };
}
}
]
};
export default config; | Error: The 'resolveId' hook should return a Promise that resolves to an ID, or null if it's not a module. Got 'string' instead.
at Object.resolveId (node:rollup:3911:15)
at Object.resolve (node:rollup:4065:24) | The breaking change in Rollup 4 is due to changes in the resolveId and transform hooks. In Rollup 3, these hooks could return synchronous values, but in Rollup 4, they must return Promises. The new Rollup 4 parser requires asynchronous resolution of IDs to support more advanced use cases, such as resolving IDs across m... | --- a/vite.config.js
+++ b/vite.config.js
@@ -5,9 +5,11 @@
plugins: [
{
name: 'my-plugin',
- resolveId(id) {
- return id;
- },
+ async resolveId(id) {
+ return id;
+ },
- transform(code, id) {
- return { code, map: null };
- }
+ async transform(code... | import { describe, expect, it } from 'vitest';
import { build } from 'vite';
import { config } from './vite.config.js';
describe('MIG-2026-VITE-7328', () => {
it('should build successfully', async () => {
await build(config);
expect(true).toBe(true);
});
}); |
MIG-2026-AXIOS-7832 | TypeScript | axios | 0.27.x -> 1.x | const adapter = (config: any) => {
return new Promise((resolve, reject) => {
// custom adapter implementation
resolve({ data: 'custom response' });
});
};
axios.defaults.adapter = adapter; | Error: Axios adapter must return an AxiosPromise
at createError (node_modules/axios/lib/core/createError.js:16:15)
at settle (node_modules/axios/lib/core/settle.js:18:12)
at Axios._resolvePromise (node_modules/axios/lib/core/Axios.js:127:14) | The breaking change occurs due to the modification of the adapter function contract in Axios 1.x. Previously, the adapter function would return a custom Promise. However, in Axios 1.x, the adapter function is expected to return an AxiosPromise, which is a specific type of Promise that provides additional functionality.... | --- a/adapter.ts
+++ b/adapter.ts
@@ -1,7 +1,7 @@
const adapter = (config: any) => {
- return new Promise((resolve, reject) => {
+ return new AxiosPromise((resolve, reject) => {
// custom adapter implementation
- resolve({ data: 'custom response' });
+ resolve({ data: 'custom response', status: 200, statu... | import axios from 'axios';
import { describe, it, expect } from 'vitest';
describe('axios adapter migration', () => {
it('should return an AxiosPromise', async () => {
const adapter = (config: any) => {
return new AxiosPromise((resolve, reject) => {
resolve({ data: 'custom response', status: 200, st... |
MIG-2026-PYDANTIC-8051 | Python | pydantic | 1.10.x -> 2.x | from pydantic import BaseModel
class User(BaseModel):
id: int
name: str
user = User(id=1, name='John Doe')
print(user.dict())
print(user.json()) | DeprecationWarning: `model.dict()` and `model.json()` are deprecated since version 2.0.0 and will be removed in a future version. Use `model.model_dump()` and `model.model_dump_json()` instead. | TheBreaking change in pydantic 2.x replaces `model.dict()` and `model.json()` with `model.model_dump()` and `model.model_dump_json()`. This change is due to the introduction of a more flexible and efficient serialization mechanism. The new methods provide more options for customizing the serialization process and impro... | --- a/user.py
+++ b/user.py
@@ -5,7 +5,7 @@
class User(BaseModel):
id: int
name: str
-user = User(id=1, name='John Doe')
-print(user.dict())
-print(user.json())
+user = User(id=1, name='John Doe')
+print(user.model_dump())
+print(user.model_dump_json()) | import pytest
from pydantic import BaseModel
from your_module import User
def test_user_serialization():
user = User(id=1, name='John Doe')
assert user.model_dump() == {'id': 1, 'name': 'John Doe'}
assert user.model_dump_json() == '{"id": 1, "name": "John Doe"}' |
MIG-2026-AWSSDKGOV2-6935 | Go | aws-sdk-go-v2 | v1.x -> v2.x | func main() {
svc := s3.New(aws.NewConfig())
params := &s3.ListBucketsInput{}
result, err := svc.ListBuckets(params)
if err != nil {
panic(err)
}
} | cannot use svc.ListBuckets(params) (type *s3.ListBucketsOutput, error) as type (*s3.ListBucketsOutput, error) in assignment: wrong type for context argument
got (*s3.ListBucketsOutput, error)
have (*s3.ListBucketsOutput, error, context.Context) | The breaking change introduced in v2.x of the aws-sdk-go-v2 requires a context.Context as the first argument to all SDK API operations. This change allows for better support of concurrency and cancellation. The deprecated code snippet uses the v1.x API, which does not pass a context. To migrate, we need to modify the c... | --- a/main.go
+++ b/main.go
@@ -1,7 +1,9 @@
func main() {
- svc := s3.New(aws.NewConfig())
+ ctx := context.Background()
+ svc := s3.New(aws.NewConfig())
params := &s3.ListBucketsInput{}
- result, err := svc.ListBuckets(params)
+ result, err := svc.ListBuckets(ctx, params)
if err != nil {
... | package main
import (
"context"
"testing"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
func TestListBuckets(t *testing.T) {
ctx := context.Background()
svc := s3.New(aws.NewConfig())
params := &s3.ListBucketsInput{}
result, err := svc.ListBuckets(ctx, params)
if err != nil {
t.F... |
MIG-2026-POLARS-5105 | Python | polars | 0.19.x -> 1.x | import polars as pl
df = pl.DataFrame({'foo': [1, 2, 3], 'bar': [4, 5, 6], 'baz': [7, 8, 9]})
pivoted_df = df.pivot(index='foo', columns='bar', values='baz') | TypeError: pivot() missing 1 required positional argument: 'values'
File "<stdin>", line 3, in <module>
File "polars/internals/dataframe/dataframe.py", line 1234, in pivot
raise TypeError("pivot() missing 1 required positional argument: 'values'") | The pivot API in polars 1.x has been refactored to use strict kwargs, which means that the index, columns, and values parameters must be passed as keyword arguments. This change was made to improve the readability and maintainability of the code. To migrate the code, we need to update the pivot method call to use keywo... | --- a/deprecated_code.py
+++ b/migrated_code.py
@@ -3,7 +3,7 @@
import polars as pl
df = pl.DataFrame({'foo': [1, 2, 3], 'bar': [4, 5, 6], 'baz': [7, 8, 9]})
-pivoted_df = df.pivot(index='foo', columns='bar', values='baz')
+pivoted_df = df.pivot(index='foo', columns='bar', values='baz') # No change needed, but for... | import pytest
import polars as pl
def test_pivot_migration():
df = pl.DataFrame({'foo': [1, 2, 3], 'bar': [4, 5, 6], 'baz': [7, 8, 9]})
pivoted_df = df.pivot(index='foo', columns='bar', values='baz')
assert pivoted_df.shape == (3, 3)
test_pivot_migration() |
MIG-2026-REACT-8328 | TypeScript | react | 18.x -> 19.x | import { forwardRef } from 'react';
const MyComponent = forwardRef((props, ref) => {
return <div ref={ref}>Hello World!</div>;
}); | Warning: `forwardRef` is deprecated. Use `ref` as a prop instead.
at MyComponent (./MyComponent.tsx:5:24)
at App (./App.tsx:10:20) | The `forwardRef` function has been deprecated in React 19.x in favor of passing `ref` as a standard component prop. This change simplifies the API and improves performance. To migrate, replace `forwardRef` with a regular function component and pass `ref` as a prop. Update the component to use the `ref` prop and remove ... | --- a/MyComponent.tsx
+++ b/MyComponent.tsx
@@ -1,5 +1,5 @@
import { useRef } from 'react';
-const MyComponent = forwardRef((props, ref) => {
+const MyComponent = (props: { ref: any }) => {
return <div ref={props.ref}>Hello World!</div>;
-});
+}; | import { describe, expect, it } from 'vitest';
import { render } from '@testing-library/react';
import MyComponent from './MyComponent';
describe('MyComponent', () => {
it('renders correctly', () => {
const { getByText } = render(<MyComponent ref={{ current: null }} />);
expect(getByText('Hello World!')).toB... |
MIG-2026-AWSSDKGOV2-5436 | Go | aws-sdk-go-v2 | v1.x -> v2.x | func main() {
svc := s3.New(aws.Config{Region: aws.String("us-west-2")})
params := &s3.PutObjectInput{
Bucket: aws.String("my-bucket"),
Key: aws.String("my-key"),
Body: bytes.NewReader([]byte("Hello World!")),
}
_, err := svc.PutObject(params)
if err!= nil {
... | cannot use aws.String("us-west-2") (type *string) as type *aws_sdk_go_v2.String in field value
github.com/aws/aws-sdk-go/aws/config.go:123:23
github.com/aws/aws-sdk-go/aws/s3/s3.go:456:12
main.go:15:24 | The aws-sdk-go-v2 package has undergone significant changes, including the relocation of pointer types helpers (aws.String, aws.Int64) from github.com/aws/aws-sdk-go/aws to aws-sdk-go-v2/aws. The deprecated code snippet uses the old location of these helpers, which results in a compiler error when upgrading to v2.x. To... | --- a/main.go
+++ b/main.go
@@ -1,7 +1,7 @@
func main() {
- svc := s3.New(aws.Config{Region: aws.String("us-west-2")})
+ svc := s3.New(aws.Config{Region: aws_sdk_go_v2.String("us-west-2")})
params := &s3.PutObjectInput{
- Bucket: aws.String("my-bucket"),
- Key: aws.String("my-key"),
+... | package main
import (
"context"
"log"
"testing"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
func TestPutObject(t *testing.T) {
ctx := context.Background()
cfg, err := config.LoadDefaultConfig(ctx)
if err!= nil {
t.Fatal(err)
}
... |
MIG-2026-POLARS-8405 | Python | polars | 0.19.x -> 1.x | import polars as pl
data = pl.DataFrame({'A': ['hello', 'world']})
series = data['A'].cast(pl.Utf8)
print(series) | FutureWarning: `pl.Utf8` is deprecated and will be removed in a future version. Use `pl.String` instead. | The upstream API broke due to the introduction of strict string/categorical type separation. The `pl.Utf8` type has been renamed to `pl.String` to better reflect its purpose. This change requires a systematic refactoring strategy to update all occurrences of `pl.Utf8` to `pl.String`. The migration involves replacing al... | --- a/example.py
+++ b/example.py
@@ -1,5 +1,5 @@
import polars as pl
-
data = pl.DataFrame({'A': ['hello', 'world']})
- series = data['A'].cast(pl.Utf8)
- print(series)
+
data = pl.DataFrame({'A': ['hello', 'world']})
+ series = data['A'].cast(pl.String)
+ print(series) | import pytest
import polars as pl
def test_migrated_code():
data = pl.DataFrame({'A': ['hello', 'world']})
series = data['A'].cast(pl.String)
assert series.dtype == pl.Dtype.STRING
print(series) |
MIG-2026-POLARS-9932 | Python | polars | 0.19.x -> 1.x | import polars as pl
df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
print(df['A'].rolling_mean(window_size=2))
print(df['B'].rolling_std(window_size=2)) | DeprecationWarning: `rolling_mean` and `rolling_std` are deprecated and will be removed in a future version. Use `df.rolling(window_size).mean()` and `df.rolling(window_size).std()` instead. | The upstream API broke due to a redesign of the rolling window syntax. The `rolling_mean` and `rolling_std` methods have been moved exclusively to the `df.rolling()` context to provide more flexibility and consistency. The systematic refactoring strategy involves replacing the deprecated methods with their equivalent `... | --- a/deprecated_code.py
+++ b/migrated_code.py
@@ -1,6 +1,6 @@
import polars as pl
-
df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
-print(df['A'].rolling_mean(window_size=2))
-print(df['B'].rolling_std(window_size=2))
+print(df['A'].rolling(2).mean())
+print(df['B'].rolling(2).std()) | import pytest
import polars as pl
def test_migrated_code():
df = pl.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
assert df['A'].rolling(2).mean().to_list() == [None, 1.5, 2.5]
assert df['B'].rolling(2).std().to_list() == [None, 0.5, 0.5]
test_migrated_code() |
MIG-2026-VITE-4771 | TypeScript | vite | 4.x -> 5.x | import { createServer } from 'vite';
const server = createServer({
root: './',
server: {
port: 3000,
hmr: true,
},
build: {
outDir: 'dist',
minify: 'terser',
},
});
server.listen(); | Warning: The 'build' option is deprecated and will be removed in a future version. Use 'build.outDir' instead.
Error: The 'server' option 'hmr' is not supported in Vite 5. Use 'server.hmr.protocol' instead. | The upstream API broke due to the deprecation of the Node.js 14/16 runtime engine and the CJS Node API build in favor of ESM only. The 'build' option has been replaced with 'build.outDir', and the 'server.hmr' option has been replaced with 'server.hmr.protocol'. The systematic refactoring strategy involves updating the... | --- a/vite.config.js
+++ b/vite.config.js
@@ -1,10 +1,10 @@
import { createServer } from 'vite';
-
-const server = createServer({
- root: './',
- server: {
- port:3000,
- hmr: true,
- },
- build: {
- outDir: 'dist',
- minify: 'terser',
- },
-});
+const server = createServer({
+ root: './',
+ server:... | import { describe, it, expect } from 'vitest';
describe('vite migration test', () => {
it('should create a server with the new options', async () => {
const server = await createServer({
root: './',
server: {
port: 3000,
hmr: {
protocol: 'ws',
},
},
build:... |
MIG-2026-LANGCHAIN-9876 | Python | langchain | 0.1.x -> 0.2.x/0.3.x | from langchain import RetrievalQA
class MyRetrievalChain(RetrievalQA):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def query(self, query):
# Implement custom query logic
pass | DeprecationWarning: RetrievalQA is deprecated in favor of create_retrieval_chain with LCEL. Please update your code to use the new API. | The upstream API broke due to a significant redesign of the retrieval chain architecture. The new create_retrieval_chain function with LCEL (Large Context Encoder Layer) provides improved performance and flexibility. The deprecated RetrievalQA class has been replaced by a more modular and composable approach, allowing ... | --- a/my_retrieval_chain.py
+++ b/my_retrieval_chain.py
@@ -1,7 +1,7 @@
-from langchain import RetrievalQA
+from langchain import create_retrieval_chain
-class MyRetrievalChain(RetrievalQA):
+class MyRetrievalChain:
def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
+ self.chai... | import pytest
from langchain import create_retrieval_chain
from my_retrieval_chain import MyRetrievalChain
@pytest.fixture
def my_retrieval_chain():
return MyRetrievalChain()
def test_my_retrieval_chain_query(my_retrieval_chain):
query = "Hello World"
result = my_retrieval_chain.query(query)
assert re... |
MIG-2026-SQLALCHEMY-7658 | Python | sqlalchemy | 1.4.x -> 2.0.x | from sqlalchemy import create_engine
engine = create_engine('postgresql://user:password@host:port/dbname')
result = engine.execute('SELECT 1')
print(result.fetchone()) | DeprecationWarning: The 'execute()' method is deprecated and will be removed in a future version. Use 'execute()' with a 'text()' construct or 'select()' instead.
result = engine.execute('SELECT 1')
sqlalchemy.exc.DeprecationWarning: The 'execute()' method is deprecated and will be removed in a future version. Use 'e... | The upstream API broke due to the deprecation of raw string execution. In sqlalchemy 2.0.x, the 'text()' construct is strictly enforced, and 'session.execute()' no longer accepts raw strings. To migrate, we need to replace 'engine.execute()' with 'engine.execute(text())' or 'select()'. The 'text()' construct provides a... | --- a/migration_example.py
+++ b/migration_example.py
@@ -1,6 +1,6 @@
from sqlalchemy import create_engine, text
engine = create_engine('postgresql://user:password@host:port/dbname')
- result = engine.execute('SELECT 1')
+ result = engine.execute(text('SELECT 1'))
print(result.fetchone()) | import pytest
from sqlalchemy import create_engine, text
def test_migration():
engine = create_engine('postgresql://user:password@host:port/dbname')
result = engine.execute(text('SELECT 1'))
assert result.fetchone() == (1,)
def test_deprecated_code():
engine = create_engine('postgresql://user:password... |
MIG-2026-GOSTANDARDLIBRARY-7867 | Go | go-standard-library | Go 1.17 -> Go 1.18+ (Generics) | func getMapKeys(m map[string]int) []string {
keys := make([]string, 0, len(m))
for k := range m {
keys = append(keys, k)
}
return keys
} | warning: reflection-based map key extraction is deprecated in Go 1.18 and later; use the `Keys` function from the `maps` package or the generic `Keys` function instead | The introduction of generics in Go 1.18 provides a more efficient and type-safe way to extract map keys. The deprecated reflection-based approach is replaced by the generic `Keys` function, which eliminates the need for explicit type casting and improves code readability. The migration involves replacing the deprecated... | --- a/main.go
+++ b/main.go
@@ -1,7 +1,7 @@
func getMapKeys(m map[string]int) []string {
- keys := make([]string, 0, len(m))
- for k := range m {
- keys = append(keys, k)
- }
- return keys
+ return maps.Keys(m)
} | package main
import (
"testing"
)
func TestGetMapKeys(t *testing.T) {
m := map[string]int{
"a": 1,
"b": 2,
"c": 3,
}
keys := getMapKeys(m)
expectedKeys := []string{
"a",
"b",
"c",
}
if len(keys) != len(expectedKeys) {
t.Errorf("expect... |
MIG-2026-SQLALCHEMY-1846 | Python | sqlalchemy | 1.4.x -> 2.0.x | from sqlalchemy import create_engine, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
email = Column(String)
engine = create_engine... | DeprecationWarning: The Query object is deprecated since version 1.4.0. Use the select() function instead. | The removal of the legacy Query API in sqlalchemy 2.0.x is due to the introduction of a new, more efficient, and flexible query system. The new system, based on the select() function, provides better support for complex queries and improved performance. The migration involves replacing the deprecated session.query() me... | --- a/example.py
+++ b/example.py
@@ -1,6 +1,6 @@
from sqlalchemy import create_engine, sessionmaker
-from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy import select
from sqlalchemy import Column, Integer, String
class User(Base):
__tablename__ = 'users'
@@ -13,5 +13,5 @@
engine = crea... | import pytest
from sqlalchemy import create_engine, sessionmaker
from sqlalchemy import select
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String)
em... |
MIG-2026-PYDANTIC-5525 | Python | pydantic | 1.10.x -> 2.x | from pydantic import BaseModel, validator
class User(BaseModel):
name: str
age: int
@validator('age')
def check_age(cls, v):
if v < 18:
raise ValueError('Age must be greater than 18')
return v
@validator('name', each_item=True)
def check_name(cls, v):
if no... | DeprecationWarning: The `@validator` decorator with `pre` or `each_item` arguments is deprecated since version 1.10.0 and will be removed in version 2.0.0. Use `@field_validator` with `mode='before'` instead. | The upstream API broke due to the deprecation of the `@validator` decorator with `pre` or `each_item` arguments in favor of the new `@field_validator` decorator with `mode='before'`. This change was made to improve the consistency and flexibility of the validation API. To migrate, we need to replace all occurrences of ... | --- a/user.py
+++ b/user.py
@@ -1,11 +1,11 @@
from pydantic import BaseModel, field_validator
class User(BaseModel):
name: str
age: int
- @validator('age')
- def check_age(cls, v):
+ @field_validator('age', mode='before')
+ def check_age(cls, v):
if v < 18:
raise ValueE... | import pytest
from pydantic import BaseModel, field_validator
from user import User
def test_user_model():
user = User(name='John Doe', age=25)
assert user.name == 'John Doe'
assert user.age == 25
def test_age_validation():
with pytest.raises(ValueError):
User(name='John Doe', age=17)... |
MIG-2026-VITE-3154 | TypeScript | vite | 4.x -> 5.x | import '../styles/global.scss';
import '../styles/home.less';
// in global.scss
@import '~@fortawesome/fontawesome-free/scss/fontawesome';
@import '~@fortawesome/fontawesome-free/scss/solid';
// in home.less
@import '~normalize.css/normalize'; | Error: Can't resolve '~@fortawesome/fontawesome-free/scss/fontawesome' in '/path/to/project/styles'
at /path/to/project/node_modules/vite/dist/node/chunks/dep-5c9379d6.js:51541:23
at /path/to/project/node_modules/vite/dist/node/chunks/dep-5c9379d6.js:51563:16 | In Vite 5.x, the CSS preprocessor import deprecation introduces a breaking change where resolving Sass/Less @import paths with leading tildes (~) is disallowed. The tilde (~) symbol is no longer recognized as a shortcut for the node_modules directory. To resolve this issue, we need to update the @import statements to u... | --- a/styles/global.scss
+++ b/styles/global.scss
@@ -1,3 +1,3 @@
-@import '~@fortawesome/fontawesome-free/scss/fontawesome';
-@import '~@fortawesome/fontawesome-free/scss/solid';
+@import 'node_modules/@fortawesome/fontawesome-free/scss/fontawesome';
+@import 'node_modules/@fortawesome/fontawesome-free/scss/solid';
-... | import { expect } from 'vitest';
import { render } from '../render';
import '../styles/global.scss';
import '../styles/home.less';
vitest.describe('migration test', () => {
vitest.test('rendered HTML should contain font awesome classes', async () => {
const { container } = await render();
expect(container.qu... |
MIG-2026-VITE-1775 | TypeScript | vite | 4.x -> 5.x | import { resolveId, transform } from 'rollup';
const config = {
plugins: [
{
name: 'example',
resolveId(id) {
if (id === 'virtual:\\\/example') return id;
return null;
},
transform(code, id) {
if (id === 'virtual:\\\/example') return { code: 'export const example = ... | Error: 'resolveId' hook must return a promise that resolves to an object with 'id' property or null. Received: string
at async resolveId (node:internal) | The Rollup 4 migration introduces changes to the 'resolveId' and 'transform' hooks. In Rollup 3, these hooks could return synchronous values, but in Rollup 4, they must return promises. The 'resolveId' hook must return a promise that resolves to an object with an 'id' property or null, while the 'transform' hook must r... | --- a/example.ts
+++ b/example.ts
@@ -1,11 +1,15 @@
import { resolveId, transform } from 'rollup';
-
const config = {
plugins: [
{
name: 'example',
- resolveId(id) {
- if (id === 'virtual:\\\/example') return id;
- return null;
- },
- transform(code, id) {
- if (id =... | import { describe, expect, it } from 'vitest';
describe('vite migration test', () => {
it('should resolve id correctly', async () => {
const config = {
plugins: [
{
name: 'example',
async resolveId(id) {
if (id === 'virtual:\\\/example') return { id };
ret... |
MIG-2026-VITE-9206 | TypeScript | vite | 4.x -> 5.x | import { defineConfig } from 'vite';
const config = defineConfig({
worker: {
format: 'iife',
plugins: [
// worker plugins
],
},
}); | error: 'iife' is not a valid value for 'worker.format'. Use 'es' instead. | The worker format change from 'iife' to 'es' in vite 5.x is due to the adoption of ES modules as the default module system. This change allows for better support of modern JavaScript features and improved compatibility with other build tools. To migrate, update the 'worker.format' option to 'es' and ensure that worker ... | --- a/vite.config.js
+++ b/vite.config.js
@@ -1,7 +1,7 @@
import { defineConfig } from 'vite';
const config = defineConfig({
- worker: {
- format: 'iife',
+ worker: {
+ format: 'es',
plugins: [
// worker plugins
],
},
}); | import { describe, expect, it } from 'vitest';
import { defineConfig } from 'vite';
describe('vite config migration', () => {
it('should use es format for workers', () => {
const config = defineConfig({
worker: {
format: 'es',
},
});
expect(config.worker.format).toBe('es');
});
}); |
MIG-2026-LANGCHAIN-4490 | Python | langchain | 0.1.x -> 0.2.x/0.3.x | from langchain.chains import RetrievalQA
def retrieve_answer(question, context):
chain = RetrievalQA()
return chain({'question': question, 'context': context}) | DeprecationWarning: RetrievalQA is deprecated in favor of create_retrieval_chain with LCEL. Use create_retrieval_chain instead. | The upstream API broke due to the deprecation of the RetrievalQA class in favor of the create_retrieval_chain function with LCEL (Langchain Embedding Layer). The create_retrieval_chain function provides more flexibility and customization options for building retrieval chains. To migrate, we need to replace the deprecat... | --- a/retrieval_example.py
+++ b/retrieval_example.py
@@ -1,7 +1,7 @@
from langchain.chains import create_retrieval_chain
-
-def retrieve_answer(question, context):
- chain = RetrievalQA()
- return chain({'question': question, 'context': context})
+def retrieve_answer(question, context):
+ chain = create_retr... | import pytest
from langchain.chains import create_retrieval_chain
def test_retrieve_answer():
question = 'What is the capital of France?'
context = 'The capital of France is Paris.'
chain = create_retrieval_chain(llm=None, retriever=None)
answer = chain.run({'question': question, 'context': context})
... |
MIG-2026-PRISMA-9328 | TypeScript | prisma | 4.x -> 5.x | const { jsonFilter } = require('@prisma/client');
const filteredData = await jsonFilter({ where: { jsonField: { equals: null } } }); | Error: @prisma/client: The `equals` filter with a value of `null` is deprecated. Use `isNull` or `isNotNull` instead. (https://prisma.io/docs/reference/api-reference/prisma-client-reference#jsonnull) | The upstream API broke due to the introduction of a distinction between `JsonNull`, `Null`, and `DbNull` in Prisma 5.x. The `equals` filter with a value of `null` is no longer sufficient to determine whether to filter by JSON null or database null. The systematic refactoring strategy involves replacing the `equals` fil... | --- a/deprecated-code.ts
+++ b/migrated-code.ts
@@ -1,5 +1,5 @@
const { jsonFilter } = require('@prisma/client');
-const filteredData = await jsonFilter({ where: { jsonField: { equals: null } } });
+const filteredData = await jsonFilter({ where: { jsonField: { isNull: true } } }); | import { test, expect } from '@jest/globals';
import { jsonFilter } from '@prisma/client';
test('migrated code runs cleanly on modern runtime', async () => {
const filteredData = await jsonFilter({ where: { jsonField: { isNull: true } } });
expect(filteredData).toBeDefined();
}); |
MIG-2026-GIN-8588 | Go | gin | v1.8.x -> v1.9.x+ | type User struct { Name string `json:"name" binding:"required"` }
func main() { router := gin.Default(); var user User; err := c.ShouldBindJSON(&user); if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) } } | binding: Validator v10 structural validation error: Key: 'User.Name' Error:Field validation for 'Name' failed on the 'required' tag | The breaking change is due to the introduction of strict JSON binding validation in gin v1.9.x+. The `binding:` tag is now validated using the `github.com/go-playground/validator/v10` package, which has different validation rules than the previous version. Specifically, the `required` tag now checks for the presence of... | --- a/main.go
+++ b/main.go
@@ -1,7 +1,7 @@
type User struct { Name string `json:"name" binding:"required"` }
-func main() { router := gin.Default(); var user User; err := c.ShouldBindJSON(&user); if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) } }
+func main() { router := gin.Default(); var... | package main
import (
"encoding/json"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
)
func TestMigration(t *testing.T) { router := gin.Default(); type User struct { Name string `json:"name" binding:"required"` }; var user User; req := httptest.NewRequest("POST", "/", strings.NewReader(`{"name":"John"}`)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.