---
title: "Comment by Minh Nguyen on \"Sentiment analysis on streaming Twitter data using Kafka, Spark Structured Streaming & Python (Part 2)\" | Hashnode"
description: "Hello, I have a problem &quot;TypeError: write_row_in_mongo() takes 1 positional argument but 2 were given&quot; when I run your code"
url: "https://hashnode.com/posts/sentiment-analysis-on-streaming-twitter-data-using-kafka-spark-structured-streaming-and-python-part-2/622f77a7df08b9b82341b93e/comment/625c14c52f84e0d4fc33e7fa"
---

[Discussion](https://hashnode.com/posts/sentiment-analysis-on-streaming-twitter-data-using-kafka-spark-structured-streaming-and-python-part-2/622f77a7df08b9b82341b93e)

Comment [Sentiment analysis on streaming Twitter data using Kafka, Spark Structured Streaming & Python (Part 2)](https://hashnode.com/posts/sentiment-analysis-on-streaming-twitter-data-using-kafka-spark-structured-streaming-and-python-part-2/622f77a7df08b9b82341b93e)

[Minh Nguyen](https://hashnode.com/@benminh1201)

[Apr 17, 2022](https://hashnode.com/posts/sentiment-analysis-on-streaming-twitter-data-using-kafka-spark-structured-streaming-and-python-part-2/622f77a7df08b9b82341b93e/comment/625c14c52f84e0d4fc33e7fa)

Hello, I have a problem "TypeError: write\_row\_in\_mongo() takes 1 positional argument but 2 were given" when I run your code

[Lorena Gongang](https://hashnode.com/@lorenagongang)

[Apr 17, 2022](https://hashnode.com/posts/sentiment-analysis-on-streaming-twitter-data-using-kafka-spark-structured-streaming-and-python-part-2/622f77a7df08b9b82341b93e/comment/625c14c52f84e0d4fc33e7fa#reply-625c1a892f84e0d4fc33e8b0)

Hello [Minh Nguyen](https://hashnode.com/@benminh1201), I know where the problem came from : Just modify write\_row\_in\_mongo and add another parameter, epoch\_id. I just changed the article, and you won't get the error after it.
