You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.2 KiB
Python

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

from kedro.pipeline import Pipeline, node, pipeline
from kedro.framework.session import KedroSession
from .nodes import parse_xsl
import logging
logger = logging.getLogger(__name__)
# we need the context here in order to access to prepare_pipeline_creation()
with KedroSession.create() as session:
context = session.load_context()
# important: **we have to call** the catalog as an attribute,
# because it makes a call to the _get_catalog() of the context method
catalog = context.catalog
logger.info("loading houses")
logger.info("------------------ houses ---------------------")
logger.info(str(context.get_houses()))
def nodes_factory(nodes_description):
"nodes creation"
nodes = []
for node_description in nodes_description:
nodes.append(node(
func=parse_xsl,
inputs=[node_description['inputs'], "params:xlststylesheet"],
outputs=node_description['outputs'],
name=node_description['name'],
tags="xsl",
))
return nodes
def create_pipeline(**kwargs):
"pipeline entry point needed by the global pipeline registry"
return pipeline(nodes_factory(context.prepare_pipeline_creation()))