Release 0.63.6#3219
Closed
odlbot wants to merge 10 commits into
Closed
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ahtesham Quraish <ahtesham.quraish@192.168.10.8>
* refactor(vector_search): extract LearningResourcesSearchFiltersSerializer base Split LearningResourcesVectorSearchRequestSerializer into a base class containing the filter fields that map to QDRANT_RESOURCE_PARAM_MAP (resource_type, platform, topic, etc.) and a subclass that adds the search-specific fields (q, offset, limit, hybrid_search). The base is reused by the vector_similar endpoint in a follow-up commit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(learning_resources_search): thread query_filter through similarity pipeline Adds an optional query_filter kwarg to get_similar_resources, get_similar_resources_qdrant, and _qdrant_similar_results. The filter is forwarded to client.query_points(), letting callers narrow similarity results using Qdrant FieldConditions. Existing callers pass no filter, so behavior is unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(learning_resources): support filters on vector_similar endpoint Wires LearningResourcesSearchFiltersSerializer into the vector_similar action so query params like resource_type, platform, topic, etc. are validated and translated to a Qdrant query_filter via qdrant_query_conditions. Declares the serializer on @extend_schema so the generated OpenAPI spec matches the endpoint's actual behavior. Closes mitodl/hq#10896 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(vector_search): move readable_id out of shared filter base serializer readable_id has a distinct role in LearningResourcesVectorSearchRequestSerializer (identifying the query resource by readable_id rather than by Qdrant point id) rather than being a result filter. Moving it back to the subclass keeps LearningResourcesSearchFiltersSerializer as a clean set of result-only filters and prevents vector_similar from exposing readable_id as a filter param. Regenerate OpenAPI spec and TypeScript client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(learning_resources): exempt vector_similar from LearningResourceFilter in schema The ViewSet inherits filter_backends = [MultipleOptionsFilterBackend] and filterset_class = LearningResourceFilter from BaseLearningResourceViewSet. drf-spectacular was advertising all LearningResourceFilter fields (resource_id, sortby, readable_id, etc.) on vector_similar even though that action ignores them entirely. Override filter_backends as a property to return [] for vector_similar so the generated schema only shows the Qdrant filter params that the endpoint actually uses. Regenerate OpenAPI spec and TypeScript client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(learning_resources): add filter support to OpenSearch similarity endpoint Both similar (OpenSearch) and vector_similar (Qdrant) endpoints now accept the same LearningResourcesSearchFiltersSerializer filter params. Each backend handles translation internally: - OpenSearch path uses generate_filter_clauses() to add filter clauses to the MoreLikeThis bool query - Qdrant path uses qdrant_query_conditions() inside get_similar_resources_qdrant (moved from the view layer) The shared dispatcher get_similar_resources() now accepts filter_params (raw validated dict) instead of a pre-translated query_filter, making the interface symmetric across backends. Also exempts the similar action from LearningResourceFilter in the schema, so both endpoints advertise only the filters they actually support. Regenerate OpenAPI spec and TypeScript client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(learning_resources): fix boolean filter handling on OpenSearch similarity path generate_filter_clauses expects list values, but ArrayWrappedBoolean fields (free, professional, certification) produce scalar booleans from validated_data. Scalar True would raise TypeError when iterated; scalar False would be silently skipped by the truthiness guard. Fix by normalizing scalar booleans to single-element lists before passing to generate_filter_clauses in get_similar_resources_opensearch. Also move url__isnull and title__isnull out of LearningResourcesSearchFiltersSerializer into LearningResourcesVectorSearchRequestSerializer — these are Qdrant-only filters (not in SEARCH_FILTERS) and should not be advertised on the OpenSearch-backed similar endpoint. Regenerate OpenAPI spec and TypeScript client. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(learning_resources): fix boolean filter handling on OpenSearch similarity path Wrap all OpenSearch filters in a bool/must dict rather than passing a bare Python list to the filter= kwarg. opensearch-dsl may not serialize a list correctly; the main search path (construct_search) uses the same bool/must pattern via post_filter("bool", must=list(filter_clauses.values())). This bug caused resource_type and other filters to be silently ignored on the /similar/ endpoint, returning unfiltered results. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * remove skip nplusone * _clean_filter_params * fix: address PR review follow-ups - Correct similarity return type hints to QuerySet[LearningResource]\n- Clarify _qdrant_similar_results input_query docstring\n- Remove redundant query in similar()\n- Remove unnecessary django_db marker in serializer tests\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat: add program unenrollment via overflow menu on dashboard - Add useDestroyProgramEnrollment hook using v3ProgramEnrollmentsDestroy API - Add UnenrollProgramDialog confirmation dialog for program unenrollment - Add Unenroll menu item to program enrollment cards' overflow menu, visible only for free (non-verified) enrollments of regular programs (display_mode != 'course') - Add programEnrollment URL helper to test utils - Add tests covering visibility conditions and API call correctness Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test: add cancel and mobile coverage for UnenrollProgramDialog - Add test verifying Cancel button does not fire the DELETE API call - Add parameterized test covering both desktop and mobile overflow menus Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: prevent loading flash in AllEnrollmentsDisplay after program unenrollment When program enrollments are invalidated after unenrolling, the dependent programsList and coursesList queries change keys (their id arrays change). Without keepPreviousData, the new key has no cache and isLoading fires, blanking the entire section. Use placeholderData: keepPreviousData on those two derived queries so stale data shows during the refetch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * prevent loading state after delete enrollment * remove unnecesary conditional --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* adding aggregation generation method * adding aggregations to response * adding some optimizations and aggregations to response * regen spec * add published back to learning resources serializer * spec update * show facets on frontend * fixing aggregation counts * fix test * fix typechecks * remove unused test * adding tests for aggregations * Update vector_search/serializers.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update vector_search/views.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fixing 'with_payload' for group by * switch to safe getter * correct comment about dropping admin params * switching collection param map to constant * adding aggregation params for contentfiles * regenerate spec * adding fix for hybrid search offset * fix tests for new expected response * fix contentfile metadata * make hits and get_results same for both serializers * fixing skip with relation to offsets * tune prefetch multiplier * gather count with hits * adding fix for fields returned by contentfile endpoint * default hits to list * Update vector_search/utils.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * restore and update js test for vector hybrid search facet results * move published to resource specific serializer field * update spec --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
OpenAPI Changes13 changes: 0 error, 8 warning, 5 info Unexpected changes? Ensure your branch is up-to-date with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shankar Ambady
Chris Chudzicki
renovate[bot]
Ahtesham Quraish