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:
class ETL:
def source(self, data_source: str):
if data_source == 'Simulation':
simulation()
elif data_source == 'File':
main()
def sink(self, data_sink: str):
if data_sink == 'Console':
command = 'Continue'
user_command = input('Please type to Continue or to Stop!')
while command != 'Stop':
simulation()
else:
pass
ETL().source('Simulation').sink('Console')
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.