Posts tagged: kedro

All posts with the tag "kedro"

40 posts latest post 2025-02-06
Publishing rhythm
Feb 2025 | 1 posts

Kedro Basics

Learn Kedro in 5 days Day 0 Setup # vm install python editor Day 1 # kedro new kedro viz Day 2 # catalog filter catalog load data fsspec Day 3 # pipeline nodes Day 4 # filter pipeline run partial pipeline Day 5 # kedro docker GitHub Actions Advanced Kedro # hooks custom datasets modular pipelines

What’s New in Kedro 0.16.4

If we take a look at the release notes I see one major feature improvement on the list, auto-discovery of hooks. This one comes a bit surprising as it was just casually mentioned in #435 Think pytest # As mentioned in #435 this is the model that pytest uses. Not all plugins automatically start doing things right out of the box but require a CLI argument. simplicity # It feels a bit crazy that simply installing a package will change the way that your pipeline gets executed. I do like that it requires just a bit less reaching into the framework stuff for the average user. Most folks will be able to write in the catalog and nodes without much change to the rest of the project. Implementation # Reading through the docs, they show us that we can make our hooks automatically register by adding a endpoint that points to a singleton instance of our hook. from the docs Careful with the singletons # hook authors beware I will be a bit cautious before installing a plugin that is automatically reg…

Kedro Catalog

I am exploring a kedro catalog meta data hook, these are some notes about what I am thinking. Process # metadata will be attached to the dataset object under a attribute metadata will be updated metadata will be empty until a pipeline is ran with the hook on optionally a function to add metadata will be added metadata will be stored in a file next to the meta Problems This Hook Should solve # what datasets have a columns with in the name what datasets were updated after last tuesday which pipeline node created this dataset how many rows are in this dataset (without reloading all datasets) implementation details # metadata will be attached to each dataset as a dictionary list/dict comprehensions can be used to make queries Metadata to Capture # try pandas method -> try spark -> try dict/list -> none column names length Null count created_by node name Database? # Is there an easy way to create a nosql database in memory from a a list of dictionaries? list-dict-DB dataset TinyDB

Gracefully adopt kedro, the catalog

Why use kedro catalog? # While using the catalog alone will not reap all of the benefits of the framework, it does get you and your project ready for the full framework eventually. For me the full benefit of the catalog comes when you combine it with the pipeline and dont even touch read/write steps at all. Taking a step into kedro by adopting the catalog first will give you a way to organize all of your data loads in one place, and stop manually writing read/write code, which can be different for each data and storage type. You just don’t need to think about it. iperitive loading style organizes your data all file locations can be quickly identified can be dropped into kedro later “can be dropped into kedro later” Let’s talk a bit more about that 2 Ways to Gracefully adopt the catalog # How do I get started with the kedro catalog add with the code api load from yaml ( recommended) 1. Adding to the catalog with the code api # how to use the kedro catalog code api It is possible to keep…

How to find things in your kedro catalog

kedro 0.16.2 just dropped last week with a long-awaited feature… catalog search! I went as far as monkey patching this into each of my projects. I work jump between a few really big projects that have tons of datasets. Being able to quickly search for what I need is so useful. The Catalog # The kedro data catalog is a key component to the kedro framework. It handles all data loading and saving for you. It is configurable and hackable. Having all your data connections listed in one place make it so easy to pick your project up and move it to a completely new environment. That sweet imperative loading style saves so much read/write overhead. I can load all my data with a single command whether it’s in amazon s3, google cloud platform, or a local file. Kick start a toy project # Just like with most of these articles, I am going to create a conda environment so that I don’t break any existing projects and scaffold up a toy project to learn from. Expect this set of commands to take a few mi…

How Kedro handles your inputs

Passing inputs into kedro is a key concept. Understanding how it accepts a single catalog key as input is quite trivial that easily makes sense, but passing a list or dictionary of catalog entries can be a bit confusing. *args/**args review # Check out this post for a review of how work in python. understanding python *args and **kwargs python args and kwargs article by @_waylonwalker All Kedro inputs are catalog Entries # When kedro runs your pipeline it uses the catalog to imperatively load your data, meaning that you don’t tell kedro how to load your data, you tell it where your data is and what type it is. These catalog entries are like a store. You just need to give the key when setting up a node. Single Inputs # These are fairly straightforward to understand. In the example below when runs the pipeline it will load the input from the catalog, then pass that input to the func, then save the returned value to the output catalog entry. List of inputs # Let’s look at an example node…

004

🔥 #kedrotips use find-kedro to assembly your pipelines

1 min

002

** 0.3.0 just launched with _ support 🎉

1 min

Kedro Static Viz 0.3.0 is out with Hooks Support

kedro-static-viz is out with support for the newly released hooks feature. This means that you can have automatically deploy a full gatsby site keeping your visualization always up to date. Even though it is a static site there is no functionality lost. The only thing that’s missing is the flask server. With kedro-static-viz you can deploy your visualization to a number of static hosting providers such as GitHub pages free of charge with wicked fast performance ⚡ It’s Fast # Even though it’s built on gatsbyjs the full site builds in under 2s even on slower hardware. This is because the site is already pre-rendered and stripped of any excess. It’s zipped up right into the python package and is typically used with the cli, but now can be used with python, or as a hook as well. What is kedro-viz 🤔 # Kedro viz is a fantastic kedro plugin that allows you to visualize your data pipeline. Kedro allows you to quickly build production-ready pipelines where you just configure a catalog, then tos…

Brainstorming Kedro Hooks

This post is a 🧠 branstorming work in progress. I will likely use it as a storage location/brain dump of hook ideas. What is Kedro 🤔 # If you are completely unsure what kedro is be sure to check out my what is kedro post after_catalog_created # filepath replacer bucket replacer before_pipeline_run # preflight check that data exists run run mypy run interrogate run flake8 after_pipeline_run # Great Expectations send email send slack before_node_run # after_node_run # Great Expectations save stats/meta data Execution Order # hooks are executed in reverse order of the hooks list. hooks with will be moved to the end of the list hooks with will be moved to the end of the list after_catalog_created before_pipeline_run args run_params = run_params = {‘run_id’: ‘2020-05-23T15.24.23.958Z’, ‘project_path’: ‘/mnt/c/temp/kedro0160’, ’env’: ’local’, ‘kedro_version’: ‘0.15.9’, ’tags’: (), ‘from_nodes’: [], ’to_nodes’: [], ’node_names’: (), ‘from_inputs’: [], ’load_versions’: {}, ‘pipeline_name’: Non…

Create Custom Kedro Dataset

Kedro provides an efficient way to build out data catalogs with their yaml api. It allows you to be very declaritive about loading and saving your data. For the most part you just need to tell Kedro what connector to use and its filepath. When running Kedro takes care of all of the read/write, you just reference the catalog key. But what is happening behind the scenes # Under the hood there is an that each connector inherits from. It sets up a lot of the behind the scenes structure for us so that we dont have to. For the most part kedro has connectors for about anything that you want to load, csv, parquet, sql, json, from about anywhere, http, s3, localfile system are just some of the examples. Here is a DataSet implementation from their docs. Here you can see the barebones example straight from the docs. Parameters from the yaml catalog will get passed in

creating the kedro-preflight hook

Kedro Hooks Intro - kedro hooks are an exciting upcoming feature of kedro. They allow you to hook into,, and (nouns). With a, or (adjective). This really reminds me of reacts lifecycle hooks, that let you hook into various state of react web components. This is going to make kedro so extendable by the community. I am super pumped to see what the community is able to do with this ability. kedro hooks are an exciting upcoming feature of kedro. They allow you to hook into,, and (nouns). With a, or (adjective). This really reminds me of reacts lifecycle hooks, that let you hook into various state of react web components. This is going to make kedro so extendable by the community. I am super pumped to see what the community is able to do with this ability. What is Kedro If you are completely unsure what kedro is be sure to check out my what is kedro post Docs # a work in progress As this is a part of an upcoming release you will need to look in the docs, not and you will find a 15_hoooks pa…

📝 Kedro Preflight Notes

This is a very rough idea for a kedro package to prevent time lost to get partway through a pipeline run only to realize that you dont have access to data or resources. Must Haves # check that inputs exist or are of a type to skip (sql) Good to haves check that all input and output databases are accessible with good credentials check for s3 bucket access check for spark install Implementation # run params #

📢 Announcing find-kedro

is a small library to enhance your kedro experience. It looks through your modules to find kedro pipelines, nodes, and iterables (lists, sets, tuples) of nodes. It then assembles them into a dictionary of pipelines, each module will create a separate pipeline, and being a combination of all pipelines. This format is compatible with the kedro format. # is a ✨ fantastic project that allows for super-fast prototyping of data pipelines, while yielding production-ready pipelines. enhances this experience by adding a pytest like node/pipeline discovery eliminating the need to bubble up pipelines through modules. When working on larger pipeline projects, it is advisable to break your project down into different sub-modules which requires knowledge of building python libraries, and knowing how to import each module correctly. While this is not too difficult, in some cases, it can trip up even the most senior engineers, losing precious feature development time to debugging a library. # is deplo…

Create New Kedro Project

This is a quickstart to getting a new kedro pipeline up and running. After this article you should be able to understand how to get started with kedro. You can learn more about this Hello World Example in the docs 🧹 Install Kedro 🛢 Create the Example Pipeline 💨 Run the example 📉 Show the pipeline visualization Create a Virtual Environment # I use conda to control my virtual environments and will create a new environment called with the following command. note the latest compatible version of python is 3.7. EDIT: as of kedro 0.16.0 kedro supports up to 3.8 Options Activate your conda environment # I try to keep my base environment as clean as possible. I have ran into too many issues installing things in the base environment. Almost always its some dependency that starts causing issues making it even harder to realize where its coming from as I never even installed it in base. Install Kedro # Currently is available on pypi and can be pip installed. EDIT kedro is up to Make sure you are…

What is Kedro

What is Kedro This is my original what-is-kedro article. There is a brand new one Kedro is an open source data pipeline framework. It provides guardrails to set your project up right from the start without needing to know deeply how to setup your own python library for data pipelining. It includes really great ways to manipulate and. This article will cover the 10K view of kedro, future articles will dive deper into each one. kedro is an open-source data pipeline framework. It provides guardrails to set your project up right from the start without needing to know deeply how to set up your own python library for data pipelining. It includes great ways to manipulate and. This article will cover the 10K view of kedro, future articles will dive deeper into each one. Libraries # Currently, kedro is broken down into 3 different libraries. 💎 kedro 📉 kedro-viz 🏗 kedro-docker kedro # kedro is the core of the ecosystem. It provides the docs, getting started, templates, and the core library inclu…

Kedro

See all of my kedro related posts in [[ tag/kedro]]. #kedrotips # I am tweeting out most of these snippets as I add them, you can find them all here #kedrotips. 🗣 Heads up # Below are some quick snippets/notes for when using kedro to build data pipelines. So far I am just compiling snippets. Eventually I will create several posts on kedro. These are mostly things that I use In my everyday with kedro. Some are a bit more essoteric. Some are helpful when writing production code, some are useful more usefule for exploration. 📚 Catalog # CSVLocalDataSet # python yaml CSVHTTPDataSet # HDFLocalDataSet # HDFS3LocalDataSet # JSONLocalDataSet # ParquetLocalDataSet # PickleS3DataSet SQLTableDataSet SQLQueryDataSet TextLocalDataSet ExcelLocalDataSet ⏳ Loading Data # Simple Loading # list all datasets # Saving Data # 🔍 Finding data # simple keyword search see on #kedrotips multi keyword serch see on #kedrotips 🐒 monkey patch it _see on #kedrotips 🤙 YOLO # You Only Load Once simple more refined 🍷 r…