Skip to content

Commit

Permalink
sdfsdf
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasHanhan committed Apr 3, 2024
1 parent 4b7dec1 commit 9bbccb0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions metadata-ingestion/src/datahub/ingestion/source/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import bson.timestamp
import pymongo.collection
from bson import CodecOptions, DatetimeConversion
from packaging import version
from pydantic import PositiveInt, validator
from pydantic.fields import Field
Expand Down Expand Up @@ -281,11 +280,9 @@ def __init__(self, ctx: PipelineContext, config: MongoDBConfig):
**options,
**self.config.options,
}
codec_options: CodecOptions = CodecOptions(
datetime_conversion=DatetimeConversion.DATETIME_AUTO
)

self.mongo_client = MongoClient(self.config.connect_uri, codec_options=codec_options, **options) # type: ignore
# See https://pymongo.readthedocs.io/en/stable/examples/datetimes.html#handling-out-of-range-datetimes
self.mongo_client = MongoClient(self.config.connect_uri, datetime_conversion="DATETIME_AUTO", **options) # type: ignore

# This cheaply tests the connection. For details, see
# https://pymongo.readthedocs.io/en/stable/api/pymongo/mongo_client.html#pymongo.mongo_client.MongoClient
Expand Down

0 comments on commit 9bbccb0

Please sign in to comment.