llm-code-validator 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llm_code_validator/__init__.py +3 -0
- llm_code_validator/benchmark.py +141 -0
- llm_code_validator/cli.py +105 -0
- llm_code_validator/core.py +359 -0
- llm_code_validator/diagnostics.py +61 -0
- llm_code_validator/fixes.py +66 -0
- llm_code_validator/formatting.py +43 -0
- llm_code_validator/library_signatures.json +842 -0
- llm_code_validator/signatures.py +163 -0
- llm_code_validator/versioning.py +153 -0
- llm_code_validator-0.1.0.dist-info/METADATA +220 -0
- llm_code_validator-0.1.0.dist-info/RECORD +16 -0
- llm_code_validator-0.1.0.dist-info/WHEEL +5 -0
- llm_code_validator-0.1.0.dist-info/entry_points.txt +2 -0
- llm_code_validator-0.1.0.dist-info/licenses/LICENSE +21 -0
- llm_code_validator-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
{
|
|
2
|
+
"langchain": {
|
|
3
|
+
"current_version": "0.3.x",
|
|
4
|
+
"last_updated": "2026-04-07",
|
|
5
|
+
"methods": {
|
|
6
|
+
"initialize_agent": {
|
|
7
|
+
"exists": false,
|
|
8
|
+
"removed_in": "0.2.0",
|
|
9
|
+
"removed_date": "2024-05-01",
|
|
10
|
+
"reason": "Replaced by LangGraph agent constructors — LangChain no longer owns agent orchestration",
|
|
11
|
+
"old_import": "from langchain.agents import initialize_agent",
|
|
12
|
+
"replacement": "langgraph.prebuilt.create_react_agent",
|
|
13
|
+
"replacement_example": "from langgraph.prebuilt import create_react_agent\nagent = create_react_agent(llm, tools)",
|
|
14
|
+
"source_note": "Curated API-drift signature for langchain 0.3.x; verify against official migration docs before marking safe_fix."
|
|
15
|
+
},
|
|
16
|
+
"ConversationBufferMemory": {
|
|
17
|
+
"exists": true,
|
|
18
|
+
"module_current": "langchain_community.memory",
|
|
19
|
+
"module_old": "langchain.memory",
|
|
20
|
+
"changed_in": "0.2.0",
|
|
21
|
+
"note": "Moved to langchain_community package — requires pip install langchain-community",
|
|
22
|
+
"old_import": "from langchain.memory import ConversationBufferMemory",
|
|
23
|
+
"new_import": "from langchain_community.memory import ConversationBufferMemory",
|
|
24
|
+
"fix_safety": "safe_fix",
|
|
25
|
+
"match_exact_only": true,
|
|
26
|
+
"source_url": "https://python.langchain.com/docs/versions/v0_2/deprecations/"
|
|
27
|
+
},
|
|
28
|
+
"LLMChain": {
|
|
29
|
+
"exists": false,
|
|
30
|
+
"removed_in": "0.3.0",
|
|
31
|
+
"removed_date": "2024-09-15",
|
|
32
|
+
"reason": "Replaced by LCEL (LangChain Expression Language) pipe syntax",
|
|
33
|
+
"old_import": "from langchain.chains import LLMChain",
|
|
34
|
+
"replacement": "chain = prompt | llm | output_parser",
|
|
35
|
+
"replacement_example": "from langchain_core.prompts import ChatPromptTemplate\nchain = ChatPromptTemplate.from_template('{input}') | llm",
|
|
36
|
+
"source_url": "https://python.langchain.com/docs/versions/v0_2/deprecations/"
|
|
37
|
+
},
|
|
38
|
+
"OpenAI": {
|
|
39
|
+
"exists": true,
|
|
40
|
+
"module_current": "langchain_openai",
|
|
41
|
+
"module_old": "langchain.llms",
|
|
42
|
+
"changed_in": "0.2.0",
|
|
43
|
+
"note": "Moved to langchain_openai package",
|
|
44
|
+
"old_import": "from langchain.llms import OpenAI",
|
|
45
|
+
"new_import": "from langchain_openai import OpenAI",
|
|
46
|
+
"source_url": "https://python.langchain.com/docs/versions/v0_2/deprecations/"
|
|
47
|
+
},
|
|
48
|
+
"ChatOpenAI": {
|
|
49
|
+
"exists": true,
|
|
50
|
+
"module_current": "langchain_openai",
|
|
51
|
+
"module_old": "langchain.chat_models",
|
|
52
|
+
"changed_in": "0.2.0",
|
|
53
|
+
"note": "Moved to langchain_openai package",
|
|
54
|
+
"old_import": "from langchain.chat_models import ChatOpenAI",
|
|
55
|
+
"new_import": "from langchain_openai import ChatOpenAI",
|
|
56
|
+
"source_url": "https://python.langchain.com/docs/versions/v0_2/deprecations/"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"openai": {
|
|
61
|
+
"current_version": "1.x",
|
|
62
|
+
"last_updated": "2026-04-07",
|
|
63
|
+
"methods": {
|
|
64
|
+
"openai.ChatCompletion.create": {
|
|
65
|
+
"exists": false,
|
|
66
|
+
"removed_in": "1.0.0",
|
|
67
|
+
"removed_date": "2023-11-06",
|
|
68
|
+
"reason": "Complete SDK rewrite — class-based API replaced by client instance methods",
|
|
69
|
+
"old_import": "import openai\nopenai.ChatCompletion.create(...)",
|
|
70
|
+
"replacement": "from openai import OpenAI\nclient = OpenAI()\nclient.chat.completions.create(...)",
|
|
71
|
+
"replacement_example": "from openai import OpenAI\nclient = OpenAI(api_key='your-key')\nresponse = client.chat.completions.create(\n model='gpt-4o-mini',\n messages=[{'role': 'user', 'content': 'Hello'}]\n)",
|
|
72
|
+
"match_exact_only": true,
|
|
73
|
+
"source_url": "https://github.com/openai/openai-python/discussions/742"
|
|
74
|
+
},
|
|
75
|
+
"openai.Completion.create": {
|
|
76
|
+
"exists": false,
|
|
77
|
+
"removed_in": "1.0.0",
|
|
78
|
+
"removed_date": "2023-11-06",
|
|
79
|
+
"reason": "Completions API replaced by chat completions — old text-in text-out pattern removed",
|
|
80
|
+
"old_import": "import openai\nopenai.Completion.create(...)",
|
|
81
|
+
"replacement": "client.chat.completions.create(...)",
|
|
82
|
+
"replacement_example": "from openai import OpenAI\nclient = OpenAI()\nresponse = client.chat.completions.create(\n model='gpt-4o-mini',\n messages=[{'role': 'user', 'content': prompt}]\n)",
|
|
83
|
+
"match_exact_only": true,
|
|
84
|
+
"source_url": "https://github.com/openai/openai-python/discussions/742"
|
|
85
|
+
},
|
|
86
|
+
"openai.api_key": {
|
|
87
|
+
"exists": false,
|
|
88
|
+
"removed_in": "1.0.0",
|
|
89
|
+
"removed_date": "2023-11-06",
|
|
90
|
+
"reason": "Global state removed — pass key to client constructor instead",
|
|
91
|
+
"old_usage": "openai.api_key = 'sk-...'",
|
|
92
|
+
"replacement": "client = OpenAI(api_key='sk-...')",
|
|
93
|
+
"source_note": "Curated API-drift signature for openai 1.x; verify against official migration docs before marking safe_fix."
|
|
94
|
+
},
|
|
95
|
+
"openai.Embedding.create": {
|
|
96
|
+
"exists": false,
|
|
97
|
+
"removed_in": "1.0.0",
|
|
98
|
+
"removed_date": "2023-11-06",
|
|
99
|
+
"reason": "Class-level API removed — use client instance",
|
|
100
|
+
"old_usage": "openai.Embedding.create(input='text', model='text-embedding-ada-002')",
|
|
101
|
+
"replacement": "client.embeddings.create(input='text', model='text-embedding-3-small')",
|
|
102
|
+
"replacement_example": "from openai import OpenAI\nclient = OpenAI()\nresponse = client.embeddings.create(\n input='text to embed',\n model='text-embedding-3-small'\n)",
|
|
103
|
+
"match_exact_only": true,
|
|
104
|
+
"source_url": "https://github.com/openai/openai-python/discussions/742"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"pydantic": {
|
|
109
|
+
"current_version": "2.x",
|
|
110
|
+
"last_updated": "2026-04-07",
|
|
111
|
+
"methods": {
|
|
112
|
+
"validator": {
|
|
113
|
+
"exists": false,
|
|
114
|
+
"removed_in": "2.0.0",
|
|
115
|
+
"removed_date": "2023-06-30",
|
|
116
|
+
"reason": "Replaced by field_validator decorator with @classmethod requirement",
|
|
117
|
+
"old_import": "from pydantic import validator",
|
|
118
|
+
"replacement": "from pydantic import field_validator",
|
|
119
|
+
"replacement_example": "from pydantic import field_validator\n\n@field_validator('field_name')\n@classmethod\ndef validate_field(cls, v):\n return v",
|
|
120
|
+
"fix_safety": "safe_fix",
|
|
121
|
+
"source_url": "https://docs.pydantic.dev/latest/migration/#changes-to-validators"
|
|
122
|
+
},
|
|
123
|
+
"root_validator": {
|
|
124
|
+
"exists": false,
|
|
125
|
+
"removed_in": "2.0.0",
|
|
126
|
+
"removed_date": "2023-06-30",
|
|
127
|
+
"reason": "Replaced by model_validator decorator",
|
|
128
|
+
"old_import": "from pydantic import root_validator",
|
|
129
|
+
"replacement": "from pydantic import model_validator",
|
|
130
|
+
"replacement_example": "from pydantic import model_validator\n\n@model_validator(mode='after')\ndef validate_model(self):\n return self",
|
|
131
|
+
"fix_safety": "safe_fix",
|
|
132
|
+
"source_url": "https://docs.pydantic.dev/latest/migration/#changes-to-validators"
|
|
133
|
+
},
|
|
134
|
+
"BaseModel.__fields__": {
|
|
135
|
+
"exists": false,
|
|
136
|
+
"removed_in": "2.0.0",
|
|
137
|
+
"reason": "Replaced by model_fields — returns FieldInfo objects instead of ModelField",
|
|
138
|
+
"old_usage": "MyModel.__fields__",
|
|
139
|
+
"replacement": "MyModel.model_fields",
|
|
140
|
+
"source_note": "Curated API-drift signature for pydantic 2.x; verify against official migration docs before marking safe_fix."
|
|
141
|
+
},
|
|
142
|
+
"BaseModel.dict": {
|
|
143
|
+
"exists": false,
|
|
144
|
+
"removed_in": "2.0.0",
|
|
145
|
+
"reason": "Replaced by model_dump() — method renamed for consistency",
|
|
146
|
+
"old_usage": "my_instance.dict()",
|
|
147
|
+
"replacement": "my_instance.model_dump()",
|
|
148
|
+
"fix_safety": "safe_fix",
|
|
149
|
+
"source_url": "https://docs.pydantic.dev/latest/migration/#changes-to-pydanticbasemodel"
|
|
150
|
+
},
|
|
151
|
+
"BaseModel.json": {
|
|
152
|
+
"exists": false,
|
|
153
|
+
"removed_in": "2.0.0",
|
|
154
|
+
"reason": "Replaced by model_dump_json() — method renamed for consistency",
|
|
155
|
+
"old_usage": "my_instance.json()",
|
|
156
|
+
"replacement": "my_instance.model_dump_json()",
|
|
157
|
+
"fix_safety": "safe_fix",
|
|
158
|
+
"source_url": "https://docs.pydantic.dev/latest/migration/#changes-to-pydanticbasemodel"
|
|
159
|
+
},
|
|
160
|
+
"BaseModel.parse_obj": {
|
|
161
|
+
"exists": false,
|
|
162
|
+
"removed_in": "2.0.0",
|
|
163
|
+
"reason": "Replaced by model_validate()",
|
|
164
|
+
"old_usage": "MyModel.parse_obj(data_dict)",
|
|
165
|
+
"replacement": "MyModel.model_validate(data_dict)",
|
|
166
|
+
"fix_safety": "safe_fix",
|
|
167
|
+
"source_url": "https://docs.pydantic.dev/latest/migration/#changes-to-pydanticbasemodel"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"sklearn": {
|
|
172
|
+
"current_version": "1.4.x",
|
|
173
|
+
"last_updated": "2026-04-07",
|
|
174
|
+
"methods": {
|
|
175
|
+
"StandardScaler.fit_transform": {
|
|
176
|
+
"exists": true,
|
|
177
|
+
"signature": "fit_transform(X, y=None, **fit_params)",
|
|
178
|
+
"common_mistake": "Passing y as a positional argument — y is ignored for StandardScaler",
|
|
179
|
+
"correct_usage": "scaler.fit_transform(X)"
|
|
180
|
+
},
|
|
181
|
+
"sklearn.externals.joblib": {
|
|
182
|
+
"exists": false,
|
|
183
|
+
"removed_in": "0.23.0",
|
|
184
|
+
"removed_date": "2020-05-01",
|
|
185
|
+
"reason": "joblib was removed from sklearn.externals — use joblib directly",
|
|
186
|
+
"old_import": "from sklearn.externals import joblib",
|
|
187
|
+
"replacement": "import joblib",
|
|
188
|
+
"replacement_example": "import joblib\njoblib.dump(model, 'model.pkl')\nmodel = joblib.load('model.pkl')",
|
|
189
|
+
"source_note": "Curated API-drift signature for sklearn 1.4.x; verify against official migration docs before marking safe_fix."
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"pandas": {
|
|
194
|
+
"current_version": "2.x",
|
|
195
|
+
"last_updated": "2026-04-07",
|
|
196
|
+
"methods": {
|
|
197
|
+
"append": {
|
|
198
|
+
"exists": false,
|
|
199
|
+
"removed_in": "2.0.0",
|
|
200
|
+
"removed_date": "2023-04-03",
|
|
201
|
+
"reason": "DataFrame.append was deprecated in 1.4.0 and removed in 2.0.0 — use pd.concat instead",
|
|
202
|
+
"old_usage": "df1.append(df2)",
|
|
203
|
+
"replacement": "pd.concat([df1, df2])",
|
|
204
|
+
"replacement_example": "import pandas as pd\nresult = pd.concat([df1, df2], ignore_index=True)",
|
|
205
|
+
"source_note": "Curated API-drift signature for pandas 2.x; verify against official migration docs before marking safe_fix."
|
|
206
|
+
},
|
|
207
|
+
"mad": {
|
|
208
|
+
"exists": false,
|
|
209
|
+
"removed_in": "2.0.0",
|
|
210
|
+
"removed_date": "2023-04-03",
|
|
211
|
+
"reason": "mad() (mean absolute deviation) was removed in 2.0.0",
|
|
212
|
+
"old_usage": "df.mad()",
|
|
213
|
+
"replacement": "(df - df.mean()).abs().mean()",
|
|
214
|
+
"source_note": "Curated API-drift signature for pandas 2.x; verify against official migration docs before marking safe_fix."
|
|
215
|
+
},
|
|
216
|
+
"Int64Index": {
|
|
217
|
+
"exists": false,
|
|
218
|
+
"removed_in": "2.0.0",
|
|
219
|
+
"removed_date": "2023-04-03",
|
|
220
|
+
"reason": "NumericIndex types (Int64Index, Float64Index, UInt64Index) were removed in 2.0.0",
|
|
221
|
+
"old_usage": "pd.Int64Index([1, 2, 3])",
|
|
222
|
+
"replacement": "pd.Index([1, 2, 3], dtype='int64')",
|
|
223
|
+
"source_note": "Curated API-drift signature for pandas 2.x; verify against official migration docs before marking safe_fix."
|
|
224
|
+
},
|
|
225
|
+
"DataFrame.swaplevel": {
|
|
226
|
+
"exists": true,
|
|
227
|
+
"changed_in": "2.0.0",
|
|
228
|
+
"note": "i and j parameter defaults changed — must now specify explicitly",
|
|
229
|
+
"old_usage": "df.swaplevel()",
|
|
230
|
+
"replacement": "df.swaplevel(0, 1)",
|
|
231
|
+
"source_note": "Curated API-drift signature for pandas 2.x; verify against official migration docs before marking safe_fix."
|
|
232
|
+
},
|
|
233
|
+
"DataFrame.iteritems": {
|
|
234
|
+
"exists": false,
|
|
235
|
+
"removed_in": "2.0.0",
|
|
236
|
+
"removed_date": "2023-04-03",
|
|
237
|
+
"reason": "iteritems() was removed — use items() instead",
|
|
238
|
+
"old_usage": "for col, series in df.iteritems():",
|
|
239
|
+
"replacement": "for col, series in df.items():",
|
|
240
|
+
"fix_safety": "safe_fix",
|
|
241
|
+
"source_url": "https://pandas.pydata.org/docs/whatsnew/v2.0.0.html"
|
|
242
|
+
},
|
|
243
|
+
"DataFrame.inplace": {
|
|
244
|
+
"exists": true,
|
|
245
|
+
"changed_in": "2.0.0",
|
|
246
|
+
"note": "inplace parameter on many DataFrame methods is deprecated and will be removed in a future version",
|
|
247
|
+
"reason": "Copy-on-Write (CoW) makes inplace semantically unclear — operations should return new objects",
|
|
248
|
+
"old_usage": "df.drop(columns=['col'], inplace=True)",
|
|
249
|
+
"replacement": "df = df.drop(columns=['col'])",
|
|
250
|
+
"replacement_example": "# Old pattern (deprecated):\ndf.reset_index(inplace=True)\n# New pattern:\ndf = df.reset_index()",
|
|
251
|
+
"source_note": "Curated API-drift signature for pandas 2.x; verify against official migration docs before marking safe_fix."
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"torch": {
|
|
256
|
+
"current_version": "2.x",
|
|
257
|
+
"last_updated": "2026-04-07",
|
|
258
|
+
"methods": {
|
|
259
|
+
"sigmoid": {
|
|
260
|
+
"exists": false,
|
|
261
|
+
"removed_in": "2.0.0",
|
|
262
|
+
"reason": "torch.nn.functional.sigmoid deprecated in favor of torch.sigmoid",
|
|
263
|
+
"old_usage": "F.sigmoid(x)",
|
|
264
|
+
"replacement": "torch.sigmoid(x)",
|
|
265
|
+
"replacement_example": "import torch\noutput = torch.sigmoid(input_tensor)",
|
|
266
|
+
"source_note": "Curated API-drift signature for torch 2.x; verify against official migration docs before marking safe_fix."
|
|
267
|
+
},
|
|
268
|
+
"cholesky": {
|
|
269
|
+
"exists": false,
|
|
270
|
+
"removed_in": "2.0.0",
|
|
271
|
+
"reason": "torch.cholesky deprecated — moved to torch.linalg namespace",
|
|
272
|
+
"old_usage": "torch.cholesky(A)",
|
|
273
|
+
"replacement": "torch.linalg.cholesky(A)",
|
|
274
|
+
"replacement_example": "import torch\nL = torch.linalg.cholesky(A)",
|
|
275
|
+
"source_note": "Curated API-drift signature for torch 2.x; verify against official migration docs before marking safe_fix."
|
|
276
|
+
},
|
|
277
|
+
"torch.cuda.amp.autocast": {
|
|
278
|
+
"exists": true,
|
|
279
|
+
"changed_in": "2.4.0",
|
|
280
|
+
"note": "torch.cuda.amp.autocast is deprecated — use torch.amp.autocast('cuda') instead",
|
|
281
|
+
"old_usage": "with torch.cuda.amp.autocast():",
|
|
282
|
+
"replacement": "with torch.amp.autocast('cuda'):",
|
|
283
|
+
"source_note": "Curated API-drift signature for torch 2.x; verify against official migration docs before marking safe_fix."
|
|
284
|
+
},
|
|
285
|
+
"torch.nn.utils.clip_grad_value_": {
|
|
286
|
+
"exists": true,
|
|
287
|
+
"note": "Still exists but foreach parameter added in 2.0 — old code works but misses perf optimization",
|
|
288
|
+
"common_mistake": "Using old single-tensor clip instead of batched foreach=True"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"fastapi": {
|
|
293
|
+
"current_version": "0.115.x",
|
|
294
|
+
"last_updated": "2026-04-07",
|
|
295
|
+
"methods": {
|
|
296
|
+
"on_event": {
|
|
297
|
+
"exists": true,
|
|
298
|
+
"changed_in": "0.93.0",
|
|
299
|
+
"note": "on_event('startup') and on_event('shutdown') are deprecated — use lifespan context managers",
|
|
300
|
+
"old_usage": "@app.on_event('startup')\nasync def startup(): ...",
|
|
301
|
+
"replacement": "@asynccontextmanager\nasync def lifespan(app: FastAPI):\n # startup\n yield\n # shutdown\napp = FastAPI(lifespan=lifespan)",
|
|
302
|
+
"replacement_example": "from contextlib import asynccontextmanager\nfrom fastapi import FastAPI\n\n@asynccontextmanager\nasync def lifespan(app: FastAPI):\n print('Starting up')\n yield\n print('Shutting down')\n\napp = FastAPI(lifespan=lifespan)",
|
|
303
|
+
"source_note": "Curated API-drift signature for fastapi 0.115.x; verify against official migration docs before marking safe_fix."
|
|
304
|
+
},
|
|
305
|
+
"Depends": {
|
|
306
|
+
"exists": true,
|
|
307
|
+
"note": "use_cache parameter default changed — be explicit about caching behavior",
|
|
308
|
+
"common_mistake": "Assuming dependencies are recomputed per-request without use_cache=False"
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"transformers": {
|
|
313
|
+
"current_version": "4.40.x",
|
|
314
|
+
"last_updated": "2026-04-07",
|
|
315
|
+
"methods": {
|
|
316
|
+
"per_gpu_train_batch_size": {
|
|
317
|
+
"exists": false,
|
|
318
|
+
"removed_in": "4.30.0",
|
|
319
|
+
"reason": "Deprecated in favor of per_device_train_batch_size — per-GPU sizing replaced by per-device",
|
|
320
|
+
"old_usage": "TrainingArguments(per_gpu_train_batch_size=8)",
|
|
321
|
+
"replacement": "TrainingArguments(per_device_train_batch_size=8)",
|
|
322
|
+
"source_note": "Curated API-drift signature for transformers 4.40.x; verify against official migration docs before marking safe_fix."
|
|
323
|
+
},
|
|
324
|
+
"AutoModelForCausalLM.from_pretrained": {
|
|
325
|
+
"exists": true,
|
|
326
|
+
"changed_in": "4.36.0",
|
|
327
|
+
"note": "device_map parameter behavior changed — 'auto' now requires accelerate installed",
|
|
328
|
+
"common_mistake": "Using device_map='auto' without pip install accelerate",
|
|
329
|
+
"old_usage": "model = AutoModelForCausalLM.from_pretrained('model', device_map='auto')",
|
|
330
|
+
"replacement": "pip install accelerate first, then model = AutoModelForCausalLM.from_pretrained('model', device_map='auto')",
|
|
331
|
+
"source_note": "Curated API-drift signature for transformers 4.40.x; verify against official migration docs before marking safe_fix."
|
|
332
|
+
},
|
|
333
|
+
"pipeline": {
|
|
334
|
+
"exists": true,
|
|
335
|
+
"changed_in": "4.36.0",
|
|
336
|
+
"note": "pipeline task parameter must match model architecture — LLMs commonly generate wrong task strings",
|
|
337
|
+
"common_mistake": "Using pipeline('text-generation', model='bert-base-uncased') — BERT is not a text generation model",
|
|
338
|
+
"correct_usage": "pipeline('fill-mask', model='bert-base-uncased') or pipeline('text-generation', model='gpt2')",
|
|
339
|
+
"source_note": "Curated API-drift signature for transformers 4.40.x; verify against official migration docs before marking safe_fix."
|
|
340
|
+
},
|
|
341
|
+
"AutoTokenizer": {
|
|
342
|
+
"exists": true,
|
|
343
|
+
"note": "AutoTokenizer returns a 'fast' (Rust-backed) tokenizer by default since 4.0. Some models only have slow tokenizers.",
|
|
344
|
+
"common_mistake": "Using AutoTokenizer.from_pretrained('model') and assuming it returns a slow tokenizer — fast tokenizers have different method signatures for offset mapping and encoding internals",
|
|
345
|
+
"old_usage": "tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased')\n# Assumes slow tokenizer behavior",
|
|
346
|
+
"replacement": "tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased', use_fast=False) # if you need slow tokenizer\n# or handle both: tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') # fast by default"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
"llama_index": {
|
|
351
|
+
"current_version": "0.10.x",
|
|
352
|
+
"last_updated": "2026-04-07",
|
|
353
|
+
"methods": {
|
|
354
|
+
"GPTSimpleVectorIndex": {
|
|
355
|
+
"exists": false,
|
|
356
|
+
"removed_in": "0.10.0",
|
|
357
|
+
"removed_date": "2024-02-15",
|
|
358
|
+
"reason": "Complete package restructure — all index classes moved and renamed",
|
|
359
|
+
"old_import": "from llama_index import GPTSimpleVectorIndex",
|
|
360
|
+
"replacement": "from llama_index.core import VectorStoreIndex",
|
|
361
|
+
"replacement_example": "from llama_index.core import VectorStoreIndex, SimpleDirectoryReader\ndocs = SimpleDirectoryReader('data').load_data()\nindex = VectorStoreIndex.from_documents(docs)",
|
|
362
|
+
"source_note": "Curated API-drift signature for llama_index 0.10.x; verify against official migration docs before marking safe_fix."
|
|
363
|
+
},
|
|
364
|
+
"ServiceContext": {
|
|
365
|
+
"exists": false,
|
|
366
|
+
"removed_in": "0.10.0",
|
|
367
|
+
"removed_date": "2024-02-15",
|
|
368
|
+
"reason": "Replaced by Settings global configuration object",
|
|
369
|
+
"old_import": "from llama_index import ServiceContext",
|
|
370
|
+
"replacement": "from llama_index.core import Settings",
|
|
371
|
+
"replacement_example": "from llama_index.core import Settings\nfrom llama_index.llms.openai import OpenAI\nSettings.llm = OpenAI(model='gpt-4o-mini')",
|
|
372
|
+
"source_note": "Curated API-drift signature for llama_index 0.10.x; verify against official migration docs before marking safe_fix."
|
|
373
|
+
},
|
|
374
|
+
"LLMPredictor": {
|
|
375
|
+
"exists": false,
|
|
376
|
+
"removed_in": "0.10.0",
|
|
377
|
+
"removed_date": "2024-02-15",
|
|
378
|
+
"reason": "Removed entirely — use Settings.llm directly",
|
|
379
|
+
"old_import": "from llama_index import LLMPredictor",
|
|
380
|
+
"replacement": "from llama_index.core import Settings",
|
|
381
|
+
"source_note": "Curated API-drift signature for llama_index 0.10.x; verify against official migration docs before marking safe_fix."
|
|
382
|
+
},
|
|
383
|
+
"SimpleDirectoryReader": {
|
|
384
|
+
"exists": true,
|
|
385
|
+
"module_current": "llama_index.core",
|
|
386
|
+
"module_old": "llama_index",
|
|
387
|
+
"changed_in": "0.10.0",
|
|
388
|
+
"old_import": "from llama_index import SimpleDirectoryReader",
|
|
389
|
+
"new_import": "from llama_index.core import SimpleDirectoryReader",
|
|
390
|
+
"source_note": "Curated API-drift signature for llama_index 0.10.x; verify against official migration docs before marking safe_fix."
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
"crewai": {
|
|
395
|
+
"current_version": "0.80.x",
|
|
396
|
+
"last_updated": "2026-04-07",
|
|
397
|
+
"methods": {
|
|
398
|
+
"Task.output": {
|
|
399
|
+
"exists": false,
|
|
400
|
+
"removed_in": "0.28.0",
|
|
401
|
+
"reason": "Task output handling restructured — use TaskOutput object from crew.kickoff()",
|
|
402
|
+
"old_usage": "task.output",
|
|
403
|
+
"replacement": "Access via crew.kickoff().raw or crew.kickoff().pydantic",
|
|
404
|
+
"replacement_example": "result = crew.kickoff()\nprint(result.raw)",
|
|
405
|
+
"source_note": "Curated API-drift signature for crewai 0.80.x; verify against official migration docs before marking safe_fix."
|
|
406
|
+
},
|
|
407
|
+
"Process.sequential": {
|
|
408
|
+
"exists": true,
|
|
409
|
+
"note": "Import unchanged but process behavior changed in 0.30.0 — tasks no longer auto-share context",
|
|
410
|
+
"old_import": "from crewai import Process",
|
|
411
|
+
"new_import": "from crewai import Process",
|
|
412
|
+
"common_mistake": "Old code assumes agents can see each others outputs without explicit context passing"
|
|
413
|
+
},
|
|
414
|
+
"Agent": {
|
|
415
|
+
"exists": true,
|
|
416
|
+
"changed_in": "0.51.0",
|
|
417
|
+
"note": "allow_delegation default changed from True to False in 0.51.0",
|
|
418
|
+
"common_mistake": "Old code assumes agents can delegate by default — must now pass allow_delegation=True explicitly",
|
|
419
|
+
"old_behavior": "Agent(role='...', goal='...', backstory='...') # delegation was True",
|
|
420
|
+
"new_behavior": "Agent(role='...', goal='...', backstory='...', allow_delegation=True)",
|
|
421
|
+
"source_note": "Curated API-drift signature for crewai 0.80.x; verify against official migration docs before marking safe_fix."
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"numpy": {
|
|
426
|
+
"current_version": "2.0.x",
|
|
427
|
+
"last_updated": "2026-04-07",
|
|
428
|
+
"methods": {
|
|
429
|
+
"np.bool": {
|
|
430
|
+
"exists": false,
|
|
431
|
+
"removed_in": "2.0.0",
|
|
432
|
+
"removed_date": "2024-06-16",
|
|
433
|
+
"reason": "Alias for Python built-in bool was removed — deprecated since 1.20",
|
|
434
|
+
"old_usage": "np.bool",
|
|
435
|
+
"replacement": "bool or np.bool_",
|
|
436
|
+
"replacement_example": "arr = np.array([True, False], dtype=bool)",
|
|
437
|
+
"fix_safety": "safe_fix",
|
|
438
|
+
"source_url": "https://numpy.org/doc/stable/release/1.20.0-notes.html#deprecations"
|
|
439
|
+
},
|
|
440
|
+
"np.int": {
|
|
441
|
+
"exists": false,
|
|
442
|
+
"removed_in": "2.0.0",
|
|
443
|
+
"removed_date": "2024-06-16",
|
|
444
|
+
"reason": "Alias for Python built-in int was removed — deprecated since 1.20",
|
|
445
|
+
"old_usage": "np.int",
|
|
446
|
+
"replacement": "int or np.int_",
|
|
447
|
+
"fix_safety": "safe_fix",
|
|
448
|
+
"source_url": "https://numpy.org/doc/stable/release/1.20.0-notes.html#deprecations"
|
|
449
|
+
},
|
|
450
|
+
"np.float": {
|
|
451
|
+
"exists": false,
|
|
452
|
+
"removed_in": "2.0.0",
|
|
453
|
+
"removed_date": "2024-06-16",
|
|
454
|
+
"reason": "Alias for Python built-in float was removed — deprecated since 1.20",
|
|
455
|
+
"old_usage": "np.float",
|
|
456
|
+
"replacement": "float or np.float64",
|
|
457
|
+
"fix_safety": "safe_fix",
|
|
458
|
+
"source_url": "https://numpy.org/doc/stable/release/1.20.0-notes.html#deprecations"
|
|
459
|
+
},
|
|
460
|
+
"np.complex": {
|
|
461
|
+
"exists": false,
|
|
462
|
+
"removed_in": "2.0.0",
|
|
463
|
+
"removed_date": "2024-06-16",
|
|
464
|
+
"reason": "Alias for Python built-in complex was removed",
|
|
465
|
+
"old_usage": "np.complex",
|
|
466
|
+
"replacement": "complex or np.complex128",
|
|
467
|
+
"fix_safety": "safe_fix",
|
|
468
|
+
"source_url": "https://numpy.org/doc/stable/release/1.20.0-notes.html#deprecations"
|
|
469
|
+
},
|
|
470
|
+
"np.object": {
|
|
471
|
+
"exists": false,
|
|
472
|
+
"removed_in": "2.0.0",
|
|
473
|
+
"removed_date": "2024-06-16",
|
|
474
|
+
"reason": "Alias for Python built-in object was removed",
|
|
475
|
+
"old_usage": "np.object",
|
|
476
|
+
"replacement": "object or np.object_",
|
|
477
|
+
"fix_safety": "safe_fix",
|
|
478
|
+
"source_url": "https://numpy.org/doc/stable/release/1.20.0-notes.html#deprecations"
|
|
479
|
+
},
|
|
480
|
+
"np.str": {
|
|
481
|
+
"exists": false,
|
|
482
|
+
"removed_in": "2.0.0",
|
|
483
|
+
"removed_date": "2024-06-16",
|
|
484
|
+
"reason": "Alias for Python built-in str was removed",
|
|
485
|
+
"old_usage": "np.str",
|
|
486
|
+
"replacement": "str or np.str_",
|
|
487
|
+
"fix_safety": "safe_fix",
|
|
488
|
+
"source_url": "https://numpy.org/doc/stable/release/1.20.0-notes.html#deprecations"
|
|
489
|
+
},
|
|
490
|
+
"np.string_": {
|
|
491
|
+
"exists": false,
|
|
492
|
+
"removed_in": "2.0.0",
|
|
493
|
+
"removed_date": "2024-06-16",
|
|
494
|
+
"reason": "np.string_ was renamed to np.bytes_ — the old name was confusing because it referred to byte strings, not unicode strings",
|
|
495
|
+
"old_usage": "np.string_",
|
|
496
|
+
"replacement": "np.bytes_",
|
|
497
|
+
"fix_safety": "safe_fix",
|
|
498
|
+
"source_url": "https://numpy.org/doc/stable/release/2.0.0-notes.html"
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
"sqlalchemy": {
|
|
503
|
+
"current_version": "2.0.x",
|
|
504
|
+
"last_updated": "2026-04-07",
|
|
505
|
+
"methods": {
|
|
506
|
+
"Session.execute": {
|
|
507
|
+
"exists": true,
|
|
508
|
+
"changed_in": "2.0.0",
|
|
509
|
+
"note": "Signature changed — no longer accepts legacy Query objects, requires select() constructs",
|
|
510
|
+
"old_usage": "session.execute(MyModel.__table__.select())",
|
|
511
|
+
"new_usage": "session.execute(select(MyModel))",
|
|
512
|
+
"replacement_example": "from sqlalchemy import select\nresult = session.execute(select(MyModel).where(MyModel.id == 1))",
|
|
513
|
+
"source_note": "Curated API-drift signature for sqlalchemy 2.0.x; verify against official migration docs before marking safe_fix."
|
|
514
|
+
},
|
|
515
|
+
"Query": {
|
|
516
|
+
"exists": false,
|
|
517
|
+
"removed_in": "2.0.0",
|
|
518
|
+
"removed_date": "2023-01-26",
|
|
519
|
+
"reason": "Legacy Query API removed — replaced by select() construct for all queries",
|
|
520
|
+
"old_usage": "session.query(MyModel).filter(MyModel.id == 1).first()",
|
|
521
|
+
"replacement": "session.execute(select(MyModel).where(MyModel.id == 1)).scalar_one_or_none()",
|
|
522
|
+
"replacement_example": "from sqlalchemy import select\nstmt = select(MyModel).where(MyModel.id == 1)\nresult = session.execute(stmt).scalar_one_or_none()",
|
|
523
|
+
"source_note": "Curated API-drift signature for sqlalchemy 2.0.x; verify against official migration docs before marking safe_fix."
|
|
524
|
+
},
|
|
525
|
+
"Engine.execute": {
|
|
526
|
+
"exists": false,
|
|
527
|
+
"removed_in": "2.0.0",
|
|
528
|
+
"removed_date": "2023-01-26",
|
|
529
|
+
"reason": "Removed connectionless execution — use connection context manager",
|
|
530
|
+
"old_usage": "engine.execute('SELECT * FROM table')",
|
|
531
|
+
"replacement": "with engine.connect() as conn:\n result = conn.execute(text('SELECT * FROM table'))",
|
|
532
|
+
"replacement_example": "from sqlalchemy import text\nwith engine.connect() as conn:\n result = conn.execute(text('SELECT * FROM users'))\n rows = result.fetchall()",
|
|
533
|
+
"source_note": "Curated API-drift signature for sqlalchemy 2.0.x; verify against official migration docs before marking safe_fix."
|
|
534
|
+
},
|
|
535
|
+
"declarative_base": {
|
|
536
|
+
"exists": true,
|
|
537
|
+
"changed_in": "2.0.0",
|
|
538
|
+
"removed_date": "2023-01-26",
|
|
539
|
+
"reason": "declarative_base() moved from sqlalchemy.ext.declarative to sqlalchemy.orm; DeclarativeBase is the preferred SQLAlchemy 2.0 style",
|
|
540
|
+
"old_import": "from sqlalchemy.ext.declarative import declarative_base\nBase = declarative_base()",
|
|
541
|
+
"replacement": "from sqlalchemy.orm import declarative_base",
|
|
542
|
+
"fix_safety": "safe_fix",
|
|
543
|
+
"match_exact_only": true,
|
|
544
|
+
"source_note": "Curated API-drift signature for sqlalchemy 2.0.x; verify against official migration docs before marking safe_fix."
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
"anthropic": {
|
|
549
|
+
"current_version": "0.40.x",
|
|
550
|
+
"last_updated": "2026-04-07",
|
|
551
|
+
"methods": {
|
|
552
|
+
"anthropic.Anthropic.completions.create": {
|
|
553
|
+
"exists": false,
|
|
554
|
+
"removed_in": "0.20.0",
|
|
555
|
+
"reason": "Completions API removed entirely — use messages.create for all Claude interactions",
|
|
556
|
+
"old_usage": "client.completions.create(model='claude-2', prompt=prompt, max_tokens=1000)",
|
|
557
|
+
"replacement": "client.messages.create(model='claude-3-5-sonnet-20241022', max_tokens=1000, messages=[{'role': 'user', 'content': prompt}])",
|
|
558
|
+
"replacement_example": "from anthropic import Anthropic\nclient = Anthropic()\nmessage = client.messages.create(\n model='claude-3-5-sonnet-20241022',\n max_tokens=1024,\n messages=[{'role': 'user', 'content': 'Hello'}]\n)",
|
|
559
|
+
"match_names": ["anthropic.completions.create"],
|
|
560
|
+
"match_exact_only": true,
|
|
561
|
+
"source_note": "Curated API-drift signature for anthropic 0.40.x; verify against official migration docs before marking safe_fix."
|
|
562
|
+
},
|
|
563
|
+
"HUMAN_PROMPT": {
|
|
564
|
+
"exists": false,
|
|
565
|
+
"removed_in": "0.20.0",
|
|
566
|
+
"reason": "Special prompt tokens (HUMAN_PROMPT, AI_PROMPT) removed with completions API — messages format handles role separation",
|
|
567
|
+
"old_usage": "f'{HUMAN_PROMPT} Hello {AI_PROMPT}'",
|
|
568
|
+
"replacement": "Use messages list format: [{'role': 'user', 'content': 'Hello'}]",
|
|
569
|
+
"source_note": "Curated API-drift signature for anthropic 0.40.x; verify against official migration docs before marking safe_fix."
|
|
570
|
+
},
|
|
571
|
+
"anthropic.Client": {
|
|
572
|
+
"exists": false,
|
|
573
|
+
"removed_in": "0.20.0",
|
|
574
|
+
"reason": "Old Client class replaced by Anthropic class",
|
|
575
|
+
"old_import": "from anthropic import Client",
|
|
576
|
+
"replacement": "from anthropic import Anthropic",
|
|
577
|
+
"replacement_example": "from anthropic import Anthropic\nclient = Anthropic(api_key='...')",
|
|
578
|
+
"source_note": "Curated API-drift signature for anthropic 0.40.x; verify against official migration docs before marking safe_fix."
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
"langgraph": {
|
|
583
|
+
"current_version": "0.2.x",
|
|
584
|
+
"last_updated": "2026-04-07",
|
|
585
|
+
"methods": {
|
|
586
|
+
"MessageGraph": {
|
|
587
|
+
"exists": false,
|
|
588
|
+
"removed_in": "0.2.0",
|
|
589
|
+
"reason": "Replaced by StateGraph with MessagesState — message-only graphs use the same StateGraph",
|
|
590
|
+
"old_import": "from langgraph.graph import MessageGraph",
|
|
591
|
+
"replacement": "from langgraph.graph import StateGraph\nfrom langgraph.graph.message import MessagesState",
|
|
592
|
+
"replacement_example": "from langgraph.graph import StateGraph\nfrom langgraph.graph.message import MessagesState\ngraph = StateGraph(MessagesState)",
|
|
593
|
+
"source_note": "Curated API-drift signature for langgraph 0.2.x; verify against official migration docs before marking safe_fix."
|
|
594
|
+
},
|
|
595
|
+
"langgraph.checkpoint.MemorySaver": {
|
|
596
|
+
"exists": true,
|
|
597
|
+
"changed_in": "0.2.0",
|
|
598
|
+
"note": "MemorySaver import path changed from langgraph.checkpoint to langgraph.checkpoint.memory; graph.compile() itself is still valid.",
|
|
599
|
+
"old_import": "from langgraph.checkpoint import MemorySaver",
|
|
600
|
+
"new_import": "from langgraph.checkpoint.memory import MemorySaver",
|
|
601
|
+
"match_exact_only": true,
|
|
602
|
+
"source_url": "https://reference.langchain.com/python/langgraph.checkpoint/memory/MemorySaver"
|
|
603
|
+
},
|
|
604
|
+
"END": {
|
|
605
|
+
"exists": true,
|
|
606
|
+
"module_current": "langgraph.graph",
|
|
607
|
+
"note": "Still exists but must be imported explicitly — not a global constant",
|
|
608
|
+
"common_mistake": "Using END without importing it from langgraph.graph",
|
|
609
|
+
"correct_import": "from langgraph.graph import StateGraph, END"
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
"pinecone": {
|
|
614
|
+
"current_version": "3.x",
|
|
615
|
+
"last_updated": "2026-04-07",
|
|
616
|
+
"methods": {
|
|
617
|
+
"pinecone.init": {
|
|
618
|
+
"exists": false,
|
|
619
|
+
"removed_in": "3.0.0",
|
|
620
|
+
"removed_date": "2024-01-15",
|
|
621
|
+
"reason": "Global init pattern removed — use Pinecone client class with explicit credentials",
|
|
622
|
+
"old_usage": "import pinecone\npinecone.init(api_key='...', environment='...')",
|
|
623
|
+
"replacement": "from pinecone import Pinecone\npc = Pinecone(api_key='...')",
|
|
624
|
+
"replacement_example": "from pinecone import Pinecone\npc = Pinecone(api_key='your-key')\nindex = pc.Index('my-index')",
|
|
625
|
+
"source_url": "https://docs.pinecone.io/reference/python-sdk"
|
|
626
|
+
},
|
|
627
|
+
"pinecone.create_index": {
|
|
628
|
+
"exists": false,
|
|
629
|
+
"removed_in": "3.0.0",
|
|
630
|
+
"removed_date": "2024-01-15",
|
|
631
|
+
"reason": "Module-level functions removed — use client instance methods with ServerlessSpec",
|
|
632
|
+
"old_usage": "pinecone.create_index('index-name', dimension=1536)",
|
|
633
|
+
"replacement": "pc.create_index(name='index-name', dimension=1536, spec=ServerlessSpec(cloud='aws', region='us-east-1'))",
|
|
634
|
+
"replacement_example": "from pinecone import Pinecone, ServerlessSpec\npc = Pinecone(api_key='...')\npc.create_index(\n name='my-index',\n dimension=1536,\n spec=ServerlessSpec(cloud='aws', region='us-east-1')\n)",
|
|
635
|
+
"source_url": "https://docs.pinecone.io/reference/python-sdk"
|
|
636
|
+
},
|
|
637
|
+
"pinecone.Index": {
|
|
638
|
+
"exists": false,
|
|
639
|
+
"removed_in": "3.0.0",
|
|
640
|
+
"removed_date": "2024-01-15",
|
|
641
|
+
"reason": "Module-level class access removed — must go through client instance",
|
|
642
|
+
"old_usage": "index = pinecone.Index('index-name')",
|
|
643
|
+
"replacement": "index = pc.Index('index-name')",
|
|
644
|
+
"source_url": "https://docs.pinecone.io/reference/python-sdk"
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
"chromadb": {
|
|
649
|
+
"current_version": "0.4.x",
|
|
650
|
+
"last_updated": "2026-04-07",
|
|
651
|
+
"methods": {
|
|
652
|
+
"Client": {
|
|
653
|
+
"exists": false,
|
|
654
|
+
"removed_in": "0.4.0",
|
|
655
|
+
"reason": "Generic Client removed — must use specific EphemeralClient (in-memory) or PersistentClient (disk) or HttpClient (server)",
|
|
656
|
+
"old_import": "import chromadb\nclient = chromadb.Client()",
|
|
657
|
+
"replacement": "import chromadb\nclient = chromadb.PersistentClient(path='./chroma_db')",
|
|
658
|
+
"replacement_example": "import chromadb\n# For persistent storage:\nclient = chromadb.PersistentClient(path='./chroma_db')\n# For in-memory testing:\nclient = chromadb.EphemeralClient()\n# For remote server:\nclient = chromadb.HttpClient(host='localhost', port=8000)",
|
|
659
|
+
"source_note": "Curated API-drift signature for chromadb 0.4.x; verify against official migration docs before marking safe_fix."
|
|
660
|
+
},
|
|
661
|
+
"Settings": {
|
|
662
|
+
"exists": true,
|
|
663
|
+
"changed_in": "0.4.0",
|
|
664
|
+
"note": "Settings class restructured — chroma_db_impl was removed from common persistent-client setup",
|
|
665
|
+
"old_usage": "chromadb.Client(Settings(chroma_db_impl='duckdb+parquet', persist_directory='./db'))",
|
|
666
|
+
"replacement": "chromadb.PersistentClient(path='./db')",
|
|
667
|
+
"required_keywords": ["chroma_db_impl"],
|
|
668
|
+
"source_note": "Curated API-drift signature for chromadb 0.4.x; verify against official migration docs before marking safe_fix."
|
|
669
|
+
},
|
|
670
|
+
"Collection.add": {
|
|
671
|
+
"exists": true,
|
|
672
|
+
"changed_in": "0.4.0",
|
|
673
|
+
"note": "embeddings parameter renamed in some contexts — ensure using current parameter names",
|
|
674
|
+
"common_mistake": "Passing positional arguments instead of keyword arguments",
|
|
675
|
+
"source_note": "Curated API-drift signature for chromadb 0.4.x; verify against official migration docs before marking safe_fix."
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
"keras": {
|
|
680
|
+
"current_version": "3.x",
|
|
681
|
+
"last_updated": "2026-04-07",
|
|
682
|
+
"methods": {
|
|
683
|
+
"tensorflow.keras": {
|
|
684
|
+
"exists": false,
|
|
685
|
+
"removed_in": "3.0.0",
|
|
686
|
+
"removed_date": "2024-03-11",
|
|
687
|
+
"reason": "Keras 3.0 is backend-agnostic — standalone package, no longer coupled to TensorFlow",
|
|
688
|
+
"old_import": "from tensorflow.keras.models import Sequential",
|
|
689
|
+
"replacement": "from keras.models import Sequential",
|
|
690
|
+
"replacement_example": "import keras\nfrom keras import layers\nmodel = keras.Sequential([\n layers.Dense(64, activation='relu'),\n layers.Dense(10, activation='softmax')\n])",
|
|
691
|
+
"source_note": "Curated API-drift signature for keras 3.x; verify against official migration docs before marking safe_fix."
|
|
692
|
+
},
|
|
693
|
+
"keras.optimizers.Adam": {
|
|
694
|
+
"exists": true,
|
|
695
|
+
"changed_in": "3.0.0",
|
|
696
|
+
"note": "Optimizer import path simplified — use keras.optimizers directly",
|
|
697
|
+
"old_import": "from tensorflow.keras.optimizers import Adam",
|
|
698
|
+
"new_import": "from keras.optimizers import Adam",
|
|
699
|
+
"source_note": "Curated API-drift signature for keras 3.x; verify against official migration docs before marking safe_fix."
|
|
700
|
+
},
|
|
701
|
+
"model.fit_generator": {
|
|
702
|
+
"exists": false,
|
|
703
|
+
"removed_in": "3.0.0",
|
|
704
|
+
"reason": "fit_generator removed — use model.fit which now accepts generators natively",
|
|
705
|
+
"old_usage": "model.fit_generator(generator, steps_per_epoch=100)",
|
|
706
|
+
"replacement": "model.fit(generator, steps_per_epoch=100)",
|
|
707
|
+
"source_note": "Curated API-drift signature for keras 3.x; verify against official migration docs before marking safe_fix."
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
"motor": {
|
|
712
|
+
"current_version": "3.x",
|
|
713
|
+
"last_updated": "2026-04-07",
|
|
714
|
+
"methods": {
|
|
715
|
+
"MotorClient": {
|
|
716
|
+
"exists": true,
|
|
717
|
+
"reason": "Motor wraps PyMongo for async usage — every database operation returns a coroutine that must be awaited",
|
|
718
|
+
"note": "Requires asyncio event loop — every database operation returns a coroutine",
|
|
719
|
+
"common_mistake": "Mixing synchronous PyMongo calls inside async structures causes event loop blocking or timeout bugs",
|
|
720
|
+
"old_import": "from motor.motor_asyncio import AsyncIOMotorClient",
|
|
721
|
+
"replacement_example": "from motor.motor_asyncio import AsyncIOMotorClient\nclient = AsyncIOMotorClient('mongodb://localhost:27017')\ndb = client.mydb\n# ALL operations must be awaited:\ndoc = await db.collection.find_one({'key': 'value'})"
|
|
722
|
+
},
|
|
723
|
+
"motor.motor_asyncio.AsyncIOMotorClient": {
|
|
724
|
+
"exists": true,
|
|
725
|
+
"reason": "The canonical async MongoDB client — import path is stable across Motor 3.x",
|
|
726
|
+
"note": "Import path is stable but ALL operations must be awaited",
|
|
727
|
+
"common_mistake": "Forgetting to await find(), insert_one(), etc. — returns coroutine object instead of result",
|
|
728
|
+
"old_usage": "doc = db.collection.find_one({'key': 'value'}) # BUG: missing await",
|
|
729
|
+
"replacement": "doc = await db.collection.find_one({'key': 'value'})",
|
|
730
|
+
"replacement_example": "import asyncio\nfrom motor.motor_asyncio import AsyncIOMotorClient\n\nasync def main():\n client = AsyncIOMotorClient('mongodb://localhost:27017')\n db = client.test_db\n await db.collection.insert_one({'name': 'test'})\n doc = await db.collection.find_one({'name': 'test'})\n print(doc)\n\nasyncio.run(main())"
|
|
731
|
+
},
|
|
732
|
+
"pymongo.MongoClient": {
|
|
733
|
+
"exists": true,
|
|
734
|
+
"reason": "PyMongo is the synchronous MongoDB driver — commonly confused with Motor in async contexts",
|
|
735
|
+
"note": "PyMongo is synchronous — do NOT use inside async frameworks like FastAPI/aiohttp",
|
|
736
|
+
"common_mistake": "Using pymongo.MongoClient inside FastAPI endpoints blocks the event loop — causes timeouts under concurrent load",
|
|
737
|
+
"old_usage": "from pymongo import MongoClient\nclient = MongoClient('mongodb://localhost:27017')\n# Inside a FastAPI async endpoint — BLOCKS",
|
|
738
|
+
"replacement": "from motor.motor_asyncio import AsyncIOMotorClient\nclient = AsyncIOMotorClient('mongodb://localhost:27017')",
|
|
739
|
+
"replacement_example": "# WRONG — blocks event loop in FastAPI:\nfrom pymongo import MongoClient\nclient = MongoClient()\n\n# CORRECT — async-safe:\nfrom motor.motor_asyncio import AsyncIOMotorClient\nclient = AsyncIOMotorClient()"
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
"tensorflow": {
|
|
744
|
+
"current_version": "2.16.x",
|
|
745
|
+
"last_updated": "2026-04-07",
|
|
746
|
+
"methods": {
|
|
747
|
+
"tf.Session": {
|
|
748
|
+
"exists": false,
|
|
749
|
+
"removed_in": "2.0.0",
|
|
750
|
+
"removed_date": "2019-09-30",
|
|
751
|
+
"reason": "TF2 uses eager execution by default — Sessions are no longer needed",
|
|
752
|
+
"old_usage": "sess = tf.Session()\nsess.run(result)",
|
|
753
|
+
"replacement": "# Just call the operation directly — eager execution\nresult = my_operation(inputs)",
|
|
754
|
+
"source_note": "Curated API-drift signature for tensorflow 2.16.x; verify against official migration docs before marking safe_fix."
|
|
755
|
+
},
|
|
756
|
+
"tf.placeholder": {
|
|
757
|
+
"exists": false,
|
|
758
|
+
"removed_in": "2.0.0",
|
|
759
|
+
"removed_date": "2019-09-30",
|
|
760
|
+
"reason": "Placeholders removed — use tf.function with input signatures or Keras Input layers",
|
|
761
|
+
"old_usage": "x = tf.placeholder(tf.float32, shape=[None, 784])",
|
|
762
|
+
"replacement": "Use keras.Input(shape=(784,)) or tf.function arguments",
|
|
763
|
+
"source_note": "Curated API-drift signature for tensorflow 2.16.x; verify against official migration docs before marking safe_fix."
|
|
764
|
+
},
|
|
765
|
+
"tf.contrib": {
|
|
766
|
+
"exists": false,
|
|
767
|
+
"removed_in": "2.0.0",
|
|
768
|
+
"removed_date": "2019-09-30",
|
|
769
|
+
"reason": "Entire tf.contrib namespace removed — functions moved to core TF, TF Addons, or removed entirely",
|
|
770
|
+
"old_import": "from tensorflow.contrib import layers",
|
|
771
|
+
"replacement": "from tensorflow.keras import layers",
|
|
772
|
+
"source_note": "Curated API-drift signature for tensorflow 2.16.x; verify against official migration docs before marking safe_fix."
|
|
773
|
+
},
|
|
774
|
+
"tf.compat.v1": {
|
|
775
|
+
"exists": true,
|
|
776
|
+
"note": "Compatibility module still exists but signals TF1 code — should be migrated to TF2 native",
|
|
777
|
+
"common_mistake": "Using tf.compat.v1.disable_eager_execution() as a permanent fix instead of migrating"
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
"scipy": {
|
|
782
|
+
"current_version": "1.14.x",
|
|
783
|
+
"last_updated": "2026-04-07",
|
|
784
|
+
"methods": {
|
|
785
|
+
"scipy.misc.imread": {
|
|
786
|
+
"exists": false,
|
|
787
|
+
"removed_in": "1.3.0",
|
|
788
|
+
"removed_date": "2019-05-17",
|
|
789
|
+
"reason": "Image IO functions removed from scipy — use imageio or PIL instead",
|
|
790
|
+
"old_import": "from scipy.misc import imread",
|
|
791
|
+
"replacement": "from imageio import imread",
|
|
792
|
+
"replacement_example": "import imageio.v3 as iio\nimage = iio.imread('image.png')",
|
|
793
|
+
"source_note": "Curated API-drift signature for scipy 1.14.x; verify against official migration docs before marking safe_fix."
|
|
794
|
+
},
|
|
795
|
+
"scipy.misc.imsave": {
|
|
796
|
+
"exists": false,
|
|
797
|
+
"removed_in": "1.3.0",
|
|
798
|
+
"reason": "Image IO functions removed — use imageio or PIL",
|
|
799
|
+
"old_import": "from scipy.misc import imsave",
|
|
800
|
+
"replacement": "from imageio import imwrite",
|
|
801
|
+
"source_note": "Curated API-drift signature for scipy 1.14.x; verify against official migration docs before marking safe_fix."
|
|
802
|
+
},
|
|
803
|
+
"scipy.misc.imresize": {
|
|
804
|
+
"exists": false,
|
|
805
|
+
"removed_in": "1.3.0",
|
|
806
|
+
"reason": "Image resize removed — use PIL or skimage",
|
|
807
|
+
"old_import": "from scipy.misc import imresize",
|
|
808
|
+
"replacement": "from PIL import Image; img.resize((w, h))",
|
|
809
|
+
"source_note": "Curated API-drift signature for scipy 1.14.x; verify against official migration docs before marking safe_fix."
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
"weaviate": {
|
|
814
|
+
"current_version": "4.x",
|
|
815
|
+
"last_updated": "2026-05-12",
|
|
816
|
+
"methods": {
|
|
817
|
+
"weaviate.Client": {
|
|
818
|
+
"exists": false,
|
|
819
|
+
"removed_in": "4.0.0",
|
|
820
|
+
"reason": "Weaviate Python client v4 replaced the old v3 Client construction flow with explicit connection helpers and the WeaviateClient class.",
|
|
821
|
+
"old_usage": "client = weaviate.Client(\"http://localhost:8080\")",
|
|
822
|
+
"replacement": "weaviate.connect_to_local() or weaviate.connect_to_weaviate_cloud(...)",
|
|
823
|
+
"replacement_example": "import weaviate\nclient = weaviate.connect_to_local()",
|
|
824
|
+
"source_url": "https://weaviate.io/developers/weaviate/client-libraries/python"
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
"qdrant_client": {
|
|
829
|
+
"current_version": "1.x",
|
|
830
|
+
"last_updated": "2026-05-12",
|
|
831
|
+
"methods": {
|
|
832
|
+
"recreate_collection": {
|
|
833
|
+
"exists": true,
|
|
834
|
+
"changed_in": "1.x",
|
|
835
|
+
"note": "recreate_collection is discouraged for production migrations because it deletes existing collections before creating them; explicit existence checks, delete, and create calls are safer.",
|
|
836
|
+
"old_usage": "client.recreate_collection(collection_name=\"docs\", vectors_config=...)",
|
|
837
|
+
"replacement": "if client.collection_exists(name): client.delete_collection(name); client.create_collection(...)",
|
|
838
|
+
"source_url": "https://python-client.qdrant.tech/"
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|