redash icon indicating copy to clipboard operation
redash copied to clipboard

Add support for MongoDB 6.0 data sources

Open pimpreneil opened this issue 2 years ago • 1 comments

What type of PR is this?

  • [ ] Refactor
  • [ ] Feature
  • [x] Bug Fix
  • [ ] New Query Runner (Data Source)
  • [ ] New Alert Destination
  • [ ] Other

Description

Because of the use of an outdated of the pymongo lib, Redash is not compatible with the latest stable release of MongoDB: MongoDB 6.0+

How is this tested?

  • [ ] Unit tests (pytest, jest)
  • [ ] E2E Tests (Cypress)
  • [x] Manually
  • [ ] N/A

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

pimpreneil avatar Oct 19 '22 09:10 pimpreneil

Note that it seems that this modification breaks the "schema" pane displayed when editing a query. It is not preventing you from write your query though, just the schema is not displayed and a "Schema refresh failed" error is displayed.

pimpreneil avatar Oct 19 '22 15:10 pimpreneil

Note that it seems that this modification breaks the "schema" pane displayed when editing a query. It is not preventing you from write your query though, just the schema is not displayed and a "Schema refresh failed" error is displayed.

That is because pymongo deprecated db.collection_names() in favor of db.list_collection_names() in the latest version jump.

To fix it update the query runner for mongodb in redash\query_runner\mongodb.py

The deprecated function is used in get_schema

PatrickBig avatar Jan 30 '23 17:01 PatrickBig

Can this PR get some love please :)

kausikram avatar Mar 14 '23 14:03 kausikram

Any updates on this?

aashishvanand avatar May 09 '23 09:05 aashishvanand

Closing this because we merged the newer Mongo library in #5970.

Thanks for taking the time and effort to creating this PR though @pimpreneil. Things should start getting reviewed and taken care of faster from here on in now. :smile:

justinclift avatar Jul 07 '23 03:07 justinclift