Replies: 4 comments 2 replies
-
@fantasticle this is really cool - I'm not super familiar with the Django ecosystem so would love to hear what other people think! |
Beta Was this translation helpful? Give feedback.
-
I'm not at all familiar with Django but this looks really cool. Could you say any more about how you use kedro and django together?
Really this belongs in the |
Beta Was this translation helpful? Give feedback.
-
Hi, @fantasticle, If I understood this right, the dataset would get data from a Django Backend using the ORM and allows for us to add filters. This also removes the effort of connecting to the DB using normal credentials and lets Django handle it for us. I feel like I'm definitely missing something here. I'm confused about the |
Beta Was this translation helpful? Give feedback.
-
Hi, in case "all you need to do" is to save a Django model's content to a csv file, might the django-import-export library be useful? Also you could use library to import data from csv to your database. Of course if you operate on 300.000.000 records, this might not be feasible. What do you to export in case of relations, the foreign keys? Are those useful in the exported csv file or do you need to traverse the relations? |
Beta Was this translation helpful? Give feedback.
-
Hi everybody
I'm trying to integrate Kedro with django and was in need for a custom dataset, that integrates with the Django ORM nicely.
I had to put Django's initialization code in one of the
__init__.py
-files to make it work withkedro ipython
(don't know if it is the right location though).Well anyways. Here is my first AbstractDataSet. I wanted to share it with you and am interested in your thoughts.
And the catalog.yml file looks like this:
The idea behind
filters
is that you can filter your django dataset in a "django-way" beforehand.as_iterator
returns the loaded dataset asQueryset.iterator()
which you can use in any python script and loop over it (e.g. load a pipeline on the iterator) if your dataset is too big for your memory, otherwise it will be loaded aspandas.DataFrame
in form of aMemoryDataset
. Thefilepath
of course is optional if you do want to store any processed data in a .csv-file afterwards.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions