Skip to content
Advertisement

AttributeError: ‘NoneType’ object has no attribute ‘sink’ [closed]

I need to develop a demo ETL system that need to run from following fluent python format

ETL().source(source_args).sink(sink_args).run()

I made the class ETL() after this I made a function source and function sink in the class. Code looks like this:

JavaScript

When I run the file I receive this error:

AttributeError: ‘NoneType’ object has no attribute ‘sink’

Where I am wrong and how to add the last method .run()? I take simulation() function from another file but this is not the problem.

Advertisement

Answer

You’ve found the answer anyway, but I’ll just add some return self to your code:

JavaScript

The above code will now work without the error.

However, you also ask about the run() method. I want to know what that is supposed to do. To me it looks like the sink() method, having a while loop is doing the run thing.

Perhaps you meant to do this:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement