Hi all, I am running multiple pipelines using thre...
# questions
c
Hi all, I am running multiple pipelines using thread runner How to increase concurrent connection to db while declaring credentials for MySQL in credentials.yml? To do it in python I can do it using passing extra argument in create_engine Or how to close connection, after loading the data ? That way I won't face the error .
n
Great question, I don't have an immediate answer. Can you share how would you do it in pure Python?
n
You can override the
create_connection
method by subclass the
SQLDataSet
.
Do you want to open a PR to add this? I think it’s reasonable to support extra args to connection. https://github.com/kedro-org/kedro-plugins/blob/7b3ac6c7b88c44143a26fe556475cebb9012ac08/kedro-datasets/kedro_datasets/pandas/sql_dataset.py#L4[…]86 Essentially the args need to be passed here
c
I will, but I have never worked on an open source project. If you can guide me on how do I verify if the changes are done are working or not? Or any article which will guide me.
n
This will be a good first PR :)
c
Sure I will on the weekend, in the meantime is there any possibility of a workaround in this?
n
You can override the
create_connection
method by subclass the
SQLDataSet
.
This will be the workaround
So essentially
Copy code
class CustomSQLDataSet(SQLDataSet):
     def create_connection(self, <extra_args>:
         ...
c
In which file this change will go?
n
This is a workaround and you need to create a CustomDataset
I am in a meeting now but you can search it in the doc with “custom dataset”