Latest / Talk Python To Me / #337: Kedro for Maintainable Data Science
Transcript
- 0:00Have you heard of Kedro? It's a Python framework for creating reproducible, maintainable, and modular data science code.
- 0:06We all know that reproducibility and related topics are important ones in the data science space.
- 0:10The freedom to pop open a notebook and just start exploring is much of the magic.
- 0:15Yet, that freeform style can lead to difficulties in versioning, reproducibility, collaboration, and moving to production.
- 0:22Solving these challenges is the goal of Kedro.
- 0:24And we have three great guests from the Kedro community here to give us the rundown.
- 0:28Yatunda Dada, Waylon Walker, and even Donov.
- 0:31This is Talk Python To Me, episode 337, recorded October 1st, 2021.
- 0:37Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:53This is your host, Michael Kennedy.
- 0:55Follow me on Twitter where I'm @mkennedy, and keep up with the show and listen to past episodes at talkpython.fm.
- 1:01And follow the show on Twitter via at Talk Python.
- 1:04We've started streaming most of our episodes live on YouTube.
- 1:08Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
- 1:16This episode is brought to you by Tab9, the editor plugin that enhances your autocomplete by learning how you write code.
- 1:23Us over at Talk Python training with our courses.
- 1:26And the transcripts are brought to you by Assembly AI.
- 1:29Yatunda, Ivan and Waylon, welcome to Talk Python To Me.
- 1:33Thank you so much for having us.
- 1:35Yeah, thank you for inviting us.
- 1:36Yes, thank you.
- 1:37Yeah, it's fantastic to have you all here.
- 1:38Let's start with just a little bit of your background.
- 1:41Since there's three of you, maybe not too long, but how do you all get into programming, Python, into this Kedro project and so on?
- 1:49Yatunda, you want to start with you?
- 1:50Sure.
- 1:50So I'm a principal product manager on Kedro.
- 1:52I've been with the project for actually exactly today, three years.
- 1:56Oh, nice.
- 1:58Three years and eight months.
- 1:59You've been there most of the time.
- 2:00That's fantastic.
- 2:00Yeah.
- 2:01Ivan has been there from the beginning, so he'll talk about that.
- 2:03My background is mechanical engineering, and I would have been a user of Kedro.
- 2:08We discovered, I think, one of the coolest user interviews I've ever done was with my former team.
- 2:12They picked it up on their own, which is amazing.
- 2:14Oh, nice.
- 2:15Ivan now.
- 2:16And I work at Quantum Black.
- 2:18That's the primary.
- 2:20Yeah, okay.
- 2:21Ivan?
- 2:21Yeah, so I'm Ivan.
- 2:22I'm a tech lead for Kedro.
- 2:24Started, like, have been working with Quantum Black for the last almost five years now.
- 2:29Is it?
- 2:30Yeah, five years.
- 2:30So you've been there from the beginning, as we hear.
- 2:33From the beginning for Kedro, not for the beginning.
- 2:35Yeah, yeah, yeah.
- 2:35That's what I, yeah.
- 2:36Quantum Black.
- 2:36Yeah.
- 2:37So initially, it was a small internal tool that was being developed by another two people on our team, Nikos and Aris.
- 2:46And then we decided to turn it into a product.
- 2:49And then we started from scratch and developed it into what it is.
- 2:53Then we found out that things can get serious.
- 2:55And then that's how we hired Yetu, because we needed a PM as well.
- 3:00As a proper product.
- 3:01Otherwise, my background is in software engineering, all kinds of software engineering.
- 3:06Started off as web developer.
- 3:08I was very keen to do some game programming before that, but I couldn't find jobs related to that.
- 3:13A lot of people are interested in doing game programming until you actually get into the reality of it.
- 3:18And the reality is, a lot of times it can be a grind and it's hard to get a job.
- 3:23I was going to say that I'm quite lucky that I didn't end up being a game programmer.
- 3:28It's not the first time I heard that.
- 3:29That's right.
- 3:30Yeah.
- 3:30Yeah.
- 3:30So then, yeah, I moved on to distributed systems and I ended up doing data and AI at QB mainly.
- 3:38So I'm kind of a newbie in the data field, but being there for five years, kind of newbie.
- 3:45A lot of people are in that realm, right?
- 3:49A lot of people are coming into the whole data science side of things.
- 3:52Waylon, how about you?
- 3:53My background is in mechanical engineering.
- 3:55Probably around 2014, I started diving deeper into the data side of things.
- 4:01I had some family medical things that came up and it kind of severely limited my ability to travel.
- 4:08And slowly over time, I just kind of doubled down into the side of things.
- 4:13Yeah.
- 4:13It was right around the time you started the show.
- 4:15And a lot of what I've learned has either been directly from this show or from like taking ideas from the show and diving into them.
- 4:24Oh, awesome.
- 4:25That's really cool.
- 4:25Happy to bring that to you.
- 4:27I think a lot of people who come from backgrounds that they're not like traditional CS backgrounds, right?
- 4:33They're kind of coming in through a side channel.
- 4:34I feel like the podcast has offered a lot of connection and extra information besides just what's on like the docs page of some projects for people, which is great.
- 4:44It's awesome to hear.
- 4:45So now I'm a team lead for a data science team and do Python every day.
- 4:50And we use Kedro pretty heavily in all of our projects.
- 4:55So before we move on to the topic, give me a quick thought on comparing mechanical engineering work life experience to software development, Python developer experience.
- 5:06How do you feel about where you are?
- 5:08I like where I'm at.
- 5:09One thing that I kind of struggled with in mechanical engineering was there was a lot of learning in college.
- 5:16There was a lot of things to learn.
- 5:17And then you get an industry and everything's kind of like walled off.
- 5:22And the learning doesn't completely stop, but it's very hard to do.
- 5:26You know, on the software side, a lot more things are open to learn.
- 5:31There's a lot more resources that are just out there in the open and not like behind proprietary IP patents and all that kind of stuff.
- 5:39I think that works really well for me.
- 5:41I'm a learner.
- 5:42I don't remember the, is it Galt?
- 5:45The personality study kind of things.
- 5:48Yeah.
- 5:48Always come out with learner is like the top thing for me.
- 5:51Nice.
- 5:51Yeah.
- 5:51So it's a good fit.
- 5:52Yeah.
- 5:52If you don't like to continually learn and continues, continually kind of reinvent yourself, then software is probably a data science is probably not a super awesome place because the life cycle of these things.
- 6:04I mean, if you want to take it to the extreme, you could do JavaScript.
- 6:06But most of us, we have like at least a year on the technology before we move on.
- 6:11Yeah.
- 6:12All right.
- 6:12Now, speaking of that, let's go ahead and get into our main topic here.
- 6:17And I want to kick this off by talking about reproducible and maintainable data science.
- 6:22So a little bit like engineering, people are coming to data science from these different angles, a lot of times from computational stuff, from biology or from finance and economics or whatever.
- 6:34And they don't necessarily come with a full baked set of, oh, here's the software engineering lifecycle skill set.
- 6:41Here's how I set up my continuous integration.
- 6:43Here's my testing.
- 6:44And like a lot of times it's like, look, I got it working.
- 6:46We're kind of good.
- 6:46You know what I mean?
- 6:47I think one of the areas the whole data science field is working with is taking a lot of these folks who are coming from non-traditional CS backgrounds and helping them create more reproducible, reusable bits of code, notebooks, maybe even code outside notebooks.
- 7:02So let's maybe open the conversation there
- 7:05because that's where Kedro focuses
- 7:07on helping data scientists create reproducible,
- 7:10maintainable code.
- 7:11Eutunde, do you want to maybe kick us off
- 7:13with some thoughts on where Kedro's philosophy is on this?
- 7:17So I guess if we actually break it down,
- 7:19it's a Python framework that helps you
- 7:21do those specific things.
- 7:22And when we talk about it being a framework,
- 7:24it's kind of embedded with best practices
- 7:27and ways of structuring how you write code
- 7:30so that you can get those reproducible,
- 7:33maintainable, and modular data science code.
- 7:35But if I go into each one of the definitions,
- 7:36when we say reproducible, we kind of mean that
- 7:39when I rerun this pipeline or rerun this experiment,
- 7:43I should get the same result at the end.
- 7:45So there shouldn't be any real surprises
- 7:47that things have really changed or things are really breaking.
- 7:50When we talk about it being maintainable,
- 7:52we now also add in an aspect of collaboration,
- 7:55even for yourself, that if you come back to this code base
- 7:58like three months from now or six months from now,
- 8:00you should be able to know what was going on in it
- 8:02and be able to modify and tweak it.
- 8:05And other people should be able to do that with you too.
- 8:07It's not really, it shouldn't be the biggest disaster
- 8:10if the main code contributor has left
- 8:13and you now have to try, scramble to figure out
- 8:15what's going on there.
- 8:16And then when we talk about it being modular,
- 8:18this is where we encompass some of the software engineering principles
- 8:21that you wouldn't ordinarily learn in,
- 8:24maybe if you enter data science from the mathematician space
- 8:27or even from the sciences,
- 8:29where we think about you being able to break your code base down into small units
- 8:34so that it's possible to think about things like reuse,
- 8:37but also it's easier to do things like testing the code base as well.
- 8:40All of these things like basically amount to
- 8:42trying to enforce like software engineering best practice,
- 8:46especially where you recognize that you might need help with that.
- 8:49One of the other areas that I've seen a lot of emphasis on the project about is collaboration.
- 8:56And one of the things that can be challenging is if you're a data scientist working on a notebook,
- 9:01you might run some cells, maybe on data that is live.
- 9:05And so the data might be slightly changing.
- 9:07You check that into GitHub or source control.
- 9:10You've got the results in sort of a scrambled up JSON file notebook,
- 9:16and then someone else has rerun it at a different time,
- 9:19and then they try to check it out.
- 9:20Well, you know, you end up with these conflicts and other issues.
- 9:23So the sort of natural flow of,
- 9:25hey, let's just check everything into Git,
- 9:28and then we'll just synchronize over that
- 9:29can sort of fall apart with some of the traditional tooling of data science.
- 9:33And that's definitely true.
- 9:35I think Kydra's origins actually come from large teams,
- 9:39upwards of like at least three or four data scientists and data engineers,
- 9:44machine learning engineers collaborating on the same code base,
- 9:47upwards of, you know, to 12 people having to work on the same code base.
- 9:50If you're using Jupyter Notebook and trying to construct your entire pipeline in it,
- 9:54I think the workflow would look kind of strange with you waiting.
- 9:58Maybe Waylon has some comment on like watching this in practice of,
- 10:02you know, waiting for someone to finish in the Jupyter Notebook
- 10:04before you could have a go at it and try your things.
- 10:07During our engagement with McKinsey,
- 10:08we were introduced to Kedro during kind of the first iteration.
- 10:12Yeah, and Waylon, by the way,
- 10:14we've only talked about Quantum Black so far,
- 10:16but Quantum Black is like a subsidiary of McKinsey.
- 10:18So yeah, right.
- 10:20This is all sort of the same organization in a sense, right?
- 10:23So that's why this is coming together, yeah?
- 10:25Yeah, good point.
- 10:26But so the second half,
- 10:27they chose like just due to familiarity,
- 10:29the people that we had with us,
- 10:31it was their first time using Kedro.
- 10:33And they're like, well, if we want to move fast on the second half,
- 10:37let's not try to do anything new.
- 10:38And let's just do notebooks like we always had.
- 10:41Right, fall back to what they know sort of thing.
- 10:43Yeah, and the workflow there was definitely like
- 10:46three people are on a project,
- 10:47two people are sitting idle
- 10:49while one person has the notebook checked out.
- 10:51Oh my gosh.
- 10:52That sounds like old school source safe type source control.
- 10:55Someone's locked the files, no one else can edit it.
- 10:58Like that's just, it's completely 1990s style, right?
- 11:01But it's a real problem.
- 11:02I mean, some of these things are,
- 11:03there's an attempt to address them
- 11:06by having collaborative notebooks,
- 11:07basically Google Docs type of experiences, right?
- 11:10But usually those are in somebody else's cloud,
- 11:12somebody else's compute cloud.
- 11:14And so you're taking the trade-offs
- 11:15of running it over there, right?
- 11:17Yeah, and there's multiple things
- 11:19I think you're missing out on.
- 11:20When we talk about even making a robust code base,
- 11:23writing unit tests in a notebook,
- 11:25writing doc strings in a notebook
- 11:27becomes a little challenging.
- 11:28And then we think about all the additional tools
- 11:31that you have to add for collaboration.
- 11:32How am I going to do pull requests
- 11:34and review my friend's code?
- 11:35Because we know the way that
- 11:37when you check in a Jupyter notebook,
- 11:38it's often with the weird Jason thing.
- 11:40So how do I do reviews of my team members' code
- 11:43so we can overall improve the code base?
- 11:45And then some of the features as well
- 11:47within notebooks like cache state as well
- 11:50cause issues down the line
- 11:52because I might be working on a version of my code
- 11:55that when I rerun my entire Jupyter notebook,
- 11:57not everything will run.
- 11:58So it's not necessarily down with the notebooks
- 12:01or anything, for sure.
- 12:02We believe that there's a space for them really
- 12:04for maybe doing exploratory data analysis,
- 12:07trying to work out what's going on with the data set.
- 12:09There's space for it
- 12:10with initial pipeline development as well
- 12:12if you're still prototyping
- 12:13and you're not sure how things are going to go.
- 12:15And then even for reporting maybe,
- 12:17if you want like a more visual interface for reporting.
- 12:19But when you talk about like code
- 12:22that I want to be able to run in three months,
- 12:24six months, and many people will be using,
- 12:26it has to be in Python script
- 12:27and it's supported when it's in the framework.
- 12:30Yeah, I think that's a good point.
- 12:31You can definitely start in the notebook space
- 12:34and then eventually move it over.
- 12:36Now, one thing I do want to give a shout out to,
- 12:39I don't remember the name,
- 12:40but you can set up a Git pre-commit hook
- 12:43that will strip out the metadata,
- 12:46the results of your notebook.
- 12:48So that's kind of a fix,
- 12:50but it's still, you know, it's not that amazing.
- 12:52The other thing, you talked about reproducibility.
- 12:55One of the things that troubles me,
- 12:57and I'm a fan of notebooks and I like it.
- 12:59And I just on Python Bytes podcast,
- 13:02we just talked about how JupyterLab
- 13:04is now a desktop application.
- 13:05they just released that like this week,
- 13:07which is really cool.
- 13:08So there's a lot of neat stuff
- 13:09happening around notebooks.
- 13:10One of the things that I'm not a big fan of though,
- 13:13is the ability to reorder execution
- 13:16or only execute part of it, right?
- 13:19There's a lot of benefits to say,
- 13:20run the cell that computes the data
- 13:21that's really expensive.
- 13:22And then run this,
- 13:24no, make, go back three cells,
- 13:26make a change here, run this one,
- 13:28and then go back down four cells and run that one.
- 13:31And it's kind of like a go-to with no explanation.
- 13:35Right?
- 13:36Where you can jump around in different orders.
- 13:38And that certainly doesn't lead to reproducibility
- 13:42when it's up to the human's decision of like,
- 13:45I decided I felt like I wanted to make a tweak
- 13:47and rerun that one.
- 13:48And I forgot to run the intermediate step that used that.
- 13:51It's very problematic for long-term reliability,
- 13:54reproducibility, and so on.
- 13:55There's quite a few studies, I think,
- 13:57where people have tried to rerun notebooks.
- 14:00There's one by NYU, I think back in 2020 or 2019,
- 14:03where they rerun like,
- 14:04I think over like 80,000 notebooks.
- 14:07And only 24% of them completed without error.
- 14:10But there's a very small part of that
- 14:15that had the same result
- 14:16when the notebook was finished running.
- 14:18Yeah.
- 14:19Wow.
- 14:19Very interesting.
- 14:20The other part that Kedro has is the versioned datasets.
- 14:24So not only like just running the code itself,
- 14:27but you can check out like an exact version of the code
- 14:30or the version of the data that was ran last time.
- 14:34Okay.
- 14:34So you sort of store the data as well?
- 14:36Like instead of just versioning just the source code or the notebook,
- 14:41you also version the data?
- 14:42Yep.
- 14:42That's an option as you're creating your catalog entries.
- 14:45You can, it's as simple as just putting versioned equals true
- 14:48pretty much on most of the datasets.
- 14:50Oh, that's really cool.
- 14:51Ivan, how about your thoughts on this reproducibility,
- 14:54maintainability side of data science?
- 14:57That's essentially why we started Kedro
- 14:59because here at QB, when we were going to clients
- 15:03and we needed to be able to,
- 15:05if anyone has worked at Consonance,
- 15:07you know that sometimes you need to rotate people,
- 15:09you need to move people from one place to another.
- 15:11And the pace is quite high.
- 15:14And when people end up in a, like in the midway,
- 15:17like in the middle of a project,
- 15:18there is quite a long onboarding time,
- 15:21which is probably a week or more than that.
- 15:24And that's super expensive for a client
- 15:26to pay for one extra person
- 15:27just to read the code that was written to that point.
- 15:30Moreover, when you hand over code,
- 15:32it can be just notebooks.
- 15:33So we ended up resorting to,
- 15:36okay, having different stages
- 15:37where you do things in notebooks,
- 15:39then you need to convert them
- 15:40in another programming language.
- 15:42And then you have an extra person doing that.
- 15:44And obviously that conversion wasn't done
- 15:47due to the limited time in the best way possible.
- 15:50So it was quite hard to have this,
- 15:53you know, workflow of making a reproducibility
- 15:55reproducible code without sacrificing speed and agility.
- 16:00And out of that need,
- 16:01that was how the initial versions of Kedro were born.
- 16:04I think notebooks are super useful as well,
- 16:06like, but they are definitely not for production code.
- 16:09They're for exploring,
- 16:10for trying out, doing some different things,
- 16:14just basically a working session.
- 16:16And I like the name notebook
- 16:18because it's essentially,
- 16:19you're just catching things in a notebook.
- 16:22The thing is that what we see is people end up
- 16:25using those in production.
- 16:26And I think that makes it hard.
- 16:29You already explained,
- 16:30like all of you mentioned some of the issues.
- 16:32How do you manage that?
- 16:35And how do you deal with credentials,
- 16:37with traditional stuff?
- 16:38And for me,
- 16:39when I was coming from different software background,
- 16:41joining a data company,
- 16:42and I was like,
- 16:43where are the frameworks here?
- 16:45Like there was no frameworks.
- 16:47Everything was platforms.
- 16:48And there was no way for you to start a project.
- 16:51And I found that super interesting.
- 16:55Interesting.
- 16:56Not like cookie cutter type of templates
- 16:58and those kinds of things for generating it.
- 17:00Like here's how we integrate
- 17:01with all of our other libraries
- 17:03and infrastructure and just go, right?
- 17:05Yeah, that wasn't there.
- 17:07And it was quite hard to align on a similar process.
- 17:11And it reminded me a lot
- 17:12to early days of web development
- 17:14when everyone had their own PHP scripts
- 17:17that they would make
- 17:18and people didn't use frameworks a lot.
- 17:20And then things moved on from there.
- 17:23And for me, that's how it felt.
- 17:24This portion of Talk Python To Me
- 17:28is brought to you by Tab9.
- 17:29As you know,
- 17:30I'm a big fan of rich text editors
- 17:32and all they can do to empower us
- 17:34to work faster and smarter.
- 17:35The most important feature there
- 17:37being autocomplete
- 17:38to help you write code more correctly and faster.
- 17:41So why not supercharge your autocomplete?
- 17:43If you haven't tried Tab9,
- 17:45you should definitely check it out.
- 17:46It works with PyCharm, VS Code,
- 17:47and even Vim among other text editors.
- 17:50Tab9 is kind of a mind reader
- 17:52that gets even better as you use it.
- 17:53Tab9 uses three AI models,
- 17:56an open-source trained AI,
- 17:58a private code-based trained AI,
- 18:00and team-trained AI.
- 18:02A very cool benefit of Tab9
- 18:04is the fact that they have a team-trained AI.
- 18:06So if you're on a team working on the same project,
- 18:09you can all work on the same model
- 18:10and get suggestions accordingly.
- 18:12The more team members you add,
- 18:14the faster the AI will learn your project,
- 18:16preferences, and patterns.
- 18:17Tab9 is free to use.
- 18:19They have a free forever subscription plan
- 18:22as well as a pro plan
- 18:24with advanced models,
- 18:25an enterprise plan for larger organizations,
- 18:27and every plan supports inviting team members.
- 18:30If you're a student, Tab9 is 100% free.
- 18:34Just let them know you're a student,
- 18:35and you'll get the pro plan for free.
- 18:37See what better adaptive autocomplete can do for you.
- 18:40Visit talkpython.fm/tab9 to get started.
- 18:43That's talkpython.fm/tab9,
- 18:46or just visit the link in your podcast player's show notes.
- 18:48And thanks to Tab9 for supporting Talk Python To Me.
- 18:53It was very interesting.
- 18:54I think it was very interesting initially
- 18:56because of this, like,
- 18:58okay, how do we bring that
- 19:00to people whose job is not to build software,
- 19:04but their job is to build models?
- 19:05And these are different skill sets, right?
- 19:07It talks about how there's these skills
- 19:09that data scientists should learn
- 19:11from software development, software engineering,
- 19:13and that's true.
- 19:13It would help them a lot,
- 19:14but there's also a lot of skills
- 19:15that data scientists and people in engineering
- 19:18and economics and biology that have,
- 19:20as software developers like you and I,
- 19:22you know, we don't know the inner details
- 19:25of, you know, gene editing or mitochondria or whatever, right?
- 19:28Like, there's a, to be fair,
- 19:30I mean, it's not like to put them in a negative light.
- 19:32It's just some of these skills
- 19:33are not learned along the traditional path,
- 19:35and so it does make things like reproducibility hard.
- 19:38Yeah, that's why I think the data is like a very,
- 19:41you know, the data landscape is a very nice place
- 19:43because it's a very creative mix of people
- 19:46from different backgrounds for that reason.
- 19:48And I think what software engineers can do is,
- 19:51okay, help those people to be the most effective,
- 19:54the most productive with what skills they already have.
- 19:57Yeah.
- 19:57And maybe just teach them
- 19:59just enough software engineering practices
- 20:01so they can go ahead.
- 20:03They don't need to be experts in two things.
- 20:05Yeah.
- 20:06You can never be like full expert in,
- 20:08you know, software engineering and then biology
- 20:10and, you know, DNA and all that.
- 20:13And if we go that way and require people
- 20:16to be full-blown experts,
- 20:17that's, I think, the wrong path.
- 20:19These are ways just to equip them with the tools.
- 20:22Especially in Python.
- 20:23Yeah.
- 20:24The ethos of Python is that it's kind of,
- 20:26you can be very effective
- 20:27with a partial understanding of what it is.
- 20:29You know, and if you require them
- 20:31to be full data scientists,
- 20:32then it's, you know, something different for sure.
- 20:35Yeah.
- 20:35So let's talk about Kendro specifically
- 20:39in terms of not just the philosophies
- 20:41and some of the goals,
- 20:42but, you know, what is it?
- 20:43When I first heard of it,
- 20:44I thought this feels a little bit like,
- 20:46you know, one of these data pipeline type of programs,
- 20:51you know, like Luigi or something like that.
- 20:53But that's not quite right, is it?
- 20:55You tuned in.
- 20:56No, it's not quite right
- 20:57because we really do dial in on that focus
- 20:59of like software engineering best practice first
- 21:01implemented on code.
- 21:02So we think about things like a project template
- 21:05for you to know where to store
- 21:07different parts of your code.
- 21:08I actually think then we've also got a data catalog
- 21:11which manages like how you load and save data.
- 21:13We've also got a way for users
- 21:15to interact with configuration
- 21:16for the first time as well.
- 21:17So removing what would have been maybe configuration
- 21:20because of their loading and saving paths
- 21:23for data out of the code,
- 21:25as well as things like removing parameters
- 21:27and even implementing logging.
- 21:28And then we also think around
- 21:30being able to have our own pipeline abstraction as well,
- 21:33which is why everyone gets excited
- 21:34and thinks that Kendro is kind of like Luigi Airflow.
- 21:37I think we get grouped with Dagster as well,
- 21:40all these different pipeline abstractions,
- 21:42but we really do focus on that journey of like,
- 21:45how do we even write code that's worth deploying?
- 21:47Which is a kind of like a different focus
- 21:49because when you get to,
- 21:50our expectation is like when you get into Prefect,
- 21:52Dagster, Luigi, Airflow,
- 21:54you really have a code base that's worth deploying.
- 21:56And you just really need to think about like,
- 21:59I want it to run at 7 a.m. on Monday.
- 22:01Right, or based on this trigger
- 22:02when a file shows up in blob storage or whatever, right?
- 22:05Yeah, which is a completely different focus.
- 22:08And we think that we call that group,
- 22:09the orchestrators are really good at what they do.
- 22:11But in terms of that whole process
- 22:14of leading up to a code base that's worth deploying,
- 22:16that's actually what Kedro handles best.
- 22:18Yeah, cool.
- 22:18You guys want to add anything to that?
- 22:20Maybe you might can go a bit more into like functionality.
- 22:23Yeah.
- 22:23What it has to do.
- 22:24I think I can't add anything after you get to this excellent introduction.
- 22:27I think initially that's the main thing we were asked for.
- 22:30It's like, oh, why don't we use Airflow instead?
- 22:33And we're not exactly the same.
- 22:35You can just use Kedro and Airflow together.
- 22:38And in fact, actually now we have a plugin because we connected with them
- 22:42and it was a very nice collaboration we had.
- 22:44But I think just to underline the main difference is,
- 22:47you know, like all of those tools,
- 22:49they came out from big tech companies that already had good processes.
- 22:53Yeah.
- 22:53Like, for example, Luigi comes from Spotify and so on, right?
- 22:58So Luigi from Spotify, Airflow from Airbnb.
- 23:00And like, those are big tech companies.
- 23:02They have uniform, like,
- 23:04or at least they have a big team that is taking care of the infrastructure.
- 23:07So you own the infrastructure, you own everything.
- 23:09You just need to put it there,
- 23:11like run your Airflow instance and then run your code there.
- 23:15And for us,
- 23:16we come from consultancies where
- 23:19you don't know what infrastructure you'll find at your client.
- 23:22So there is no way for us to say,
- 23:24okay, this is the scheduler we're going to use.
- 23:26And it was really impossible.
- 23:27Yeah.
- 23:28And you also don't know what sort of team you're dropping into.
- 23:30Is it a large, highly professional, experienced software team?
- 23:35Or is it a bunch of research scientists
- 23:37who need a little help on the software side, right?
- 23:39Yeah, absolutely.
- 23:40Also the team, you don't know any of that.
- 23:43And the thing is that
- 23:44we need to have some transferable skills within our teams
- 23:47when you work on one project here and there.
- 23:50So the next time you're more efficient and more productive,
- 23:53even though you're changing project.
- 23:55And that's the main difference here
- 23:56with Kedro and those orchestrators
- 23:58that like we don't have that assumption on the infrastructure.
- 24:00As yet to mention,
- 24:01it's like we focus on how to make something that's worth deploying.
- 24:05And then once you need to deploy it,
- 24:07at least that's very hard to achieve.
- 24:09But this is what we strive for
- 24:11is to make Kedro deployable basically anywhere.
- 24:14If it's managed service in AWS,
- 24:16or if it's Airflow or maybe they're offering,
- 24:20they have an astronomer offering,
- 24:22which is basically managed Airflow.
- 24:24If you need any of that,
- 24:25Kedro should be able to run on all of this.
- 24:28But during the development process,
- 24:30you don't need to, you know,
- 24:32use their primitives to create your nodes
- 24:35and deal with all the, you know, the extra work.
- 24:38The data scientists or data engineers,
- 24:40they don't need to care about,
- 24:41okay, what is an Airflow operator or these kind of things.
- 24:45So does this mean that you're able to swap out
- 24:49these different data pipelines?
- 24:51Like if, for example,
- 24:53I had a company we started on Luigi
- 24:55and we're like,
- 24:55oh, we really want to move to Airflow.
- 24:57We'd written our stuff in Kedro.
- 24:59Would it make that easier?
- 24:59Yeah, I would say yes.
- 25:01Okay.
- 25:02Depending how you've written it.
- 25:03I guess you can always make code not portable, but yeah.
- 25:08You know, one of the options
- 25:09that hasn't been mentioned yet is the one we're using,
- 25:12which is just the Kedro Docker plugin.
- 25:14So Kedro works very nicely inside of Docker.
- 25:17Despite all the nice orchestrators out there,
- 25:20there's also the backup plan of just put it in Docker
- 25:23and that can run virtually anywhere as well.
- 25:26Yeah.
- 25:26Sometimes that is really nice.
- 25:28Just, I know there's all this stuff as a service
- 25:30to help me out,
- 25:31but we'll just go in the simple route
- 25:33and run in it this way.
- 25:34All right, let's talk about some of the features.
- 25:36And Kevin, you talked about the lack
- 25:39of some kind of template to get started.
- 25:41And that's the first feature listed here.
- 25:44So maybe tell folks about this.
- 25:46I think that was probably the first one we implemented
- 25:48when we were rebuilding the thing.
- 25:50Because what we found out is like lots of data scientists,
- 25:53they were naturally using like some cookie cutter templates.
- 25:56Yeah.
- 25:56Okay, this is my project.
- 25:57This is the structure I like.
- 25:59And then we had a big discussion
- 26:02with many different data scientists
- 26:03how to implement this.
- 26:05So we set out on a,
- 26:07the thing that will be the bare minimum
- 26:09that you will need for starting a project.
- 26:12Right.
- 26:12The minimal set that everyone is going to use.
- 26:14One of the things I really dislike about templates,
- 26:16these types of project templates,
- 26:18and I see them all over the place,
- 26:19is, oh, here's how you use this template to get started.
- 26:23And the template says,
- 26:24okay, what we're going to do
- 26:25is we're going to set up Celery as your backend worker.
- 26:27We're going to set up Postgres as your database.
- 26:29We're going to set up SQLAlchemy as your data layer.
- 26:33We're going to set up X,
- 26:34and you end up with 10 things.
- 26:35You're like, I only want four of these,
- 26:37but the four it's helping with is really useful.
- 26:39But then I got to hunt through and get the others out.
- 26:41And it's just,
- 26:42you do want to aim for this minimal side
- 26:45because, you know,
- 26:46while it's nice to have support for the other things,
- 26:48like if you foist it upon people
- 26:51and they're like, I just,
- 26:51this is more junk than I,
- 26:53like I'm using less than half of this.
- 26:55So this is not useful for me.
- 26:56Right.
- 26:57Yeah.
- 26:57So that was your philosophy to go more minimalist on it.
- 26:59Yeah, absolutely.
- 27:00Even though,
- 27:01because at that time it was an internal tool,
- 27:04we had some stakeholders that we had to appease, right?
- 27:06Like there was,
- 27:07we had internally a very well-developed
- 27:09data engineering convention.
- 27:11And then they absolutely wanted to have the,
- 27:14you know, in the template,
- 27:15we need to have the folders
- 27:16with those layers in the data engineering.
- 27:19And I think you can still find that in Kedro.
- 27:21So there are these kinds of things that we needed to do,
- 27:25but they're not necessarily,
- 27:26okay,
- 27:27you don't need to use them,
- 27:28that you can remove a lot of those.
- 27:30And further down the line,
- 27:31we ended up introducing something called starters.
- 27:34And this is essentially,
- 27:35you can have a custom template that you can start from.
- 27:38And people are using them to create their own custom projects for their organizations.
- 27:44Yeah.
- 27:45I think that's a great idea.
- 27:46Yeah.
- 27:47Yeah.
- 27:47And we're using cookie cutter behind the scenes,
- 27:50which means like another thing that we wanted to do is to not reinvent the wheel
- 27:55and use standard tools out there.
- 27:57If the Python world is using cookie cutter,
- 27:59there is no reason for us not to use it.
- 28:01Right.
- 28:02And we went with that.
- 28:04And that's how we settled on the template system.
- 28:07Yeah.
- 28:07Nice.
- 28:08And you talked about,
- 28:09or Hedro talks about on the homepage,
- 28:12how it uses the cookie cutter data science,
- 28:15cookie cutter template,
- 28:16which is a logical,
- 28:17how much of that is that?
- 28:19Or have you kind of moved beyond that?
- 28:20I think we moved beyond that.
- 28:21It was mainly,
- 28:22that's what the inspiration was.
- 28:25Ah,
- 28:25got it.
- 28:25It's not like we're using it,
- 28:26but more like it was inspired by this because we found out like a few users back then,
- 28:31they use that one.
- 28:33And it was fairly sane.
- 28:34I mean,
- 28:34if you,
- 28:34if you don't need to framework,
- 28:36I think it's quite a good starting point.
- 28:38So if you don't need a full blown Kedro setup,
- 28:41I would recommend that one.
- 28:43And,
- 28:44uh,
- 28:45we said,
- 28:45okay,
- 28:45how can we build upon that?
- 28:47And like make,
- 28:48obviously we started from scratch,
- 28:50not copying any of their templating,
- 28:52but saying,
- 28:53okay,
- 28:53this is a very good example of what we can be.
- 28:56And then how can we achieve the same thing,
- 28:58but achieving our goals for making this framework.
- 29:02And,
- 29:03uh,
- 29:03that's how we,
- 29:04we settled on.
- 29:05And I think we,
- 29:06we still honor it because,
- 29:07uh,
- 29:08I think it was a good inspiration for us in our documentation.
- 29:11Yeah.
- 29:12Very nice.
- 29:12I love it.
- 29:13And definitely thumbs up on using something like cookie cutter,
- 29:17right?
- 29:17There's already so many templates out there that people are using.
- 29:20People are somewhat familiar with the idea and they maybe know how to extend it.
- 29:24Right.
- 29:24So no need to go write your own macro language or something crazy.
- 29:28Yeah.
- 29:28All right.
- 29:29Next main feature is the data catalog.
- 29:32One thing I was going to mention here,
- 29:33Michael mentioned that you get like from a template,
- 29:37a lot of times you get a,
- 29:38a thing that's got everything that you need.
- 29:41And then a bunch of stuff you don't need.
- 29:42I think one thing that plays well with Kedro is this catalog.
- 29:46So with the catalog,
- 29:47I can kind of,
- 29:48you know,
- 29:48abstractly tell Kedro where my data is and what type it is.
- 29:52So that catalog can load things from pandas,
- 29:55spark,
- 29:56desk,
- 29:56from databases.
- 29:58There's pretty long list of data sources that it can load from.
- 30:01So I don't need to change the template based on what my underlying data is or where it's stored.
- 30:07That's really nice.
- 30:08A lot of times when you're thinking of data,
- 30:10the abstractions are you can switch between MySQL,
- 30:12Microsoft SQL server and Postgres,
- 30:15not between,
- 30:16you know,
- 30:17spark and a relational database or cloud storage or something like that.
- 30:21That's a lot of flexibility.
- 30:23One really nice feature I like that was added in the 16 series is it's built on FS spec under the hood.
- 30:30So you can have data sitting on S3,
- 30:33GCP or your local file system.
- 30:35And all you do is change your file path,
- 30:38maybe like a slight tweak to your requirements.txt.
- 30:42But other than that,
- 30:43Kedro just knows how to load data into whatever object type you ask for.
- 30:48Yeah,
- 30:49very nice.
- 30:49Also helps on the data science side,
- 30:51if you're not super familiar with like remote blob storage APIs,
- 30:55you don't have to learn that,
- 30:57right?
- 30:57Which is good.
- 30:58Cool.
- 30:58And another thing to maybe mention is if you don't need the full Kedro template,
- 31:04you don't need the pipeline and everything,
- 31:06you can use Kedro's catalog by itself.
- 31:09Okay.
- 31:09So maybe if you're just starting a notebook or just starting a project in a notebook,
- 31:13you might want to move it to Kedro later.
- 31:16You can start putting your catalog together as a Kedro catalog from the start.
- 31:21Nice.
- 31:21And then maybe as you move it more into source files,
- 31:24it's like part of that's already done,
- 31:26right?
- 31:26Yep.
- 31:26You're closer to the destination.
- 31:28Yep.
- 31:28And you can use their loaders and savers so that you don't have to write any sort of
- 31:32saving and loading code manually.
- 31:34Yeah.
- 31:35All right.
- 31:35Next one is pipeline abstraction,
- 31:39automatic resolution of dependencies between pure Python functions and data pipeline visualizations.
- 31:44And you all have a cool visualizer there of a whole lot of stuff going on here.
- 31:49I could zoom in here,
- 31:51but like this,
- 31:52this really interesting visualizer of what's happening.
- 31:56who wants to sort of tell us what this one's about?
- 31:58I'll happily take this one.
- 32:00And I leave the coding starters to yet.
- 32:03I really wanted to take that one because I want to kind of promote using more the API of the pipeline.
- 32:09I think this is probably one of the best things we've done.
- 32:13And it was kind of a find that we had is what is the pipeline in our,
- 32:18I think that's probably one of the things that makes Kedro different than other tools.
- 32:22We treat each processing node as a pure function.
- 32:25So what you need to do is just to write a pure function that you have inputs and outputs,
- 32:30and you return stuff and that's all you need to do.
- 32:33And then you need to announce that in a pipeline that,
- 32:38okay,
- 32:38I'm going to use that function.
- 32:39we'll have those inputs from the catalog that Waylon was talking about.
- 32:43And they're just aliases to,
- 32:45to those references in the catalog.
- 32:47And then when I'm done with that function,
- 32:49then I'll save them to those datasets.
- 32:52And you don't need to know,
- 32:54okay,
- 32:54what's the order of execution or like any of that.
- 32:58You just need to think locally.
- 33:00You need to think about that function you're dealing with.
- 33:03Okay.
- 33:03I need maybe in this example that we have on the screen,
- 33:07like people who are listening,
- 33:08they might not be able to see,
- 33:09but let's say you have an input to a function and let's say factory train.
- 33:15In that example,
- 33:17we have,
- 33:17and that's your input.
- 33:18And then you want to remove the new columns and that's your function.
- 33:22And then let's say you have a,
- 33:24let's say we call the output a clean factory input or what was it?
- 33:30So that's all you need to think about how to solve that locally.
- 33:34You don't need to think how that would fit in globally.
- 33:36And then once you add enough of those functions,
- 33:40then the connection,
- 33:41those dependencies,
- 33:43because you announced them in your inputs and your outputs,
- 33:45they'll be figured out by Kedro.
- 33:47And then,
- 33:48you know,
- 33:48this graph,
- 33:49the visualization will be drawn for you out of your code.
- 33:53And then you can use that for running your code in that particular order.
- 33:57And why I say that we,
- 33:59we are so proud of this because using these pure functions and connecting them as pipelines,
- 34:04gave us a lot of ability to reuse code and reuse parts of the pipelines without really taking care of like where the data is.
- 34:14So you just work on a pipeline level and the connections,
- 34:17and then the data catalog would load and save things for you.
- 34:20And,
- 34:21and that,
- 34:21that made it super,
- 34:22super easy for us to,
- 34:24to scale the types of projects we can build.
- 34:27We started off with very small pipelines and now we,
- 34:29we have maybe yet to can talk more about this,
- 34:32but we have projects which have like hundreds of people,
- 34:34hundreds of nodes internally in QB.
- 34:36Yeah.
- 34:37If you look at this,
- 34:38there's a lot going on here.
- 34:39And I really appreciate the idea of being able to just focus in on,
- 34:43you know,
- 34:43small pieces.
- 34:44It brings me back to your idea of talking about,
- 34:47well,
- 34:47let's just write a .php file and put,
- 34:49start just,
- 34:50I'm going to start writing HTML and I'm going to start writing some SQL query and I'm going to write some more markup.
- 34:56It's just all from scratch and there's zero structure and there's zero support.
- 35:01So if you're going to do something like that,
- 35:02you're doing it all at once,
- 35:04all at the same time.
- 35:05Whereas,
- 35:06you know,
- 35:06compare that to like a modern framework,
- 35:07like Flask,
- 35:08all you do is write the view method.
- 35:10You don't care about how the template gets rendered.
- 35:12You don't care about how the process comes in or finding the verbs to figure out.
- 35:16You just,
- 35:16I know when I get here,
- 35:17Flask got me here.
- 35:18I do the,
- 35:19the five lines of code that I got to do and we're good.
- 35:22And I feel like this is real similar,
- 35:23right?
- 35:23Yeah.
- 35:24Yeah,
- 35:24absolutely.
- 35:25You just write a function.
- 35:26Yeah.
- 35:26You write a function that says unify timestamp column name,
- 35:29or you write a function called remove null columns.
- 35:31Like you can definitely do that.
- 35:33That's not challenging,
- 35:34but if you look at this overall workflow,
- 35:35it looks like there's a lot going on here.
- 35:38Yeah.
- 35:38Yeah.
- 35:38And I really liked that you brought that analogy with frameworks,
- 35:42with view and like these things,
- 35:43because the more we started building that,
- 35:45the more it was very similar for me.
- 35:47I mean,
- 35:47I've done some Ruby on rails before and actually the pipeline sounded like the
- 35:52roots file.
- 35:52So you would have different routes like,
- 35:54okay,
- 35:54what is the,
- 35:55how do you register on this URL?
- 35:57This is the action I would call and actions here are our notes.
- 36:01Right.
- 36:02And what data is provided to it and things and so on.
- 36:05Yeah.
- 36:05All that.
- 36:05So the data that's provided to it is basically,
- 36:07you know,
- 36:08the URL endpoints and,
- 36:09and maybe the post data and things like that.
- 36:12And then the output is your views,
- 36:14for example,
- 36:15in,
- 36:16in,
- 36:16in traditional framework.
- 36:17The only difference here is that your inputs and outputs,
- 36:19their data,
- 36:20they're not a URL data coming from,
- 36:24you know,
- 36:24the request.
- 36:25And then the response is not a view,
- 36:27but actually again,
- 36:28saving to the data.
- 36:29And there is one subtle difference here is that you,
- 36:32you have dependencies between different routes where in web frameworks,
- 36:36they're fairly independent,
- 36:37right?
- 36:38It's a stateless thing.
- 36:39Yeah.
- 36:39We're here.
- 36:40We kind of,
- 36:41it's still stateless,
- 36:42but you have dependencies between different parts of the route.
- 36:45And maybe here comes the real reason I wanted to talk about the pipeline was that this abstraction done
- 36:51this way gives you kind of like an algebra that you can use to combine pipelines,
- 36:57to have prebuilt pipelines,
- 36:58plus them together,
- 37:00plus them together,
- 37:00or maybe just join them together,
- 37:02or remove things from them,
- 37:05or maybe saying,
- 37:05because it's a tree,
- 37:07like a,
- 37:08ends up being dark,
- 37:09directed acyclic graph.
- 37:11means like,
- 37:12I want to get this sub pipeline that produces that output.
- 37:17And then it will remove everything from you.
- 37:19Okay.
- 37:19So maybe you're like saying,
- 37:20I only care about the output at the,
- 37:23say,
- 37:24fifth function,
- 37:25this round timestamps thing,
- 37:27and it could strip off a whole bunch of the other pieces.
- 37:29Because it's like,
- 37:29well,
- 37:30all this other stuff is not involved in this part of the chain of the pipeline,
- 37:34reversing the acyclic graph.
- 37:36Yeah,
- 37:36exactly.
- 37:36And you don't need to do anything.
- 37:37You just need to say pipeline two,
- 37:40and then specify.
- 37:41So we have a bunch of methods that you can use.
- 37:43And,
- 37:44uh,
- 37:44unfortunately they're underutilized.
- 37:46Like people don't really use them.
- 37:48And then when we ask like,
- 37:49Oh,
- 37:49how can I do that?
- 37:50And it's like,
- 37:51there is one method call and people are like,
- 37:53Oh,
- 37:53that's so cool.
- 37:54Maybe we need to improve our documentation.
- 37:57And this one.
- 37:58Yeah.
- 37:58Maybe you should go on a podcast and tell people about it.
- 38:01Yeah.
- 38:01Yeah.
- 38:01I think that's why I want to use the opportunity.
- 38:04Yeah.
- 38:04Absolutely.
- 38:05You should.
- 38:06Do you want to elaborate on some of these larger pipelines that you'll have going?
- 38:09This actually speaks to a lot to the collaborative way that you can work once you're using the
- 38:13Kedra pipelines,
- 38:14because now your team sessions can easily become something like,
- 38:17okay,
- 38:18I know I need to work on like these three key functions because we know this is what we
- 38:21want this pipeline to do.
- 38:23And then you split out the work and work accordingly to produce those specific nodes and functions.
- 38:27Also,
- 38:28one of the things that I'd like to call out about the pipeline abstraction is that you definitely
- 38:32do get Kedra Viz for free on top of it.
- 38:35It's a pipeline visualization tool.
- 38:37It's really cool because it allows you to give like kind of like a bird's eye view of
- 38:41what's going on in the pipeline.
- 38:42So you can actually understand like how different things are connected.
- 38:45some of the ways our users have used it, but ways that we didn't imagine it was originally created for being able to talk to non-technical users or stakeholders about the way that the code base was structured instead of diving into code and showing them,
- 38:59hey,
- 38:59here's how the code works,
- 39:00because they'll be like,
- 39:01I don't know what's going on here.
- 39:02But we've also found our users will do things like debugging with Kedra Viz to find out,
- 39:08oh,
- 39:08something doesn't appear right in my pipeline and then figure out what's going on there.
- 39:12And in some ways,
- 39:13we've actually extended some of that functionality.
- 39:15So you'll see that there's now like a code viewer for you to interact with your code.
- 39:20And we have some,
- 39:21I guess,
- 39:21maybe exciting things planned down the line when we're talking about the roadmap.
- 39:25We'll be able to allude to some of the work that we're doing with experiment tracking,
- 39:28which will extend Kedra Viz a bit further.
- 39:30So nice.
- 39:31Yeah.
- 39:32Yeah.
- 39:32You can definitely tell if you've got like a dependency mismatch and the order is wrong or something you could see,
- 39:37oh,
- 39:37this one is supposed to be after that one.
- 39:39And it's really nice.
- 39:40The visualizers.
- 39:41It's nice.
- 39:41You've kind of got this like map thing you can cruise around on.
- 39:44And for people who are listening,
- 39:46I'll definitely put this in the show notes so you can open it up.
- 39:50and explore it.
- 39:50There's a pretty elaborate pipeline here to explore.
- 39:53Does this do anything runtime or is it just for visualizing the static structure?
- 39:57It's actually just for visualizing the static structure.
- 40:00We often find,
- 40:01we've tried to skirt away from what we call the orchestrator UI interface because it takes us a bit too much.
- 40:07I mentioned into that realm of like where we would prefer the orchestrators to play a part.
- 40:12So for now it's just static view of what's going on in your code base.
- 40:15Yeah.
- 40:16No,
- 40:16this is great.
- 40:17I feel like a lot of projects would benefit from this kind of stuff.
- 40:19not just data science things,
- 40:21right?
- 40:21Like I'd like this kind of view of my code for other things as well.
- 40:25We have found people using,
- 40:27KedroViz is also available as a React app and people use it in,
- 40:32without Kedro.
- 40:34So we'll find that they will build,
- 40:36one of the most common use cases we've seen built on top of KedroViz is data lineage,
- 40:40but specifically column level lineage that people will want to visualize.
- 40:44So they end up using the React app for that.
- 40:46I also have a friend who was playing a game.
- 40:49He's actually one of the former maintainers on Kedro,
- 40:51KedroViz and Kedro,
- 40:53where he was playing a game where he needed to work on how to build,
- 40:56I don't know what this game is called.
- 40:57How to build.
- 40:58It was Factorio.
- 40:59Factorio.
- 41:00You basically look at like how to,
- 41:04how to build up your factory,
- 41:05I think,
- 41:06or something like that and use the different elements in the factory.
- 41:08and he used KedroViz to visualize what he should be doing in his factory.
- 41:12So yeah,
- 41:13it's different ways.
- 41:14Oh, that's funny.
- 41:14I guess you can visualize lots of things with it.
- 41:18How neat.
- 41:18Yeah.
- 41:18All right.
- 41:19The next main feature here is deployment.
- 41:22One comment I had on the,
- 41:24on the pipeline was,
- 41:25so,
- 41:26you know,
- 41:26you get a task to do on your sprint.
- 41:29You sit down to work for the day.
- 41:31And if you're not in this Kedro type of,
- 41:34or this framework mode,
- 41:36a lot of times it's like,
- 41:37okay,
- 41:37open the notebook or open the script.
- 41:40And I've got to run to a certain point to start my work.
- 41:43Cause I've got to have that data in memory or I,
- 41:46I,
- 41:46that's my option.
- 41:47Or I'm manually saving things along the way.
- 41:50Both have their downsides.
- 41:53But so a lot of times it's like,
- 41:55okay,
- 41:55I'm going to run the notebook and then I'm going to go grab coffee.
- 41:57And maybe when it's,
- 41:58when I get back,
- 41:59I can start my work.
- 42:00So Kedro is saving each one of these points in the background along the way.
- 42:05So when I get a task and it's like,
- 42:06Hey,
- 42:07you've got to put a note in between these two,
- 42:09I can start right away.
- 42:10Cause the data is already sitting there.
- 42:12Oh,
- 42:12that's cool.
- 42:12I can also use the pipeline dag object.
- 42:15like Ivan mentioned to just run that section of pipeline I'm working on as I'm working.
- 42:22Interesting.
- 42:22It's a little bit like just rerun the failing tests or just this one test or something like
- 42:27that in the unit testing world.
- 42:28Like instead of trying to rerun the entire test suite for every little change.
- 42:31Yeah.
- 42:32That's a cool thing.
- 42:33All right.
- 42:33You did talk about the deployment stuff before.
- 42:35So maybe you want to touch on some of the deployment stuff.
- 42:38I guess it will just be a quick mention.
- 42:40So what we do support is two deployment plugins right now.
- 42:44The first one is Kedra Docker,
- 42:45which packages your Kedra project in a Docker container.
- 42:47And the second one is Kedra Airflow,
- 42:49which was built with the Airflow astronomer team,
- 42:52which will take your Kedra pipeline and convert it into an Airflow DAG so that you can run it on Airflow.
- 42:57But we also do support in our documentation,
- 43:00like a few guides on how to deploy Kedra on Prefect,
- 43:03on Kubeflow,
- 43:04on AWS Batch,
- 43:05AWS SageMaker,
- 43:06and AWS Databricks as well.
- 43:11One of them.
- 43:11I always feel like with AWS and Azure,
- 43:13there's just,
- 43:14no matter how much I studied,
- 43:16there's like three more things that are similar to what are there,
- 43:18but they're different.
- 43:19So like I know Batch,
- 43:20but not the one you named after that.
- 43:22Yeah.
- 43:23That's definitely the case.
- 43:24I believe it's AWS Databricks.
- 43:26But you can kind of use the same methodology if you're working with Azure Databricks as well to deploy things there.
- 43:31Ivan alluded to the fact that we do really pride on flexible deployment
- 43:35because we don't know what is your internal infrastructure like
- 43:38and therefore should be able to support the most generalizable case to do that.
- 43:42So you can definitely check out those guides.
- 43:44I know if there are guides missing,
- 43:45just raise GitHub issues and we'll look at it.
- 43:48As well,
- 43:49we add a growing tally of mentions of things that we haven't heard people necessarily using with Kedra.
- 43:54Yeah,
- 43:54it's worth checking out.
- 43:55Yeah.
- 43:56It's open source.
- 43:56If people want to add new deployment stories,
- 43:59they can go and PRs are accepted.
- 44:01Is that true?
- 44:01Yeah.
- 44:02Yeah.
- 44:02Write up a guide and we'll take it.
- 44:04We have a great sense of contributing guide that's available on our documentation too.
- 44:10That shows you how to make,
- 44:12I mean,
- 44:12PRs across like whether it's features or minor tech improvements or bug fixes,
- 44:17as well as documentation too,
- 44:19because we like to write our docs.
- 44:20Yeah,
- 44:20that's important.
- 44:21And coming into October,
- 44:22it's October.
- 44:23So people can come in and I think we will be really,
- 44:28really grateful for adding more deployment because no matter how many you have,
- 44:32you always run out of,
- 44:34or maybe differently,
- 44:36like no matter how many you have,
- 44:37you always don't have everything.
- 44:39And there is always someone would come and like,
- 44:42by the way,
- 44:42how do you deploy it on this AWS,
- 44:44whatever,
- 44:45the new thing that they have?
- 44:46It's like,
- 44:47how do I know?
- 44:48It's like,
- 44:48this is the first time I hear about it.
- 44:50So there is always room for more.
- 44:53And this is the thing that we would really,
- 44:55really love help with.
- 44:57So if you want to find something to contribute to for this October,
- 45:01maybe that could be Kedra.
- 45:02Yeah,
- 45:03that'd be awesome.
- 45:04Yeah.
- 45:04I periodically will get in October contributions to like,
- 45:08for example,
- 45:09my course projects,
- 45:10the GitHub repos for them.
- 45:12And it would be like slight changing in the wording.
- 45:14And if so,
- 45:15like if it says the Kedra documentation includes three examples to help you,
- 45:18you get started,
- 45:19they might say to help you get started.
- 45:21The documentation contains three examples.
- 45:23There's a PR.
- 45:24So I,
- 45:24it counts.
- 45:24I'm like,
- 45:25so I just got to go through and close them.
- 45:26So please people listening,
- 45:27just a minor useful contribution,
- 45:30but yeah,
- 45:31it would be great to work on this.
- 45:32Right.
- 45:32And I feel like these types of pipelines are very accessible because they,
- 45:36they narrow the focus so much,
- 45:38right.
- 45:39When you get down to like certain tasks and certain things,
- 45:41you don't have to understand the whole project.
- 45:43Just how do you do this other tasks slightly differently?
- 45:45Yeah,
- 45:45absolutely.
- 45:46And I'm pretty sure that talking about contributors,
- 45:48like if it's just change of words,
- 45:50we might not have t-shirt for you.
- 45:52If you're adding a guide,
- 45:54we would definitely send out a t-shirt.
- 45:56Oh,
- 45:56nice.
- 45:57Awesome.
- 45:57T-shirts are included,
- 45:58not just a passing.
- 46:01Uber fest.
- 46:01Okay.
- 46:02So one of the things I find is a little tricky,
- 46:04uh,
- 46:05is always talking through,
- 46:06or like thinking through an example of these kinds of things.
- 46:08They're very neat,
- 46:09but they also sometimes feel pretty abstract.
- 46:11So even you would,
- 46:12maybe want to talk us through,
- 46:14uh,
- 46:15just this like hello world example.
- 46:16I know it's hard to talk about code on audio.
- 46:18So not,
- 46:19not exactly,
- 46:20but just give us a sense of what it means to write one of these pipelines.
- 46:24Yeah.
- 46:24Sure.
- 46:24Starting from the first one is,
- 46:26uh,
- 46:27I think in the hello world example,
- 46:29we have,
- 46:30we show like what a node is and,
- 46:32and it's not very different than a function.
- 46:34It's just a function actually.
- 46:35And your function,
- 46:36we accept two types of nodes,
- 46:38actually three types of nodes,
- 46:40nodes that have only inputs,
- 46:41nodes that have only outputs,
- 46:43or nodes that have both inputs and outputs.
- 46:45So we don't accept functions that don't have neither inputs nor outputs.
- 46:51So for obvious reasons,
- 46:52because that doesn't do much.
- 46:54And,
- 46:55uh,
- 46:56you can start with your own function.
- 46:57Let's say you can call it return greeting,
- 47:00which will just return hello.
- 47:01So,
- 47:02uh,
- 47:02just let me elaborate on that for a second.
- 47:03So what you have is a Python function that takes no parameters and returns a string.
- 47:09But the thing that's notable about this is it doesn't have a decorator or some other special thing about it.
- 47:16It's literally just a bare Python function that has nothing to do with case.
- 47:20With Kidro per se.
- 47:21Yeah,
- 47:22absolutely.
- 47:22So the reason why we did it this way was to allow all kinds of people just to create functions.
- 47:29Like if you don't know decorators and these kinds of things,
- 47:31you don't need to know that.
- 47:32And then the second one is you might actually use functions from libraries that were not at all designed to be part of our framework.
- 47:39You know,
- 47:40if you're importing a function,
- 47:41you cannot add a decorator on that one.
- 47:43Well,
- 47:43there is ways obviously in Python always,
- 47:46but it's not,
- 47:48you know,
- 47:48very intuitive.
- 47:49So we just work with pure functions.
- 47:52how that gets turned into a node is actually more curious here.
- 47:56And then we have a,
- 47:58like it happens to a helper function we have,
- 48:00which is called node conveniently.
- 48:02And then you provide your function and you provide your inputs and outputs strings.
- 48:07So these are the three things you can add.
- 48:10So for example,
- 48:11for this return greeting function,
- 48:13your inputs would be none.
- 48:15So,
- 48:15because you don't have any inputs and your outputs could be a string,
- 48:19which says my salutation.
- 48:21That's in our,
- 48:22how we've done in the hello world example.
- 48:25So this will create a node in Kedro sense,
- 48:28which you can embed later in a pipeline.
- 48:30Nice.
- 48:31And then here,
- 48:32the output has a static.
- 48:34Is that like the name of the output?
- 48:36So you can use it in the pipeline?
- 48:37Yeah.
- 48:37Not the value,
- 48:38but like the name.
- 48:39So you can refer to it later on,
- 48:40right?
- 48:40Yeah,
- 48:41exactly.
- 48:41So you can think of them as variables in a way as a variable,
- 48:45the variable,
- 48:45like you can define where to store that valuable through the data catalog later.
- 48:51Yeah.
- 48:51Very nice.
- 48:52So it seems super easy.
- 48:54You have also a more elaborate example.
- 48:56It says a space flight tutorial.
- 48:58Yeah.
- 48:59So people want to,
- 49:00what is this?
- 49:00And we don't have to talk to it.
- 49:02Just if people want to go and play with it,
- 49:03what is this one?
- 49:04I really want the editor to introduce it because initially when we were thinking of an example,
- 49:08I think she came up with the idea to make it more of a space flight.
- 49:12And we actually,
- 49:14it was quite funny that this led to something more interesting that the editor can share about.
- 49:20Yeah.
- 49:20Nice.
- 49:20I think it was actually Dimitri that did this.
- 49:22he was a former maintainer on the Kendra project.
- 49:24But the scenario for this tutorial is that it's the year 2160.
- 49:28You're somehow a data scientist predicting the price of space flights to the moon and back.
- 49:32And you have access to three data sources,
- 49:35information about companies that are flying people to the moon,
- 49:38reviews on their shuttles that they have,
- 49:40and then also the customer reviews that they've given while working with those companies.
- 49:43And the whole thing is you just want to predict the price of a space flight.
- 49:47So if you go through the tutorial,
- 49:49you'll get acquainted with all the way from beginner functionality,
- 49:52like install Kedro,
- 49:54you know,
- 49:55set up my project template,
- 49:57all the way to kind of intermediate,
- 49:58just before intermediate functionality in Kedro.
- 50:01So you get up to speed in about like an hour,
- 50:03an hour and a half in total,
- 50:05as you go through the full tutorial.
- 50:06And it will teach you all the basics of like,
- 50:08how do I use the project template?
- 50:10How do I use the data catalog?
- 50:11How do I construct my pipeline?
- 50:13How do I visualize my pipeline?
- 50:15And how do I package my project as well?
- 50:17So it's really useful for getting up to speed on that.
- 50:20But we've had a really great time with the space flights project,
- 50:24because we found out that NASA,
- 50:26a team at NASA was using Kedro.
- 50:27So it was almost like a dream.
- 50:29Oh, nice.
- 50:29When we discovered,
- 50:32when we discovered that,
- 50:33because it was like we went full circle and went to the moon with them.
- 50:36They're actually doing space flights.
- 50:39Amazing.
- 50:40Yeah.
- 50:40I'm pretty sure they chose this only because of our tutorial.
- 50:43We were thinking Luigi,
- 50:47but then we saw this tutorial and we knew this was the one.
- 50:49Now, I do love these imaginative examples and tutorials
- 50:53rather than something really boring.
- 50:55Like, oh, let's build a to-do list.
- 50:56And here's how we're going to do it.
- 50:57Like, okay.
- 50:59No, this sounds really fun.
- 51:01So if people want to get a sense for what it's like to work with Kedro,
- 51:05you recommend this as the tutorial to work through to get started?
- 51:08Definitely recommend this.
- 51:10And then there are a few online resources if you want to use them.
- 51:13We have a blogger.
- 51:14I mean, he's been inactive for a while,
- 51:16but he still has really good YouTube tutorials.
- 51:18Search for Data Engineer 1 and look for his walkthrough of the tutorial there.
- 51:22It's also very handy for getting up to speed if you want a video kind of like workflow
- 51:27as you go through the tutorial.
- 51:28But we are going to be repiloting some live stream workshops of us working through the tutorial
- 51:34ourselves later on in the year.
- 51:36So definitely do look out for that on, I think, probably the Quantum Black YouTube will have
- 51:40them.
- 51:41And then also, oh, yeah, you can actually see.
- 51:43I'm here, opened up.
- 51:44First, I got to get through the ad for people to see.
- 51:46I'm not logged in over here.
- 51:48But yeah, there we go.
- 51:49That's Data Engineer 1 in action.
- 51:51And then I definitely recommend either joining in on those live streams as we host them.
- 51:55Nice.
- 51:55Or live the follow-up YouTube videos as we do them.
- 51:58Yeah, cool.
- 51:58I'll link to some of the YouTube videos for people to go check out there.
- 52:02Very nice.
- 52:03So we're getting pretty short on time.
- 52:04Maybe one thing we could just do to wrap this up is maybe, I know you talked about some of
- 52:09the cool libraries and stuff you used to build this.
- 52:11Maybe you could just talk a little bit briefly about the internals and some of the fun things
- 52:15you used there.
- 52:16Sure.
- 52:17So probably good libraries that were mentioning.
- 52:20And maybe I will not use the time to too much about Kedrus internals, but like just to
- 52:24have a shout out for nice libraries that we found out.
- 52:26Yeah.
- 52:27One thing that Waylon already mentioned was FSPEC.
- 52:31I think that was amazing.
- 52:32And we really found it super useful.
- 52:35I think it is in the Anaconda ecosystem developed by some of the people there.
- 52:43And the good news is that actually it's also becoming part of Pandas.
- 52:49So whenever you're doing load CSV in the newest version of Pandas, they use FSPEC as well.
- 52:55Oh yeah.
- 52:56And now it says it's also in Dask, Pandas, even DVC and many other things.
- 53:01This has been really, really useful because it simplified a lot of our code about the datasets.
- 53:08We didn't have to, previously we had the dataset for S3.
- 53:12We had a dataset for GCP and GCS and Azure Blob Store and all of that.
- 53:18I don't know.
- 53:19It's super annoying because they do exactly the same thing.
- 53:22You do it like many times, just changing endpoints and things like that.
- 53:26It was super frustrating to maintain it.
- 53:28And when we have many of those datasets, it was super frustrating.
- 53:31And when this came out, it simplified basically, maybe reduced our code base for datasets three times or something like that.
- 53:38Wow.
- 53:38Yeah.
- 53:39Because they do that abstraction for you.
- 53:41Yeah.
- 53:42You just pass it along, right?
- 53:43Yeah.
- 53:43So if someone wants to treat a remote database as kind of like a local file, I think AppSPEC is really useful too.
- 53:51Cool.
- 53:51Let's see.
- 53:52Another one that you mentioned was Dynacomp.
- 53:55Yeah.
- 53:56That's a quite nice one.
- 53:58We started using it recently.
- 53:59What we wanted to do in Kedro, because we are a framework, and there is some framework code that needs to call user code.
- 54:08And that's a bit challenging because you don't know what the package name of the user, because the user will create their own code.
- 54:15They will choose a package name, and you don't know what to import from.
- 54:18So we came up with a pattern that was actually applied by Django, which you kind of configure projects by their package name, and then you load some of the settings.
- 54:31So if people know Django, they know that they have an extensive way of doing settings in order to configure different things in Django.
- 54:38How Dynacomp helped us with that is because it was a very extensive, like very clean abstraction to do lazy loading of settings.
- 54:47And why did we need lazy loading of settings?
- 54:50And for example, you might have multiple pipelines in Kedro.
- 54:55One of them would not be completed.
- 54:57There could be some errors in it.
- 54:58But you still want to run the other pipeline.
- 55:01And if you eagerly load all of that, then your code will fail for no reason.
- 55:07Right, right.
- 55:08Even if you weren't actually going to end up running that part.
- 55:10Yeah, exactly.
- 55:11It's almost like a compiled language versus a dynamic language.
- 55:15Yeah, and here Python shines, right?
- 55:17Because you can have things like Dynacomp, where you don't need to compile that path.
- 55:22So it helped us a lot with making those settings loaded lazily, because there were different things.
- 55:28You can add validators to validate settings and so on.
- 55:31It's fairly extensive.
- 55:32I recommend people to read their documentation.
- 55:35You can use it for many things.
- 55:37So yeah, it's a nice package we stumbled on.
- 55:41Yeah, very neat.
- 55:41Those are great recommendations.
- 55:42So with just a little bit of time left, let's wrap up our conversation with where things are going.
- 55:48Yatunda, maybe want to give us a roadmap future view of what people who are maybe using Kedro now are like, what's coming?
- 55:55So I guess maybe one of the next upcoming feature that you'll start to see being rolled out is experiment tracking in Kedro.
- 56:02So what we're doing is Kedro is already, I think Waylon spoke to it, really aware of like being able to save your data sets.
- 56:09And for us, our data catalog would apply to models as well.
- 56:12So we already had some form of model versioning in Kedro.
- 56:15But what we really needed to extend, and we already have a concept of parameters too, so inputs.
- 56:20But what we really needed to do was think around how do we think about features and how do we think about metrics coming out of the pipeline as well.
- 56:28And those are the two additions that we've made kind of as additional data sets in the Kedro framework too.
- 56:33And then the last thing that we had to think around was like, how do we collect all of these things as one unit or one experiment?
- 56:39That concept is actually very, it's actually been implemented on the framework side.
- 56:44So you can really start to interact with the, you know, experiment tracking functionality there.
- 56:48But a lot of the massive changes are going to be done on the front end, where you'll be able to, you know, look at the list of experiments that you've run, compare them as well.
- 56:57And then we'll be building up like the functionality as we see fit, including probably MLflow model registry and model serving integration as well.
- 57:05And that's probably going to be done through our data catalog as well.
- 57:07Oh, that's cool. Is that if I go to the trouble to train up a model and it takes a day, I can store that and other people can just pull it down and use it without spending another day?
- 57:17Exactly. That's the large thinking around it.
- 57:19So yeah, you can definitely look forward to that.
- 57:22There's some open issues on the, our GitHub repository around configuration.
- 57:26So I do suggest if users have, you know, interacted with Kedro and you've had issues with scaling configuration, please do check it out and give us comment there.
- 57:34Because that will decide whether or not, like when we pick those, those issues up based on like user responses there.
- 57:40So that's what I think you can look forward to.
- 57:43Oh, fantastic. All right.
- 57:44Even I think we're going to take your two libraries you mentioned as the notable PyPI projects, just for the sake of time, since we're kind of over.
- 57:52I'll just do one final question for everyone out there.
- 57:55And that's if you're going to write some Python code, what editor do you use?
- 57:59Even you want to go first?
- 58:00IntelliJ.
- 58:02I come from Java and Scala world.
- 58:04So I stick with IntelliJ.
- 58:05So basically the Python support in like full-on IntelliJ, right?
- 58:09Yeah.
- 58:10Yeah.
- 58:10Yeah.
- 58:10And not PyCharm, but IntelliJ.
- 58:12Yep.
- 58:13Go ahead.
- 58:13Ivan says like, no PyCharm, I'm full PyCharm.
- 58:16Same here.
- 58:19There's arguments on the team about this.
- 58:21Oh, is there?
- 58:22This is a point of contention.
- 58:23I see.
- 58:24That's funny because they're so similar, right?
- 58:27It's not like VS Code versus PyCharm.
- 58:29Oh, Aylan, how about you?
- 58:31I'm an avid NeoVim user.
- 58:32You know, part of my workflow as being a lead data scientist is I bounce between probably
- 58:39like a dozen projects a day between like actual running pipelines, or maybe it's like a couple
- 58:46of our internal libraries that help like those things run.
- 58:49And it's really nice to have something lightweight that can run with pretty low resources.
- 58:55Also, having it running in Tmux makes it easy to like a few keystrokes.
- 59:00They can go into a specific project.
- 59:03The editors, they all tend to look the same.
- 59:05And you have a bunch of projects looking the same.
- 59:07It's very easy to edit the wrong one.
- 59:10Yeah.
- 59:10Yeah.
- 59:11Cool.
- 59:11All right.
- 59:12A good recommendation.
- 59:13All right.
- 59:13Well, thank you all for being here.
- 59:16Maybe final call to action.
- 59:17People want to get started with Kedro.
- 59:19Bring it into the organization.
- 59:21Try it out.
- 59:21What do you all say?
- 59:22Well, you know how to get started.
- 59:23Get into the Spaceflight tutorial and then just shout if you have any issues.
- 59:27We're up on Discord.
- 59:28And we also do have a GitHub discussions page as well.
- 59:31So you can just flag.
- 59:31We help users across the different levels of where they find themselves.
- 59:34So definitely do that.
- 59:36Yeah.
- 59:36And I guess Quantum Black does consulting for Kedro.
- 59:40So if people have these projects and they're like, I'm not sure we can handle this ourselves,
- 59:43they could probably hire you all, right?
- 59:45We've never quite had that level of interaction.
- 59:47It's not that a Quantum Black data science and data engineering team will go out and use Kedro
- 59:54as part of a larger engagement on like, how do we make a business problem?
- 59:59So you can definitely learn Kedro through that way.
- 1:00:01But you're in the open source community as we move in the open source space.
- 1:00:05It would definitely be through the channels that we have available.
- 1:00:08Cool.
- 1:00:08One thing to mention is like, if people want to engage with Quantum Black because they know
- 1:00:12about Kedro, please mention that.
- 1:00:16I mean, like, we found it because of Kedro, you know, the Kedro team.
- 1:00:20So that, you know, we get the Keds.
- 1:00:23Yeah.
- 1:00:24Awesome.
- 1:00:25Yeah, I bring that up because there's different ways to support open source, right?
- 1:00:29I mean, there's the MongoDB model where they sell MongoDB as a service and Atlas and all
- 1:00:34that.
- 1:00:35There's, you know, like Tidelift.
- 1:00:37There's GitHub support.
- 1:00:39But here's like yet another way in which this project is being grown and being supported
- 1:00:43because it's, you know, supporting you all doing your work.
- 1:00:46So, yeah.
- 1:00:47So, I mean, if that's the case, then I'll definitely say we do really want to be able to help a
- 1:00:52lot of people in the industry as well, because we know that it's needed.
- 1:00:55And we obviously recognize that as a framework, especially in the data science space, we are
- 1:01:00a bit of a first mover.
- 1:01:01So we suffer a lot of like first mover pains where people are like, why on earth do I need
- 1:01:05a framework?
- 1:01:06I don't need a framework.
- 1:01:07So if you help us with breaking through those barriers, like please go for it and be an
- 1:01:12advocate.
- 1:01:12And I guess in this sense, be a Kedroid.
- 1:01:14Right on.
- 1:01:15All right.
- 1:01:16Yatunda, Waylon, even thank you all for being here.
- 1:01:19It's been great to learn about Kedro and great to chat with you.
- 1:01:22It's been awesome.
- 1:01:22Thank you so much.
- 1:01:23Thank you.
- 1:01:24Bye.
- 1:01:24Thanks, Michael.
- 1:01:25Bye.
- 1:01:25This has been another episode of Talk Python To Me.
- 1:01:29Our guests on this episode have been Yatunda Dada, Waylon Walker, and even Donov.
- 1:01:34And it's been brought to you by Tab9 and us over at Talk Python Training.
- 1:01:38And the transcripts are brought to you by Assembly AI.
- 1:01:40Supercharge your editors.
- 1:01:43Auto-complete with Tab9.
- 1:01:44The editor add-in that uses AI to learn your coding styles and preferences and make you even
- 1:01:49more effective.
- 1:01:50Visit talkpython.fm/Tab9 to get started.
- 1:01:54Do you need a great automatic speech-to-text API?
- 1:01:57Get human-level accuracy in just a few lines of code.
- 1:02:00Visit talkpython.fm/assemblyai.
- 1:02:02Want to level up your Python?
- 1:02:04We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:02:08Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:02:13And best of all, there's not a subscription in sight.
- 1:02:16Check it out for yourself at training.talkpython.fm.
- 1:02:19Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
- 1:02:24We should be right at the top.
- 1:02:25You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:02:30and the direct RSS feed at /rss on talkpython.fm.
- 1:02:34We're live streaming most of our recordings these days.
- 1:02:38If you want to be part of the show and have your comments featured on the air,
- 1:02:41be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:02:46This is your host, Michael Kennedy.
- 1:02:47Thanks so much for listening.
- 1:02:49I really appreciate it.
- 1:02:50Now get out there and write some Python code.
- 1:02:52Thank you.