Project
kedro.framework.project ¶
kedro.framework.project module provides utility to
configure a Kedro project and access its settings.
| Function | Description |
|---|---|
configure_logging |
Configure logging according to the logging_config dictionary. |
configure_project |
Configure a Kedro project by populating its settings with values defined in settings.py and pipeline_registry.py. |
find_pipelines |
Automatically find modular pipelines having a create_pipeline function. |
validate_settings |
Eagerly validate that the settings module is importable if it exists. |
kedro.framework.project.configure_logging ¶
configure_logging(logging_config)
Configure logging according to logging_config dictionary.
Source code in kedro/framework/project/__init__.py
569 570 571 | |
kedro.framework.project.configure_project ¶
configure_project(package_name, preserve_logging=False)
Configure a Kedro project by populating its settings with values defined in user's settings.py and pipeline_registry.py.
Parameters:
-
package_name(str) –The name of the project package.
-
preserve_logging(bool, default:False) –If True, skip re-applying the logging configuration when setting up the project logger. Useful in long-running processes (e.g. FastAPI apps) where custom handlers are added at runtime and must not be overwritten on repeated calls to
configure_project().
Source code in kedro/framework/project/__init__.py
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 | |
kedro.framework.project.find_pipelines ¶
find_pipelines(raise_errors=False, pipelines_to_find=None)
Automatically find modular pipelines having a create_pipeline
function. By default, projects created using Kedro 0.18.3 and higher
call this function to autoregister pipelines upon creation/addition.
Projects that require more fine-grained control can still define the
pipeline registry without calling this function. Alternatively, they
can modify the mapping generated by the find_pipelines function.
For more information on the pipeline registry and autodiscovery, see https://docs.kedro.org/en/stable/build/pipeline_registry/
Parameters:
-
raise_errors(bool, default:False) –If
True, raise an error upon failed discovery. -
pipelines_to_find(list[str] | None, default:None) –Optional list of pipeline names to load selectively. If
Noneor contains"__default__", all pipelines are loaded.
Returns:
-
dict[str, Pipeline]–A generated mapping from pipeline names to
Pipelineobjects.
Raises:
-
RuntimeError–When the project has not been configured (i.e.
PACKAGE_NAMEisNone). -
ImportError–When a module does not expose a
create_pipelinefunction, thecreate_pipelinefunction does not return aPipelineobject, or if the module import fails up front. Ifraise_errorsisFalse, see Warns section instead.
Warns:
-
UserWarning–When a module does not expose a
create_pipelinefunction, thecreate_pipelinefunction does not return aPipelineobject, or if the module import fails up front. Ifraise_errorsisTrue, see Raises section instead.
Source code in kedro/framework/project/__init__.py
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 | |
kedro.framework.project.validate_settings ¶
validate_settings()
Eagerly validate that the settings module is importable if it exists. This is desirable to
surface any syntax or import errors early. In particular, without eagerly importing
the settings module, dynaconf would silence any import error (e.g. missing
dependency, missing/mislabelled pipeline), and users would instead get a cryptic
error message Expected an instance of `ConfigLoader`, got `NoneType` instead.
More info on the dynaconf issue: https://github.com/dynaconf/dynaconf/issues/460
Source code in kedro/framework/project/__init__.py
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |