Skip to content

Commit

Permalink
Fix #2498 Adding logging issue 2498 (#2842)
Browse files Browse the repository at this point in the history
* Fixing typo n on line 114 file /docs/source/nodes_and_pipelines/run_a_pipeline.md from issue #2607

Signed-off-by: laizaparizotto <laizamsparizotto@gmail.com>

* Removed redundant packages at lines 66, 67 and 68 on file kedro/docs/source/nodes_and_pipelines/run_a_pipeline.md, packages:  from kedro.io import AbstractDataSet, DataCatalog, MemoryDataSet,  from kedro.pipeline import Pipeline and  from kedro.runner.runner import AbstractRunner

Signed-off-by: laizaparizotto <laizamsparizotto@gmail.com>

* Add logger object for logging when computing micropackage version

Signed-off-by: laizaparizotto <laizamsparizotto@gmail.com>

* Added new format to the logging

Signed-off-by: laizaparizotto <laizamsparizotto@gmail.com>

---------

Signed-off-by: laizaparizotto <laizamsparizotto@gmail.com>
Co-authored-by: Merel Theisen <49397448+merelcht@users.noreply.github.com>
  • Loading branch information
laizaparizotto and merelcht authored Aug 8, 2023
1 parent 0c9d4ec commit b1b461f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kedro/framework/cli/micropkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# ruff: noqa: I001 # https://github.com/kedro-org/kedro/pull/2634
from __future__ import annotations

import logging
import re
import shutil
import sys
Expand Down Expand Up @@ -52,6 +53,8 @@
find = {{}}
"""

logger = logging.getLogger(__name__)


class _EquivalentRequirement(Requirement):
"""Parse a requirement according to PEP 508.
Expand Down Expand Up @@ -592,6 +595,12 @@ def _get_default_version(metadata: ProjectMetadata, micropkg_module_path: str) -
)
return micropkg_module.__version__ # type: ignore
except (AttributeError, ModuleNotFoundError):
logger.warning(
"Micropackage version not found in '%s.%s', will take the top-level one in '%s'",
metadata.package_name,
micropkg_module_path,
metadata.package_name,
)
# if micropkg version doesn't exist, take the project one
project_module = import_module(f"{metadata.package_name}")
return project_module.__version__ # type: ignore
Expand Down

0 comments on commit b1b461f

Please sign in to comment.