Dataset Viewer
Auto-converted to Parquet
instance_id
stringclasses
7 values
memory_items
dict
django__django-11477
{ "memory_items": [ { "title": "Align Patch Scope with Failure Point", "description": "Ensure modifications target the exact function causing test failures.", "content": "Read the stack trace to pinpoint the code path (e.g., the match() method in resolvers.py) and apply the fix there, rather than altering unrelated modules or utilities." }, { "title": "Filter None Values in Keyword Arguments", "description": "Omit kwargs whose value is None when building URLs.", "content": "Use a dictionary comprehension to drop None entries from match.groupdict(), preventing placeholder strings like \"None\" from appearing in generated URLs and satisfying translation tests." }, { "title": "Minimize Unrelated Changes in Bug Fixes", "description": "Avoid adding or modifying files that are not directly related to the bug.", "content": "Keep patches focused on the problematic code; extraneous additions (e.g., test settings, conftest) can introduce side effects and distract from the core functionality needed to pass tests." } ] }
django__django-13158
{ "memory_items": [ { "title": "Deep copy mutable collections in clone methods", "description": "Clone must duplicate internal mutable structures to avoid shared state.", "content": "When overriding a clone method, explicitly copy every mutable attribute (e.g., lists, tuples) such as combined_queries using a fresh tuple or list comprehension. Failing to deep鈥慶opy these leads to shared references that cause stale data to appear in new objects, breaking tests that rely on isolation." }, { "title": "Propagate state changes to nested query objects", "description": "Methods that modify a query's state must also affect its combined sub鈥憅ueries.", "content": "Operations like set_empty should iterate over any combined_queries and invoke the same state鈥憆eset on each. Neglecting this propagation leaves sub鈥憅ueries populated, resulting in unexpected results (e.g., a union鈥憂one query still returning rows)." }, { "title": "Use the golden patch as a checklist for required modifications", "description": "Verify generated patches against the reference implementation to ensure all needed changes are present.", "content": "Cross鈥慶hecking with the golden patch helps identify missing lines (e.g., handling of combined_queries in clone and set_empty). Treat the reference diff as a checklist so that no essential functionality is omitted in future patch attempts." } ] }
django__django-13297
{ "memory_items": [ { "title": "Consistent Replacement of Lazy Wrappers", "description": "Replace SimpleLazyObject with lazy at the import and decorator level, not by post鈥憄rocessing kwargs.", "content": "When a framework changes its lazy鈥慹valuation API, the fix must modify the original import (`from django.utils.functional import lazy`) and remove the `@SimpleLazyObject` decorator. Adding ad鈥慼oc code that iterates over `kwargs` and forces evaluation leaves `SimpleLazyObject` instances in the context, causing type errors in queries and failing tests." }, { "title": "Use lazy() to Produce Plain Values", "description": "Assign context values using `lazy(access_value, type(value))()` so they resolve to plain objects before use.", "content": "The correct pattern wraps the accessor with `lazy` and immediately calls it, yielding a value of the expected type. This prevents unsupported鈥憈ype errors when the value is passed to the ORM and ensures the context behaves like the original implementation." }, { "title": "Preserve Expected Warning Behavior", "description": "Do not swallow or alter deprecation warnings while fixing lazy evaluation.", "content": "The original code emits a `RemovedInDjango40Warning` when URL kwargs are added to the context. Introducing custom resolution logic that catches or re鈥憆aises these warnings can change the exception flow, leading to `TypeError` or missing warnings in tests. Keep the warning path intact and let Django鈥檚 lazy wrapper handle it." } ] }
django__django-14034
{ "memory_items": [ { "title": "Target the Correct Module for the Desired Behavior", "description": "Patch changes must be applied to the component that actually implements the feature in question.", "content": "When a bug concerns HTML attribute handling in a bound field, modify the boundfield module rather than the field's validation logic. Misplacing changes leads to missed functionality and wasted effort." }, { "title": "Preserve Existing Control Flow While Extending Logic", "description": "Add new behavior without disrupting the original decision paths.", "content": "Introduce conditional handling (e.g., for MultiWidget subwidgets) inside the existing required鈥慳ttribute block, keeping the original `attrs['required'] = True` path intact for other cases. This avoids breaking established behavior and ensures backward compatibility." }, { "title": "Synchronize Import Statements with New Dependencies", "description": "Any new class used in a patch must be imported in the file where it is referenced.", "content": "If the fix requires `MultiWidget`, add the import to the same module (boundfield) rather than elsewhere. Missing imports cause runtime errors and prevent the intended logic from executing." } ] }
django__django-14170
{ "memory_items": [ { "title": "Modify Core Backend Operations for New Lookup Features", "description": "When adding support for a new lookup (e.g., ISO year), update the low鈥憀evel backend methods that compute bounds, not just the high鈥憀evel Lookup class.", "content": "Tests that depend on correct date boundaries will fail if the backend鈥檚 `year_lookup_bounds_for_date_field` and `year_lookup_bounds_for_datetime_field` aren鈥檛 extended to handle the new flag. Ensure the patch adds the `iso_year` parameter and the corresponding logic in those methods." }, { "title": "Detect and Propagate Contextual Flags Correctly", "description": "Identify the specific lookup type (e.g., `ExtractIsoYear`) and pass a flag through the lookup chain to the backend.", "content": "The generated patch added a bypass but never set the `iso_year` flag, so the backend kept using Gregorian bounds. Implement a reliable detection (e.g., `isinstance(self.lhs, ExtractIsoYear)`) and forward `iso_year=True` to the backend functions." }, { "title": "Keep Patches Focused and Avoid Unrelated File Changes", "description": "Introduce changes only in files directly related to the requested functionality.", "content": "Modifying unrelated modules (like adding permission checks in `filesystem.py`) can introduce side effects and distract from the core fix. Limit edits to the lookup and backend files to maintain clarity and reduce regression risk." } ] }
django__django-15252
{ "memory_items": [ { "title": "Focus on Core Requirement, Not Side Features", "description": "Patch changes must directly address the primary functionality the test expects.", "content": "When a test asserts that a specific method (e.g., `ensure_schema`) should not be called under certain conditions, the fix should implement the early鈥慹xit logic that skips that call. Adding unrelated features鈥攕uch as router checks鈥攃an cause the test to fail because the core behavior remains unchanged." }, { "title": "Respect Mock Expectations in Conditional Paths", "description": "Introduce conditionals that keep mocked methods from being invoked when they shouldn't be.", "content": "Tests often use mocks to verify that a method is *not* called. Any new code must preserve the original call pattern, adding early returns or guard clauses before the mocked method is reached. Failing to do so triggers assertion errors like \"Expected 'ensure_schema' to not have been called\"." }, { "title": "Prefer Minimal, Non鈥慖ntrusive Changes", "description": "Modify the code just enough to satisfy the test without altering unrelated logic.", "content": "Introduce the necessary early鈥憆eturn (e.g., when the migration plan is empty and the table already exists) while keeping existing functionality intact. This avoids side effects, maintains compatibility with other parts of the system, and reduces the risk of breaking unrelated tests." } ] }
django__django-15957
{ "memory_items": [ { "title": "Respect Read鈥慜nly Framework Attributes", "description": "Do not assign to properties that are defined as read鈥憃nly in the library.", "content": "When extending Django internals, use the public API (e.g., `clear_limits()`) instead of directly setting attributes like `is_sliced`, which raises an `AttributeError`. Understanding the intended mutability of objects prevents runtime failures." }, { "title": "Preserve Slice Semantics with Proper Query Constructs", "description": "Handle sliced querysets by translating limits into window鈥慺unction predicates rather than simply clearing them.", "content": "A robust Prefetch implementation must keep the original slice information. Using `Window`, `RowNumber`, and appropriate lookups (`GreaterThan`, `LessThanOrEqual`) allows the prefetch query to respect low/high marks while still being filterable, matching the behavior of the golden patch." }, { "title": "Limit Patch Scope to Relevant Files", "description": "Avoid modifying unrelated modules, as they can introduce unrelated bugs.", "content": "Changes to files like `django/template/loaders/filesystem.py` were unnecessary and potentially harmful. Keeping modifications confined to the target functionality reduces risk of side鈥慹ffects and makes the patch easier to review and maintain." } ] }

No dataset card yet

Downloads last month
13