Skip to content

Conversation

@gramian
Copy link
Collaborator

@gramian gramian commented Oct 29, 2025

What does this PR do?

This change temporary makes mongoDB commands be handled as queries, so instead of returning just null at least queries can be handled this way. This is important to make mongo queries work in studio.

Motivation

Mongo queries are not working in studio

Related issues

#2168

Additional Notes

To execute actual commands, the mongoDBWrapper needs to add a command method similar to its query method.

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gramian, 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 introduces a temporary workaround to address an issue where MongoDB queries were not functioning correctly in the studio environment. By modifying the MongoQueryEngine to treat MongoDB commands as queries, the PR ensures that basic query operations can proceed. This change is a stopgap measure, with a clear indication that a more comprehensive solution for handling actual MongoDB commands is needed in the future.

Highlights

  • Temporary Command Handling: MongoDB commands are now temporarily processed as queries within the MongoQueryEngine to enable basic query functionality in the studio.
  • Error Handling: The command method that accepts Map<String, Object> parameters now includes error handling, logging exceptions and throwing a CommandParsingException.
  • Future Improvement: A TODO comment has been added to both command methods, indicating that a dedicated command method is still required in mongoDBWrapper for proper command execution beyond queries.
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.

@mergify
Copy link
Contributor

mergify bot commented Oct 29, 2025

🧪 CI Insights

Here's what we observed from your CI run for a82bf1f.

🟢 All jobs passed!

But CI Insights is watching 👀

Copy link
Contributor

@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 provides a temporary fix to handle MongoDB commands as queries, which is a good step towards resolving the issue with Studio. The changes correctly redirect command calls to the query logic. My review includes a couple of suggestions to refactor the new implementations to reduce code duplication by delegating to the existing query methods. This will improve the code's maintainability.

Comment on lines +77 to +82
try {
return mongoDBWrapper.query(query);
} catch (final Exception e) {
LogManager.instance().log(this, Level.SEVERE, "Error on initializing Mongo query engine", e);
throw new CommandParsingException("Error on initializing Mongo query engine", e);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The body of this method is identical to the query(String, ContextConfiguration, Map<String, Object>) method. To avoid code duplication and improve maintainability, you can delegate this call directly to the query method.

    return query(query, configuration, parameters);

@Override
public ResultSet command(final String query, ContextConfiguration configuration, final Object... parameters) {
return null;
return query(query, null, (Map) null);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency and to avoid duplicating logic, it's better to delegate to the query method that has the same signature (query(..., Object...)). This makes the code more maintainable as any future changes to the query method will be automatically reflected here.

    return query(query, configuration, parameters);

@lvca lvca merged commit 0fc9749 into ArcadeData:main Oct 29, 2025
11 of 12 checks passed
@lvca
Copy link
Contributor

lvca commented Oct 29, 2025

Great idea 👍

@lvca lvca self-requested a review October 29, 2025 19:44
@lvca lvca added the enhancement New feature or request label Oct 29, 2025
@lvca lvca added this to the 25.10.1 milestone Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants