From fd9fe79bd4ba24fccde12bd03fcdc3c046a693d4 Mon Sep 17 00:00:00 2001 From: Yi Hu Date: Tue, 2 Dec 2025 22:41:38 -0500 Subject: [PATCH 1/2] Revert "Include Beam version details in MongoDB handshake (#36949)" This reverts commit f242a88382ffba53afcb9065b748ddcae044a60c. --- sdks/python/apache_beam/io/mongodbio.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sdks/python/apache_beam/io/mongodbio.py b/sdks/python/apache_beam/io/mongodbio.py index 62cfc21df746..b0e509c296a9 100644 --- a/sdks/python/apache_beam/io/mongodbio.py +++ b/sdks/python/apache_beam/io/mongodbio.py @@ -97,7 +97,6 @@ from pymongo import DESCENDING from pymongo import MongoClient from pymongo import ReplaceOne - from pymongo.driver_info import DriverInfo except ImportError: objectid = None json_util = None @@ -106,7 +105,6 @@ DESCENDING = -1 MongoClient = None ReplaceOne = None - DriverInfo = None _LOGGER.warning("Could not find a compatible bson package.") __all__ = ["ReadFromMongoDB", "WriteToMongoDB"] @@ -264,10 +262,6 @@ def __init__( self.projection = projection self.spec = extra_client_params self.bucket_auto = bucket_auto - self.client = MongoClient( - self.uri, - **self.spec, - driver=DriverInfo("Apache Beam", beam.__version__)) if "driver" not in self.spec: self.spec["driver"] = DriverInfo( From eb9e5b4327cecc701a96fbf769c260bf82864f11 Mon Sep 17 00:00:00 2001 From: Yi Hu Date: Wed, 3 Dec 2025 03:46:18 +0000 Subject: [PATCH 2/2] add back import --- .github/trigger_files/beam_PostCommit_Python_MongoDBIO_IT.json | 1 + sdks/python/apache_beam/io/mongodbio.py | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 .github/trigger_files/beam_PostCommit_Python_MongoDBIO_IT.json diff --git a/.github/trigger_files/beam_PostCommit_Python_MongoDBIO_IT.json b/.github/trigger_files/beam_PostCommit_Python_MongoDBIO_IT.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/.github/trigger_files/beam_PostCommit_Python_MongoDBIO_IT.json @@ -0,0 +1 @@ +{} diff --git a/sdks/python/apache_beam/io/mongodbio.py b/sdks/python/apache_beam/io/mongodbio.py index b0e509c296a9..aede27674f8f 100644 --- a/sdks/python/apache_beam/io/mongodbio.py +++ b/sdks/python/apache_beam/io/mongodbio.py @@ -97,6 +97,7 @@ from pymongo import DESCENDING from pymongo import MongoClient from pymongo import ReplaceOne + from pymongo.driver_info import DriverInfo except ImportError: objectid = None json_util = None @@ -105,6 +106,7 @@ DESCENDING = -1 MongoClient = None ReplaceOne = None + DriverInfo = None _LOGGER.warning("Could not find a compatible bson package.") __all__ = ["ReadFromMongoDB", "WriteToMongoDB"]