Skip to content

Commit

Permalink
[DOP-8664] - updated logs messages in MongoDB.WriteOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-lixakov committed Sep 11, 2023
1 parent 10a13a7 commit acd4ac5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion onetl/connection/db_connection/mongodb/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def write_df_to_target(

if self._collection_exists(target):
if write_options.if_exists == MongoDBCollectionExistBehavior.ERROR:
raise ValueError("Operation stopped due to MongoDB.WriteOptions(if_exists=...) is set to 'error'.")
raise ValueError("Operation stopped due to MongoDB.WriteOptions(if_exists='error')")
elif write_options.if_exists == MongoDBCollectionExistBehavior.IGNORE:
log.info(
"|%s| Skip writing to existing collection because of MongoDB.WriteOptions(if_exists='ignore')",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_mongodb_writer_if_exists_error(spark, processing, get_schema_table, cap

with pytest.raises(
ValueError,
match=re.escape("Operation stopped due to MongoDB.WriteOptions(if_exists=...) is set to 'error'."),
match=re.escape("Operation stopped due to MongoDB.WriteOptions(if_exists='error')"),
):
writer.run(df)

Expand Down

0 comments on commit acd4ac5

Please sign in to comment.