Skip to content

Conversation

@gopidesupavan
Copy link
Member

@gopidesupavan gopidesupavan commented Jul 25, 2025

closes: #51972
closes: #52547

pymongo is restricted due to mongomock, as mongomock no longer maintained we should remove this dependency.

In place of mongomock, i am introducing to use MongoDbContainer testcontainer , this is working nicely, the MongoDbContainer is very light weight, after adding MongoDbContainer to tests are working fine , now the total time taking for mongo test approx 1min, i think this fine to considering the fact we dont have any other option to mock the pymongo and we are testing mongo against real client it gives more confidence :)

Bumped pymongo to latest version.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@gopidesupavan gopidesupavan force-pushed the unblock-pymongo branch 2 times, most recently from 6dbf921 to 686fd25 Compare July 26, 2025 08:01
Copy link
Contributor

@shahar1 shahar1 left a comment

Choose a reason for hiding this comment

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

LGTM :)

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

Very cool. First use of testcontainers :). We could likely migrate some of our integration tests to use testcontainers!

@potiuk potiuk merged commit 9c40220 into apache:main Jul 26, 2025
105 checks passed
@gopidesupavan gopidesupavan deleted the unblock-pymongo branch July 26, 2025 21:56
@gopidesupavan
Copy link
Member Author

Very cool. First use of testcontainers :). We could likely migrate some of our integration tests to use testcontainers!

yeah offcourse thats on my list to get it :)
was side tracked lastweek, working on now for e2e testing with testcontainer will get it soon :)

ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
…Container testcontainer for testing. (apache#53773)

* Remove mongomock dependency from mongo provider

* Fix mongo integration tests
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
…Container testcontainer for testing. (apache#53773)

* Remove mongomock dependency from mongo provider

* Fix mongo integration tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pymongo is held by apache-airflow-providers-mongo from upgrade Find replacement for mongomock

4 participants