You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "MS-Kinguin (via GitHub)" <gi...@apache.org> on 2024/03/03 05:02:26 UTC

[I] [Bug]: year 0 is out of range when connecting to MongoDB Atlas [beam]

MS-Kinguin opened a new issue, #30471:
URL: https://github.com/apache/beam/issues/30471

   ### What happened?
   
   ### Cause of the problem
   
   My collection in MongoDB on Atlas has an incorrect date value in one of the fields:
   
   `
   registrationDate:
   0000-12-30T00:00:00.000+00:00`
   
   The issue arises because the pipeline cannot progress to the transform stage where I could fix it. It fails while reading the data with the connector, displaying the following error:
   
   `bson.errors.InvalidBSON: year 0 is out of range (Consider Using CodecOptions(datetime_conversion=DATETIME_AUTO) or MongoClient(datetime_conversion='DATETIME_AUTO')). See: https://pymongo.readthedocs.io/en/stable/examples/datetimes.html#handling-out-of-range-datetimes`
   
   This failure likely occurs at some validation level of the BSON object when attempting to connect to Atlas. To my knowledge, utilizing CodecOptions is not feasible at the mongodbio connector level. Here is my current setup:
   
   ` | "Read documents" >> beam.io.ReadFromMongoDB(uri='mongodb+srv://user:password@host.mongodb.net/?retryWrites=true&w=majority&readPreference=secondary',
                                                        db="database",
                                                        coll="collection",
                                                        filter=query,
                                                        bucket_auto=True)`
   
   While the direct solution is to adjust the values in Atlas, it's well-known that data quality can be an issue, even in production environments, and often it's beyond our control. Simply filtering out these documents is a workaround, not a solution. It would be beneficial if the connector could automatically detect and correct the year 0 to a different placeholder date. I have observed such functionality in custom JDBC drivers for Mongo Atlas in different environments (Data Fusion + Dataproc).
   
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [X] Component: Python SDK
   - [ ] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: year 0 is out of range when connecting to MongoDB Atlas (SDK 2.53.0) [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #30471:
URL: https://github.com/apache/beam/issues/30471#issuecomment-4142368372

   This issue has been closed due to lack of activity. If you think that is incorrect, you can reopen the issue at any time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: year 0 is out of range when connecting to MongoDB Atlas (SDK 2.53.0) [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #30471: [Bug]: year 0 is out of range when connecting to MongoDB Atlas (SDK 2.53.0)
URL: https://github.com/apache/beam/issues/30471


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug]: year 0 is out of range when connecting to MongoDB Atlas (SDK 2.53.0) [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #30471:
URL: https://github.com/apache/beam/issues/30471#issuecomment-3959043603

   This issue has been marked as stale due to 150 days of inactivity. It will be closed in 30 days if no further activity occurs. If you think that’s incorrect or this issue still needs to be addressed, please simply write any comment. If closed, you can reopen the issue at any time. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org