diff --git "a/data/test.jsonl" "b/data/test.jsonl" --- "a/data/test.jsonl" +++ "b/data/test.jsonl" @@ -33,7 +33,6 @@ {"repo": "astral-sh/uv", "buggy_commit": "e4c55567ada966de4911513b5c526070e6cddd3f", "bug_issue": 22966, "solve_pr": 22977, "call_graph": {"nodes": [{"id": "crates/uv-trampoline/src/bounce.rs::bounce"}, {"id": "crates/uv-trampoline/src/bounce.rs::close_handles"}], "edges": [{"source": "crates/uv-trampoline/src/bounce.rs::bounce", "target": "crates/uv-trampoline/src/bounce.rs::close_handles"}]}, "graph_spec": "`bounce` provides the execution entry point for a Windows trampoline, an executable launcher that delegates to Python to run a script or serve as a Python proxy; its interface distinguishes console and GUI use and does not return. The supplied `close_handles` node has no declaration or documentation in the current repository, so its responsibility and relationship to `bounce` cannot be established from the permitted sources."} {"repo": "astropy/astropy", "buggy_commit": "c3319952ebd2a9d4969f6dfb84fc61c84a240cbd", "bug_issue": 13009, "solve_pr": 13033, "call_graph": {"nodes": [{"id": "astropy/timeseries/core.py::BaseTimeSeries::_check_required_columns"}, {"id": "astropy/timeseries/core.py::BaseTimeSeries::_delay_required_column_checks"}], "edges": [{"source": "astropy/timeseries/core.py::BaseTimeSeries::_delay_required_column_checks", "target": "astropy/timeseries/core.py::BaseTimeSeries::_check_required_columns"}]}, "graph_spec": "Astropy time series are tables that associate measurements with observation times or time bins through dedicated time-related columns. Within BaseTimeSeries, _check_required_columns supports consistency with required-column contracts, while _delay_required_column_checks provides a context for deferring that validation during table changes."} {"repo": "astropy/astropy", "buggy_commit": "6ed769d58d89380ebaa1ef52b300691eefda8928", "bug_issue": 13235, "solve_pr": 13236, "call_graph": {"nodes": [{"id": "astropy/table/table.py::Table::__setitem__"}, {"id": "astropy/table/table.py::Table::_convert_data_to_col"}, {"id": "astropy/table/table.py::Table::_init_from_list"}, {"id": "astropy/table/table.py::Table::_init_from_ndarray"}, {"id": "astropy/table/table.py::Table::_replace_column_warnings"}, {"id": "astropy/table/table.py::Table::add_column"}, {"id": "astropy/table/table.py::Table::add_columns"}, {"id": "astropy/table/table.py::Table::replace_column"}], "edges": [{"source": "astropy/table/table.py::Table::__setitem__", "target": "astropy/table/table.py::Table::_replace_column_warnings"}, {"source": "astropy/table/table.py::Table::__setitem__", "target": "astropy/table/table.py::Table::add_column"}, {"source": "astropy/table/table.py::Table::_init_from_list", "target": "astropy/table/table.py::Table::_convert_data_to_col"}, {"source": "astropy/table/table.py::Table::_init_from_ndarray", "target": "astropy/table/table.py::Table::_init_from_list"}, {"source": "astropy/table/table.py::Table::_replace_column_warnings", "target": "astropy/table/table.py::Table::replace_column"}, {"source": "astropy/table/table.py::Table::add_column", "target": "astropy/table/table.py::Table::_convert_data_to_col"}, {"source": "astropy/table/table.py::Table::add_columns", "target": "astropy/table/table.py::Table::add_column"}, {"source": "astropy/table/table.py::Table::replace_column", "target": "astropy/table/table.py::Table::_convert_data_to_col"}]}, "graph_spec": "These functions support constructing and modifying Astropy tables, which organize heterogeneous data into named columns with associated metadata. They initialize tables from column lists or NumPy arrays, convert column-like data into supported column objects, and provide assignment, single-column and multiple-column addition, and column replacement. The scoped replacement wrapper also provides warnings associated with column replacement."} -{"repo": "astropy/astropy", "buggy_commit": "19cc80471739bcb67b7e8099246b391c355023ee", "bug_issue": 13451, "solve_pr": 13453, "call_graph": {"nodes": [{"id": "astropy/io/ascii/html.py::HTML::write"}], "edges": []}, "graph_spec": "HTML.write must reject tables whose column dimensionality exceeds the format’s supported two dimensions, then return a single complete HTML document string containing UTF-8 metadata, a table header, and one data row per input row. Header names and cell text are emitted after trimming; configured fill-value and column-format processing must be reflected in every cell. A two-dimensional column is represented, when multicolumn output is enabled, by a header with the appropriate colspan and by its per-element values as adjacent cells, preserving row alignment; otherwise it remains a single formatted cell value. Ordinary cell content must be XML-escaped, while columns explicitly designated for raw HTML use configured sanitization. The document must incorporate requested styling or script resources/content, apply a string table identifier and optional CSS class to the table, and omit an identifier for non-string table selectors."} {"repo": "astropy/astropy", "buggy_commit": "0df94ff7097961e92fd7812036a24b145bc13ca8", "bug_issue": 13488, "solve_pr": 13579, "call_graph": {"nodes": [{"id": "astropy/wcs/wcsapi/wrappers/sliced_wcs.py::SlicedLowLevelWCS::world_to_pixel_values"}], "edges": [{"source": "astropy/wcs/wcsapi/wrappers/sliced_wcs.py::SlicedLowLevelWCS::world_to_pixel_values", "target": "astropy/wcs/wcsapi/wrappers/sliced_wcs.py::SlicedLowLevelWCS::world_to_pixel_values"}]}, "graph_spec": "SlicedLowLevelWCS.world_to_pixel_values converts numerical world-coordinate scalars or arrays, expressed in the WCS’s declared units, into pixel-coordinate scalars or arrays for a sliced WCS. World coordinates represent physical quantities associated with data, while pixel coordinates locate positions within it; this method provides that mapping for the subregion or reduced-dimensional view represented by the slice."} {"repo": "astropy/astropy", "buggy_commit": "5250b2442501e6c671c6b380536f1edb352602d1", "bug_issue": 13976, "solve_pr": 13977, "call_graph": {"nodes": [{"id": "astropy/units/quantity.py::Quantity::__array_ufunc__"}], "edges": []}, "graph_spec": "Quantity ufunc dispatch must determine the operation’s required input conversions and result unit before numerical evaluation, apply those conversions to raw array values, and delegate the ufunc without recursively re-entering Quantity dispatch. It must preserve NumPy’s `out` contract by validating that supplied destinations can represent the result (including unit/subclass and safe casting constraints), executing against array views, and restoring the computed unit on Quantity outputs; multiple outputs and `None` output slots must retain their corresponding structure. Reduction `initial` values must be expressed in the result unit. Results with a physical unit must be returned as appropriate Quantity views (preserving a compatible subclass), while unitless results remain plain array results; in-place `at` operations return their native no-result outcome. Unsupported or incompatible unit operations must raise normally unless another participating input/output type owns ufunc dispatch, in which case the method must return `NotImplemented` so that type can handle the operation."} {"repo": "astropy/astropy", "buggy_commit": "cdb66059a2feb44ee49021874605ba90801f9986", "bug_issue": 14305, "solve_pr": 14309, "call_graph": {"nodes": [{"id": "astropy/io/fits/connect.py::is_fits"}], "edges": []}, "graph_spec": "`is_fits` is the Table I/O identifier for FITS and must return a boolean using the most reliable available input: when given a readable file object, inspect its first 30 bytes for the exact FITS signature and restore the object’s original stream position; otherwise, when given a path, recognize case-insensitively only the supported `.fits`, `.fit`, or `.fts` suffixes, optionally followed by `.gz`; when neither is available, identify only FITS in-memory inputs represented by an `HDUList`, `TableHDU`, `BinTableHDU`, or `GroupsHDU`. Inputs not meeting the applicable criterion must not be identified as FITS."} @@ -69,6 +68,7 @@ {"repo": "django/django", "buggy_commit": "179ee13eb37348cd87169a198aec18fedccc8668", "bug_issue": 28607, "solve_pr": 14053, "call_graph": {"nodes": [{"id": "django/contrib/staticfiles/management/commands/collectstatic.py::Command::collect"}, {"id": "django/contrib/staticfiles/management/commands/collectstatic.py::Command::handle"}, {"id": "django/contrib/staticfiles/storage.py::HashedFilesMixin::post_process"}], "edges": [{"source": "django/contrib/staticfiles/management/commands/collectstatic.py::Command::collect", "target": "django/contrib/staticfiles/storage.py::HashedFilesMixin::post_process"}, {"source": "django/contrib/staticfiles/management/commands/collectstatic.py::Command::handle", "target": "django/contrib/staticfiles/management/commands/collectstatic.py::Command::collect"}]}, "graph_spec": "Command.handle provides the management-command entry point, and Command.collect performs the collection of static assets into a shared deployment location. HashedFilesMixin.post_process prepares collected assets for cache-busting by producing content-hashed filenames and updating references between assets, reporting file-processing results."} {"repo": "django/django", "buggy_commit": "f0adf3b9b7a19cdee05368ff0c0c2d087f011180", "bug_issue": 28690, "solve_pr": 11848, "call_graph": {"nodes": [{"id": "django/contrib/staticfiles/views.py::serve"}, {"id": "django/middleware/http.py::ConditionalGetMiddleware::process_response"}, {"id": "django/utils/cache.py::get_conditional_response"}, {"id": "django/utils/http.py::parse_http_date"}, {"id": "django/utils/http.py::parse_http_date_safe"}, {"id": "django/views/decorators/http.py::decorator::inner"}, {"id": "django/views/static.py::serve"}, {"id": "django/views/static.py::was_modified_since"}], "edges": [{"source": "django/contrib/staticfiles/views.py::serve", "target": "django/views/static.py::serve"}, {"source": "django/middleware/http.py::ConditionalGetMiddleware::process_response", "target": "django/utils/cache.py::get_conditional_response"}, {"source": "django/middleware/http.py::ConditionalGetMiddleware::process_response", "target": "django/utils/http.py::parse_http_date_safe"}, {"source": "django/utils/cache.py::get_conditional_response", "target": "django/utils/http.py::parse_http_date_safe"}, {"source": "django/utils/http.py::parse_http_date_safe", "target": "django/utils/http.py::parse_http_date"}, {"source": "django/views/decorators/http.py::decorator::inner", "target": "django/utils/cache.py::get_conditional_response"}, {"source": "django/views/static.py::serve", "target": "django/views/static.py::was_modified_since"}, {"source": "django/views/static.py::was_modified_since", "target": "django/utils/http.py::parse_http_date"}]}, "graph_spec": "Static-file serving must be limited to the permitted development context, normalize and safely resolve requested paths, reject missing resources and disallowed directory indexes, and delegate located static assets to the common file-serving behavior. File responses must honor a valid If-Modified-Since value (including its optional length qualifier) by returning 304 only when the resource’s size and whole-second modification time show it has not changed; otherwise return the file with its Last-Modified metadata. HTTP dates must accept the three standard HTTP date syntaxes and yield UTC epoch seconds, while the safe parser treats malformed input as absent. Conditional evaluation must apply only to successful responses and enforce request preconditions in HTTP order: If-Match, then If-Unmodified-Since only when no If-Match is supplied, then If-None-Match, then If-Modified-Since only when no If-None-Match is supplied; failed preconditions produce 412, whereas a matching retrieval precondition produces 304 for GET/HEAD with required cache and validator headers preserved. The middleware must perform this evaluation for GET responses with available validators (adding an ETag when allowed), and the condition decorator must compute and attach supplied validators for safe requests without replacing headers already set by the view."} {"repo": "django/django", "buggy_commit": "ec5aa2161d8015a3fe57dcbbfe14200cd18f0a16", "bug_issue": 28925, "solve_pr": 13121, "call_graph": {"nodes": [{"id": "django/db/models/expressions.py::Combinable::__add__"}, {"id": "django/db/models/expressions.py::Combinable::__mod__"}, {"id": "django/db/models/expressions.py::Combinable::__mul__"}, {"id": "django/db/models/expressions.py::Combinable::__radd__"}, {"id": "django/db/models/expressions.py::Combinable::__rmul__"}, {"id": "django/db/models/expressions.py::Combinable::__rsub__"}, {"id": "django/db/models/expressions.py::Combinable::__sub__"}, {"id": "django/db/models/expressions.py::Combinable::__truediv__"}, {"id": "django/db/models/expressions.py::Combinable::_combine"}, {"id": "django/db/models/expressions.py::CombinedExpression::as_sql"}], "edges": [{"source": "django/db/models/expressions.py::Combinable::__add__", "target": "django/db/models/expressions.py::Combinable::_combine"}, {"source": "django/db/models/expressions.py::Combinable::__mod__", "target": "django/db/models/expressions.py::Combinable::_combine"}, {"source": "django/db/models/expressions.py::Combinable::__mul__", "target": "django/db/models/expressions.py::Combinable::_combine"}, {"source": "django/db/models/expressions.py::Combinable::__radd__", "target": "django/db/models/expressions.py::Combinable::_combine"}, {"source": "django/db/models/expressions.py::Combinable::__rmul__", "target": "django/db/models/expressions.py::Combinable::_combine"}, {"source": "django/db/models/expressions.py::Combinable::__rsub__", "target": "django/db/models/expressions.py::Combinable::_combine"}, {"source": "django/db/models/expressions.py::Combinable::__sub__", "target": "django/db/models/expressions.py::Combinable::_combine"}, {"source": "django/db/models/expressions.py::Combinable::__truediv__", "target": "django/db/models/expressions.py::Combinable::_combine"}, {"source": "django/db/models/expressions.py::CombinedExpression::as_sql", "target": "django/db/models/expressions.py::CombinedExpression::as_sql"}]}, "graph_spec": "Arithmetic operators on combinable expressions must construct a CombinedExpression with the matching SQL connector and preserve operand order, including reversed addition, subtraction, and multiplication; non-expression operands must be incorporated as equivalent values, and timedelta operands must preserve duration semantics. SQL compilation must compile the left then right operand, concatenate parameters in that same order, use the backend’s expression-combining operation, and parenthesize the result to preserve precedence. On backends without native duration support, arithmetic involving durations must yield correctly convertible DurationField results without conversion errors, and subtraction of two like date, datetime, or time expressions must use temporal subtraction so it yields the appropriate duration semantics."} +{"repo": "django/django", "buggy_commit": "447980e72ac01da1594dd3373a03ba40b7ee6f80", "bug_issue": 29224, "solve_pr": 12708, "call_graph": {"nodes": [{"id": "django/db/backends/base/schema.py::BaseDatabaseSchemaEditor::alter_index_together"}], "edges": []}, "graph_spec": "BaseDatabaseSchemaEditor.alter_index_together manages database index changes associated with a model’s index_together setting, taking the model and its old and new index definitions. This setting groups model fields into combined indexes, and the method updates the model’s table indexes to reflect the revised definitions."} {"repo": "django/django", "buggy_commit": "b9cf764be62e77b4777b3a75ec256f6209a57671", "bug_issue": 29528, "solve_pr": 10097, "call_graph": {"nodes": [{"id": "django/core/validators.py::URLValidator::__call__"}], "edges": [{"source": "django/core/validators.py::URLValidator::__call__", "target": "django/core/validators.py::URLValidator::__call__"}]}, "graph_spec": "URLValidator.__call__ must either accept a complete URL or raise ValidationError with its configured message and code. It must compare the scheme case-insensitively against the configured scheme list (defaulting to HTTP, HTTPS, FTP, and FTPS), require a syntactically valid authority and optional credentials, port, and resource component, and support localhost, IPv4, bracketed IPv6, and Unicode domain names by validating an IDNA/ASCII representation when necessary. A literal IPv6 host must also be semantically valid, and the parsed network location must not exceed 253 characters; malformed parsing or IDNA conversion must remain invalid."} {"repo": "django/django", "buggy_commit": "4b45b6c8e4d7c9701a332e80d3b1c84209dc36e2", "bug_issue": 29706, "solve_pr": 11066, "call_graph": {"nodes": [{"id": "django/contrib/contenttypes/management/__init__.py::RenameContentType::_rename"}, {"id": "django/contrib/contenttypes/management/__init__.py::RenameContentType::rename_backward"}, {"id": "django/contrib/contenttypes/management/__init__.py::RenameContentType::rename_forward"}], "edges": [{"source": "django/contrib/contenttypes/management/__init__.py::RenameContentType::rename_backward", "target": "django/contrib/contenttypes/management/__init__.py::RenameContentType::_rename"}, {"source": "django/contrib/contenttypes/management/__init__.py::RenameContentType::rename_forward", "target": "django/contrib/contenttypes/management/__init__.py::RenameContentType::_rename"}]}, "graph_spec": "RenameContentType must keep the content-type record for its configured app label aligned with a model rename on the schema editor’s database: forward migration maps old model name to new, while reversal applies the inverse mapping. It must use the migration-provided historical ContentType model and honor migration routing, making no change when the model is not permitted on that database or the old natural key is absent. A rename must update only the model field atomically; if the target natural key cannot be stored because it conflicts with an existing record, the operation must leave the original name intact and not expose a partial change. After a successful rename, it must clear the ContentType manager cache so subsequent natural-key lookups cannot return the record under its former name."} {"repo": "django/django", "buggy_commit": "55b68de643b5c2d5f0a8ea7587ab3b2966021ccc", "bug_issue": 29744, "solve_pr": 11333, "call_graph": {"nodes": [{"id": "django/conf/urls/i18n.py::is_language_prefix_patterns_used"}, {"id": "django/contrib/admindocs/views.py::ViewDetailView::_get_view_func"}, {"id": "django/core/handlers/base.py::BaseHandler::_get_response"}, {"id": "django/core/handlers/exception.py::convert_exception_to_response::inner"}, {"id": "django/core/handlers/exception.py::response_for_exception"}, {"id": "django/middleware/common.py::CommonMiddleware::process_request"}, {"id": "django/middleware/common.py::CommonMiddleware::process_response"}, {"id": "django/middleware/common.py::CommonMiddleware::should_redirect_with_slash"}, {"id": "django/middleware/locale.py::LocaleMiddleware::process_request"}, {"id": "django/middleware/locale.py::LocaleMiddleware::process_response"}, {"id": "django/urls/base.py::is_valid_path"}, {"id": "django/urls/base.py::resolve"}, {"id": "django/urls/base.py::reverse"}, {"id": "django/urls/base.py::translate_url"}, {"id": "django/urls/resolvers.py::get_resolver"}, {"id": "django/views/i18n.py::set_language"}], "edges": [{"source": "django/conf/urls/i18n.py::is_language_prefix_patterns_used", "target": "django/urls/resolvers.py::get_resolver"}, {"source": "django/contrib/admindocs/views.py::ViewDetailView::_get_view_func", "target": "django/urls/resolvers.py::get_resolver"}, {"source": "django/core/handlers/base.py::BaseHandler::_get_response", "target": "django/urls/resolvers.py::get_resolver"}, {"source": "django/core/handlers/exception.py::convert_exception_to_response::inner", "target": "django/core/handlers/exception.py::response_for_exception"}, {"source": "django/core/handlers/exception.py::response_for_exception", "target": "django/urls/resolvers.py::get_resolver"}, {"source": "django/middleware/common.py::CommonMiddleware::process_request", "target": "django/middleware/common.py::CommonMiddleware::should_redirect_with_slash"}, {"source": "django/middleware/common.py::CommonMiddleware::process_response", "target": "django/middleware/common.py::CommonMiddleware::should_redirect_with_slash"}, {"source": "django/middleware/common.py::CommonMiddleware::should_redirect_with_slash", "target": "django/urls/base.py::is_valid_path"}, {"source": "django/middleware/locale.py::LocaleMiddleware::process_request", "target": "django/conf/urls/i18n.py::is_language_prefix_patterns_used"}, {"source": "django/middleware/locale.py::LocaleMiddleware::process_response", "target": "django/conf/urls/i18n.py::is_language_prefix_patterns_used"}, {"source": "django/middleware/locale.py::LocaleMiddleware::process_response", "target": "django/urls/base.py::is_valid_path"}, {"source": "django/urls/base.py::is_valid_path", "target": "django/urls/base.py::resolve"}, {"source": "django/urls/base.py::resolve", "target": "django/urls/base.py::resolve"}, {"source": "django/urls/base.py::resolve", "target": "django/urls/resolvers.py::get_resolver"}, {"source": "django/urls/base.py::reverse", "target": "django/urls/resolvers.py::get_resolver"}, {"source": "django/urls/base.py::translate_url", "target": "django/urls/base.py::resolve"}, {"source": "django/urls/base.py::translate_url", "target": "django/urls/base.py::reverse"}, {"source": "django/views/i18n.py::set_language", "target": "django/urls/base.py::translate_url"}]}, "graph_spec": "These functions connect Django’s URL configuration—the mapping between URL paths and views—to resolver access, path matching, URL generation, view lookup for administrative documentation, request dispatch, and exception-to-HTTP-response conversion. The common middleware hooks support request filtering and URL normalization, including assessing slash redirects, while the locale middleware hooks support language selection across requests and responses. The internationalization utilities identify language-prefixed URL configuration, translate URLs between languages, and provide a view for saving a user’s language preference and redirecting them."} @@ -80,12 +80,17 @@ {"repo": "django/django", "buggy_commit": "8180ffba21bf10f4be905cb0d4890dc2bcff2788", "bug_issue": 30191, "solve_pr": 11087, "call_graph": {"nodes": [{"id": "django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py::Command::handle"}, {"id": "django/db/models/deletion.py::Collector::collect"}, {"id": "django/db/models/query.py::QuerySet::delete"}], "edges": [{"source": "django/contrib/contenttypes/management/commands/remove_stale_contenttypes.py::Command::handle", "target": "django/db/models/deletion.py::Collector::collect"}, {"source": "django/db/models/deletion.py::Collector::collect", "target": "django/db/models/deletion.py::Collector::collect"}, {"source": "django/db/models/query.py::QuerySet::delete", "target": "django/db/models/deletion.py::Collector::collect"}]}, "graph_spec": "These functions support Django’s model deletion workflow: Command.handle removes obsolete content-type records, which identify models, while QuerySet.delete removes queried model records and returns deletion counts. Collector.collect gathers model instances and their associated parent and related objects for deletion, connecting both entry points to cascading deletion—the management of dependent records through model relationships and their deletion policies."} {"repo": "django/django", "buggy_commit": "e8fcdaad5c428878d0a5d6ba820d957013f75595", "bug_issue": 30255, "solve_pr": 12155, "call_graph": {"nodes": [{"id": "django/contrib/admindocs/utils.py::parse_docstring"}, {"id": "django/contrib/admindocs/utils.py::trim_docstring"}, {"id": "django/contrib/admindocs/views.py::ModelDetailView::get_context_data"}, {"id": "django/contrib/admindocs/views.py::TemplateFilterIndexView::get_context_data"}, {"id": "django/contrib/admindocs/views.py::TemplateTagIndexView::get_context_data"}, {"id": "django/contrib/admindocs/views.py::ViewDetailView::get_context_data"}], "edges": [{"source": "django/contrib/admindocs/utils.py::parse_docstring", "target": "django/contrib/admindocs/utils.py::trim_docstring"}, {"source": "django/contrib/admindocs/views.py::ModelDetailView::get_context_data", "target": "django/contrib/admindocs/utils.py::parse_docstring"}, {"source": "django/contrib/admindocs/views.py::ModelDetailView::get_context_data", "target": "django/contrib/admindocs/utils.py::trim_docstring"}, {"source": "django/contrib/admindocs/views.py::TemplateFilterIndexView::get_context_data", "target": "django/contrib/admindocs/utils.py::parse_docstring"}, {"source": "django/contrib/admindocs/views.py::TemplateTagIndexView::get_context_data", "target": "django/contrib/admindocs/utils.py::parse_docstring"}, {"source": "django/contrib/admindocs/views.py::ViewDetailView::get_context_data", "target": "django/contrib/admindocs/utils.py::parse_docstring"}, {"source": "django/contrib/admindocs/views.py::ViewDetailView::get_context_data", "target": "django/contrib/admindocs/views.py::ViewDetailView::get_context_data"}]}, "graph_spec": "Admin documentation must turn a callable or model docstring into a stable `(title, body, metadata)` representation: missing text produces empty values; common indentation is removed; the first paragraph is the title; and a final header-style paragraph is exposed as metadata only when it yields actual headers, otherwise it remains part of the body. Model, view, template-tag, and template-filter contexts must preserve this separation while rendering present title, body, and metadata values as reST in the appropriate reference context; empty components must remain empty. Tag and filter indexes must include built-in and configured libraries, retain each item’s name and originating library, and remain usable with an empty list when no default template engine is available. A view detail request must resolve only an installed callback and return not-found for an unresolved one; model detail must likewise reject unknown apps or models while supplying its canonical name, documentation summary/description, and field/method documentation."} {"repo": "django/django", "buggy_commit": "e245046bb6e8b32360aa48b8a41fb7050f0fc730", "bug_issue": 30289, "solve_pr": 11149, "call_graph": {"nodes": [{"id": "django/contrib/admin/options.py::InlineModelAdmin::_get_form_for_get_fields"}, {"id": "django/contrib/admin/options.py::InlineModelAdmin::get_formset"}, {"id": "django/contrib/admin/options.py::InlineModelAdmin::has_add_permission"}, {"id": "django/contrib/admin/options.py::InlineModelAdmin::has_change_permission"}, {"id": "django/contrib/admin/options.py::InlineModelAdmin::has_delete_permission"}, {"id": "django/contrib/admin/options.py::ModelAdmin::_changeform_view"}, {"id": "django/contrib/admin/options.py::ModelAdmin::_create_formsets"}, {"id": "django/contrib/admin/options.py::ModelAdmin::add_view"}, {"id": "django/contrib/admin/options.py::ModelAdmin::change_view"}, {"id": "django/contrib/admin/options.py::ModelAdmin::changeform_view"}, {"id": "django/contrib/admin/options.py::ModelAdmin::get_formsets_with_inlines"}, {"id": "django/contrib/admin/options.py::ModelAdmin::get_inline_formsets"}, {"id": "django/contrib/admin/options.py::ModelAdmin::get_inline_instances"}, {"id": "django/contrib/admin/options.py::_create_formsets::user_deleted_form"}], "edges": [{"source": "django/contrib/admin/options.py::InlineModelAdmin::_get_form_for_get_fields", "target": "django/contrib/admin/options.py::InlineModelAdmin::get_formset"}, {"source": "django/contrib/admin/options.py::InlineModelAdmin::get_formset", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_add_permission"}, {"source": "django/contrib/admin/options.py::InlineModelAdmin::get_formset", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_change_permission"}, {"source": "django/contrib/admin/options.py::InlineModelAdmin::get_formset", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_delete_permission"}, {"source": "django/contrib/admin/options.py::ModelAdmin::_changeform_view", "target": "django/contrib/admin/options.py::ModelAdmin::_create_formsets"}, {"source": "django/contrib/admin/options.py::ModelAdmin::_changeform_view", "target": "django/contrib/admin/options.py::ModelAdmin::get_inline_formsets"}, {"source": "django/contrib/admin/options.py::ModelAdmin::_create_formsets", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_change_permission"}, {"source": "django/contrib/admin/options.py::ModelAdmin::_create_formsets", "target": "django/contrib/admin/options.py::ModelAdmin::get_formsets_with_inlines"}, {"source": "django/contrib/admin/options.py::ModelAdmin::_create_formsets", "target": "django/contrib/admin/options.py::_create_formsets::user_deleted_form"}, {"source": "django/contrib/admin/options.py::ModelAdmin::add_view", "target": "django/contrib/admin/options.py::ModelAdmin::changeform_view"}, {"source": "django/contrib/admin/options.py::ModelAdmin::change_view", "target": "django/contrib/admin/options.py::ModelAdmin::changeform_view"}, {"source": "django/contrib/admin/options.py::ModelAdmin::changeform_view", "target": "django/contrib/admin/options.py::ModelAdmin::_changeform_view"}, {"source": "django/contrib/admin/options.py::ModelAdmin::get_formsets_with_inlines", "target": "django/contrib/admin/options.py::InlineModelAdmin::get_formset"}, {"source": "django/contrib/admin/options.py::ModelAdmin::get_formsets_with_inlines", "target": "django/contrib/admin/options.py::ModelAdmin::get_inline_instances"}, {"source": "django/contrib/admin/options.py::ModelAdmin::get_inline_formsets", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_add_permission"}, {"source": "django/contrib/admin/options.py::ModelAdmin::get_inline_formsets", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_change_permission"}, {"source": "django/contrib/admin/options.py::ModelAdmin::get_inline_formsets", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_delete_permission"}, {"source": "django/contrib/admin/options.py::ModelAdmin::get_inline_instances", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_add_permission"}, {"source": "django/contrib/admin/options.py::ModelAdmin::get_inline_instances", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_delete_permission"}, {"source": "django/contrib/admin/options.py::_create_formsets::user_deleted_form", "target": "django/contrib/admin/options.py::InlineModelAdmin::has_delete_permission"}]}, "graph_spec": "Admin add and change entry points must run through the same atomic change-form workflow: determine add versus existing-object mode (including save-as-new), enforce the parent object’s applicable access rights, bind and validate the parent form and all permitted inline formsets, and persist related changes only when every required form is valid. Inline instances must be included only when the requester has some relevant view/change, add, or delete capability; lack of add capability must prevent extra inline creation, while each inline formset must independently expose add, change, and delete behavior according to its permission hooks (with auto-created intermediary models deriving these capabilities from the related target model). Formset construction must use stable, distinct prefixes for repeated inline types, bind POST/files when submitted, and make view-only existing inline rows non-editable without suppressing an explicitly authorized submitted deletion. The rendered inline administration state must carry the same permission decisions used during construction, so the UI and submitted-data handling agree on what may be viewed, added, edited, or deleted."} +{"repo": "django/django", "buggy_commit": "e6588aa4e793b7f56f4cadbfa155b581e0efc59a", "bug_issue": 30302, "solve_pr": 11163, "call_graph": {"nodes": [{"id": "django/forms/models.py::BaseModelForm::__init__"}, {"id": "django/forms/models.py::model_to_dict"}], "edges": [{"source": "django/forms/models.py::BaseModelForm::__init__", "target": "django/forms/models.py::model_to_dict"}]}, "graph_spec": "A model form must require an associated model class and retain the supplied instance; when initialized with an existing instance, its initial form data must be derived from that instance only through editable concrete, private, and many-to-many model fields, honoring the form’s configured field inclusion list and exclusion list (with exclusion taking precedence) and using each field’s form-facing value representation. A form created without an instance must instead use a new model instance and empty model-derived initial data. Explicit initial values must then overlay the derived values, so caller-provided initial data takes precedence without mutating the instance."} +{"repo": "django/django", "buggy_commit": "19fc6376ce67d01ca37a91ef2f55ef769f50513a", "bug_issue": 30330, "solve_pr": 11179, "call_graph": {"nodes": [{"id": "django/db/models/base.py::Model::delete"}, {"id": "django/db/models/deletion.py::Collector::delete"}], "edges": [{"source": "django/db/models/base.py::Model::delete", "target": "django/db/models/deletion.py::Collector::delete"}]}, "graph_spec": "Model.delete provides the model-instance API for removing persisted objects, while Collector.delete carries out deletion for the collected objects within that operation. Their scope includes relational deletion, where foreign-key relationships and deletion policies govern related objects, and deletion reporting summarizes the objects removed."} {"repo": "django/django", "buggy_commit": "21aa2a5e785eef1f47beb1c3760fdd7d8915ae09", "bug_issue": 30349, "solve_pr": 11265, "call_graph": {"nodes": [{"id": "django/db/models/sql/query.py::Query::build_filter"}, {"id": "django/db/models/sql/query.py::Query::split_exclude"}, {"id": "django/db/models/sql/query.py::Query::trim_start"}], "edges": [{"source": "django/db/models/sql/query.py::Query::build_filter", "target": "django/db/models/sql/query.py::Query::split_exclude"}]}, "graph_spec": "`Query.build_filter()` must turn one valid lookup into a composable WHERE clause while enforcing lookup/filterability and join-permission constraints, tracking reusable joins, and preserving SQL’s intended Python-level null semantics under negation (including the outer-join requirements that prevent nullable related rows from being incorrectly discarded). When a negated traversal crosses an N-to-many relation, it must delegate to `split_exclude()` to express exclusion through a correlated nested query: the inner query must represent matching related rows without ordering, select the appropriate linking key, exclude null keys from an `IN` result, preserve outer-query restrictions when aliases are reused, and account for left-outer paths so null-related outer rows retain the correct exclusion meaning. `trim_start()` must safely minimize that nested query’s leading join path only across lookup-created joins, derive the corresponding outer lookup prefix and selected relation key, retain joins where outer-join or filtered-relation semantics would otherwise be lost, apply required relation restrictions when trimming, and leave a valid base-table FROM entry."} {"repo": "django/django", "buggy_commit": "571ab44e8a8936014c22e7eebe4948d9611fd7ce", "bug_issue": 30363, "solve_pr": 11206, "call_graph": {"nodes": [{"id": "django/utils/numberformat.py::format"}], "edges": []}, "graph_spec": "The format function in django.utils.numberformat converts a number into a formatted string, with controls for decimal presentation, digit grouping, separators, and localization."} {"repo": "django/django", "buggy_commit": "1f8382d34d54061eddc41df6994e20ee38c60907", "bug_issue": 30449, "solve_pr": 11400, "call_graph": {"nodes": [{"id": "django/contrib/admin/filters.py::RelatedFieldListFilter::__init__"}, {"id": "django/contrib/admin/filters.py::RelatedFieldListFilter::field_choices"}, {"id": "django/contrib/admin/filters.py::RelatedOnlyFieldListFilter::field_choices"}, {"id": "django/db/models/fields/__init__.py::Field::get_choices"}, {"id": "django/db/models/fields/reverse_related.py::ForeignObjectRel::get_choices"}], "edges": [{"source": "django/contrib/admin/filters.py::RelatedFieldListFilter::__init__", "target": "django/contrib/admin/filters.py::RelatedFieldListFilter::field_choices"}, {"source": "django/contrib/admin/filters.py::RelatedFieldListFilter::field_choices", "target": "django/db/models/fields/__init__.py::Field::get_choices"}, {"source": "django/contrib/admin/filters.py::RelatedOnlyFieldListFilter::field_choices", "target": "django/db/models/fields/__init__.py::Field::get_choices"}]}, "graph_spec": "These functions support relation-based filtering in Django’s admin change list: RelatedFieldListFilter initializes the filter and supplies related-object choices, while RelatedOnlyFieldListFilter supplies choices representing objects participating in the relation. Field.get_choices and ForeignObjectRel.get_choices provide selectable field choices for model fields and reverse relationships, connecting model relationship metadata to the admin’s filtering interface."} {"repo": "django/django", "buggy_commit": "7991111af12056ec9a856f35935d273526338c1f", "bug_issue": 30543, "solve_pr": 11551, "call_graph": {"nodes": [{"id": "django/contrib/admin/checks.py::ModelAdminChecks::_check_list_display"}, {"id": "django/contrib/admin/checks.py::ModelAdminChecks::_check_list_display_item"}, {"id": "django/contrib/admin/checks.py::ModelAdminChecks::check"}], "edges": [{"source": "django/contrib/admin/checks.py::ModelAdminChecks::_check_list_display", "target": "django/contrib/admin/checks.py::ModelAdminChecks::_check_list_display_item"}, {"source": "django/contrib/admin/checks.py::ModelAdminChecks::check", "target": "django/contrib/admin/checks.py::ModelAdminChecks::_check_list_display"}]}, "graph_spec": "ModelAdmin validation must include list_display checks alongside the inherited and other ModelAdmin checks, returning the combined diagnostics. list_display itself must be a list or tuple; each entry is valid only when it is a callable, an attribute on the ModelAdmin, a model field, or an attribute or method on the model. Entries that cannot be resolved through those forms must be reported, and a resolved ManyToMany model field must be rejected even though it exists."} +{"repo": "django/django", "buggy_commit": "e065b293878b1e3ea56655aa9d33e87576cd77ff", "bug_issue": 30556, "solve_pr": 11451, "call_graph": {"nodes": [{"id": "django/contrib/auth/backends.py::ModelBackend::authenticate"}], "edges": []}, "graph_spec": "ModelBackend.authenticate verifies user identifier and password credentials against Django’s configured user model, serving as the credential-verification entry point for Django’s default authentication backend. It accepts request context and credentials and produces an authentication result representing a user identity."} {"repo": "django/django", "buggy_commit": "8dd5877f58f84f2b11126afbd0813e24545919ed", "bug_issue": 30557, "solve_pr": 11555, "call_graph": {"nodes": [{"id": "django/contrib/admin/templatetags/admin_list.py::date_hierarchy"}, {"id": "django/db/models/query.py::QuerySet::aggregate"}, {"id": "django/db/models/query.py::QuerySet::count"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::find_ordering_name"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::get_order_by"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup"}, {"id": "django/db/models/sql/query.py::Query::get_aggregation"}, {"id": "django/db/models/sql/query.py::Query::get_count"}, {"id": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery"}], "edges": [{"source": "django/contrib/admin/templatetags/admin_list.py::date_hierarchy", "target": "django/db/models/query.py::QuerySet::aggregate"}, {"source": "django/db/models/query.py::QuerySet::aggregate", "target": "django/db/models/sql/query.py::Query::get_aggregation"}, {"source": "django/db/models/query.py::QuerySet::count", "target": "django/db/models/sql/query.py::Query::get_count"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::as_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::as_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::find_ordering_name", "target": "django/db/models/sql/compiler.py::SQLCompiler::find_ordering_name"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_order_by"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::get_order_by", "target": "django/db/models/sql/compiler.py::SQLCompiler::find_ordering_name"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_order_by"}, {"source": "django/db/models/sql/query.py::Query::get_aggregation", "target": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery"}, {"source": "django/db/models/sql/query.py::Query::get_count", "target": "django/db/models/sql/query.py::Query::get_aggregation"}, {"source": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery", "target": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}]}, "graph_spec": "QuerySet aggregation must accept only valid aggregate expressions with stable aliases, leave the original query usable, and return a name-to-value mapping; count must return the cached result length when available, otherwise count the query’s filtered result set and normalize an empty aggregate result to zero. Aggregation must preserve the result-set boundaries of slicing, distinctness, grouping/annotations, and set combinations by evaluating those operations in an inner subquery when required, while disabling irrelevant ordering, limits, locking, and related selection for the final aggregate; the inner SQL and parameters must be carried intact into the outer aggregate query. SQL generation must prepare selection, ordering, filtering, HAVING, grouping, and required extra selected ordering expressions coherently, restore temporary join reference counts afterward, and produce clauses and parameters in their SQL order. Compound queries must align selected values across components, obey backend restrictions on component ordering/slicing and parentheses, omit permitted empty components, preserve UNION ALL semantics, and order combined results by result-column positions while rejecting an ordering expression absent from the result. Related-model default ordering must expand recursively with direction propagation and detect cycles. For the admin date hierarchy, the initial drill-down level must be chosen from the queryset’s minimum and maximum dates when no date part is selected, and generated navigation must consistently replace only that hierarchy’s filters."} {"repo": "django/django", "buggy_commit": "a7038adbd02c916315b16939b835f021c2ee8880", "bug_issue": 30572, "solve_pr": 11490, "call_graph": {"nodes": [{"id": "django/db/models/query.py::QuerySet::count"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql"}, {"id": "django/db/models/sql/query.py::Query::get_aggregation"}, {"id": "django/db/models/sql/query.py::Query::get_count"}, {"id": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery"}], "edges": [{"source": "django/db/models/query.py::QuerySet::count", "target": "django/db/models/sql/query.py::Query::get_count"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::as_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}, {"source": "django/db/models/sql/query.py::Query::get_aggregation", "target": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery"}, {"source": "django/db/models/sql/query.py::Query::get_count", "target": "django/db/models/sql/query.py::Query::get_aggregation"}, {"source": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery", "target": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}]}, "graph_spec": "QuerySet.count() must return the cached result length when available, otherwise the integer cardinality of the queryset’s constrained result set, with an empty aggregate result normalized to 0. Counting and other summary aggregates must operate over the already-defined result set: when grouping, annotations, slicing, distinctness, or set combinations affect that set, compile an inner query preserving those semantics and aggregate over it; retain any selection needed for a valid subquery, suppress irrelevant ordering/locking/related selection, and return converted aggregate values. The aggregate wrapper must embed the inner SQL with its parameters and stable column aliases. SQL generation for compound queries must keep each operand’s projected value columns compatible, respect backend capabilities for operand ordering, slicing, parentheses, and supported set operators, omit only permitted empty operands, concatenate parameters in SQL order, and restore transient alias-reference state after compilation."} +{"repo": "django/django", "buggy_commit": "a5308514fb4bc5086c9a16a8a24a945eeebb073c", "bug_issue": 30608, "solve_pr": 11532, "call_graph": {"nodes": [{"id": "django/core/mail/backends/smtp.py::EmailBackend::open"}, {"id": "django/core/mail/utils.py::CachedDnsName::__str__"}, {"id": "django/core/mail/utils.py::CachedDnsName::get_fqdn"}], "edges": [{"source": "django/core/mail/backends/smtp.py::EmailBackend::open", "target": "django/core/mail/utils.py::CachedDnsName::get_fqdn"}, {"source": "django/core/mail/utils.py::CachedDnsName::__str__", "target": "django/core/mail/utils.py::CachedDnsName::get_fqdn"}]}, "graph_spec": "Scope covers Django's lazy, process-wide DNS name cache and its use as the SMTP local hostname. CachedDnsName is instantiated once as the module-level DNS_NAME singleton, so every caller in this scope shares one cache. get_fqdn() must determine the fully qualified domain name of the local host at most once per instance: the name is determined on the first call, and every later call must return that same previously determined value without performing another lookup, so repeated calls are idempotent and return an identical object/value. Once determined, the value must be reused even when it is empty. The determined name must be usable in generated email headers: a message's Message-ID must be constructible from it under any message encoding, including when the local host name contains non-ASCII characters and the message uses a non-Unicode encoding that cannot represent them, so mail-header construction never fails because of this value. CachedDnsName.__str__ must produce exactly the cached FQDN, delegating to get_fqdn() and therefore sharing its caching semantics, so stringifying the DNS_NAME object yields the same value as calling get_fqdn() directly and triggers at most one lookup. EmailBackend.open must treat this cached FQDN as the SMTP local_hostname passed to the connection class (alongside optional timeout and SSL key/cert parameters), invoking get_fqdn() only when a connection is actually being established, and must not invalidate, refresh, or otherwise mutate the cache. Establishing a connection must not change the observed FQDN for subsequent connections or for any other caller; the cached value remains stable for the life of the process."} +{"repo": "django/django", "buggy_commit": "003bb34b218adb23d1a7e67932a6ba9b3c4dcc81", "bug_issue": 30691, "solve_pr": 11740, "call_graph": {"nodes": [{"id": "django/core/management/commands/makemigrations.py::Command::handle"}, {"id": "django/core/management/commands/migrate.py::Command::handle"}, {"id": "django/db/migrations/autodetector.py::MigrationAutodetector::_detect_changes"}, {"id": "django/db/migrations/autodetector.py::MigrationAutodetector::changes"}, {"id": "django/db/migrations/autodetector.py::MigrationAutodetector::generate_altered_fields"}], "edges": [{"source": "django/core/management/commands/makemigrations.py::Command::handle", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::changes"}, {"source": "django/core/management/commands/migrate.py::Command::handle", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::changes"}, {"source": "django/db/migrations/autodetector.py::MigrationAutodetector::_detect_changes", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::generate_altered_fields"}, {"source": "django/db/migrations/autodetector.py::MigrationAutodetector::changes", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::_detect_changes"}]}, "graph_spec": "The migration commands must derive pending schema changes by comparing the loaded migration project state with the current application state through a single autodetection result: `makemigrations` uses that result to produce migrations, honoring requested app conversion/trimming and graph-based naming/dependency arrangement, while `migrate` uses it only to report unapplied model changes when there is no execution plan. Detection must consider managed, migratable models and process renames before field comparison so renamed models, fields, relation targets, and intermediary models are not misidentified as independent changes. For each surviving field difference, it must create an `AlterField` only when both forms are compatible (both many-to-many or both non-many-to-many), include required foreign-key dependencies, and otherwise represent the transition as removal plus addition. Tightening a non-many-to-many field from nullable to non-nullable without a model default must obtain a one-off migration default when supplied, without preserving that temporary value as the field's ongoing default. The resulting per-app operations must then be ordered, split, and optimized into migrations consistent with the existing migration graph."} {"repo": "django/django", "buggy_commit": "05457817647368be4b019314fcc655445a5b4c0c", "bug_issue": 30731, "solve_pr": 11728, "call_graph": {"nodes": [{"id": "django/contrib/admindocs/utils.py::replace_named_groups"}, {"id": "django/contrib/admindocs/utils.py::replace_unnamed_groups"}, {"id": "django/contrib/admindocs/views.py::ViewIndexView::get_context_data"}, {"id": "django/contrib/admindocs/views.py::simplify_regex"}], "edges": [{"source": "django/contrib/admindocs/views.py::ViewIndexView::get_context_data", "target": "django/contrib/admindocs/views.py::simplify_regex"}, {"source": "django/contrib/admindocs/views.py::simplify_regex", "target": "django/contrib/admindocs/utils.py::replace_named_groups"}, {"source": "django/contrib/admindocs/views.py::simplify_regex", "target": "django/contrib/admindocs/utils.py::replace_unnamed_groups"}]}, "graph_spec": "The admin view index must produce one documentation entry per discovered URL view, retaining its fully qualified callable name and its namespace-qualified URL name while presenting a human-readable URL. URL patterns must be normalized by first replacing each complete named capture group—even when it contains nested or escaped parentheses—with its `` placeholder, then replacing each remaining outermost unnamed capture group (including nested contents) with ``; escaped parentheses must not alter capture-group boundaries. The resulting display path must remove regex anchors and residual `?` syntax and always begin with `/`, while leaving non-group path text in order."} {"repo": "django/django", "buggy_commit": "999891bd80b3d02dd916731a7a239e1036174885", "bug_issue": 30739, "solve_pr": 11734, "call_graph": {"nodes": [{"id": "django/db/models/sql/query.py::Query::build_filter"}, {"id": "django/db/models/sql/query.py::Query::split_exclude"}], "edges": [{"source": "django/db/models/sql/query.py::Query::build_filter", "target": "django/db/models/sql/query.py::Query::split_exclude"}]}, "graph_spec": "Query.build_filter must turn one valid filter expression into a standalone WHERE clause while resolving conditional expressions, lookup paths, values, joins, and reusable aliases; it must reject malformed, non-filterable, or disallowed joined expressions, and preserve SQL/Python null semantics by choosing required outer joins and adding null guards when negation would otherwise yield UNKNOWN. If resolving a negated lookup would traverse a multi-valued relation, it must delegate to split_exclude, which represents the exclusion as a nested membership condition: the inner query applies the original predicate, removes irrelevant ordering and leading joins, excludes null selected keys, preserves any needed correlation with reusable outer aliases, and adds the appropriate outer-null alternative when the trimmed path contains an outer join. The resulting clause and join requirements must remain suitable for the caller’s later join-promotion decisions."} {"repo": "django/django", "buggy_commit": "350123f38c2b6217c38d70bfbd924a9ba3df1289", "bug_issue": 30763, "solve_pr": 11749, "call_graph": {"nodes": [{"id": "django/core/management/__init__.py::call_command"}], "edges": []}, "graph_spec": "Django management commands expose administrative actions that can be invoked from application code. `call_command` provides the primary public API for invoking a management command with arguments and named options, returning the command’s result."} @@ -93,9 +98,11 @@ {"repo": "django/django", "buggy_commit": "b1d6b35e146aea83b171c1b921178bbaae2795ed", "bug_issue": 30776, "solve_pr": 11790, "call_graph": {"nodes": [{"id": "django/contrib/auth/forms.py::AuthenticationForm::__init__"}], "edges": []}, "graph_spec": "AuthenticationForm.__init__ initializes Django’s username-and-password login form, accepting form data and request context for authentication customization by subclasses. It prepares a form used to collect credentials for establishing a user’s identity during login."} {"repo": "django/django", "buggy_commit": "c2678e49759e5c4c329bff0eeca2886267005d21", "bug_issue": 30798, "solve_pr": 11820, "call_graph": {"nodes": [{"id": "django/core/checks/model_checks.py::check_all_models"}, {"id": "django/db/models/base.py::Model::_check_ordering"}, {"id": "django/db/models/base.py::Model::check"}], "edges": [{"source": "django/core/checks/model_checks.py::check_all_models", "target": "django/db/models/base.py::Model::check"}, {"source": "django/db/models/base.py::Model::check", "target": "django/db/models/base.py::Model::_check_ordering"}]}, "graph_spec": "Model checking must enumerate either all registered models or only those from the supplied app configurations, invoke each model’s class-level check with the received options, and aggregate its diagnostics while reporting an invalid non-method override of that check entry point. A model’s check must always include swappability, model, and manager validation, but run field, relationship, naming, index, uniqueness, ordering, and constraint validation only for models that are not swapped; dependent column-name diagnostics must be suppressed when earlier field-name clash diagnostics exist. Ordering validation must reject incompatible ordering configuration and non-sequence ordering values, otherwise accept empty or order-with-respect-to configurations, ordering expressions and random ordering, signed field names, and the `pk` alias; it must report each unresolved plain field or related traversal/lookup while allowing valid fields, attribute names, reverse related query names, relations, and supported transforms."} {"repo": "django/django", "buggy_commit": "312049091288dbba2299de8d07ea3e3311ed7238", "bug_issue": 30827, "solve_pr": 11951, "call_graph": {"nodes": [{"id": "django/db/models/query.py::QuerySet::_batched_insert"}, {"id": "django/db/models/query.py::QuerySet::bulk_create"}], "edges": [{"source": "django/db/models/query.py::QuerySet::bulk_create", "target": "django/db/models/query.py::QuerySet::_batched_insert"}]}, "graph_spec": "Django’s QuerySet.bulk_create() provides efficient database insertion of collections of model instances, where instances represent records managed by the ORM. QuerySet._batched_insert() supports this bulk creation by handling insertion in batches, grouping database writes to reduce query overhead."} +{"repo": "django/django", "buggy_commit": "06909fe084f87a65459a83bd69d7cdbe4fce9a7c", "bug_issue": 30839, "solve_pr": 11880, "call_graph": {"nodes": [{"id": "django/forms/fields.py::Field::__deepcopy__"}], "edges": []}, "graph_spec": "Field.__deepcopy__ provides deep-copy support for Django form field instances, returning a copied field through Python’s copying protocol. Form fields define validation responsibilities and presentation settings for individual inputs in a form."} {"repo": "django/django", "buggy_commit": "84633905273fc916e3d17883810d9969c03f73c2", "bug_issue": 30931, "solve_pr": 11999, "call_graph": {"nodes": [{"id": "django/db/models/fields/__init__.py::Field::contribute_to_class"}], "edges": []}, "graph_spec": "Django model fields describe aspects of a model’s data and its database representation. Field.contribute_to_class() registers a field with its owning model class, associating the field declaration with the model and its field name."} {"repo": "django/django", "buggy_commit": "58c1acb1d6054dfec29d0f30b1033bae6ef62aec", "bug_issue": 30961, "solve_pr": 12039, "call_graph": {"nodes": [{"id": "django/db/backends/ddl_references.py::Columns::__str__"}, {"id": "django/db/backends/ddl_references.py::IndexColumns::__str__"}], "edges": []}, "graph_spec": "Columns.__str__ and IndexColumns.__str__ provide SQL text representations of table-column references and index-column references, respectively, for deferred database schema statements used during migrations. In this context, columns identify table fields, while index columns identify the fields involved in a database index."} {"repo": "django/django", "buggy_commit": "b93a0e34d9b9b99d41103782b7e7aeabf47517e3", "bug_issue": 30971, "solve_pr": 12050, "call_graph": {"nodes": [{"id": "django/db/models/query_utils.py::FilteredRelation::as_sql"}, {"id": "django/db/models/sql/query.py::Query::build_filter"}, {"id": "django/db/models/sql/query.py::Query::build_filtered_relation_q"}, {"id": "django/db/models/sql/query.py::Query::resolve_lookup_value"}], "edges": [{"source": "django/db/models/query_utils.py::FilteredRelation::as_sql", "target": "django/db/models/sql/query.py::Query::build_filtered_relation_q"}, {"source": "django/db/models/sql/query.py::Query::build_filter", "target": "django/db/models/sql/query.py::Query::resolve_lookup_value"}, {"source": "django/db/models/sql/query.py::Query::build_filtered_relation_q", "target": "django/db/models/sql/query.py::Query::build_filter"}, {"source": "django/db/models/sql/query.py::Query::build_filtered_relation_q", "target": "django/db/models/sql/query.py::Query::build_filtered_relation_q"}]}, "graph_spec": "These functions support translating Django ORM filtering conditions into SQL, where lookups express database predicates and Q objects represent combined conditions. Query.build_filter constructs an individual filter clause, Query.resolve_lookup_value resolves lookup values in the query context, and Query.build_filtered_relation_q builds filtering conditions for a FilteredRelation. FilteredRelation.as_sql provides the SQL representation of that relation’s condition for a JOIN’s ON clause, which controls how related records participate in the join."} +{"repo": "django/django", "buggy_commit": "5573a54d409bb98b5c5acdb308310bed02d392c2", "bug_issue": 31031, "solve_pr": 12143, "call_graph": {"nodes": [{"id": "django/contrib/admin/options.py::ModelAdmin::_get_edited_object_pks"}, {"id": "django/contrib/admin/options.py::ModelAdmin::_get_list_editable_queryset"}, {"id": "django/contrib/admin/options.py::ModelAdmin::changelist_view"}], "edges": [{"source": "django/contrib/admin/options.py::ModelAdmin::_get_list_editable_queryset", "target": "django/contrib/admin/options.py::ModelAdmin::_get_edited_object_pks"}, {"source": "django/contrib/admin/options.py::ModelAdmin::changelist_view", "target": "django/contrib/admin/options.py::ModelAdmin::_get_list_editable_queryset"}]}, "graph_spec": "For a changelist save that uses `list_editable`, the admin must derive the edited object identifiers only from POST field names matching that formset’s exact prefix, numeric form index, and the model primary-key field, then build the formset from the request-scoped editable queryset restricted to those identifiers. Each submitted identifier must be accepted only if it converts through the queryset model’s primary-key conversion; if any is invalid, the restricted-query optimization must be abandoned and the full editable queryset used so normal formset validation handles the submission. The changelist view must require change permission for this save path, validate the resulting formset before persisting anything, save and log only forms whose values changed, report a success count when applicable, and redirect after a valid submission to prevent resubmission."} {"repo": "django/django", "buggy_commit": "5a68f024987e6d16c2626a31bf653a2edddea579", "bug_issue": 31071, "solve_pr": 12209, "call_graph": {"nodes": [{"id": "django/core/management/commands/loaddata.py::Command::handle"}, {"id": "django/core/management/commands/loaddata.py::Command::loaddata"}, {"id": "django/core/serializers/base.py::DeserializedObject::save"}, {"id": "django/core/serializers/base.py::DeserializedObject::save_deferred_fields"}, {"id": "django/db/models/base.py::Model::_save_table"}, {"id": "django/db/models/base.py::Model::save_base"}], "edges": [{"source": "django/core/management/commands/loaddata.py::Command::handle", "target": "django/core/management/commands/loaddata.py::Command::loaddata"}, {"source": "django/core/management/commands/loaddata.py::Command::loaddata", "target": "django/core/serializers/base.py::DeserializedObject::save_deferred_fields"}, {"source": "django/core/serializers/base.py::DeserializedObject::save", "target": "django/db/models/base.py::Model::save_base"}, {"source": "django/core/serializers/base.py::DeserializedObject::save_deferred_fields", "target": "django/core/serializers/base.py::DeserializedObject::save"}, {"source": "django/db/models/base.py::Model::save_base", "target": "django/db/models/base.py::Model::_save_table"}]}, "graph_spec": "Fixture loading must run as one atomic operation on the selected database: after confirming fixtures exist, save each permitted object while constraint checks are suspended, defer unresolved forward foreign-key and many-to-many relations until all base objects have been processed, then resolve and persist those relations before manually validating constraints and resetting sequences for loaded models. Deserialized saves must bypass model-specific save overrides but invoke the model base save in raw mode, apply many-to-many assignments only after the object record exists, and clear pending relation data so it cannot be applied twice. Deferred relation resolution must use the same database, report relation-deserialization failures with object/field context, and then save the object and resolved many-to-many values. Base model persistence must select the write database, preserve raw-save semantics (including skipping parent saves and value preprocessing), bracket table writes appropriately, maintain pre/post-save signaling and instance state, and perform an update when a matching primary key row exists or otherwise insert while honoring force/update-field constraints and database-returned fields."} {"repo": "django/django", "buggy_commit": "69331bb851c34f05bc77e9fc24020fe6908b9cd5", "bug_issue": 31128, "solve_pr": 12262, "call_graph": {"nodes": [{"id": "django/contrib/admin/templatetags/base.py::InclusionAdminNode::__init__"}, {"id": "django/template/library.py::dec::compile_func"}, {"id": "django/template/library.py::parse_bits"}], "edges": [{"source": "django/contrib/admin/templatetags/base.py::InclusionAdminNode::__init__", "target": "django/template/library.py::parse_bits"}, {"source": "django/template/library.py::dec::compile_func", "target": "django/template/library.py::parse_bits"}]}, "graph_spec": "Template-tag compilation must turn the token arguments (excluding the tag name) into deferred filter expressions and keyword bindings that match the decorated callable’s Python signature. With `takes_context=True`, the callable must declare `context` as its first parameter, which is supplied implicitly rather than from the token. Parsing must reject unknown or duplicate keyword arguments, positional arguments following keyword arguments, excess positional arguments when varargs are unavailable, and omission of required positional or keyword-only parameters; defaults, varargs, and arbitrary keyword arguments remain valid where declared. Both ordinary registered tag compilers and admin inclusion nodes must apply this same contract, preserving the tag name in syntax errors and passing the resulting argument bindings to their nodes."} {"repo": "django/django", "buggy_commit": "4c1b401e8250f9f520b3c7dc369554477ce8b15a", "bug_issue": 31154, "solve_pr": 12304, "call_graph": {"nodes": [{"id": "django/db/models/enums.py::ChoicesMeta::__new__"}], "edges": []}, "graph_spec": "ChoicesMeta must construct choice enums with standard Enum semantics while separating each declared member’s concrete value arguments from an optional final human-readable label (a string or lazy translation); the remaining arguments must form the member value, supporting both scalar and multi-argument concrete types. When no such label is supplied, it must derive one from the member name by replacing underscores with spaces and title-casing. The resulting class must expose each member’s label, preserve declaration order in the value-to-label association, reject duplicate values, and allow Django template expressions to resolve members through the enum class and access their labels and values."} @@ -104,6 +111,7 @@ {"repo": "django/django", "buggy_commit": "5b884d45ac5b76234eca614d90c83b347294c332", "bug_issue": 31462, "solve_pr": 12713, "call_graph": {"nodes": [{"id": "django/contrib/admin/options.py::BaseModelAdmin::formfield_for_dbfield"}, {"id": "django/contrib/admin/options.py::BaseModelAdmin::formfield_for_manytomany"}], "edges": [{"source": "django/contrib/admin/options.py::BaseModelAdmin::formfield_for_dbfield", "target": "django/contrib/admin/options.py::BaseModelAdmin::formfield_for_manytomany"}]}, "graph_spec": "These admin hooks connect database model fields to form fields used for editing model data: formfield_for_dbfield provides the general customization point, while formfield_for_manytomany provides the corresponding form field for a ManyToManyField. A many-to-many relationship allows multiple records on each side to relate to multiple records on the other, and the specialized hook supports its representation in admin forms."} {"repo": "django/django", "buggy_commit": "67f9d076cfc1858b94f9ed6d1a5ce2327dcc8d0d", "bug_issue": 31500, "solve_pr": 12774, "call_graph": {"nodes": [{"id": "django/db/models/query.py::QuerySet::in_bulk"}], "edges": []}, "graph_spec": "QuerySet.in_bulk() retrieves model instances from a database query as a dictionary keyed by unique field values. It supports bulk lookup of ORM objects, connecting database record identifiers with their corresponding model instances."} {"repo": "django/django", "buggy_commit": "d17b380653da5f95885ce53468fe7aac60672841", "bug_issue": 31538, "solve_pr": 12858, "call_graph": {"nodes": [{"id": "django/core/checks/model_checks.py::check_all_models"}, {"id": "django/db/models/base.py::Model::_check_ordering"}, {"id": "django/db/models/base.py::Model::check"}], "edges": [{"source": "django/core/checks/model_checks.py::check_all_models", "target": "django/db/models/base.py::Model::check"}, {"source": "django/db/models/base.py::Model::check", "target": "django/db/models/base.py::Model::_check_ordering"}]}, "graph_spec": "The model checks entry point must enumerate every installed model (or only models from the supplied app configurations), preserve the supplied check kwargs when invoking each valid class-level `check()`, aggregate all resulting messages, and also report an invalid override of that class method while continuing global metadata validation. Each model’s `check()` must retain baseline model and manager checks, but for a swapped model limit validation to swap-related checks; otherwise include field, relationship, database-dependent, naming, index, constraint, and ordering validation, suppressing dependent column-name clashes when earlier name-clash diagnostics exist. Ordering validation must reject simultaneous explicit `ordering` and `order_with_respect_to`, accept no ordering when ordering is implicitly controlled by `order_with_respect_to`, require a nonempty explicit ordering to be a list or tuple, ignore ordering expressions and random-order markers, allow descending prefixes and the `pk` alias, and diagnose every unresolved local field, relation traversal, transform, or lookup while recognizing valid field names, attribute names, and reverse related-query names."} +{"repo": "django/django", "buggy_commit": "fbe82f82555bc25dccb476c749ca062f0b522be3", "bug_issue": 31596, "solve_pr": 13109, "call_graph": {"nodes": [{"id": "django/db/models/fields/related.py::ForeignKey::validate"}], "edges": []}, "graph_spec": "ForeignKey.validate provides field-level validation of a foreign-key value in the context of a model instance. A foreign key represents a many-to-one relationship between models, so this method supplies relationship-field validation within Django’s model validation framework."} {"repo": "django/django", "buggy_commit": "437196da9a386bd4cc62b0ce3f2de4aba468613d", "bug_issue": 31624, "solve_pr": 12965, "call_graph": {"nodes": [{"id": "django/db/models/sql/compiler.py::SQLDeleteCompiler::single_alias"}], "edges": []}, "graph_spec": "SQLDeleteCompiler.single_alias characterizes the table-alias scope of a deletion query as part of SQL compilation. Table aliases distinguish table references in SQL, so this property concerns the query’s table references within the deletion compiler."} {"repo": "django/django", "buggy_commit": "a59de6e89e8dc1f3e71c9a5a5bbceb373ea5247e", "bug_issue": 31657, "solve_pr": 13033, "call_graph": {"nodes": [{"id": "django/contrib/admin/templatetags/admin_list.py::date_hierarchy"}, {"id": "django/db/models/query.py::QuerySet::aggregate"}, {"id": "django/db/models/query.py::QuerySet::count"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::find_ordering_name"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::get_order_by"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup"}, {"id": "django/db/models/sql/query.py::Query::get_aggregation"}, {"id": "django/db/models/sql/query.py::Query::get_count"}, {"id": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery"}], "edges": [{"source": "django/contrib/admin/templatetags/admin_list.py::date_hierarchy", "target": "django/db/models/query.py::QuerySet::aggregate"}, {"source": "django/db/models/query.py::QuerySet::aggregate", "target": "django/db/models/sql/query.py::Query::get_aggregation"}, {"source": "django/db/models/query.py::QuerySet::count", "target": "django/db/models/sql/query.py::Query::get_count"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::as_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::as_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::find_ordering_name", "target": "django/db/models/sql/compiler.py::SQLCompiler::find_ordering_name"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_order_by"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::get_order_by", "target": "django/db/models/sql/compiler.py::SQLCompiler::find_ordering_name"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_order_by"}, {"source": "django/db/models/sql/query.py::Query::get_aggregation", "target": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery"}, {"source": "django/db/models/sql/query.py::Query::get_count", "target": "django/db/models/sql/query.py::Query::get_aggregation"}, {"source": "django/db/models/sql/subqueries.py::AggregateQuery::add_subquery", "target": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}]}, "graph_spec": "Date-hierarchy navigation must derive its initial drill-down level from the current queryset’s minimum and maximum date/datetime values, localizing aware datetimes before comparison, while aggregation and counting validate aggregate inputs, avoid mutating the caller’s query, return named aggregate values, and report zero for an empty count. Aggregate evaluation must preserve the row set selected by slicing, distinctness, grouping, existing annotations, and set combinations by aggregating an appropriately projected subquery when required; that subquery must retain ordering when it affects the selected rows, expose needed columns, and compile as a parameterized derived table. SQL generation must establish selection, ordering, filtering, grouping, and extra selected ordering expressions consistently before rendering clauses, restore temporary join state afterward, and keep ordering semantics valid for combined queries by resolving relation default orderings recursively with cycle detection, deduplicating equivalent terms, ordering combined results by result-column positions, enforcing backend compound-query limits, and preserving compatible column layouts and parameter order across all component queries."} {"repo": "django/django", "buggy_commit": "78ad4b4b0201003792bfdbf1a7781cbc9ee03539", "bug_issue": 31664, "solve_pr": 13028, "call_graph": {"nodes": [{"id": "django/db/models/sql/query.py::Query::build_filter"}, {"id": "django/db/models/sql/query.py::Query::check_filterable"}], "edges": [{"source": "django/db/models/sql/query.py::Query::build_filter", "target": "django/db/models/sql/query.py::Query::check_filterable"}, {"source": "django/db/models/sql/query.py::Query::check_filterable", "target": "django/db/models/sql/query.py::Query::check_filterable"}]}, "graph_spec": "Query.build_filter must turn one valid filter clause into a WHERE node while enforcing filterability whenever that validation is enabled: it must reject a referenced lookup expression and the resolved lookup value if either is unsuitable for WHERE use, before constructing the lookup condition. Query.check_filterable must reject any expression that both participates in expression resolution and explicitly declares itself non-filterable, raising the clause-specific unsupported-operation error; this rule applies recursively to every source expression so a non-filterable descendant cannot be admitted through an otherwise permitted composite expression. Validation must be bypassable only through the explicit check_filterable control, preserving callers that intentionally disable it."} @@ -112,7 +120,9 @@ {"repo": "django/django", "buggy_commit": "453967477e3ddae704cd739eac2449c0e13d464c", "bug_issue": 31750, "solve_pr": 13401, "call_graph": {"nodes": [{"id": "django/db/models/fields/__init__.py::Field::__eq__"}, {"id": "django/db/models/fields/__init__.py::Field::__hash__"}, {"id": "django/db/models/fields/__init__.py::Field::__lt__"}], "edges": []}, "graph_spec": "Django’s Field objects describe model fields and their database representation. Field.__eq__ and Field.__lt__ provide equality and ordering comparisons between field objects, while Field.__hash__ supplies a hash value for their use in hash-based collections."} {"repo": "django/django", "buggy_commit": "2d67222472f80f251607ae1b720527afceba06ad", "bug_issue": 31755, "solve_pr": 13128, "call_graph": {"nodes": [{"id": "django/db/models/expressions.py::CombinedExpression::resolve_expression"}], "edges": [{"source": "django/db/models/expressions.py::CombinedExpression::resolve_expression", "target": "django/db/models/expressions.py::CombinedExpression::resolve_expression"}]}, "graph_spec": "CombinedExpression.resolve_expression() prepares a combined query expression for inclusion in a database query, using the query context to support preprocessing and validation and returning a resolved copy. Query expressions represent database values or computations; resolving a combined expression also encompasses its nested expressions so the overall computation is ready for query use."} {"repo": "django/django", "buggy_commit": "7af8f4127397279d19ef7c7899e93018274e2f9b", "bug_issue": 31767, "solve_pr": 13158, "call_graph": {"nodes": [{"id": "django/contrib/admin/options.py::InlineModelAdmin::get_queryset"}, {"id": "django/contrib/admin/options.py::ModelAdmin::_create_formsets"}, {"id": "django/db/models/fields/related_descriptors.py::RelatedManager::_apply_rel_filters"}, {"id": "django/db/models/fields/related_descriptors.py::RelatedManager::get_prefetch_queryset"}, {"id": "django/db/models/fields/related_descriptors.py::RelatedManager::get_queryset"}, {"id": "django/db/models/query.py::QuerySet::__getitem__"}, {"id": "django/db/models/query.py::QuerySet::get"}, {"id": "django/db/models/query.py::QuerySet::get_or_create"}, {"id": "django/db/models/query.py::QuerySet::none"}, {"id": "django/db/models/query.py::QuerySet::update_or_create"}, {"id": "django/db/models/sql/query.py::Query::clone"}, {"id": "django/db/models/sql/query.py::Query::has_results"}, {"id": "django/db/models/sql/query.py::Query::set_empty"}, {"id": "django/db/models/sql/query.py::Query::set_limits"}, {"id": "django/forms/models.py::BaseInlineFormSet::__init__"}, {"id": "django/forms/models.py::ModelMultipleChoiceField::clean"}, {"id": "django/views/generic/dates.py::BaseArchiveIndexView::get_dated_items"}, {"id": "django/views/generic/dates.py::BaseYearArchiveView::get_dated_items"}], "edges": [{"source": "django/contrib/admin/options.py::InlineModelAdmin::get_queryset", "target": "django/contrib/admin/options.py::InlineModelAdmin::get_queryset"}, {"source": "django/contrib/admin/options.py::InlineModelAdmin::get_queryset", "target": "django/db/models/query.py::QuerySet::none"}, {"source": "django/contrib/admin/options.py::ModelAdmin::_create_formsets", "target": "django/contrib/admin/options.py::InlineModelAdmin::get_queryset"}, {"source": "django/db/models/fields/related_descriptors.py::RelatedManager::_apply_rel_filters", "target": "django/db/models/query.py::QuerySet::none"}, {"source": "django/db/models/fields/related_descriptors.py::RelatedManager::get_prefetch_queryset", "target": "django/db/models/fields/related_descriptors.py::RelatedManager::get_queryset"}, {"source": "django/db/models/fields/related_descriptors.py::RelatedManager::get_queryset", "target": "django/db/models/fields/related_descriptors.py::RelatedManager::_apply_rel_filters"}, {"source": "django/db/models/query.py::QuerySet::__getitem__", "target": "django/db/models/sql/query.py::Query::set_limits"}, {"source": "django/db/models/query.py::QuerySet::get", "target": "django/db/models/sql/query.py::Query::set_limits"}, {"source": "django/db/models/query.py::QuerySet::get_or_create", "target": "django/db/models/query.py::QuerySet::get"}, {"source": "django/db/models/query.py::QuerySet::none", "target": "django/db/models/sql/query.py::Query::set_empty"}, {"source": "django/db/models/query.py::QuerySet::update_or_create", "target": "django/db/models/query.py::QuerySet::get"}, {"source": "django/db/models/sql/query.py::Query::has_results", "target": "django/db/models/sql/query.py::Query::set_limits"}, {"source": "django/db/models/sql/query.py::Query::set_limits", "target": "django/db/models/sql/query.py::Query::set_empty"}, {"source": "django/forms/models.py::BaseInlineFormSet::__init__", "target": "django/db/models/query.py::QuerySet::none"}, {"source": "django/forms/models.py::ModelMultipleChoiceField::clean", "target": "django/db/models/query.py::QuerySet::none"}, {"source": "django/views/generic/dates.py::BaseArchiveIndexView::get_dated_items", "target": "django/db/models/query.py::QuerySet::none"}, {"source": "django/views/generic/dates.py::BaseYearArchiveView::get_dated_items", "target": "django/db/models/query.py::QuerySet::none"}]}, "graph_spec": "This scope must preserve QuerySet isolation and semantics: derived queries must retain the applicable filters, database routing/hints, and relationship metadata without mutating the source query; relation managers must return cached prefetched results when available, otherwise constrain results to their bound instance and yield an empty QuerySet when the relation key cannot identify persisted related rows. An empty result must remain a model-aware QuerySet and propagate through combined queries, while slicing, single-object retrieval, and existence checks apply composable bounds that preserve existing offsets/limits and make an exhausted range empty. `get()` must distinguish zero, one, and multiple matches; `get_or_create()` and `update_or_create()` must use the write database, report whether creation occurred, and make the update-or-create lookup/update atomic. Admin inline formset construction must use each inline’s permission-filtered queryset and expose no initial child rows for an unsaved parent; optional empty multiple-choice input must clean to an empty QuerySet. Date archive views must return an empty model-aware object list when no date buckets exist or when a yearly archive is configured not to include its object list, while retaining the corresponding date/context information."} +{"repo": "django/django", "buggy_commit": "d08e6f55e3a986a8d4b3a58431d9615c7bc81eaa", "bug_issue": 31790, "solve_pr": 13195, "call_graph": {"nodes": [{"id": "django/contrib/messages/storage/cookie.py::CookieStorage::_store"}, {"id": "django/contrib/messages/storage/cookie.py::CookieStorage::_update_cookie"}, {"id": "django/contrib/sessions/middleware.py::SessionMiddleware::process_response"}, {"id": "django/http/response.py::HttpResponseBase::delete_cookie"}], "edges": [{"source": "django/contrib/messages/storage/cookie.py::CookieStorage::_store", "target": "django/contrib/messages/storage/cookie.py::CookieStorage::_update_cookie"}, {"source": "django/contrib/messages/storage/cookie.py::CookieStorage::_update_cookie", "target": "django/http/response.py::HttpResponseBase::delete_cookie"}, {"source": "django/contrib/sessions/middleware.py::SessionMiddleware::process_response", "target": "django/http/response.py::HttpResponseBase::delete_cookie"}]}, "graph_spec": "These functions manage response cookies that support temporary notifications and per-visitor session data across requests. CookieStorage._store persists messages and reports those not stored, while _update_cookie manages the message cookie; SessionMiddleware.process_response coordinates session persistence and session-cookie management. HttpResponseBase.delete_cookie provides the shared response interface for deleting cookies used by both responsibilities."} {"repo": "django/django", "buggy_commit": "6e9c5ee88fc948e05b4a7d9f82a8861ed2b0343d", "bug_issue": 31864, "solve_pr": 13279, "call_graph": {"nodes": [{"id": "django/contrib/sessions/backends/base.py::SessionBase::encode"}, {"id": "django/contrib/sessions/backends/db.py::SessionStore::create_model_instance"}, {"id": "django/contrib/sessions/backends/db.py::SessionStore::save"}, {"id": "django/contrib/sessions/backends/file.py::SessionStore::create"}, {"id": "django/contrib/sessions/backends/file.py::SessionStore::load"}, {"id": "django/contrib/sessions/backends/file.py::SessionStore::save"}], "edges": [{"source": "django/contrib/sessions/backends/db.py::SessionStore::create_model_instance", "target": "django/contrib/sessions/backends/base.py::SessionBase::encode"}, {"source": "django/contrib/sessions/backends/db.py::SessionStore::save", "target": "django/contrib/sessions/backends/db.py::SessionStore::create_model_instance"}, {"source": "django/contrib/sessions/backends/file.py::SessionStore::create", "target": "django/contrib/sessions/backends/file.py::SessionStore::save"}, {"source": "django/contrib/sessions/backends/file.py::SessionStore::load", "target": "django/contrib/sessions/backends/file.py::SessionStore::create"}, {"source": "django/contrib/sessions/backends/file.py::SessionStore::save", "target": "django/contrib/sessions/backends/base.py::SessionBase::encode"}, {"source": "django/contrib/sessions/backends/file.py::SessionStore::save", "target": "django/contrib/sessions/backends/file.py::SessionStore::create"}]}, "graph_spec": "Session persistence must serialize each session dictionary with the configured serializer and a backend-specific signed, optionally compressed representation, so stored data is authenticated and remains decodable by the same store and by concurrently deployed compatible readers sharing the data when SHA-1 is configured. Database saves must build a model record from the current session key (creating one if necessary), encoded data, and computed expiry, and must distinguish required insertion from update semantics: insertion conflicts are reported as creation failures, while an unavailable update is reported as an update failure. File-backed sessions must allocate unique keys through exclusive creation, write encoded content via a temporary file and replacement so readers never observe a partial payload, and preserve those same create-versus-update outcomes. Loading a file must return a usable dictionary: absent or inaccessible storage clears the key, empty files yield an empty session, and invalid or expired content is discarded, with the expired file removed and a fresh session created."} +{"repo": "django/django", "buggy_commit": "e39e727ded673e74016b5d3658d23cbe20234d11", "bug_issue": 31928, "solve_pr": 13344, "call_graph": {"nodes": [{"id": "django/middleware/cache.py::CacheMiddleware::__init__"}, {"id": "django/middleware/cache.py::FetchFromCacheMiddleware::__init__"}, {"id": "django/middleware/cache.py::UpdateCacheMiddleware::__init__"}, {"id": "django/middleware/security.py::SecurityMiddleware::__init__"}], "edges": []}, "graph_spec": "The cache middleware constructors must initialize a coherent cache configuration from the middleware settings—key prefix, cache alias and resolved cache backend, default timeout, and page timeout—so the combined middleware and the paired fetch/update middleware use the same settings-derived identity and backend. The combined CacheMiddleware must preserve the distinction between omitted decorator-style overrides (retain middleware settings) and explicit `None` overrides (use an empty key prefix or the default cache alias), while explicit timeout and page-timeout values take effect as supplied. SecurityMiddleware must snapshot its configured transport-security, redirect, response-header, and referrer-policy options at construction, and compile every redirect-exemption pattern so later request handling can safely apply those configured exemptions; initialization must remain compatible with the middleware response callable contract."} {"repo": "django/django", "buggy_commit": "a6291394256aa758d74eec9ce0cfae8aea6475f2", "bug_issue": 31941, "solve_pr": 13343, "call_graph": {"nodes": [{"id": "django/db/models/fields/files.py::FileField::__init__"}, {"id": "django/db/models/fields/files.py::FileField::deconstruct"}], "edges": []}, "graph_spec": "FileField.__init__ initializes a model field for file uploads using field metadata, upload destination settings, and storage configuration. FileField.deconstruct returns the information needed to recreate that field, supporting its serialization for Django model migrations."} {"repo": "django/django", "buggy_commit": "580a4341cb0b4cbfc215a70afc004875a7e815f4", "bug_issue": 31989, "solve_pr": 13410, "call_graph": {"nodes": [{"id": "django/contrib/staticfiles/storage.py::ManifestFilesMixin::post_process"}, {"id": "django/contrib/staticfiles/storage.py::ManifestFilesMixin::save_manifest"}, {"id": "django/core/cache/backends/filebased.py::FileBasedCache::set"}, {"id": "django/core/cache/backends/filebased.py::FileBasedCache::touch"}, {"id": "django/core/files/locks.py::lock"}, {"id": "django/core/files/locks.py::unlock"}, {"id": "django/core/files/move.py::file_move_safe"}, {"id": "django/core/files/storage.py::FileSystemStorage::_save"}, {"id": "django/core/files/storage.py::Storage::save"}], "edges": [{"source": "django/contrib/staticfiles/storage.py::ManifestFilesMixin::post_process", "target": "django/contrib/staticfiles/storage.py::ManifestFilesMixin::post_process"}, {"source": "django/contrib/staticfiles/storage.py::ManifestFilesMixin::post_process", "target": "django/contrib/staticfiles/storage.py::ManifestFilesMixin::save_manifest"}, {"source": "django/contrib/staticfiles/storage.py::ManifestFilesMixin::save_manifest", "target": "django/core/files/storage.py::FileSystemStorage::_save"}, {"source": "django/core/cache/backends/filebased.py::FileBasedCache::set", "target": "django/core/files/move.py::file_move_safe"}, {"source": "django/core/cache/backends/filebased.py::FileBasedCache::touch", "target": "django/core/files/locks.py::lock"}, {"source": "django/core/files/move.py::file_move_safe", "target": "django/core/files/locks.py::lock"}, {"source": "django/core/files/move.py::file_move_safe", "target": "django/core/files/locks.py::unlock"}, {"source": "django/core/files/storage.py::FileSystemStorage::_save", "target": "django/core/files/locks.py::lock"}, {"source": "django/core/files/storage.py::FileSystemStorage::_save", "target": "django/core/files/locks.py::unlock"}, {"source": "django/core/files/storage.py::FileSystemStorage::_save", "target": "django/core/files/move.py::file_move_safe"}, {"source": "django/core/files/storage.py::Storage::save", "target": "django/core/files/storage.py::FileSystemStorage::_save"}]}, "graph_spec": "Manifest static-file processing must start from a fresh hash-path mapping, yield the underlying hash/copy and reference-rewrite results (including repeated passes for adjustable files until substitutions stabilize or the configured limit is reported), then—except in dry-run mode—persist exactly the resulting mapping with its manifest version, replacing any prior manifest. Saving content must normalize file-like inputs, choose an available name before delegating to filesystem storage, create required directories, avoid name-collision races by retrying with a new available name, preserve configured permissions, and return a forward-slash storage name. Filesystem writes and fallback cross-filesystem moves must serialize destination writes with an exclusive portable lock that is released on all paths; where file locking is supported, successful lock acquisition and release must each return true. Moves must reject an existing destination unless overwrite is allowed, prefer rename, otherwise copy all bytes, preserve metadata where permitted, and remove the source only after transfer. File-cache set must write a complete serialized value to a temporary file and publish it by overwrite-capable safe move, cleaning the temporary file if publication fails; touch must exclusively lock the existing entry, retain its value while replacing only expiry, return false for missing or expired entries, and always unlock."} {"repo": "django/django", "buggy_commit": "71ae1ab0123582cc5bfe0f7d5f4cc19a9412f396", "bug_issue": 31990, "solve_pr": 13417, "call_graph": {"nodes": [{"id": "django/db/models/query.py::QuerySet::ordered"}], "edges": []}, "graph_spec": "QuerySet.ordered is a public introspection property that reports whether a queryset has a defined result ordering. It exposes a boolean status for the ordering associated with a database query, a concept encompassing query-level ordering and model-level default ordering."} @@ -130,6 +140,7 @@ {"repo": "django/django", "buggy_commit": "466920f6d726eee90d5566e0a9948e92b33a122e", "bug_issue": 32455, "solve_pr": 14017, "call_graph": {"nodes": [{"id": "django/db/models/query_utils.py::Q::__and__"}, {"id": "django/db/models/query_utils.py::Q::__or__"}, {"id": "django/db/models/query_utils.py::Q::_combine"}], "edges": [{"source": "django/db/models/query_utils.py::Q::__and__", "target": "django/db/models/query_utils.py::Q::_combine"}, {"source": "django/db/models/query_utils.py::Q::__or__", "target": "django/db/models/query_utils.py::Q::_combine"}]}, "graph_spec": "Q objects represent reusable SQL conditions for database queries. Q.__and__ and Q.__or__ compose these conditions through logical AND and OR, producing combined Q objects; Q._combine provides the shared composition role within this scope."} {"repo": "django/django", "buggy_commit": "bc04941bf811d1ea2c79fb7fc20457ed2c7e3410", "bug_issue": 32546, "solve_pr": 14122, "call_graph": {"nodes": [{"id": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::get_group_by"}, {"id": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup"}], "edges": [{"source": "django/db/models/sql/compiler.py::SQLCompiler::as_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::as_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::get_combinator_sql", "target": "django/db/models/sql/compiler.py::SQLCompiler::as_sql"}, {"source": "django/db/models/sql/compiler.py::SQLCompiler::pre_sql_setup", "target": "django/db/models/sql/compiler.py::SQLCompiler::get_group_by"}]}, "graph_spec": "SQL compilation must first establish a consistent select list, ordering, WHERE/HAVING split, any DISTINCT-required ordering selects, and a GROUP BY derived from the query’s minimum grouping plus relevant select, ordering, and HAVING expressions; grouping SQL must be formatted and deduplicated with its parameters preserved. It must then produce a parameterized SELECT whose clauses occur in SQL order, honor backend capabilities and transaction requirements for compound operations and row locking, and restore query alias reference counts on every exit. Compound SELECTs must compile each nonempty component with a compatible projected column set, reject unsupported component ordering or slicing, preserve component parameter order, omit empty components only where the set operation permits it, and apply UNION ALL only for UNION. When ordering expressions are added solely to satisfy DISTINCT, a subquery used as an expression must expose only its intended select columns."} {"repo": "django/django", "buggy_commit": "45814af6197cfd8f4dc72ee43b90ecde305a1d5a", "bug_issue": 32548, "solve_pr": 14140, "call_graph": {"nodes": [{"id": "django/db/models/query_utils.py::Q::__and__"}, {"id": "django/db/models/query_utils.py::Q::__or__"}, {"id": "django/db/models/query_utils.py::Q::_combine"}, {"id": "django/db/models/query_utils.py::Q::deconstruct"}], "edges": [{"source": "django/db/models/query_utils.py::Q::__and__", "target": "django/db/models/query_utils.py::Q::_combine"}, {"source": "django/db/models/query_utils.py::Q::__or__", "target": "django/db/models/query_utils.py::Q::_combine"}, {"source": "django/db/models/query_utils.py::Q::_combine", "target": "django/db/models/query_utils.py::Q::deconstruct"}]}, "graph_spec": "Q objects represent reusable SQL conditions for database operations. Within this scope, __and__ and __or__ provide logical conjunction and disjunction, supported by _combine to compose conditions into Q objects; deconstruct provides reconstruction information for Django’s object serialization."} +{"repo": "django/django", "buggy_commit": "6efc35b4fe3009666e56a60af0675d7d532bf4ff", "bug_issue": 32573, "solve_pr": 14170, "call_graph": {"nodes": [{"id": "django/db/backends/base/operations.py::BaseDatabaseOperations::year_lookup_bounds_for_date_field"}, {"id": "django/db/backends/base/operations.py::BaseDatabaseOperations::year_lookup_bounds_for_datetime_field"}, {"id": "django/db/models/lookups.py::YearLookup::as_sql"}, {"id": "django/db/models/lookups.py::YearLookup::year_lookup_bounds"}], "edges": [{"source": "django/db/models/lookups.py::YearLookup::as_sql", "target": "django/db/models/lookups.py::YearLookup::year_lookup_bounds"}, {"source": "django/db/models/lookups.py::YearLookup::year_lookup_bounds", "target": "django/db/backends/base/operations.py::BaseDatabaseOperations::year_lookup_bounds_for_date_field"}, {"source": "django/db/models/lookups.py::YearLookup::year_lookup_bounds", "target": "django/db/backends/base/operations.py::BaseDatabaseOperations::year_lookup_bounds_for_datetime_field"}]}, "graph_spec": "These functions support Django ORM year-based filtering of date and datetime fields, covering calendar years and ISO 8601 week-numbering years. The two BaseDatabaseOperations methods provide temporal bounds for their respective field categories, while YearLookup.year_lookup_bounds supplies bounds within the lookup context and YearLookup.as_sql produces the lookup’s SQL fragment and query parameters."} {"repo": "django/django", "buggy_commit": "5a8e8f80bb82a867eab7e4d9d099f21d0a976d22", "bug_issue": 32669, "solve_pr": 14311, "call_graph": {"nodes": [{"id": "django/core/management/commands/runserver.py::Command::handle"}, {"id": "django/core/management/commands/runserver.py::Command::run"}, {"id": "django/utils/autoreload.py::get_child_arguments"}, {"id": "django/utils/autoreload.py::restart_with_reloader"}, {"id": "django/utils/autoreload.py::run_with_reloader"}], "edges": [{"source": "django/core/management/commands/runserver.py::Command::handle", "target": "django/core/management/commands/runserver.py::Command::run"}, {"source": "django/core/management/commands/runserver.py::Command::run", "target": "django/utils/autoreload.py::run_with_reloader"}, {"source": "django/utils/autoreload.py::restart_with_reloader", "target": "django/utils/autoreload.py::get_child_arguments"}, {"source": "django/utils/autoreload.py::run_with_reloader", "target": "django/utils/autoreload.py::restart_with_reloader"}]}, "graph_spec": "The development-server command must reject unsafe or invalid startup configuration, normalize the requested host, port, and IPv6 mode (including appropriate defaults), and then either run directly when reloading is disabled or delegate the same server-start callback and options to the reloader. Reloading must separate a supervising process from a marked child process: the supervisor must reconstruct an equivalent Python invocation, retaining warning options and faithfully handling module-based, script-based, and supported Windows entrypoints, then launch the child with the autoreload environment marker. The child must run the supplied server callback under a selected file reloader, while the supervisor restarts it only for the designated reload exit status and otherwise returns the child’s final exit status; termination interrupts should end cleanly."} {"repo": "django/django", "buggy_commit": "187118203197801c6cb72dc8b06b714b23b6dd3d", "bug_issue": 32687, "solve_pr": 14315, "call_graph": {"nodes": [{"id": "django/core/management/commands/dbshell.py::Command::handle"}, {"id": "django/db/backends/base/client.py::BaseDatabaseClient::runshell"}, {"id": "django/db/backends/postgresql/client.py::DatabaseClient::settings_to_cmd_args_env"}], "edges": [{"source": "django/core/management/commands/dbshell.py::Command::handle", "target": "django/db/backends/base/client.py::BaseDatabaseClient::runshell"}]}, "graph_spec": "The dbshell command must select the requested database connection and delegate all trailing parameters unchanged to its client shell. The client must translate PostgreSQL settings into a `psql` invocation, placing configured user, host, port, and database arguments before user-supplied parameters; when neither a database name nor service is configured, it must target `postgres`. Connection secrets and PostgreSQL service/TLS/passfile options must be supplied through the corresponding environment variables, preserving the inherited process environment when any are set. The shell process must report a missing executable and nonzero exit status as command errors, and PostgreSQL execution must temporarily ignore SIGINT so `psql` receives it, then always restore the prior handler."} {"repo": "django/django", "buggy_commit": "06fd4df41afb5aa1d681b853c3c08d8c688ca3a5", "bug_issue": 32690, "solve_pr": 14351, "call_graph": {"nodes": [{"id": "django/db/models/lookups.py::In::get_group_by_cols"}], "edges": []}, "graph_spec": "In.get_group_by_cols() identifies the column references contributed by a membership lookup expression for SQL GROUP BY construction. It participates in Django’s expression interface for grouping, which organizes query rows into groups for aggregation."} @@ -143,6 +154,7 @@ {"repo": "django/django", "buggy_commit": "4884a87e022056eda10534c13d74e49b8cdda632", "bug_issue": 33027, "solve_pr": 14771, "call_graph": {"nodes": [{"id": "django/core/management/commands/runserver.py::Command::handle"}, {"id": "django/core/management/commands/runserver.py::Command::run"}, {"id": "django/utils/autoreload.py::get_child_arguments"}, {"id": "django/utils/autoreload.py::restart_with_reloader"}, {"id": "django/utils/autoreload.py::run_with_reloader"}], "edges": [{"source": "django/core/management/commands/runserver.py::Command::handle", "target": "django/core/management/commands/runserver.py::Command::run"}, {"source": "django/core/management/commands/runserver.py::Command::run", "target": "django/utils/autoreload.py::run_with_reloader"}, {"source": "django/utils/autoreload.py::restart_with_reloader", "target": "django/utils/autoreload.py::get_child_arguments"}, {"source": "django/utils/autoreload.py::run_with_reloader", "target": "django/utils/autoreload.py::restart_with_reloader"}]}, "graph_spec": "These functions coordinate Django’s lightweight development web server: Command.handle provides the command entry point, and Command.run manages server execution with automatic reloading support. Automatic reloading lets code changes take effect during development; run_with_reloader coordinates execution of a supplied callable, while restart_with_reloader and get_child_arguments support restarting the development process and preparing its executable arguments."} {"repo": "django/django", "buggy_commit": "004b4620f6f4ad87261e149898940f2dcd5757ef", "bug_issue": 33043, "solve_pr": 14787, "call_graph": {"nodes": [{"id": "django/utils/decorators.py::_multi_decorate::_wrapper"}], "edges": []}, "graph_spec": "The scoped wrapper supports applying function decorators to instance methods in Django, including methods of class-based views. It serves as the callable adapter for a decorated method, accepting method-call arguments and returning the decorated call’s result; this bridges the distinction between standalone functions and methods associated with an instance."} {"repo": "django/django", "buggy_commit": "dab48b7482295956973879d15bfd4d3bb0718772", "bug_issue": 33187, "solve_pr": 15037, "call_graph": {"nodes": [{"id": "django/core/management/commands/inspectdb.py::Command::handle"}, {"id": "django/core/management/commands/inspectdb.py::Command::handle_inspection"}], "edges": [{"source": "django/core/management/commands/inspectdb.py::Command::handle", "target": "django/core/management/commands/inspectdb.py::Command::handle_inspection"}]}, "graph_spec": "These functions support the inspectdb management command, which examines an existing database schema and produces a Django model module to help integrate that database with Django. Django models represent database tables and their fields in Python; handle provides the command entry point and output responsibility, while handle_inspection supplies the inspection and model-generation work using command options."} +{"repo": "django/django", "buggy_commit": "a754b82dac511475b6276039471ccd17cc64aeb8", "bug_issue": 33201, "solve_pr": 14999, "call_graph": {"nodes": [{"id": "django/db/migrations/operations/models.py::RenameModel::database_backwards"}, {"id": "django/db/migrations/operations/models.py::RenameModel::database_forwards"}], "edges": [{"source": "django/db/migrations/operations/models.py::RenameModel::database_backwards", "target": "django/db/migrations/operations/models.py::RenameModel::database_forwards"}]}, "graph_spec": "A model rename must run database schema changes only when the destination model is allowed on the active database alias, and it must be a no-op when the old and new models use the same physical table. Otherwise it must rename the model table, retarget every relation that pointed at the old model using the corresponding field in the destination state (including self-relations), and rename auto-created, non-self-referential many-to-many intermediary tables and their model-name-derived columns. Reversal must apply precisely the same behavior with old and new identities exchanged, then restore the operation’s original names and normalized-name state so the operation remains reusable and correctly describes the forward rename."} {"repo": "django/django", "buggy_commit": "a7e7043c8746933dafce652507d3b821801cdc7d", "bug_issue": 33305, "solve_pr": 15104, "call_graph": {"nodes": [{"id": "django/core/management/commands/makemigrations.py::Command::handle"}, {"id": "django/core/management/commands/migrate.py::Command::handle"}, {"id": "django/db/migrations/autodetector.py::MigrationAutodetector::_detect_changes"}, {"id": "django/db/migrations/autodetector.py::MigrationAutodetector::changes"}, {"id": "django/db/migrations/autodetector.py::MigrationAutodetector::generate_renamed_models"}, {"id": "django/db/migrations/autodetector.py::MigrationAutodetector::only_relation_agnostic_fields"}], "edges": [{"source": "django/core/management/commands/makemigrations.py::Command::handle", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::changes"}, {"source": "django/core/management/commands/migrate.py::Command::handle", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::changes"}, {"source": "django/db/migrations/autodetector.py::MigrationAutodetector::_detect_changes", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::generate_renamed_models"}, {"source": "django/db/migrations/autodetector.py::MigrationAutodetector::changes", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::_detect_changes"}, {"source": "django/db/migrations/autodetector.py::MigrationAutodetector::generate_renamed_models", "target": "django/db/migrations/autodetector.py::MigrationAutodetector::only_relation_agnostic_fields"}]}, "graph_spec": "The scoped flow must compare the migration loader’s project state with the installed-app model state and produce dependency-ordered, graph-compatible migration plans; `makemigrations` must use that result for the requested apps (including conversion to initial migrations when requested), report no changes when empty, and otherwise emit the planned migration files, while `migrate` must use the same comparison only to notify that unapplied model changes exist when there is no migration plan. Detection must initialize fresh operation/index/constraint state, exclude unmanaged, proxy, and already-real-app models according to their migration eligibility, resolve both states’ relations, identify model renames before other model-level operations, then order, split, and optimize operations into migrations. A rename is eligible only between removed and added models in the same app whose fields have equivalent deep definitions after ignoring field names and relation targets; confirmation is required, relation dependencies must be retained, and accepted renames must update the old/new model and relation mappings so later comparison treats them as one continuing model."} {"repo": "django/django", "buggy_commit": "cb383753c0e0eb52306e1024d32a782549c27e61", "bug_issue": 33319, "solve_pr": 15128, "call_graph": {"nodes": [{"id": "django/db/models/query.py::QuerySet::__or__"}, {"id": "django/db/models/sql/query.py::Query::bump_prefix"}, {"id": "django/db/models/sql/query.py::Query::combine"}], "edges": [{"source": "django/db/models/query.py::QuerySet::__or__", "target": "django/db/models/sql/query.py::Query::combine"}]}, "graph_spec": "`QuerySet.__or__` must produce a compatible, independent queryset whose result set is the logical union of the operands: reject already-combined querysets and incompatible projected value selections, preserve either operand unchanged when the other is empty, retain known related-object state from both, and express sliced/non-filterable operands through primary-key membership before combining. `Query.combine(..., OR)` must reject incompatible base models, slicing, or distinctness configuration; merge the right-hand query without mutating it; and correctly combine queries containing repeated or overlapping relationship paths without raising an internal error or changing their result semantics. It must preserve required relationship-path multiplicity and optional-related-row behavior, combine WHERE clauses with OR, carry selection/extra state and right-side-preferred ordering coherently, and reject the ambiguous case where both operands supply extra selected columns."} {"repo": "django/django", "buggy_commit": "30613d6a748fce18919ff8b0da166d9fda2ed9bc", "bug_issue": 33406, "solve_pr": 15277, "call_graph": {"nodes": [{"id": "django/db/models/fields/__init__.py::CharField::__init__"}], "edges": []}, "graph_spec": "CharField.__init__ initializes a Django model field for string data using field configuration options. In Django’s model API, a CharField describes a text-valued database attribute, with configuration covering character length and database collation."} @@ -172,6 +184,7 @@ {"repo": "django/django", "buggy_commit": "39f83765e12b0e5d260b7939fc3fe281d879b279", "bug_issue": 34272, "solve_pr": 16485, "call_graph": {"nodes": [{"id": "django/template/defaultfilters.py::floatformat"}], "edges": []}, "graph_spec": "`floatformat` must convert a numeric input to a localized, safe display string using decimal half-up rounding. With a nonnegative precision it must show exactly that many fractional digits; with a negative precision (including the default −1) it must suppress the fractional part when the value is integral, while otherwise rounding to the corresponding absolute precision. It must preserve numeric sign and avoid scientific-notation output, support `g` to force locale-based thousands grouping and `u` to disable localization (including either combined suffix order), and format non-finite Decimal values as their ordinary string representation. Inputs that cannot be interpreted numerically produce an empty string; an invalid precision or a value that cannot be converted to an integer for integral detection is returned in its original string form."} {"repo": "django/django", "buggy_commit": "bd366ca2aeffa869b7dbc0b0aa01caea75e6dc31", "bug_issue": 34301, "solve_pr": 16527, "call_graph": {"nodes": [{"id": "django/contrib/admin/templatetags/admin_modify.py::submit_row"}], "edges": []}, "graph_spec": "The `submit_row` function supports displaying the save and delete controls on Django admin forms, using the template context to provide presentation information. These controls support the admin’s model-record editing workflow, allowing users to save changes or access deletion."} {"repo": "django/django", "buggy_commit": "f9fe062de5fc0896d6bbbf3f260b5c44473b3c77", "bug_issue": 34366, "solve_pr": 16595, "call_graph": {"nodes": [{"id": "django/db/migrations/operations/fields.py::AlterField::reduce"}], "edges": []}, "graph_spec": "AlterField.reduce participates in optimizing Django migrations, which represent changes to model and database schemas, for an operation that changes an existing field’s definition. Given another migration operation and application context, it provides replacement operations or a boolean optimization indication, supporting simplification while preserving the represented changes."} +{"repo": "django/django", "buggy_commit": "55bcbd8d172b689811fae17cde2f09218dd74e9c", "bug_issue": 34377, "solve_pr": 16612, "call_graph": {"nodes": [{"id": "django/contrib/admin/sites.py::AdminSite::catch_all_view"}], "edges": []}, "graph_spec": "AdminSite.catch_all_view serves as the admin site's fallback web view, accepting an HTTP request and URL to provide a response within the admin URL namespace. Its documented role supports the admin site's authentication boundary and helps protect the privacy of which models are exposed through the administration interface."} {"repo": "django/django", "buggy_commit": "9b224579875e30203d079cc2fee83b116d98eb78", "bug_issue": 34384, "solve_pr": 16631, "call_graph": {"nodes": [{"id": "django/contrib/auth/__init__.py::get_user"}, {"id": "django/contrib/auth/middleware.py::AuthenticationMiddleware::process_request"}, {"id": "django/contrib/auth/middleware.py::get_user"}, {"id": "django/utils/decorators.py::_decorator::_wrapper_view"}], "edges": [{"source": "django/contrib/auth/middleware.py::AuthenticationMiddleware::process_request", "target": "django/contrib/auth/middleware.py::get_user"}, {"source": "django/contrib/auth/middleware.py::get_user", "target": "django/contrib/auth/__init__.py::get_user"}, {"source": "django/utils/decorators.py::_decorator::_wrapper_view", "target": "django/contrib/auth/middleware.py::AuthenticationMiddleware::process_request"}]}, "graph_spec": "These functions connect session-based authentication to Django web requests: the authentication and middleware user accessors retrieve the user associated with a request’s session, while AuthenticationMiddleware.process_request exposes the current user on the request. The view wrapper supports applying middleware functionality to individual views, bringing that request-level authentication context into view handling."} {"repo": "django/django", "buggy_commit": "fbe850106b2e4b85f838219cb9e1df95fba6c164", "bug_issue": 34405, "solve_pr": 16642, "call_graph": {"nodes": [{"id": "django/http/response.py::FileResponse::_set_streaming_content"}, {"id": "django/http/response.py::FileResponse::set_headers"}], "edges": [{"source": "django/http/response.py::FileResponse::_set_streaming_content", "target": "django/http/response.py::FileResponse::set_headers"}]}, "graph_spec": "FileResponse must treat readable file-like content as a managed, block-wise byte stream, retain it for file-serving, arrange for its close method to run with response cleanup, and configure headers before streaming begins; non-file iterables must retain normal streaming-response behavior without file metadata. Header generation must describe only the remaining bytes from the file’s current position, computing Content-Length when supported while preserving or correctly restoring the stream position. Unless a content type was explicitly supplied, Content-Type must be inferred from the effective basename (including safe handling of compressed-file encodings) with an octet-stream fallback. Content-Disposition must use the requested filename or file name’s basename and reflect whether delivery is an attachment, without exposing directory components."} {"repo": "django/django", "buggy_commit": "02c356f2f3945b8075735d485c3cf48cad991011", "bug_issue": 34424, "solve_pr": 16667, "call_graph": {"nodes": [{"id": "django/forms/widgets.py::SelectDateWidget::value_from_datadict"}], "edges": []}, "graph_spec": "SelectDateWidget.value_from_datadict extracts the widget’s date value from submitted form data for use in form processing. It connects a date input presented as separate month, day, and year selection controls to Django’s interface for retrieving a single widget value."} @@ -180,7 +193,6 @@ {"repo": "django/django", "buggy_commit": "f8c43aca467b7b0c4bb0a7fa41362f90b610b8df", "bug_issue": 34717, "solve_pr": 17084, "call_graph": {"nodes": [{"id": "django/contrib/admin/filters.py::BooleanFieldListFilter::choices"}, {"id": "django/contrib/admin/filters.py::ChoicesFieldListFilter::choices"}, {"id": "django/contrib/admin/filters.py::DateFieldListFilter::choices"}, {"id": "django/contrib/admin/filters.py::EmptyFieldListFilter::choices"}, {"id": "django/contrib/admin/filters.py::FacetsMixin::get_facet_queryset"}, {"id": "django/contrib/admin/filters.py::RelatedFieldListFilter::choices"}, {"id": "django/contrib/admin/filters.py::SimpleListFilter::choices"}, {"id": "django/db/models/query.py::QuerySet::aggregate"}, {"id": "django/db/models/sql/query.py::Query::get_aggregation"}], "edges": [{"source": "django/contrib/admin/filters.py::BooleanFieldListFilter::choices", "target": "django/contrib/admin/filters.py::FacetsMixin::get_facet_queryset"}, {"source": "django/contrib/admin/filters.py::ChoicesFieldListFilter::choices", "target": "django/contrib/admin/filters.py::FacetsMixin::get_facet_queryset"}, {"source": "django/contrib/admin/filters.py::DateFieldListFilter::choices", "target": "django/contrib/admin/filters.py::FacetsMixin::get_facet_queryset"}, {"source": "django/contrib/admin/filters.py::EmptyFieldListFilter::choices", "target": "django/contrib/admin/filters.py::FacetsMixin::get_facet_queryset"}, {"source": "django/contrib/admin/filters.py::FacetsMixin::get_facet_queryset", "target": "django/db/models/query.py::QuerySet::aggregate"}, {"source": "django/contrib/admin/filters.py::RelatedFieldListFilter::choices", "target": "django/contrib/admin/filters.py::FacetsMixin::get_facet_queryset"}, {"source": "django/contrib/admin/filters.py::SimpleListFilter::choices", "target": "django/contrib/admin/filters.py::FacetsMixin::get_facet_queryset"}, {"source": "django/db/models/query.py::QuerySet::aggregate", "target": "django/db/models/sql/query.py::Query::get_aggregation"}]}, "graph_spec": "Each admin list-filter `choices()` node must yield a stable, ordered stream of choice mappings carrying `selected`, `query_string`, and a human-readable `display`; the set of choices is derived from the filter's own configured choices/links, and only when `changelist.add_facets` is truthy may display text be augmented with per-choice counts. In the faceted path, every such node must obtain all counts through `FacetsMixin.get_facet_queryset(changelist)`, which builds the queryset from the changelist while excluding the filter's own expected parameters, then aggregates exactly the count expressions supplied by the filter's `get_facet_counts()`, keyed so each filter can map a choice to its count (or fall back to an unavailable indicator/marker where a named key is absent). Count aggregations must be computed over the filtered queryset without mutating the changelist or leaking the temporarily substituted filter parameter values. `QuerySet.aggregate()` must reject querysets using `distinct(fields)`, require all supplied expressions to be aggregate expressions and each complex positional aggregate to have a usable default alias, otherwise raise the appropriate `TypeError`/`NotImplementedError`, and must return a plain mapping of alias to value produced by chaining the query and delegating to `Query.get_aggregation()`; it must not restrict to a single aggregate. `Query.get_aggregation()` must return an empty mapping when no aggregate expressions are given, validate and resolve each alias (rejecting non-aggregate expressions), and produce exactly one result row containing all requested aggregates while honoring existing grouping/annotations, limits, distinctness, subquery references, window references, HAVING/QUALIFY, and combinator state — using an inner subquery plus outer aggregate query when any of those require aggregation over already-shaped results, and returning results keyed by the requested aliases."} {"repo": "duckdb/duckdb", "buggy_commit": "668f94740b280bf44c7c081df664ae1eb310c090", "bug_issue": 25298, "solve_pr": 25552, "call_graph": {"nodes": [{"id": "src/function/cast/string_cast.cpp::StringToNestedTypeCast"}], "edges": []}, "graph_spec": "`StringToNestedTypeCast` is the bound cast functor from VARCHAR into a nested target (LIST, ARRAY, STRUCT/TUPLE, MAP); it is templated on a target-shape helper whose `StringToNestedTypeCastLoop` does the per-row parsing and recursive child casting. It must require a VARCHAR source (asserted) and dispatch on the source vector type. A CONSTANT_VECTOR contributes exactly one string value with one-row semantics and no selection vector, and the result must be re-normalized to a constant vector afterward because a child (e.g. a shredded VARIANT child) may not itself be representable as constant; any other vector type must be read through unified format so the data pointer, validity mask, and selection vector are all honored. In the non-constant path the helper loop is invoked with the full row count and the source selection vector, so every row must resolve its source value and validity through the selection index while writing result state at the logical row position; NULL source rows must produce NULL results and must not be reported as conversion failures. The result's flat validity mask is shared with the helper, which marks rows NULL for parse or child-cast errors according to the cast parameters, and the boolean return must be false if any non-null value failed soft casting (true when all converted). Overall the result's cardinality and shape must match the source (one broadcast row for constant input, otherwise `count` rows)."} {"repo": "duckdb/duckdb", "buggy_commit": "6d7abb1090e1079f252b15ba0366310bb87d8582", "bug_issue": 25304, "solve_pr": 25303, "call_graph": {"nodes": [{"id": "src/catalog/catalog_entry/duck_table_entry.cpp::DuckTableEntry::Rollback"}, {"id": "src/execution/operator/schema/physical_create_index.cpp::PhysicalCreateIndex::Sink"}, {"id": "src/execution/physical_plan/plan_create_index.cpp::PhysicalPlanGenerator::CreatePlan"}, {"id": "src/planner/binder/statement/bind_alter.cpp::Binder::Bind"}, {"id": "src/planner/binder/statement/bind_alter.cpp::Binder::BindAlterAddIndex"}, {"id": "src/storage/wal_replay.cpp::WriteAheadLogDeserializer::ReplayAlter"}, {"id": "src/storage/wal_replay.cpp::WriteAheadLogDeserializer::ReplayEntry"}, {"id": "src/storage/write_ahead_log.cpp::WriteAheadLog::WriteAlter"}, {"id": "src/transaction/duck_transaction.cpp::DuckTransaction::WriteToWAL"}, {"id": "src/transaction/duck_transaction_manager.cpp::DuckTransactionManager::CommitTransaction"}, {"id": "src/transaction/meta_transaction.cpp::MetaTransaction::Commit"}, {"id": "src/transaction/undo_buffer.cpp::UndoBuffer::WriteToWAL"}, {"id": "src/transaction/wal_write_state.cpp::WALWriteState::CommitEntry"}, {"id": "src/transaction/wal_write_state.cpp::WALWriteState::WriteCatalogEntry"}], "edges": [{"source": "src/execution/physical_plan/plan_create_index.cpp::PhysicalPlanGenerator::CreatePlan", "target": "src/execution/physical_plan/plan_create_index.cpp::PhysicalPlanGenerator::CreatePlan"}, {"source": "src/planner/binder/statement/bind_alter.cpp::Binder::BindAlterAddIndex", "target": "src/planner/binder/statement/bind_alter.cpp::Binder::BindAlterAddIndex"}, {"source": "src/storage/wal_replay.cpp::WriteAheadLogDeserializer::ReplayEntry", "target": "src/storage/wal_replay.cpp::WriteAheadLogDeserializer::ReplayAlter"}, {"source": "src/transaction/duck_transaction.cpp::DuckTransaction::WriteToWAL", "target": "src/transaction/undo_buffer.cpp::UndoBuffer::WriteToWAL"}, {"source": "src/transaction/duck_transaction_manager.cpp::DuckTransactionManager::CommitTransaction", "target": "src/transaction/duck_transaction.cpp::DuckTransaction::WriteToWAL"}, {"source": "src/transaction/meta_transaction.cpp::MetaTransaction::Commit", "target": "src/transaction/duck_transaction_manager.cpp::DuckTransactionManager::CommitTransaction"}, {"source": "src/transaction/undo_buffer.cpp::UndoBuffer::WriteToWAL", "target": "src/transaction/wal_write_state.cpp::WALWriteState::CommitEntry"}, {"source": "src/transaction/wal_write_state.cpp::WALWriteState::CommitEntry", "target": "src/transaction/wal_write_state.cpp::WALWriteState::WriteCatalogEntry"}, {"source": "src/transaction/wal_write_state.cpp::WALWriteState::WriteCatalogEntry", "target": "src/storage/write_ahead_log.cpp::WriteAheadLog::WriteAlter"}]}, "graph_spec": "`ALTER TABLE ... ADD` of an index-based (UNIQUE or PRIMARY KEY) constraint must behave as one atomic operation that both builds a physical index and adds the catalog constraint, staying consistent through binding, planning, execution, commit, WAL journaling/replay, and rollback. Binding must resolve the altered entry, require a table in a non-system catalog, register the catalog as modified unless the table is temporary, and for an add-unique request rewrite it into an index build bound against a table scan while carrying the derived constraint/index name, key columns, and constraint type. The create-index plan must fail when an index of that name already exists (unless conflicts are ignored), reject non-Duck tables, side-effecting key expressions, and unknown index types, and lower to scan → projection → optional NULL filter → optional sort → create-index, where NULL keys are filtered out for UNIQUE but retained for PRIMARY KEY so they can be rejected; execution must enforce NOT NULL for primary keys, refuse to finalize against a table that was dropped or altered (transaction conflict), and apply the catalog alteration only after verifying no same-named index already exists, then register the physical index in storage. A committing transaction writes to the WAL only when it changed data and WAL writes are enabled; catalog entries flow through the undo buffer in order, and an add-unique ALTER record must serialize both the alter info and the created index's storage description, while other ALTER records serialize only the alter info. Replay must reconstruct the constraint and, for add-unique, the index from that payload so recovery reproduces the same schema, and rolling back the table must remove physical indexes for constraints that were absent before the ALTER so no orphaned index survives."} -{"repo": "duckdb/duckdb", "buggy_commit": "6d7abb1090e1079f252b15ba0366310bb87d8582", "bug_issue": 25324, "solve_pr": 25323, "call_graph": {"nodes": [{"id": "src/planner/binder/statement/bind_insert.cpp::Binder::BindNode"}, {"id": "src/planner/binder/statement/bind_insert.cpp::Binder::GenerateMergeInto"}, {"id": "src/planner/binder/statement/bind_insert.cpp::CreateSetInfoForReplace"}], "edges": [{"source": "src/planner/binder/statement/bind_insert.cpp::Binder::BindNode", "target": "src/planner/binder/statement/bind_insert.cpp::Binder::GenerateMergeInto"}, {"source": "src/planner/binder/statement/bind_insert.cpp::Binder::GenerateMergeInto", "target": "src/planner/binder/statement/bind_insert.cpp::CreateSetInfoForReplace"}]}, "graph_spec": "An INSERT query node carrying ON CONFLICT information must not be planned as a plain insert: BindNode resolves the target as a table entry (rejecting non-table entries and expanding insert triggers first), and whenever on_conflict_info is present it lowers the statement into a MERGE INTO through GenerateMergeInto and binds that resulting statement, so the observable insert-or-update/ignore behavior, statement properties, and the Count/BIGINT result shape are inherited from the bound merge. GenerateMergeInto must derive the conflict target either from the table's unique/primary-key indexes, forming `target. = excluded.` equalities over each index and failing when no unique constraint exists or, for any action other than DO NOTHING, when more than one index matches, or from explicitly listed conflict columns, rejecting ROWID/generated columns and any list that is not exactly covered by a unique index; it must expose incoming rows under the name `excluded`, expand defaults in VALUES, alias and default-pad by-position sources up to the target columns, apply DISTINCT ON over each conflict target, map REPLACE to a WHEN MATCHED update, reject ON CONFLICT WHERE, emit WHEN NOT MATCHED as an insert preserving the original column order, and propagate RETURNING. For REPLACE/DO UPDATE, the WHEN MATCHED action must update exactly the columns that are not part of any unique conflict key: CreateSetInfoForReplace gathers the physical columns referenced by unique indexes, omits those columns from the SET list whether the insert supplies an implicit full column list or an explicit one, and provides the remaining columns as excluded-qualified references, so a conflicting row keeps its key values while receiving all other incoming values."} {"repo": "duckdb/duckdb", "buggy_commit": "79469d161a61de178d8cae745c901cbc9ba3cc15", "bug_issue": 25368, "solve_pr": 25369, "call_graph": {"nodes": [{"id": "src/function/cast/union_casts.cpp::UnionMemberToMemberCast"}, {"id": "src/function/cast/union_casts.cpp::duckdb::ToUnionCast"}, {"id": "src/function/cast/union_casts.cpp::duckdb::UnionToVarcharCast"}], "edges": [{"source": "src/function/cast/union_casts.cpp::duckdb::ToUnionCast", "target": "src/function/cast/union_casts.cpp::UnionMemberToMemberCast"}, {"source": "src/function/cast/union_casts.cpp::duckdb::UnionToVarcharCast", "target": "src/function/cast/union_casts.cpp::duckdb::ToUnionCast"}]}, "graph_spec": "This scope covers casting values into and out of DuckDB UNION types. `ToUnionCast` is the entry point for casts whose result type is a UNION: it must dispatch on `UnionMemberBoundCastData::is_member_to_member`, routing member-to-member mappings to `UnionMemberToMemberCast` and scalar-member promotion to `ToUnionMemberCast`, and must report success. For `UnionMemberToMemberCast` (UNION -> UNION), every source member must be cast into the target member selected by `tag_map`, and the source tag vector must be remapped through the same `tag_map` so each row's tag identifies the member actually written. Target members not reached by the map must be forced to constant NULL, preserving the union invariant that only the tag-selected member column is valid for a row; rows with an invalid/NULL source tag must become NULL. The constant-vector path maps a single source tag and may set the result constant, while the general path must flatten target member vectors and set per-row tags, and the result must satisfy `Verify()` with `count` rows. `UnionToVarcharCast` (UNION -> VARCHAR) must delegate to `ToUnionCast` against a UNION whose members are all VARCHAR, then emit, for each row, NULL when the tag is invalid and the selected member's string otherwise, mapping a valid tag whose member value is NULL to the literal text `NULL`, and finalizing a verified result vector of `count` rows."} {"repo": "duckdb/duckdb", "buggy_commit": "10de9573794001c649621013bdd93553b54e00c9", "bug_issue": 25373, "solve_pr": 25673, "call_graph": {"nodes": [{"id": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"id": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushFiltersIntoDelimJoin"}, {"id": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushdownJoin"}, {"id": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"id": "src/optimizer/filter_statistics.cpp::FilterStatisticsOptimizer::Optimize"}, {"id": "src/optimizer/optimizer.cpp::Optimizer::Optimize"}, {"id": "src/optimizer/optimizer.cpp::Optimizer::RunBuiltInOptimizers"}, {"id": "src/optimizer/partitioned_execution.cpp::PartitionedExecution::Optimize"}, {"id": "src/optimizer/partitioned_execution.cpp::duckdb::PartitionedExecutionSplitPipeline"}, {"id": "src/optimizer/pushdown/pushdown_aggregate.cpp::FilterPushdown::PushdownAggregate"}, {"id": "src/optimizer/pushdown/pushdown_cross_product.cpp::FilterPushdown::PushdownCrossProduct"}, {"id": "src/optimizer/pushdown/pushdown_distinct.cpp::FilterPushdown::PushdownDistinct"}, {"id": "src/optimizer/pushdown/pushdown_filter.cpp::FilterPushdown::PushdownFilter"}, {"id": "src/optimizer/pushdown/pushdown_inner_join.cpp::FilterPushdown::PushdownInnerJoin"}, {"id": "src/optimizer/pushdown/pushdown_left_join.cpp::FilterPushdown::PushdownLeftJoin"}, {"id": "src/optimizer/pushdown/pushdown_limit.cpp::FilterPushdown::PushdownLimit"}, {"id": "src/optimizer/pushdown/pushdown_mark_join.cpp::FilterPushdown::PushdownMarkJoin"}, {"id": "src/optimizer/pushdown/pushdown_outer_join.cpp::FilterPushdown::PushdownOuterJoin"}, {"id": "src/optimizer/pushdown/pushdown_projection.cpp::FilterPushdown::PushdownProjection"}, {"id": "src/optimizer/pushdown/pushdown_secure_view.cpp::FilterPushdown::PushdownSecureView"}, {"id": "src/optimizer/pushdown/pushdown_semi_anti_join.cpp::FilterPushdown::PushdownSemiAntiJoin"}, {"id": "src/optimizer/pushdown/pushdown_set_operation.cpp::FilterPushdown::PushdownSetOperation"}, {"id": "src/optimizer/pushdown/pushdown_single_join.cpp::FilterPushdown::PushdownSingleJoin"}, {"id": "src/optimizer/pushdown/pushdown_unnest.cpp::FilterPushdown::PushdownUnnest"}, {"id": "src/optimizer/pushdown/pushdown_window.cpp::FilterPushdown::PushdownWindow"}], "edges": [{"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushFiltersIntoDelimJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushdownJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushdownJoin", "target": "src/optimizer/pushdown/pushdown_left_join.cpp::FilterPushdown::PushdownLeftJoin"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushdownJoin", "target": "src/optimizer/pushdown/pushdown_mark_join.cpp::FilterPushdown::PushdownMarkJoin"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushdownJoin", "target": "src/optimizer/pushdown/pushdown_outer_join.cpp::FilterPushdown::PushdownOuterJoin"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushdownJoin", "target": "src/optimizer/pushdown/pushdown_semi_anti_join.cpp::FilterPushdown::PushdownSemiAntiJoin"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushdownJoin", "target": "src/optimizer/pushdown/pushdown_single_join.cpp::FilterPushdown::PushdownSingleJoin"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/pushdown/pushdown_aggregate.cpp::FilterPushdown::PushdownAggregate"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/pushdown/pushdown_cross_product.cpp::FilterPushdown::PushdownCrossProduct"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/pushdown/pushdown_projection.cpp::FilterPushdown::PushdownProjection"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/pushdown/pushdown_secure_view.cpp::FilterPushdown::PushdownSecureView"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/pushdown/pushdown_set_operation.cpp::FilterPushdown::PushdownSetOperation"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/pushdown/pushdown_unnest.cpp::FilterPushdown::PushdownUnnest"}, {"source": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite", "target": "src/optimizer/pushdown/pushdown_window.cpp::FilterPushdown::PushdownWindow"}, {"source": "src/optimizer/filter_statistics.cpp::FilterStatisticsOptimizer::Optimize", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/optimizer.cpp::Optimizer::Optimize", "target": "src/optimizer/optimizer.cpp::Optimizer::RunBuiltInOptimizers"}, {"source": "src/optimizer/optimizer.cpp::Optimizer::RunBuiltInOptimizers", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/partitioned_execution.cpp::PartitionedExecution::Optimize", "target": "src/optimizer/partitioned_execution.cpp::duckdb::PartitionedExecutionSplitPipeline"}, {"source": "src/optimizer/partitioned_execution.cpp::duckdb::PartitionedExecutionSplitPipeline", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_aggregate.cpp::FilterPushdown::PushdownAggregate", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/pushdown/pushdown_aggregate.cpp::FilterPushdown::PushdownAggregate", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_cross_product.cpp::FilterPushdown::PushdownCrossProduct", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_distinct.cpp::FilterPushdown::PushdownDistinct", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/pushdown/pushdown_filter.cpp::FilterPushdown::PushdownFilter", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/pushdown/pushdown_inner_join.cpp::FilterPushdown::PushdownInnerJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/pushdown/pushdown_inner_join.cpp::FilterPushdown::PushdownInnerJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::PushFiltersIntoDelimJoin"}, {"source": "src/optimizer/pushdown/pushdown_inner_join.cpp::FilterPushdown::PushdownInnerJoin", "target": "src/optimizer/pushdown/pushdown_cross_product.cpp::FilterPushdown::PushdownCrossProduct"}, {"source": "src/optimizer/pushdown/pushdown_left_join.cpp::FilterPushdown::PushdownLeftJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_limit.cpp::FilterPushdown::PushdownLimit", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/pushdown/pushdown_mark_join.cpp::FilterPushdown::PushdownMarkJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_outer_join.cpp::FilterPushdown::PushdownOuterJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/pushdown/pushdown_outer_join.cpp::FilterPushdown::PushdownOuterJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_projection.cpp::FilterPushdown::PushdownProjection", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_secure_view.cpp::FilterPushdown::PushdownSecureView", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_semi_anti_join.cpp::FilterPushdown::PushdownSemiAntiJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_set_operation.cpp::FilterPushdown::PushdownSetOperation", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_single_join.cpp::FilterPushdown::PushdownSingleJoin", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_unnest.cpp::FilterPushdown::PushdownUnnest", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}, {"source": "src/optimizer/pushdown/pushdown_window.cpp::FilterPushdown::PushdownWindow", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::FinishPushdown"}, {"source": "src/optimizer/pushdown/pushdown_window.cpp::FilterPushdown::PushdownWindow", "target": "src/optimizer/filter_pushdown.cpp::FilterPushdown::Rewrite"}]}, "graph_spec": "FilterPushdown is a logical-plan rewrite that moves predicates as far down toward the scans as semantics allow; its three entry points (Optimizer::RunBuiltInOptimizers, FilterStatisticsOptimizer::Optimize when statistics propagation changed filter bindings, and PartitionedExecutionSplitPipeline after deep-copying a plan) must all leave a tree that returns exactly the same rows as the input, so no predicate may be dropped, evaluated on rows an intervening operator would have removed, or pushed to a child that does not contain all of its bindings. Rewrite dispatches by operator type to per-operator handlers; for any type it cannot push through, FinishPushdown recursively rewrites each child with a fresh FilterPushdown and then re-attaches every leftover filter at the current level via PushFinalFilters/AddLogicalFilter, so filters are never lost and the recursion terminates leaving only equivalent LogicalFilter/LogicalEmptyResult wrappers. PushdownJoin selects a handler from the join type (inner/left/outer/asof/mark/single/semi/anti, unsupported stopping at FinishPushdown) and restores join projection maps; inner joins become cross products with conditions converted to filters, left joins may be upgraded to inner when a filter is null-rejecting, and any contradictory predicate collapses the subtree to LogicalEmptyResult. The FilterCombiner both merges/reorders predicates, can derive new single-side filters from join conditions, and detects unsatisfiable combinations. Barrier-carrying expressions (potentially throwing or side-effecting) must not cross operators that can remove rows, are re-applied above such operators, and are ordered after non-barrier filters. Per-operator obligations must hold: aggregate filters only move when their bindings are in every grouping set and are not volatile; projection substitution must avoid changing volatility/computed-expression evaluation; distinct, limit, window partitioning, unnest, set-operation child-binding rewrites, cross-product side splitting, and the secure-view boundary/cardinality freeze must each keep their operator-specific guarantees."} {"repo": "duckdb/duckdb", "buggy_commit": "6d7abb1090e1079f252b15ba0366310bb87d8582", "bug_issue": 25384, "solve_pr": 25385, "call_graph": {"nodes": [{"id": "src/execution/index/unbound_index.cpp::UnboundIndex::Bind"}, {"id": "src/execution/index/unbound_index.cpp::UnboundIndex::ResetStorage"}], "edges": []}, "graph_spec": "Scope covers the two public entry points of UnboundIndex, an index reconstructed from serialized metadata before it is bound to a live implementation. UnboundIndex::ResetStorage must reclaim the index's persistent storage exactly once: it may only mark blocks from storage_info.allocator_infos as modified through the index block manager when they are valid, and it must be idempotent/no-op on any subsequent call, which the storage_reclaimed guard enforces. The destructor relies on this by reclaiming only when storage has not already been handed off, so destroying an index that was never bound releases its blocks while an already-transferred index leaves them intact. UnboundIndex::Bind must produce a bound index via the index binder and then mark the storage as reclaimed without separately re-reclaiming the blocks, transferring ownership of those persistent blocks to the bound index so they are not freed while still in use. Additionally, when buffered WAL-replay operations are present, Bind must apply them to the newly bound index using the physical column types and the index's stable mapped column ordering, preserving the recorded insert/delete operation order and row-id associations so the bound index reflects all buffered operations. The two nodes are independent entry points that share the single-ownership invariant: storage is reclaimed or handed off at most once, and a bound result must retain both its inherited storage and its replayed operations."} @@ -216,7 +228,6 @@ {"repo": "duckdb/duckdb", "buggy_commit": "37d658d3878004e1ada191c258b046d102281bf4", "bug_issue": 25776, "solve_pr": 25792, "call_graph": {"nodes": [{"id": "src/function/cast/variant/from_variant.cpp::TryFromShreddedCast"}, {"id": "src/function/cast/variant/from_variant.cpp::duckdb::CastFromVARIANT"}], "edges": [{"source": "src/function/cast/variant/from_variant.cpp::duckdb::CastFromVARIANT", "target": "src/function/cast/variant/from_variant.cpp::TryFromShreddedCast"}]}, "graph_spec": "Scope covers the VARIANT-to-target cast entry point `CastFromVARIANT` and the shredded short-circuit `TryFromShreddedCast` it invokes. For a batch of `count` rows, `CastFromVARIANT` must yield exactly `count` values of the requested target type whose values, nulls, and ordering match what the general per-row VARIANT conversion would produce. It must offer the batch to `TryFromShreddedCast` first and, when that reports success, must not also run the fallback conversion; otherwise it must fall back to the recursive VARIANT conversion (the input is then expected to truly be VARIANT) and, on failure, either return false with a descriptive `error_message` or raise a conversion error that names the failing conversion and the target type, leaving an all-NULL result for unsupported targets. `TryFromShreddedCast` must claim success only when the input is a shredded vector and the shredded representation is unambiguously the target type for every row: either the shredded child's declared type equals the target, or the vector is fully shredded as a struct whose typed-value child's type equals the target and whose untyped-value child is constant NULL. It must decline (return false without modifying the result) when the input is not shredded, when the target type is nested, or when only part of the batch is shredded to the target, because aliasing a mismatched or partially-shredded child would produce incorrect values or nulls. On success it may alias the underlying shredded buffer, so the result must stay valid for the whole batch (referenced storage kept alive), preserve per-row validity including NULLs, and preserve the source's constant-vector character. The fast path and the general conversion must be observationally equivalent."} {"repo": "duckdb/duckdb", "buggy_commit": "8aae2b52b605292ec77489e320b7b0ded1c64b19", "bug_issue": 25778, "solve_pr": 25838, "call_graph": {"nodes": [{"id": "extension/json/json_functions/json_serialize_plan.cpp::duckdb::JsonSerializePlanFunction"}, {"id": "src/main/capi/v2/capi_v2_prepared_statement.cpp::duckdb_v2_prepared_statement_create"}, {"id": "src/main/client_context.cpp::ClientContext::CreatePreparedStatement"}, {"id": "src/main/client_context.cpp::ClientContext::CreatePreparedStatementInternal"}, {"id": "src/main/client_context.cpp::ClientContext::ExtractPlan"}, {"id": "src/main/client_context.cpp::ClientContext::Prepare"}, {"id": "src/main/client_context.cpp::ClientContext::PrepareInternal"}, {"id": "src/main/client_context.cpp::ClientContext::Query"}, {"id": "src/main/client_context.cpp::ClientContext::RunInternalStatement"}, {"id": "src/main/client_context.cpp::ClientContext::RunStatementInternal"}, {"id": "src/main/client_context.cpp::ClientContext::Submit"}, {"id": "src/main/client_context.cpp::ClientContext::SubmitInternal"}, {"id": "src/main/client_context.cpp::ClientContext::SubmitInternalStatement"}, {"id": "src/main/client_context.cpp::ClientContext::SubmitStatement"}, {"id": "src/main/client_context.cpp::ClientContext::SubmitStatementInternal"}, {"id": "src/main/client_verify.cpp::ClientContext::StatementVerification"}, {"id": "src/main/connection.cpp::Connection::ExtractPlan"}, {"id": "src/main/connection.cpp::Connection::Prepare"}, {"id": "src/main/prepared_statement.cpp::PreparedStatement::Execute"}, {"id": "src/main/prepared_statement.cpp::PreparedStatement::Submit"}, {"id": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::FindCandidates"}, {"id": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::MaterializedCTEInfo::MaterializedCTEInfo"}, {"id": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::Optimize"}, {"id": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::PushFilterIntoCTE"}, {"id": "src/optimizer/optimizer.cpp::Optimizer::Optimize"}, {"id": "src/optimizer/optimizer.cpp::Optimizer::RunBuiltInOptimizers"}, {"id": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::MaterializeDelimJoinAsCTE"}, {"id": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::Rewrite"}, {"id": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::RewriteDelimJoinsToCTEs"}], "edges": [{"source": "extension/json/json_functions/json_serialize_plan.cpp::duckdb::JsonSerializePlanFunction", "target": "src/optimizer/optimizer.cpp::Optimizer::Optimize"}, {"source": "src/main/capi/v2/capi_v2_prepared_statement.cpp::duckdb_v2_prepared_statement_create", "target": "src/main/client_context.cpp::ClientContext::Prepare"}, {"source": "src/main/client_context.cpp::ClientContext::CreatePreparedStatement", "target": "src/main/client_context.cpp::ClientContext::CreatePreparedStatementInternal"}, {"source": "src/main/client_context.cpp::ClientContext::CreatePreparedStatementInternal", "target": "src/optimizer/optimizer.cpp::Optimizer::Optimize"}, {"source": "src/main/client_context.cpp::ClientContext::ExtractPlan", "target": "src/optimizer/optimizer.cpp::Optimizer::Optimize"}, {"source": "src/main/client_context.cpp::ClientContext::Prepare", "target": "src/main/client_context.cpp::ClientContext::PrepareInternal"}, {"source": "src/main/client_context.cpp::ClientContext::PrepareInternal", "target": "src/main/client_context.cpp::ClientContext::RunStatementInternal"}, {"source": "src/main/client_context.cpp::ClientContext::Query", "target": "src/main/client_context.cpp::ClientContext::SubmitInternal"}, {"source": "src/main/client_context.cpp::ClientContext::RunInternalStatement", "target": "src/main/client_context.cpp::ClientContext::RunStatementInternal"}, {"source": "src/main/client_context.cpp::ClientContext::RunStatementInternal", "target": "src/main/client_context.cpp::ClientContext::SubmitInternal"}, {"source": "src/main/client_context.cpp::ClientContext::Submit", "target": "src/main/client_context.cpp::ClientContext::SubmitInternal"}, {"source": "src/main/client_context.cpp::ClientContext::SubmitInternal", "target": "src/main/client_context.cpp::ClientContext::SubmitStatement"}, {"source": "src/main/client_context.cpp::ClientContext::SubmitInternal", "target": "src/main/client_verify.cpp::ClientContext::StatementVerification"}, {"source": "src/main/client_context.cpp::ClientContext::SubmitInternalStatement", "target": "src/main/client_context.cpp::ClientContext::SubmitInternal"}, {"source": "src/main/client_context.cpp::ClientContext::SubmitStatement", "target": "src/main/client_context.cpp::ClientContext::SubmitStatementInternal"}, {"source": "src/main/client_context.cpp::ClientContext::SubmitStatementInternal", "target": "src/main/client_context.cpp::ClientContext::CreatePreparedStatement"}, {"source": "src/main/client_verify.cpp::ClientContext::StatementVerification", "target": "src/main/client_context.cpp::ClientContext::RunStatementInternal"}, {"source": "src/main/connection.cpp::Connection::ExtractPlan", "target": "src/main/client_context.cpp::ClientContext::ExtractPlan"}, {"source": "src/main/connection.cpp::Connection::Prepare", "target": "src/main/client_context.cpp::ClientContext::Prepare"}, {"source": "src/main/prepared_statement.cpp::PreparedStatement::Execute", "target": "src/main/client_context.cpp::ClientContext::RunInternalStatement"}, {"source": "src/main/prepared_statement.cpp::PreparedStatement::Submit", "target": "src/main/client_context.cpp::ClientContext::SubmitInternalStatement"}, {"source": "src/main/prepared_statement.cpp::PreparedStatement::Submit", "target": "src/main/prepared_statement.cpp::PreparedStatement::Submit"}, {"source": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::FindCandidates", "target": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::FindCandidates"}, {"source": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::Optimize", "target": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::FindCandidates"}, {"source": "src/optimizer/optimizer.cpp::Optimizer::Optimize", "target": "src/optimizer/optimizer.cpp::Optimizer::RunBuiltInOptimizers"}, {"source": "src/optimizer/optimizer.cpp::Optimizer::RunBuiltInOptimizers", "target": "src/optimizer/cte_filter_pusher.cpp::CTEFilterPusher::Optimize"}, {"source": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::Rewrite", "target": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::RewriteDelimJoinsToCTEs"}, {"source": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::RewriteDelimJoinsToCTEs", "target": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::MaterializeDelimJoinAsCTE"}, {"source": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::RewriteDelimJoinsToCTEs", "target": "src/planner/subquery/delim_join_cte_rewriter.cpp::DelimJoinCTERewriter::RewriteDelimJoinsToCTEs"}]}, "graph_spec": "This scope covers the statement-preparation/execution lifecycle and the plan rewrites that keep materialized-CTE consumers equivalent. ClientContext Prepare/Submit/Query/RunInternal/SubmitInternalStatement accept exactly one statement, verify named parameters, and funnel through SubmitInternal → StatementVerification (only when verification is requested) → SubmitStatement → SubmitStatementInternal; they must report failures as QueryResult error objects (never corrupt the context) while preserving the user's original query text for errors. SubmitStatementInternal → CreatePreparedStatement → CreatePreparedStatementInternal must build the logical plan, run Optimizer::Optimize only when the plan requires it and the optimizer is enabled (otherwise performing only mandatory aggregate lowering), and always yield a non-null physical plan; ExtractPlan and json_serialize_plan(..., optimize=true) reuse the same Optimizer::Optimize on a freshly planned statement and then must produce a binding-resolvable, verifiable, serializable plan. Optimizer::Optimize delegates to RunBuiltInOptimizers, which applies expression rewriting, CTE inlining, filter pullup/pushdown, CTEFilterPusher::Optimize, then CTEFilterPusher::ClearDependencies, followed by later rewrites (regex-range, IN-clause, deliminator, join-order, etc.); the whole sequence must be semantics-preserving and leave a valid plan for every statement type that enters it, including plans that skip optimization. DelimJoinCTERewriter::Rewrite collects marker indexes, iteratively pushes eligible filters, then RewriteDelimJoinsToCTEs → MaterializeDelimJoinAsCTE rewrites fully decorrelated DELIM_JOIN/DELIM_GET into materialized CTEs with distinct row-scan and domain/dedup consumers and must leave no DELIM_JOIN or DELIM_GET in the result; a CTE whose input ordering can be restricted records a filter dependency pairing those two consumer table indexes, and that marker is valid only for the original generated consumers and is deliberately not serialized. CTEFilterPusher::FindCandidates must discover each LOGICAL_MATERIALIZED_CTE and, for every consumer, record filtered references (LOGICAL_FILTER directly over LOGICAL_CTE_REF) and unfiltered references, marking all_cte_refs_are_filtered false on any unfiltered ref; MaterializedCTEInfo must retain the CTE, its references, its filters, and whether a filter dependency exists. Optimize must process CTEs in insertion order (deepest first), re-discover candidates after each push because plan changes invalidate stored references, and may push only when either every reference is filtered, or the CTE has a filter dependency with exactly two references (one row scan, one domain scan) and exactly one filter, and that filter's CTE ref is the row-scan reference. PushFilterIntoCTE must combine the per-consumer filters with OR into a disjunction placed on the CTE definition, remap CTE-ref column bindings to the definition's bindings, split the predicates, and push them down; it must treat any unfiltered consumer as making its disjunct true, exclude conjuncts that are volatile, contain an expression barrier, or can throw while other conjuncts are not repeatable, and must push nothing at all when no reference retains a safe conjunct, so that shared-consumer results and error behavior are unchanged. ClearDependencies must reset the dependency after CTE filter pushdown so later rewrites that do not preserve consumer identity cannot rely on the original-consumer guarantee."} {"repo": "duckdb/duckdb", "buggy_commit": "8aae2b52b605292ec77489e320b7b0ded1c64b19", "bug_issue": 25804, "solve_pr": 25839, "call_graph": {"nodes": [{"id": "src/optimizer/grouping_sets_optimizer.cpp::GroupingSetsOptimizer::TryExpandGroupingSets"}, {"id": "src/optimizer/multi_stage_aggregate_rewriter.cpp::CreateRewriteBranch"}, {"id": "src/optimizer/multi_stage_aggregate_rewriter.cpp::MultiStageAggregateRewriter::TryRewrite"}], "edges": []}, "graph_spec": "The scope covers a logical-plan rewrite that lowers a single LOGICAL_AGGREGATE_AND_GROUP_BY into an equivalent, multi-branch plan while keeping consumer-visible bindings, types, and semantics unchanged. TryExpandGroupingSets applies to an aggregate with at least two grouping sets and non-empty aggregate expressions, and must produce a UNION over one aggregation branch per grouping set, all reading a single shared materialized CTE of the original child input; each branch groups by exactly that set's columns in the original group order, substitutes typed NULL constants for group columns absent from the set, computes every original aggregate expression, and emits the correct GROUPING() bitmask for that set. The resulting union preserves the original column count and order (groups, then aggregates, then grouping functions), preserves the aggregate's estimated cardinality, and installs replacement bindings so downstream references to the original group/aggregate/grouping table indices and projection indices resolve to the union's outputs. CreateRewriteBranch must validate and realize one aggregate rewrite set: the plan must have a non-empty stage list, a valid result-stage index, at least one source per stage, topological ordering in which every stage source precedes its consumer, the input source consumed alone when used, and every stage must retain all original groups with unchanged return types while containing no unused stage; it rebinds stage groups, aggregates, and result expressions through the supplied input replacements, builds each stage as a LogicalAggregate over its sources, combines multiple sources with NOT-DISTINCT-FROM equality joins on the group columns (or cross products when there are no groups), materializes any input or stage output consumed more than once as a CTE, and returns a branch exposing its result expressions over the output bindings. MultiStageAggregateRewriter::TryRewrite is the entry point: it only rewrites a one-child aggregate whose expressions are all bound aggregates and whose grouping-set state is either absent or exactly one complete grouping set containing every group; it partitions aggregate expressions into DISTINCT, rewrite, and regular branches, merges rewrites that can share a plan, deduplicates/orders DISTINCT sets, shares the pinned input through a materialized CTE when more than one branch is needed, joins branch outputs on the group columns, and constructs the final projection that reproduces the original grouping-function values (zero for a complete single grouping set) and remaps the original group/aggregate/grouping bindings with matching types and estimated cardinality, returning whether a rewrite was performed."} -{"repo": "duckdb/duckdb", "buggy_commit": "8aae2b52b605292ec77489e320b7b0ded1c64b19", "bug_issue": 25829, "solve_pr": 25837, "call_graph": {"nodes": [{"id": "src/function/scalar/operator/multiply.cpp::MultiplyOperator::Operation"}, {"id": "src/function/scalar/operator/multiply.cpp::TryMultiplyOperator::Operation"}], "edges": [{"source": "src/function/scalar/operator/multiply.cpp::MultiplyOperator::Operation", "target": "src/function/scalar/operator/multiply.cpp::TryMultiplyOperator::Operation"}]}, "graph_spec": "Within `src/function/scalar/operator/multiply.cpp`, the scope covers the two coordinated multiply entry points, `MultiplyOperator::Operation` and `TryMultiplyOperator::Operation`, over all their supported type specializations (signed/unsigned integers of every width, hugeint/uhugeint, interval scaled by integer or double, and floating point). `TryMultiplyOperator::Operation` must be total and non-throwing: for any supported operands it returns true exactly when the exact mathematical product is representable in the output type, in which case `result` holds that exact product, and returns false otherwise without wrapping, truncating, or raising, leaving `result` unspecified on failure. `MultiplyOperator::Operation` must compute that same exact product when it is representable and must raise `OutOfRangeException` whenever it is not, so the two forms agree on both the value and the representability verdict and never silently yield a wrapped or truncated result. The directed dependency encodes this agreement: the interval×double specializations of `MultiplyOperator::Operation` delegate to `TryMultiplyOperator::Operation` and raise `OutOfRangeException` precisely when it reports failure, while the checked integer specializations form their products in a wider type through `MultiplyOperator::Operation` so the subsequent range test is applied to an exact, non-wrapping intermediate. Boundary inputs that must be classified consistently include zero, one, the most-negative signed values, operands near each type's numeric limits, and floating-point NaN/infinity cases; interval results must additionally keep months, days, and micros each within their component ranges and preserve the fractional cascade between units, reporting any overflow through the same false/throw convention."} {"repo": "duckdb/duckdb", "buggy_commit": "ae9f5159992765b1107b908eaaee139c8a3a175a", "bug_issue": 25872, "solve_pr": 25904, "call_graph": {"nodes": [{"id": "extension/parquet/reader/variant_column_reader.cpp::VariantColumnReader::Read"}, {"id": "src/function/scalar/variant/variant_extract.cpp::TryShreddedExtractRecursive"}, {"id": "src/function/scalar/variant/variant_extract.cpp::VariantUtils::VariantExtract"}, {"id": "src/function/scalar/variant/variant_extract.cpp::duckdb::TryFromShreddedExtract"}, {"id": "src/function/scalar/variant/variant_extract.cpp::duckdb::VariantExtractFunction"}, {"id": "src/storage/table/variant_column_data.cpp::VariantColumnData::ScanWithCallback"}], "edges": [{"source": "extension/parquet/reader/variant_column_reader.cpp::VariantColumnReader::Read", "target": "src/function/scalar/variant/variant_extract.cpp::VariantUtils::VariantExtract"}, {"source": "src/function/scalar/variant/variant_extract.cpp::TryShreddedExtractRecursive", "target": "src/function/scalar/variant/variant_extract.cpp::TryShreddedExtractRecursive"}, {"source": "src/function/scalar/variant/variant_extract.cpp::VariantUtils::VariantExtract", "target": "src/function/scalar/variant/variant_extract.cpp::duckdb::TryFromShreddedExtract"}, {"source": "src/function/scalar/variant/variant_extract.cpp::duckdb::TryFromShreddedExtract", "target": "src/function/scalar/variant/variant_extract.cpp::TryShreddedExtractRecursive"}, {"source": "src/function/scalar/variant/variant_extract.cpp::duckdb::VariantExtractFunction", "target": "src/function/scalar/variant/variant_extract.cpp::VariantUtils::VariantExtract"}, {"source": "src/storage/table/variant_column_data.cpp::VariantColumnData::ScanWithCallback", "target": "src/function/scalar/variant/variant_extract.cpp::VariantUtils::VariantExtract"}]}, "graph_spec": "This scope covers extracting a single path component from a VARIANT value and must preserve these obligations across all six entry points. Semantics: `VariantExtractFunction` exposes `variant_extract(variant, path)` where the path argument is constant VARCHAR or integral; integral indexes are 1-based (index 0 is rejected), a key lookup applies only to an OBJECT and an index lookup only to an ARRAY, and a missing key, wrong container kind, out-of-range index, or NULL input row must yield NULL rather than an error. Result fidelity: every route (shredded fast path, generic fallback, storage scan, and Parquet read) must return the same value and NULL placement as a plain full read followed by extraction, one output value per input row. `TryFromShreddedExtract` may take the shredded path only when the input is a SHREDDED_VECTOR that is fully shredded; otherwise `VariantUtils::VariantExtract` must fall back to the generic recursive-format extraction rather than producing partial output. `TryShreddedExtractRecursive` may descend only through non-empty STRUCT wrappers whose first entry is a STRUCT `typed_value`, matching each BY_KEY component against the child key names; it must decline (return false) on non-STRUCT inputs, empty/primitive/array typed values, non-BY_KEY components, keys not found, and nested leaf types, and may only succeed at the end of a path for a non-nested leaf, when it establishes a shredded vector whose unshredded portion is NULL. Zero-copy: the extracted result may reference the input's keys/children/data only when no row is NULL; if any row is NULL the result must be copied before nulls are applied so the caller's input is never mutated, and the result size must be set with each row's index 0 remapped to the extracted sub-value. `VariantColumnData::ScanWithCallback` for a pushdown-extract storage index must either read the fully shredded leaf directly (only when `CreateScanStates` verified the field exists and is fully shredded for this row group) or unshred the full variant and then extract, returning the scanned row count and a result identical to the full-read-plus-extract path. `VariantColumnReader::Read` must likewise replace its reconstructed variant with the extract of the requested path when pushdown extraction is active. Overall, NULL rows remain NULL, invalid paths resolve to NULL, and the shredded and unshredded representations must be observationally interchangeable."} {"repo": "duckdb/duckdb", "buggy_commit": "bdd42afc245c278198fa94cddec7087e77acf7c0", "bug_issue": 25873, "solve_pr": 25954, "call_graph": {"nodes": [{"id": "src/function/cast/variant/from_variant.cpp::CastVariantToJSON"}, {"id": "src/function/cast/variant/from_variant.cpp::duckdb::CastFromVARIANT"}, {"id": "src/function/cast/variant/from_variant.cpp::duckdb::CastVariant"}, {"id": "src/function/cast/variant/from_variant.cpp::duckdb::ConvertVariantToStruct"}, {"id": "src/function/cast/variant/from_variant.cpp::duckdb::ConvertVariantToTuple"}], "edges": [{"source": "src/function/cast/variant/from_variant.cpp::duckdb::CastFromVARIANT", "target": "src/function/cast/variant/from_variant.cpp::duckdb::CastVariant"}, {"source": "src/function/cast/variant/from_variant.cpp::duckdb::CastVariant", "target": "src/function/cast/variant/from_variant.cpp::CastVariantToJSON"}, {"source": "src/function/cast/variant/from_variant.cpp::duckdb::CastVariant", "target": "src/function/cast/variant/from_variant.cpp::duckdb::ConvertVariantToTuple"}, {"source": "src/function/cast/variant/from_variant.cpp::duckdb::ConvertVariantToStruct", "target": "src/function/cast/variant/from_variant.cpp::duckdb::CastVariant"}, {"source": "src/function/cast/variant/from_variant.cpp::duckdb::ConvertVariantToTuple", "target": "src/function/cast/variant/from_variant.cpp::duckdb::CastVariant"}]}, "graph_spec": "This scope implements the VARIANT-to-target cast (`CastFromVARIANT`) and its recursive conversion dispatch (`CastVariant`), including the special-case conversions `ConvertVariantToStruct`, `ConvertVariantToTuple`, and `CastVariantToJSON`. Correctness obligations: (1) `CastFromVARIANT` must accept a VARIANT input vector and populate the result vector for `count` rows; when the input is fully shredded on a compatible non-nested type it may reference the shredded data directly, otherwise it falls back to recursive conversion, propagates CONSTANT vector type to the result, and on overall failure either reports through `parameters.error_message` or throws a `ConversionException`. (2) `CastVariant` must dispatch by target `LogicalTypeId`, recursively casting nested children, and use value-level cast fallback for nested targets; when a target cannot be handled it must mark all affected rows NULL and return failure. (3) All conversions must honor the `sel`, `offset`, `count`, and optional `row` addressing: NULL variant rows stay SQL NULL (validity is preserved and pre-existing result invalidity is respected), and when `row` is valid every output row reads from that single variant row. (4) `ConvertVariantToStruct` must read a variant OBJECT, look up each struct child by its key name, fail with a descriptive error if a required key is absent, and recursively cast each found child. (5) `ConvertVariantToTuple` must read a variant ARRAY and assign elements positionally, failing if an element at a required index is missing. (6) `CastVariantToJSON` must serialize each non-NULL variant into a JSON string, write SQL NULL for NULL rows rather than the JSON token null, and must truncate its writer and return false (rather than throw) when serialization fails so TRY_CAST semantics are preserved. (7) On conversion failure the conversion data's error string must describe the offending VARIANT type and/or missing key or index, and string/blob results must keep their non-inlined data owned by the result vector."} {"repo": "duckdb/duckdb", "buggy_commit": "4600457765b19bf1e91d3a86df82f3fc86038d97", "bug_issue": 25882, "solve_pr": 25893, "call_graph": {"nodes": [{"id": "src/function/table/direct_file_reader.cpp::DirectFileReader::Scan"}], "edges": []}, "graph_spec": "DirectFileReader::Scan is the single-row-per-file scan routine backing read_blob/read_text. It runs only for the file currently claimed by the multi-file harness (file_list_idx), and each call that has a file to produce must materialize exactly one output row (output cardinality one) for that file and then move into a terminal state; it reports HAVE_MORE_OUTPUT and any subsequent call, or a call whose file index is no longer below the global file list's total count, must write nothing and report FINISHED. Files that cannot be materialized are skipped silently rather than raising: when metadata is required but GetStatsIfExists returns nothing, and when a remotely listed file fails its existence check, the reader becomes done and returns FINISHED with no row. The routine must not touch the filesystem more than the projected columns require: it opens a handle (remote paths using direct I/O and remote-only caching, also carrying metadata) when content or remote metadata is requested, otherwise it relies on local stats, so a file handle and a file-metadata source are alternatives feeding size and last-modified. Only columns present in the global state's column_ids are written, ROW_ID is skipped, and values are placed at their projected output positions: filename from the path; content as the full file contents read in bounded chunks, looping until the declared size is consumed or until EOF for pipes/zero-length files, reusing the shared stream buffer, rejecting files exceeding the 32-bit size limit, and for VARCHAR (read_text) rejecting content that is not valid UTF-8 while BLOB (read_blob) accepts arbitrary bytes; size as a 64-bit value; last modified as a timestamp that becomes NULL when the filesystem cannot convert it. When a filesystem reports an operation as not implemented, that column is set to NULL and the scan continues instead of failing."} @@ -324,6 +335,7 @@ {"repo": "matplotlib/matplotlib", "buggy_commit": "33a0599711d26dc2b79f851c6daed4947df7c167", "bug_issue": 23471, "solve_pr": 23476, "call_graph": {"nodes": [{"id": "lib/matplotlib/figure.py::Figure::__getstate__"}], "edges": [{"source": "lib/matplotlib/figure.py::Figure::__getstate__", "target": "lib/matplotlib/figure.py::Figure::__getstate__"}]}, "graph_spec": "Figure.__getstate__ supplies a figure’s state for Python pickle serialization, supporting short-term storage of plots for later restoration and modification. A Figure is the top-level container for plot elements, so this method participates in preserving the plot as an object."} {"repo": "matplotlib/matplotlib", "buggy_commit": "5c4595267ccd3daf78f5fd05693b7ecbcd575c1e", "bug_issue": 24024, "solve_pr": 24026, "call_graph": {"nodes": [{"id": "lib/matplotlib/stackplot.py::stackplot"}], "edges": []}, "graph_spec": "`stackplot` must interpret the supplied y inputs as unstacked series sharing the x positions, promote accumulation to a floating-capable dtype, and render exactly one filled `PolyCollection` per series: the first between the selected baseline and the first cumulative boundary, then each later one between adjacent cumulative boundaries. It must support only the documented `zero`, `sym`, `wiggle`, and `weighted_wiggle` baseline layouts, positioning all cumulative boundaries consistently with the selected baseline (including finite zero-total handling for weighted wiggle). Colors and labels must be consumed in series order, with provided colors cycling and omitted labels left unset; remaining fill options must be forwarded to every area. The first collection must retain a zero y sticky edge for autoscaling behavior, and the returned list must preserve drawing order."} {"repo": "matplotlib/matplotlib", "buggy_commit": "c744161bdaf8b2a40bf96dcc0ebcd37ea0444319", "bug_issue": 24097, "solve_pr": 24177, "call_graph": {"nodes": [{"id": "lib/matplotlib/axes/_axes.py::Axes::fill"}, {"id": "lib/matplotlib/axes/_axes.py::Axes::stairs"}, {"id": "lib/matplotlib/axes/_base.py::_AxesBase::_unit_change_handler"}, {"id": "lib/matplotlib/axes/_base.py::_AxesBase::_update_patch_limits"}, {"id": "lib/matplotlib/axes/_base.py::_AxesBase::add_patch"}, {"id": "lib/matplotlib/axes/_base.py::_AxesBase::relim"}], "edges": [{"source": "lib/matplotlib/axes/_axes.py::Axes::fill", "target": "lib/matplotlib/axes/_base.py::_AxesBase::add_patch"}, {"source": "lib/matplotlib/axes/_axes.py::Axes::stairs", "target": "lib/matplotlib/axes/_base.py::_AxesBase::add_patch"}, {"source": "lib/matplotlib/axes/_base.py::_AxesBase::_unit_change_handler", "target": "lib/matplotlib/axes/_base.py::_AxesBase::relim"}, {"source": "lib/matplotlib/axes/_base.py::_AxesBase::add_patch", "target": "lib/matplotlib/axes/_base.py::_AxesBase::_update_patch_limits"}, {"source": "lib/matplotlib/axes/_base.py::_AxesBase::relim", "target": "lib/matplotlib/axes/_base.py::_AxesBase::_update_patch_limits"}]}, "graph_spec": "Axes.fill must turn each supplied polygonal fill into an Axes-owned patch, return the complete patch list, and request autoscaling after their data limits have been incorporated. Axes.stairs must construct and register a unit-converted StepPatch with the requested orientation, baseline, fill styling, and default edges when omitted; it must preserve the baseline as a sticky data edge and include it in the relevant data limit before requesting autoscaling. Registering any patch must establish its Axes properties and default clip path, retain it as a removable child, and update limits from its geometry. Patch-limit calculation must use path extrema (including curve extrema), transform them into data coordinates, and update only dimensions governed by the patch transform; it must ignore fully zero-size rectangles and avoid irrelevant axis updates for non-rectilinear axis transforms. relim must rebuild limits from eligible current child artists (optionally excluding invisible ones), including patches through the same calculation, while unit changes must recache lines, recompute limits, and request autoscaling only for the changed valid axis."} +{"repo": "matplotlib/matplotlib", "buggy_commit": "60660c54c4a75a58b7faa1d599e7a275a05bd774", "bug_issue": 24386, "solve_pr": 24570, "call_graph": {"nodes": [{"id": "lib/matplotlib/offsetbox.py::HPacker::get_extent_offsets"}, {"id": "lib/matplotlib/offsetbox.py::_get_aligned_offsets"}], "edges": [{"source": "lib/matplotlib/offsetbox.py::HPacker::get_extent_offsets", "target": "lib/matplotlib/offsetbox.py::_get_aligned_offsets"}]}, "graph_spec": "HPacker must lay out only visible children horizontally, converting point-based padding and separation through the renderer while retaining pixel-based requested dimensions. With no visible children it returns a padding-only extent and no offsets. Otherwise it derives each child’s vertical (height, descent) geometry and uses the selected valid alignment to produce a shared container height, descent, and per-child vertical offsets: baseline alignment places all bottoms at zero and expands to accommodate the greatest ascent and descent; bottom/left, top/right, and center align the corresponding edges or centers within the requested-or-maximum height. The returned extent includes padding on both sides, and each child position combines its packed horizontal location with its own horizontal descent, normalized to the first child’s descent, alongside the calculated vertical offset."} {"repo": "matplotlib/matplotlib", "buggy_commit": "5ec2bd279729ff534719b8bf238dbbca907b93c5", "bug_issue": 24821, "solve_pr": 25122, "call_graph": {"nodes": [{"id": "lib/matplotlib/axes/_axes.py::Axes::cohere"}, {"id": "lib/matplotlib/axes/_axes.py::Axes::csd"}, {"id": "lib/matplotlib/axes/_axes.py::Axes::psd"}, {"id": "lib/matplotlib/axes/_axes.py::Axes::specgram"}, {"id": "lib/matplotlib/mlab.py::_spectral_helper"}, {"id": "lib/matplotlib/mlab.py::cohere"}, {"id": "lib/matplotlib/mlab.py::csd"}, {"id": "lib/matplotlib/mlab.py::psd"}, {"id": "lib/matplotlib/mlab.py::specgram"}], "edges": [{"source": "lib/matplotlib/axes/_axes.py::Axes::cohere", "target": "lib/matplotlib/mlab.py::cohere"}, {"source": "lib/matplotlib/axes/_axes.py::Axes::csd", "target": "lib/matplotlib/mlab.py::csd"}, {"source": "lib/matplotlib/axes/_axes.py::Axes::psd", "target": "lib/matplotlib/mlab.py::psd"}, {"source": "lib/matplotlib/axes/_axes.py::Axes::specgram", "target": "lib/matplotlib/mlab.py::specgram"}, {"source": "lib/matplotlib/mlab.py::cohere", "target": "lib/matplotlib/mlab.py::csd"}, {"source": "lib/matplotlib/mlab.py::cohere", "target": "lib/matplotlib/mlab.py::psd"}, {"source": "lib/matplotlib/mlab.py::csd", "target": "lib/matplotlib/mlab.py::_spectral_helper"}, {"source": "lib/matplotlib/mlab.py::psd", "target": "lib/matplotlib/mlab.py::csd"}, {"source": "lib/matplotlib/mlab.py::specgram", "target": "lib/matplotlib/mlab.py::_spectral_helper"}]}, "graph_spec": "The spectral routines must compute consistently aligned Welch-style spectra: split 1-D signals into overlapping NFFT-length segments, zero-pad inputs shorter than NFFT, detrend and window each segment, FFT to `pad_to`, and return frequencies and segment-center times matching the spectrum rows and columns. Defaults are NFFT=256, Fs=2, no overlap except spectrogram’s 128; default sidedness is one-sided for real input and two-sided for complex input, with correct frequency ordering and density/power normalization (including one-sided interior-bin scaling). `csd` returns the segment-averaged complex cross spectrum, `psd` is the corresponding real auto-spectrum, and coherence requires sufficient data for averaged NFFT segments and returns `|Pxy|²/(Pxx*Pyy)`. Spectrogram preserves the per-segment 2-D result, supports only valid spectral modes (with non-PSD modes limited to identical input data), and returns real values except in complex mode. Axes methods must pass spectral options through, offset returned/plotted frequencies by `Fc`, plot PSD/CSD in dB while returning unscaled spectral arrays (and optionally the line for PSD/CSD), and for spectrogram reject complex display and dB phase/angle displays, use 10-log power versus 20-log amplitude scaling, vertically orient the image correctly, derive a segment-bin time extent when absent, and return the spectrum, shifted frequencies, times, and image."} {"repo": "matplotlib/matplotlib", "buggy_commit": "a3011dfd1aaa2487cce8aa7369475533133ef777", "bug_issue": 24865, "solve_pr": 24970, "call_graph": {"nodes": [{"id": "lib/matplotlib/colors.py::Colormap::__call__"}], "edges": []}, "graph_spec": "Colormap.__call__ must lazily initialize its lookup table, then map scalar or array-like inputs to RGBA by treating floating values in [0, 1] as quantized positions (with exactly 1 selecting the final regular color) and integer values as direct color indices. Values below or above the regular index range must use the configured under or over color, while NaN and masked values must use the bad color; this classification must remain correct for copied inputs and non-native-endian arrays. It must preserve input dimensionality by returning X.shape + (4,) for array-like X and an RGBA tuple for scalar X, optionally producing uint8 components rather than normalized floats. A supplied alpha is clipped to its valid range and may be scalar or exactly X-shaped, otherwise raising ValueError; it replaces the output alpha except that a fully transparent default bad color remains transparent for bad values. Valid integer inputs, including empty unsigned-integer arrays, must be accepted without emitting warnings."} {"repo": "matplotlib/matplotlib", "buggy_commit": "9ff38a890e50a58f7f3497329854bc9f760c6f5e", "bug_issue": 25165, "solve_pr": 25287, "call_graph": {"nodes": [{"id": "lib/matplotlib/axes/_base.py::_AxesBase::__clear"}, {"id": "lib/matplotlib/axes/_base.py::_AxesBase::__init__"}, {"id": "lib/matplotlib/axes/_base.py::_AxesBase::cla"}, {"id": "lib/matplotlib/axes/_base.py::_AxesBase::clear"}, {"id": "lib/matplotlib/axis.py::Axis::__init__"}, {"id": "lib/matplotlib/axis.py::Axis::clear"}, {"id": "lib/matplotlib/axis.py::XAxis::__init__"}, {"id": "lib/matplotlib/axis.py::XAxis::_init"}, {"id": "lib/matplotlib/axis.py::YAxis::__init__"}, {"id": "lib/matplotlib/axis.py::YAxis::_init"}, {"id": "lib/matplotlib/colorbar.py::Colorbar::_cbar_cla"}], "edges": [{"source": "lib/matplotlib/axes/_base.py::_AxesBase::__clear", "target": "lib/matplotlib/axis.py::Axis::clear"}, {"source": "lib/matplotlib/axes/_base.py::_AxesBase::__init__", "target": "lib/matplotlib/axes/_base.py::_AxesBase::clear"}, {"source": "lib/matplotlib/axes/_base.py::_AxesBase::cla", "target": "lib/matplotlib/axes/_base.py::_AxesBase::__clear"}, {"source": "lib/matplotlib/axes/_base.py::_AxesBase::cla", "target": "lib/matplotlib/axes/_base.py::_AxesBase::clear"}, {"source": "lib/matplotlib/axes/_base.py::_AxesBase::clear", "target": "lib/matplotlib/axes/_base.py::_AxesBase::__clear"}, {"source": "lib/matplotlib/axes/_base.py::_AxesBase::clear", "target": "lib/matplotlib/axes/_base.py::_AxesBase::cla"}, {"source": "lib/matplotlib/axis.py::Axis::__init__", "target": "lib/matplotlib/axis.py::Axis::clear"}, {"source": "lib/matplotlib/axis.py::Axis::clear", "target": "lib/matplotlib/axis.py::XAxis::_init"}, {"source": "lib/matplotlib/axis.py::XAxis::__init__", "target": "lib/matplotlib/axis.py::XAxis::_init"}, {"source": "lib/matplotlib/axis.py::YAxis::__init__", "target": "lib/matplotlib/axis.py::YAxis::_init"}, {"source": "lib/matplotlib/colorbar.py::Colorbar::_cbar_cla", "target": "lib/matplotlib/axes/_base.py::_AxesBase::cla"}]}, "graph_spec": "These functions construct and clear Matplotlib Axes—the plotting regions within figures—and their associated x- and y-axis objects, which manage coordinate scales, ticks, and labels. The axis initialization functions establish labels and tick-offset text, while the clearing functions reset plotting and axis state; the colorbar clearing function clears interactive state for a color scale displayed in an Axes."} @@ -357,6 +369,7 @@ {"repo": "psf/requests", "buggy_commit": "091991be0da19de9108dbe5e3752917fea3d7fdc", "bug_issue": 2316, "solve_pr": 2317, "call_graph": {"nodes": [{"id": "requests/sessions.py::Session::request"}], "edges": []}, "graph_spec": "Session.request provides the session-level interface for making HTTP requests, accepting a method, destination URL, and request data and settings, and returning a Response representing the server’s reply. It operates within a Session, which provides shared configuration, persistent cookies, and connection pooling across requests."} {"repo": "psf/requests", "buggy_commit": "5f7a3a74aab1625c2bb65f643197ee885e3da576", "bug_issue": 2930, "solve_pr": 2931, "call_graph": {"nodes": [{"id": "requests/api.py::delete"}, {"id": "requests/api.py::head"}, {"id": "requests/api.py::options"}, {"id": "requests/api.py::patch"}, {"id": "requests/api.py::post"}, {"id": "requests/api.py::request"}, {"id": "requests/models.py::PreparedRequest::prepare"}, {"id": "requests/models.py::PreparedRequest::prepare_body"}, {"id": "requests/models.py::Request::prepare"}, {"id": "requests/models.py::RequestEncodingMixin::_encode_params"}, {"id": "requests/sessions.py::Session::delete"}, {"id": "requests/sessions.py::Session::head"}, {"id": "requests/sessions.py::Session::options"}, {"id": "requests/sessions.py::Session::patch"}, {"id": "requests/sessions.py::Session::post"}, {"id": "requests/sessions.py::Session::prepare_request"}, {"id": "requests/sessions.py::Session::put"}, {"id": "requests/sessions.py::Session::request"}], "edges": [{"source": "requests/api.py::delete", "target": "requests/api.py::request"}, {"source": "requests/api.py::head", "target": "requests/api.py::request"}, {"source": "requests/api.py::options", "target": "requests/api.py::request"}, {"source": "requests/api.py::patch", "target": "requests/api.py::request"}, {"source": "requests/api.py::post", "target": "requests/api.py::request"}, {"source": "requests/api.py::request", "target": "requests/sessions.py::Session::request"}, {"source": "requests/models.py::PreparedRequest::prepare", "target": "requests/models.py::PreparedRequest::prepare_body"}, {"source": "requests/models.py::PreparedRequest::prepare_body", "target": "requests/models.py::RequestEncodingMixin::_encode_params"}, {"source": "requests/models.py::Request::prepare", "target": "requests/models.py::PreparedRequest::prepare"}, {"source": "requests/sessions.py::Session::delete", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::head", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::options", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::patch", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::post", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::prepare_request", "target": "requests/models.py::PreparedRequest::prepare"}, {"source": "requests/sessions.py::Session::put", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::request", "target": "requests/sessions.py::Session::prepare_request"}]}, "graph_spec": "The scoped API and Session methods provide general and HTTP-method-specific interfaces for sending requests from URLs, request data, and configuration and returning Response objects; sessions supply persistent settings and cookies across requests. Request.prepare, Session.prepare_request, and PreparedRequest.prepare turn request descriptions into transmission-ready requests, with session preparation incorporating session settings. PreparedRequest.prepare_body and RequestEncodingMixin._encode_params support this preparation by preparing HTTP body data and encoding request parameters."} {"repo": "psf/requests", "buggy_commit": "39d0fdd9096f7dceccbc8f82e1eda7dd64717a8e", "bug_issue": 5367, "solve_pr": 5414, "call_graph": {"nodes": [{"id": "requests/api.py::delete"}, {"id": "requests/api.py::get"}, {"id": "requests/api.py::head"}, {"id": "requests/api.py::options"}, {"id": "requests/api.py::patch"}, {"id": "requests/api.py::post"}, {"id": "requests/api.py::put"}, {"id": "requests/api.py::request"}, {"id": "requests/models.py::PreparedRequest::prepare"}, {"id": "requests/models.py::PreparedRequest::prepare_url"}, {"id": "requests/models.py::Request::prepare"}, {"id": "requests/sessions.py::Session::delete"}, {"id": "requests/sessions.py::Session::get"}, {"id": "requests/sessions.py::Session::head"}, {"id": "requests/sessions.py::Session::options"}, {"id": "requests/sessions.py::Session::patch"}, {"id": "requests/sessions.py::Session::post"}, {"id": "requests/sessions.py::Session::prepare_request"}, {"id": "requests/sessions.py::Session::put"}, {"id": "requests/sessions.py::Session::request"}], "edges": [{"source": "requests/api.py::delete", "target": "requests/api.py::request"}, {"source": "requests/api.py::get", "target": "requests/api.py::request"}, {"source": "requests/api.py::head", "target": "requests/api.py::request"}, {"source": "requests/api.py::options", "target": "requests/api.py::request"}, {"source": "requests/api.py::patch", "target": "requests/api.py::request"}, {"source": "requests/api.py::post", "target": "requests/api.py::request"}, {"source": "requests/api.py::put", "target": "requests/api.py::request"}, {"source": "requests/api.py::request", "target": "requests/sessions.py::Session::request"}, {"source": "requests/models.py::PreparedRequest::prepare", "target": "requests/models.py::PreparedRequest::prepare_url"}, {"source": "requests/models.py::Request::prepare", "target": "requests/models.py::PreparedRequest::prepare"}, {"source": "requests/sessions.py::Session::delete", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::get", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::head", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::options", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::patch", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::post", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::prepare_request", "target": "requests/models.py::PreparedRequest::prepare"}, {"source": "requests/sessions.py::Session::put", "target": "requests/sessions.py::Session::request"}, {"source": "requests/sessions.py::Session::request", "target": "requests/sessions.py::Session::prepare_request"}]}, "graph_spec": "All module-level and Session verb helpers must delegate with their intended HTTP method and preserve caller-supplied request options; GET supplies query parameters, POST carries both data and JSON, and HEAD defaults to not following redirects unless explicitly overridden. The module-level API must perform the request through a temporary Session whose resources are closed afterward, while Session.request must construct, prepare, and send a request using its per-call settings together with applicable Session defaults. Session preparation must merge request headers, parameters, authentication, cookies, and hooks with Session state without discarding explicit request values, normalize the method, and yield a fully prepared request. Preparation must canonicalize HTTP(S) URLs by accepting string-like or UTF-8 byte input, trimming leading whitespace, requiring a scheme and host, rejecting invalid host labels, IDNA-encoding Unicode hosts, supplying '/' for an empty path, preserving existing query and fragment components, appending encoded parameters, and percent-quoting the reconstructed URL; non-HTTP schemes remain unmodified. The prepared request must have method, URL, headers, cookies, body, authentication, and hooks established in an order that lets authentication operate on the complete request and lets its changes be reflected in final content metadata."} +{"repo": "psf/requests", "buggy_commit": "0192aac24123735b3eaf9b08df46429bb770c283", "bug_issue": 6027, "solve_pr": 6028, "call_graph": {"nodes": [{"id": "requests/adapters.py::HTTPAdapter::get_connection"}, {"id": "requests/adapters.py::HTTPAdapter::send"}, {"id": "requests/utils.py::prepend_scheme_if_needed"}], "edges": [{"source": "requests/adapters.py::HTTPAdapter::get_connection", "target": "requests/utils.py::prepend_scheme_if_needed"}, {"source": "requests/adapters.py::HTTPAdapter::send", "target": "requests/adapters.py::HTTPAdapter::get_connection"}]}, "graph_spec": "HTTPAdapter.send must obtain the connection selected for the prepared request URL and its applicable proxy settings, then send through that connection with TLS verification/client-certificate configuration, the proxy-appropriate request target, request headers and body, configured retries, and normalized connect/read timeouts (accepting either one value, a two-value tuple, or an existing timeout object). Connection selection must use a matching proxy when configured, otherwise the adapter pool; proxy URLs lacking a scheme must be normalized with the supplied default without replacing an existing scheme, while preserving authority (including credentials), path, query, and fragment and handling scheme-less parsed authorities consistently. A selected proxy must contain a host or be rejected as invalid. The resulting response must remain unpreloaded/undecoded for Requests to wrap, and transport, proxy, TLS, retry, timeout, and invalid-URL failures must be exposed through the corresponding Requests-level exceptions."} {"repo": "pydata/xarray", "buggy_commit": "aebe60c8593447c7ef95ca6af6eaef1f7fedc6d5", "bug_issue": 2097, "solve_pr": 2905, "call_graph": {"nodes": [{"id": "xarray/core/variable.py::Variable::__setitem__"}, {"id": "xarray/core/variable.py::as_compatible_data"}], "edges": [{"source": "xarray/core/variable.py::Variable::__setitem__", "target": "xarray/core/variable.py::as_compatible_data"}]}, "graph_spec": "`Variable.__setitem__` must apply orthogonal indexed assignment while treating a non-`Variable` right-hand side as compatible variable data: preserve supported array backends and existing Variables appropriately, unwrap pandas/xarray containers to their values, represent tuples as scalar object data, normalize timestamp/timedelta and object-like temporal values, and convert masked values to a dtype-appropriate missing-value representation. The normalized value must have no more dimensions than the indexed result, then be associated with the trailing target dimensions and broadcast by dimension name to the selected shape; scalars must be assignable, incompatible ranks must raise `ValueError`, and any indexing-axis reordering must be reversed before writing into the underlying data."} {"repo": "pydata/xarray", "buggy_commit": "83706af66c9cb42032dbc5536b30be1da38100c0", "bug_issue": 2840, "solve_pr": 4695, "call_graph": {"nodes": [{"id": "xarray/core/dataarray.py::_LocIndexer::__getitem__"}], "edges": []}, "graph_spec": "`DataArray.loc[...]` must provide label-based selection and return the corresponding new `DataArray`. A mapping key is passed through as named label indexers; a non-mapping key is interpreted positionally across the array’s dimensions, with ellipses expanded to the full dimensionality and each resulting label bound to its dimension in order. The resulting selection must retain the normal `sel` label-indexing semantics, including scalar, slice, array, datetime, and MultiIndex label handling (with label slices inclusive at both endpoints), along with the selected data and compatible coordinate metadata."} {"repo": "pydata/xarray", "buggy_commit": "8f0d9e5c9909c93a90306ed7cb5a80c1c2e1c97d", "bug_issue": 3094, "solve_pr": 3095, "call_graph": {"nodes": [{"id": "xarray/core/variable.py::IndexVariable::copy"}], "edges": []}, "graph_spec": "`IndexVariable.copy` must return a new instance of the same index-variable type that preserves the sole dimension and independent attribute and encoding mappings. With no replacement data, it must copy the underlying pandas-index representation using the requested `deep` argument while retaining index semantics and the class’s required one-dimensional, immutable index-backed form. With replacement data, it must first normalize it to compatible array data and reject any shape different from the original; otherwise the replacement becomes the new index values while the original remains unchanged."} @@ -373,8 +386,11 @@ {"repo": "pydata/xarray", "buggy_commit": "6bb2b855498b5c68d7cca8cceb710365d58e6048", "bug_issue": 6597, "solve_pr": 6599, "call_graph": {"nodes": [{"id": "xarray/core/computation.py::_ensure_numeric"}, {"id": "xarray/core/computation.py::polyval"}], "edges": [{"source": "xarray/core/computation.py::polyval", "target": "xarray/core/computation.py::_ensure_numeric"}]}, "graph_spec": "`polyval` evaluates polynomials represented by coefficients along a polynomial-degree dimension at supplied values, accepting and returning xarray DataArray or Dataset objects. `_ensure_numeric` supports this numerical evaluation by converting datetime-valued variables to numeric representations within those objects, connecting temporal data with polynomial computation."} {"repo": "pydata/xarray", "buggy_commit": "c4e40d991c28be51de9ac560ce895ac7f9b14924", "bug_issue": 6931, "solve_pr": 6938, "call_graph": {"nodes": [{"id": "xarray/core/variable.py::IndexVariable::to_index_variable"}], "edges": []}, "graph_spec": "IndexVariable.to_index_variable returns the variable as an xarray.IndexVariable, providing its index-oriented representation. An IndexVariable accommodates a pandas.Index within xarray’s variable model, representing immutable, one-dimensional values associated with a named dimension."} {"repo": "pydata/xarray", "buggy_commit": "076bd8e15f04878d7b97100fb29177697018138f", "bug_issue": 7220, "solve_pr": 7229, "call_graph": {"nodes": [{"id": "xarray/core/computation.py::where"}], "edges": []}, "graph_spec": "`where(cond, x, y, keep_attrs=None)` must perform elementwise conditional selection—choosing `x` where `cond` is true and `y` otherwise—while applying xarray’s labeled broadcasting across all three inputs. Labeled indexes and Dataset data-variable sets that require alignment must match exactly, rather than being implicitly joined or reindexed; differing unlabeled dimensions may broadcast. It must preserve the highest-priority xarray container represented by the inputs (Dataset, then DataArray, then Variable, otherwise an array), use compatible shared value dtypes for the two alternatives, and allow supported lazy array inputs. Attribute handling follows the configured/default policy; when explicitly enabled, output-level, data-variable, and coordinate attributes are derived from `x`, including the Dataset-promotion case where only a named `x` variable receives its attributes."} +{"repo": "pydata/xarray", "buggy_commit": "c92102bca4a20b4e9f2aacf722b7008698522c8a", "bug_issue": 7232, "solve_pr": 7233, "call_graph": {"nodes": [{"id": "xarray/core/rolling.py::Coarsen::construct"}], "edges": []}, "graph_spec": "Coarsen.construct must require one unambiguous mapping—passed directly or as keywords—that assigns every and only coarsened source dimension to exactly two non-string output dimension names. It must reshape each variable that uses a coarsened dimension by replacing that dimension with the mapped pair, whose inner size equals the configured window and whose grouping honors the configured boundary and side policy; variables independent of all coarsened dimensions remain unchanged. The result must preserve the caller’s Dataset-versus-DataArray type, retain the original coordinates as coordinates after reshaping (including coordinates that are themselves coarsened), and retain object and variable attributes only when `keep_attrs` is enabled or selected by its default policy."} +{"repo": "pylint-dev/pylint", "buggy_commit": "99589b08de8c5a2c6cc61e13a37420a868c80599", "bug_issue": 4603, "solve_pr": 4604, "call_graph": {"nodes": [{"id": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_names"}, {"id": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_node"}, {"id": "pylint/checkers/variables.py::VariablesChecker::leave_assign"}, {"id": "pylint/checkers/variables.py::VariablesChecker::leave_for"}, {"id": "pylint/checkers/variables.py::VariablesChecker::leave_functiondef"}, {"id": "pylint/checkers/variables.py::VariablesChecker::leave_with"}, {"id": "pylint/checkers/variables.py::VariablesChecker::visit_arguments"}], "edges": [{"source": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_names", "target": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_node"}, {"source": "pylint/checkers/variables.py::VariablesChecker::leave_assign", "target": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_names"}, {"source": "pylint/checkers/variables.py::VariablesChecker::leave_for", "target": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_names"}, {"source": "pylint/checkers/variables.py::VariablesChecker::leave_functiondef", "target": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_node"}, {"source": "pylint/checkers/variables.py::VariablesChecker::leave_with", "target": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_names"}, {"source": "pylint/checkers/variables.py::VariablesChecker::visit_arguments", "target": "pylint/checkers/variables.py::VariablesChecker::_store_type_annotation_node"}]}, "graph_spec": "These VariablesChecker methods support static analysis of Python variable usage and scope by processing assignment, loop, context-manager, function, and argument declarations, while accounting for names referenced in type annotations. Together they connect AST traversal events with the checker’s broader checks for consumed, unused, and potentially redefined names across scopes."} {"repo": "pylint-dev/pylint", "buggy_commit": "754b487f4d892e3d4872b6fc7468a71db4e31c13", "bug_issue": 6385, "solve_pr": 6386, "call_graph": {"nodes": [{"id": "pylint/checkers/base_checker.py::BaseChecker::__init__"}, {"id": "pylint/config/argument.py::_CallableArgument::__init__"}, {"id": "pylint/config/arguments_manager.py::_ArgumentsManager::_add_parser_option"}, {"id": "pylint/config/arguments_manager.py::_ArgumentsManager::_register_options_provider"}, {"id": "pylint/config/arguments_provider.py::_ArgumentsProvider::__init__"}, {"id": "pylint/config/utils.py::_convert_option_to_argument"}, {"id": "pylint/config/utils.py::_preprocess_options"}, {"id": "pylint/lint/base_options.py::_make_run_options"}, {"id": "pylint/lint/run.py::Run::__init__"}], "edges": [{"source": "pylint/checkers/base_checker.py::BaseChecker::__init__", "target": "pylint/config/arguments_provider.py::_ArgumentsProvider::__init__"}, {"source": "pylint/config/arguments_manager.py::_ArgumentsManager::_register_options_provider", "target": "pylint/config/utils.py::_convert_option_to_argument"}, {"source": "pylint/config/arguments_provider.py::_ArgumentsProvider::__init__", "target": "pylint/config/arguments_manager.py::_ArgumentsManager::_register_options_provider"}, {"source": "pylint/lint/run.py::Run::__init__", "target": "pylint/config/utils.py::_preprocess_options"}]}, "graph_spec": "Run initialization must preprocess only the designated early command-line options before creating the linter: consume them (including either `--option=value` or a following non-option value when required), apply their effects to the Run state, preserve all other arguments in order, and reject missing required values or values supplied to valueless options. Checker/provider construction must normalize a non-null checker name to lowercase, retain its manager, and immediately register every declared option. Registration must translate each option definition into the appropriate argparse argument, retaining long/short flags, default, type conversion, choices, destination, grouping, help visibility, and deprecation or extension semantics; callback actions must retain their action class, supplied keyword arguments, and metavar and be added with those keyword arguments. Options must be placed in their declared section (or the provider-derived section), share groups consistently, and parsing an empty argument list after registration must load the accumulated defaults into the common configuration namespace."} {"repo": "pylint-dev/pylint", "buggy_commit": "0220a39f6d4dddd1bf8f2f6d83e11db58a093fbe", "bug_issue": 6471, "solve_pr": 6528, "call_graph": {"nodes": [{"id": "pylint/lint/pylinter.py::PyLinter::_discover_files"}, {"id": "pylint/lint/pylinter.py::PyLinter::check"}, {"id": "pylint/lint/run.py::Run::__init__"}], "edges": [{"source": "pylint/lint/pylinter.py::PyLinter::check", "target": "pylint/lint/pylinter.py::PyLinter::_discover_files"}, {"source": "pylint/lint/run.py::Run::__init__", "target": "pylint/lint/pylinter.py::PyLinter::check"}]}, "graph_spec": "These functions support Pylint’s analysis of Python code for errors, coding-standard issues, and code smells. Run.__init__ provides the command-line-oriented startup interface and initiates linting; PyLinter.check is the main entry point for checking named files or modules; and PyLinter._discover_files identifies Python modules and packages within directories and yields their paths as analysis targets."} +{"repo": "pylint-dev/pylint", "buggy_commit": "79dfe9d77f2383e2be70bf1dd93bf1473e34afe1", "bug_issue": 6902, "solve_pr": 6903, "call_graph": {"nodes": [{"id": "pylint/lint/run.py::Run::__init__"}, {"id": "pylint/lint/run.py::_cpu_count"}], "edges": [{"source": "pylint/lint/run.py::Run::__init__", "target": "pylint/lint/run.py::_cpu_count"}]}, "graph_spec": "Run.__init__ provides the entry point for starting a Pylint analysis from command-line-style arguments, coordinating configuration, linting, and reporting with support for a supplied reporter. _cpu_count supplies an available processor count for parallel linting, accounting for virtualized or containerized execution environments; parallel linting distributes analysis across processes to use available computing resources."} {"repo": "pylint-dev/pylint", "buggy_commit": "cfc393a8dff9ec09bd2fcb25857e772ae04a4991", "bug_issue": 7229, "solve_pr": 8898, "call_graph": {"nodes": [{"id": "pylint/config/argument.py::_regexp_csv_transfomer"}], "edges": []}, "graph_spec": "`_regexp_csv_transfomer` converts a comma-separated string of regular expressions into a sequence of compiled patterns for Pylint’s option-parsing system. Regular expressions describe text-matching patterns, allowing configuration options to express multiple matching criteria."} {"repo": "pylint-dev/pylint", "buggy_commit": "684a1d6aa0a6791e20078bc524f97c8906332390", "bug_issue": 7231, "solve_pr": 7277, "call_graph": {"nodes": [{"id": "pylint/__init__.py::modify_sys_path"}], "edges": []}, "graph_spec": "`modify_sys_path` mutates `sys.path` for module execution so imports do not resolve from the current working directory: it removes an initial empty string, `'.'`, or exact cwd entry; then, when `PYTHONPATH` begins or ends with an empty path component, removes the corresponding cwd-derived entry near the front unless `PYTHONPATH` explicitly names the cwd or `'.'`. It must preserve later `sys.path` entries, including an editable-install path, and leave entries unchanged when these conditions do not apply."} {"repo": "pytest-dev/pytest", "buggy_commit": "da9a2b584eb7a6c7e924b2621ed0ddaeca0a7bea", "bug_issue": 10060, "solve_pr": 10081, "call_graph": {"nodes": [{"id": "src/_pytest/unittest.py::TestCaseFunction::runtest"}], "edges": []}, "graph_spec": "The `runtest` method executes a collected standard-library `unittest.TestCase` test through pytest’s test-item interface. It serves as the integration point between unittest’s test execution and result protocol and pytest’s test-running and reporting model."} @@ -457,6 +473,7 @@ {"repo": "sympy/sympy", "buggy_commit": "6fb3ee16d1faef2392c7a5d3093dfe4c24cfc5fa", "bug_issue": 15718, "solve_pr": 15976, "call_graph": {"nodes": [{"id": "sympy/printing/mathml.py::MathMLPresentationPrinter::_print_Symbol"}], "edges": []}, "graph_spec": "Presentation MathML symbol rendering must render a symbol name as Presentation MathML, separating its base name, superscript components, and subscript components with the printer’s standard name convention and translating recognized Greek identifiers in every component to their Unicode glyphs. A plain symbol is a single `` containing the translated base; symbols with only subscripts, only superscripts, or both must use ``, ``, or `` respectively, with the base first and subscript before superscript. Each script is an `` when it has one component, or an `` of `` components separated by space `` elements when it has multiple components. When requested with bold style, the resulting outer presentation element must carry `mathvariant=\"bold\"`, without changing the name or script structure."} {"repo": "sympy/sympy", "buggy_commit": "2b4f967740cc56f864a2271c09215269a0983dd7", "bug_issue": 15873, "solve_pr": 15875, "call_graph": {"nodes": [{"id": "sympy/core/add.py::Add::_eval_is_zero"}], "edges": []}, "graph_spec": "`Add._eval_is_zero` must provide a conservative three-valued zero classification. It must return `True` when every summand is established real zero; it must return `False` when a proven nonzero real component remains, or when the real component cancels but a definitely imaginary component remains without any possibly-zero imaginary contribution. It may conclude that a mixed real sum is zero only after the nonzero real summands themselves are established to sum to zero and no imaginary contribution is present. Noncommutative additions, summands with unknown relevant assumptions, purely real nonzero sums whose cancellation is undecidable, and mixtures where imaginary cancellation cannot be ruled out must remain indeterminate rather than being classified as zero or nonzero."} {"repo": "sympy/sympy", "buggy_commit": "7ec680459c66036cb9d023b2bc32df8ab313ba99", "bug_issue": 16791, "solve_pr": 16792, "call_graph": {"nodes": [{"id": "sympy/utilities/autowrap.py::autowrap"}, {"id": "sympy/utilities/autowrap.py::binary_function"}, {"id": "sympy/utilities/autowrap.py::ufuncify"}, {"id": "sympy/utilities/codegen.py::CodeGen::routine"}, {"id": "sympy/utilities/codegen.py::codegen"}, {"id": "sympy/utilities/codegen.py::make_routine"}], "edges": [{"source": "sympy/utilities/autowrap.py::autowrap", "target": "sympy/utilities/codegen.py::CodeGen::routine"}, {"source": "sympy/utilities/autowrap.py::binary_function", "target": "sympy/utilities/autowrap.py::autowrap"}, {"source": "sympy/utilities/autowrap.py::ufuncify", "target": "sympy/utilities/autowrap.py::autowrap"}, {"source": "sympy/utilities/autowrap.py::ufuncify", "target": "sympy/utilities/codegen.py::make_routine"}, {"source": "sympy/utilities/codegen.py::codegen", "target": "sympy/utilities/codegen.py::CodeGen::routine"}, {"source": "sympy/utilities/codegen.py::make_routine", "target": "sympy/utilities/codegen.py::CodeGen::routine"}]}, "graph_spec": "This scope must turn symbolic expressions into routines and callable compiled interfaces without changing their declared input/output meaning: routine construction must derive inputs from free symbols (excluding requested globals and internal locals), represent equality left sides and matrix results as output or in-out arguments, retain ordinary scalar expressions as return values, and enforce any explicit argument order by rejecting omitted required arguments while permitting explicitly redundant inputs. `codegen` and `make_routine` must select a valid generator, honor language/code-generator exclusivity and generation options, normalize single versus multiple named expressions, and emit or return the corresponding source artifacts. `autowrap` must validate or infer a backend-compatible language, compile the main routine together with declared helpers, preserve requested argument ordering (including wrapper-returned pure outputs), and return the backend callable; `binary_function` must expose that callable through a symbolic implemented function. `ufuncify` must preserve the supplied argument order and perform the expression elementwise: its NumPy backend must create real broadcasting ufuncs with supported input/output arity, while other supported backends provide the documented one-dimensional array-oriented callable semantics."} +{"repo": "sympy/sympy", "buggy_commit": "6da7d01906895c8df0dc067c559b3a8f19a9ecbe", "bug_issue": 17137, "solve_pr": 17139, "call_graph": {"nodes": [{"id": "sympy/simplify/fu.py::TR16::f"}, {"id": "sympy/simplify/fu.py::TR5"}, {"id": "sympy/simplify/fu.py::TR6"}, {"id": "sympy/simplify/fu.py::_TR56"}, {"id": "sympy/simplify/fu.py::_TR56::_f"}, {"id": "sympy/simplify/trigsimp.py::_futrig"}, {"id": "sympy/simplify/trigsimp.py::futrig"}, {"id": "sympy/simplify/trigsimp.py::trigsimp_old"}], "edges": [{"source": "sympy/simplify/fu.py::TR16::f", "target": "sympy/simplify/fu.py::_TR56"}, {"source": "sympy/simplify/fu.py::TR5", "target": "sympy/simplify/fu.py::_TR56"}, {"source": "sympy/simplify/fu.py::TR6", "target": "sympy/simplify/fu.py::_TR56"}, {"source": "sympy/simplify/fu.py::_TR56", "target": "sympy/simplify/fu.py::_TR56::_f"}, {"source": "sympy/simplify/trigsimp.py::_futrig", "target": "sympy/simplify/fu.py::TR5"}, {"source": "sympy/simplify/trigsimp.py::futrig", "target": "sympy/simplify/trigsimp.py::_futrig"}, {"source": "sympy/simplify/trigsimp.py::trigsimp_old", "target": "sympy/simplify/trigsimp.py::futrig"}]}, "graph_spec": "The scoped transformations must preserve symbolic equivalence while rewriting eligible nonnegative real powers of sin or cos bottom-up: TR5 converts sin(x)**2 (and permitted even higher powers up to `max`) to expressions in 1 - cos(x)**2, and TR6 does the dual conversion; negative, non-real, oversized, odd, or (when `pow=True`) non-perfect-power exponents remain unchanged. TR16 must likewise use the reciprocal cos-power identity only where its guarded rewrite applies. `futrig` must sympify inputs, leave non-Basic or atomic values unchanged, simplify trig-containing subexpressions bottom-up through a fixed greedy Fu-like pipeline, preserve any multiplicative nontrigonometric coefficient, choose candidates by the stated structural complexity objective, and optionally simplify hyperbolic subexpressions via a reversible trig representation; `trigsimp_old` may invoke this subset for its futrig comparison/method behavior without changing the selected result solely because of comparison."} {"repo": "sympy/sympy", "buggy_commit": "30b12bacf3c837040eb71c5af4590cea9521f4e8", "bug_issue": 17624, "solve_pr": 17630, "call_graph": {"nodes": [{"id": "sympy/matrices/expressions/matexpr.py::get_postprocessor::_postprocessor"}], "edges": []}, "graph_spec": "The postprocessor for core Add or Mul expressions containing matrix-valued operands must separate matrix operands from scalar/non-matrix operands and return the appropriate matrix-expression form without requiring eager traversal of nested subexpressions. With no matrix operands, it must preserve the normal core operation. For multiplication, it must preserve the scalar coefficient together with the ordered matrix product, absorbing all scalar factors into an available explicit matrix when possible; otherwise it must construct and evaluate a MatMul with the canonical scalar factor followed by the matrix operands. For addition, a purely matrix-valued sum must become an evaluated MatAdd, while a mixed scalar-and-matrix sum must remain a core Add whose matrix portion is consolidated into an evaluated MatAdd, so scalar-plus-matrix expressions remain representable. Scalar subexpressions must be rebuilt through the originating core operation so their canonical simplification is retained."} {"repo": "sympy/sympy", "buggy_commit": "3f8c8c2377cb8e0daaf8073e8d03ac7d87580813", "bug_issue": 17737, "solve_pr": 22080, "call_graph": {"nodes": [{"id": "sympy/printing/codeprinter.py::CodePrinter::_print_Mul"}], "edges": []}, "graph_spec": "CodePrinter._print_Mul must emit a precedence-preserving code expression for a product: honor the printer’s configured factor ordering (or retain the original factor sequence for legacy/no ordering), extract a leading negative coefficient as a single unary sign, and parenthesize factors whenever required by multiplication precedence, including the stricter binding needed for a lone negated factor. Commutative powers with negative rational exponents must be rendered as division by corresponding positive powers while noncommutative or other factors remain in the numerator; use `1` when no numerator factors remain. Emit no slash for an all-numerator product, one ungrouped denominator for a single divisor, and a parenthesized product for multiple divisors. In particular, reciprocal powers whose base is a multi-factor product must retain grouping around that base so the generated division denotes the same reciprocal product."} {"repo": "sympy/sympy", "buggy_commit": "270cf6880b441599bda9706e3c8caf696ef20302", "bug_issue": 18186, "solve_pr": 18189, "call_graph": {"nodes": [{"id": "sympy/solvers/diophantine.py::diophantine"}], "edges": []}, "graph_spec": "`diophantine` accepts an expression assumed equal to zero (or an equality, converted to lhs−rhs) and returns a set of solution tuples ordered by SymPy’s canonical symbol ordering, or by a valid requested symbol ordering. It must accept only polynomial equations with rational coefficients, normalize removable numeric factors and rational denominators, and exclude numerator solutions that make a symbolic denominator zero. A product equation represents the union of the independently solved factor equations; each partial solution must be expanded to all equation variables with fresh integer parameters for unconstrained variables and discarded if it violates symbol assumptions. Results must contain valid integer-valued solutions, retain the all-zero solution when applicable even if no nontrivial branch is produced, and, when requested for equation classes whose symmetries permit it, include only the corresponding sign/value permutations without introducing invalid sign combinations."}