Barry Sun
06/02/2022, 7:41 AMdf
in successfully (by passing the df.head()
into the logger) but when I run this `context.resources.io_manager.handle_output(context, obj=df)`I get the error AttributeError: 'NoneType' object has no attribute 'to_parquet'
. Which suggests that when I pass the dataframe into the io_manager, it becomes a NoneType. How does this work?owen
06/02/2022, 3:59 PM<http://context.resources.io|context.resources.io>_manager.handle_output
(this will get automatically called by framework code to store the outputs of your ops). so if you have an op defined as
@op
def do_some_output(context):
# ...
return some_pandas_dataframe
then the io manager will automatically be invoked on some_pandas_dataframe. So I think what's happening in your case is that you're manually calling this handle_output function inside the body of your op (which will succeed), and then not returning a value from your op, so then when dagster invokes the handle_output function automatically, it will be invoked on the return value of your op (which is None).Barry Sun
06/02/2022, 11:28 PMowen
06/02/2022, 11:31 PM