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
362 363 364 | |
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
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | |
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
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 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 | |
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
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | |