Skip to content

Comments

Fix: correct parameter order in AvocadoParams.objects() method.#6270

Open
buildearth wants to merge 1 commit intoavocado-framework:masterfrom
buildearth:master
Open

Fix: correct parameter order in AvocadoParams.objects() method.#6270
buildearth wants to merge 1 commit intoavocado-framework:masterfrom
buildearth:master

Conversation

@buildearth
Copy link

The objects() method in AvocadoParams class had incorrect parameter order when calling self.get(). The method was passing (path, key, "") instead of (key, path, ""), which caused the method to search for the wrong key and potentially raise KeyError or return incorrect results.

Signed-off-by: lixintao <lixintao@uniontech.com>
@mr-avocado mr-avocado bot moved this to Review Requested in Default project Feb 4, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @buildearth, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical bug in the AvocadoParams.objects() method by correcting the parameter order passed to an internal self.get() call. This fix ensures that data retrieval operates as intended, preventing potential KeyError exceptions and guaranteeing the accuracy of results when querying objects.

Highlights

  • Parameter Order Correction: The objects() method in AvocadoParams was incorrectly calling self.get() with (path, key, ""). This pull request corrects the order to (key, path, ""), resolving a bug that could lead to KeyError or incorrect results.
  • Docstring Enhancement: The docstring for the objects() method has been updated to explicitly include the path parameter, improving code clarity and documentation.
Changelog
  • avocado/core/parameters.py
    • Corrected the parameter order in the self.get() call within the objects() method from (path, key, "") to (key, path, "").
    • Added a docstring entry for the path parameter in the objects() method.
Activity
  • The pull request was opened by buildearth.
  • No human activity (comments, reviews) has occurred since its creation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a bug in the AvocadoParams.objects() method by swapping the key and path parameters in the call to self.get(). This change prevents incorrect lookups and potential errors. The update to the docstring to include the path parameter is also a welcome improvement. I've added one suggestion to further improve the docstring by documenting the exceptions that can be raised by this method.

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.71%. Comparing base (fdf8aee) to head (4fd5b3c).

Files with missing lines Patch % Lines
avocado/core/parameters.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6270      +/-   ##
==========================================
- Coverage   75.02%   73.71%   -1.32%     
==========================================
  Files         206      206              
  Lines       22510    22510              
==========================================
- Hits        16888    16593     -295     
- Misses       5622     5917     +295     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review Requested

Development

Successfully merging this pull request may close these issues.

1 participant