Merged
Conversation
Co-authored-by: Ahtesham Quraish <ahtesham.quraish@192.168.10.4>
* adding posthog_ui_host * adding value to frontend env
* consolidating filter code * refactor to allow for more complext filters * adding isnull params for url and title * add title to qdrant index * update specs * allow null in serializer * adding test * spec update * updating resource collection indexes, payload fields and fix tests * refactor to avoid lint C901,PLR0912 * fix delete points filter selector * check for bad values
OpenAPI ChangesShow/hide 6 changes: 0 error, 0 warning, 6 infoUnexpected changes? Ensure your branch is up-to-date with |
| "enrollment_modes" not in run | ||
| or any( | ||
| mode.get("mode_slug") == "verified" | ||
| for mode in run.pop("enrollment_modes", []) |
There was a problem hiding this comment.
Bug: The use of run.pop("enrollment_modes") in parse_certification mutates the run dictionary, removing a field that downstream consumers rely on.
Severity: HIGH
Suggested Fix
In parse_certification, change the iteration from for mode in run.pop("enrollment_modes", []) to for mode in run.get("enrollment_modes", []). This will read the data without modifying the original run dictionary.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: learning_resources/etl/utils.py#L1097
Potential issue: In `learning_resources/etl/utils.py`, the `parse_certification`
function uses `run.pop("enrollment_modes", [])` to iterate over a list of modes. Because
dictionaries are mutable, this `.pop()` call removes the `enrollment_modes` key from the
original `run` object. This modified `run` object is then yielded by the calling
functions (`transform_programs` and `_transform_course`). Downstream consumers,
including frontend components, expect the `enrollment_modes` field to be present on run
objects, and its absence will lead to missing data and potential rendering errors.
Did we get this right? 👍 / 👎 to inform future reviews.
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
Matt Bertrand
Chris Chudzicki
Ahtesham Quraish