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
514 515 516 | |
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
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |
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
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 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 | |
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
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 | |