Additional behavior | Hook implementations | Additional tools used | Example |
---|---|---|---|
Pipeline performance monitoring | before_node_run after_node_run after_pipeline_run |
StatsD, Grafana | PipelineMonitoringHooks |
Data validation for node inputs and outputs | before_node_run after_node_run |
Great Expectations | DataValidationHooks |
Experiment tracking | after_node_run before_pipeline_run after_pipeline_run |
MLflow | [ModelTrackingHooks](https://github.com/quantumblacklabs/kedro-examples/blob/master/kedro-hooks-tutorial/src/kedro_hooks_tutorial/hoo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_master_table( | |
shuttles: pd.DataFrame, companies: pd.DataFrame, reviews: pd.DataFrame | |
) -> pd.DataFrame: | |
"""Combines all data to create a master table. | |
Args: | |
shuttles: Preprocessed data for shuttles. | |
companies: Preprocessed data for companies. | |
reviews: Raw data for reviews. | |
Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_pipeline(**kwargs): | |
return Pipeline( | |
[ | |
node( | |
func=preprocess_companies, | |
inputs="companies", | |
outputs="preprocessed_companies", | |
name="preprocess_companies_node", | |
), | |
node( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def preprocess_companies(companies: pd.DataFrame) -> pd.DataFrame: | |
"""Preprocesses the data for companies. | |
Args: | |
companies: Raw data. | |
Returns: | |
Preprocessed data, with `company_rating` converted to a float and | |
`iata_approved` converted to boolean. | |
""" | |
companies["iata_approved"] = _is_true(companies["iata_approved"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kedro.io import DataCatalog, MemoryDataSet | |
from kedro.pipeline import node, Pipeline | |
from kedro.runner import SequentialRunner | |
# Prepare a data catalog | |
data_catalog = DataCatalog({"my_salutation": MemoryDataSet()}) | |
# Prepare first node | |
def return_greeting(): | |
return "Hello" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-----+--------+-------------+-----------------+------------+ | |
| ID | Name | CountryCode | District | Population | | |
+-----+--------+-------------+-----------------+------------+ | |
| 130 | Sydney | AUS | New South Wales | 3276207 | | |
+-----+--------+-------------+-----------------+------------+ | |
1 row in set (0.00 sec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./bin/graql.sh | |
>>> match $x isa country; limit 10; | |
$x id "country-AGO" isa country; | |
$x id "country-ARE" isa country; | |
$x id "country-ANT" isa country; | |
$x id "country-ARG" isa country; | |
$x id "country-DZA" isa country; | |
$x id "country-ATG" isa country; | |
$x id "country-ASM" isa country; | |
$x id "country-NLD" isa country; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CountryCode-parent isa role-type; | |
CountryCode-child isa role-type; | |
CountryCode-relation isa relation-type, | |
has-role CountryCode-child, | |
has-role CountryCode-parent; | |
city plays-role CountryCode-parent; | |
country plays-role CountryCode-child; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert | |
city isa entity-type, | |
has-resource ID, | |
has-resource Name, | |
has-resource CountryCode, | |
has-resource District, | |
has-resource Population; | |
country isa entity-type, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./migration.sh sql -driver <jdbcDriver> -user <username> -pass <password> -database <url> -graph <graphname> [engine <url>] | |
-driver JDBC driver | |
-user username for SQL database | |
-pass password for SQL database | |
-database URL to SQL database | |
-graph graph name | |
-engine MindmapsDB engine URL, default localhost | |