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
412 413 414 | |
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
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | |
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
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 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 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 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 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 | |
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
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |