Hello Kedro team, I have a last minute requirement...
# questions
p
Hello Kedro team, I have a last minute requirement - need to update a table in the kedro pipeline. I’m using the sql query dataset to specify the update sql query. I have a pipeline as follows:
Copy code
def create_pipeline(**kwargs) -> Pipeline:
    """
    """
    return pipeline(
        [
            node(
                func=lambda *args: None,
                inputs=["<catalog entry for the update query>"],
                outputs=None,
                name="update_table",
            ),
        ]
    )
This executes the update query successfully, but the pipeline fails because there are no results to be returned. Is there a workaround for this? Thank you so much!
j
hello @Priyanka Patil, can you share the traceback? in principle
outputs=None
should be OK, unless I'm missing something
p
sure thing! @Juan Luis here’s the error trace..
Copy code
sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically.
Copy code
kedro.io.core.DataSetError: Failed while loading data from data set SQLQueryDataSet(execution_options={}, filepath=None, load_args={}, sql=update tablename set status = 'COMPLETE' where id = 22;).
This result object does not return rows. It has been closed automatically.
this post can be closed Here’s the fix:
Copy code
update tablename set status = 'COMPLETE' where id = 22 RETURNING tablename.*;
j
glad you solved it!
👌 1