Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kedro run --conf-source=conf.tar.gz gives UnicodeDecodeError #2722

Closed
astrojuanlu opened this issue Jun 23, 2023 · 6 comments
Closed

kedro run --conf-source=conf.tar.gz gives UnicodeDecodeError #2722

astrojuanlu opened this issue Jun 23, 2023 · 6 comments
Labels
Issue: Bug Report 🐞 Bug that needs to be fixed

Comments

@astrojuanlu
Copy link
Member

astrojuanlu commented Jun 23, 2023

Description

Running kedro run --conf-source={fname}.tar.gz fails.

Context

This was surprising because I very clearly remember closing #2146 a few months ago, but it actually failed.

Steps to Reproduce

Edit: The feature only works with OmegaConfigLoader, see below for latest status

  1. kedro new --starter=spaceflights
  2. kedro package
  3. kedro run --conf-source dist/conf-spaceflights_intermediate.tar.gz

Expected Result

A normal kedro run happens.

Actual Result

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/bin/kedro:8 in <module>                         │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/framework/cl │
│ i/cli.py:211 in main                                                                             │
│                                                                                                  │
│   208 │   """                                                                                    │
│   209 │   _init_plugins()                                                                        │
│   210 │   cli_collection = KedroCLI(project_path=Path.cwd())                                     │
│ ❱ 211 │   cli_collection()                                                                       │
│   212                                                                                            │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/click/core.py:1130 │
│ in __call__                                                                                      │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/framework/cl │
│ i/cli.py:139 in main                                                                             │
│                                                                                                  │
│   136 │   │   )                                                                                  │
│   137 │   │                                                                                      │
│   138 │   │   try:                                                                               │
│ ❱ 139 │   │   │   super().main(                                                                  │
│   140 │   │   │   │   args=args,                                                                 │
│   141 │   │   │   │   prog_name=prog_name,                                                       │
│   142 │   │   │   │   complete_var=complete_var,                                                 │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/click/core.py:1055 │
│ in main                                                                                          │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/click/core.py:1657 │
│ in invoke                                                                                        │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/click/core.py:1404 │
│ in invoke                                                                                        │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/click/core.py:760  │
│ in invoke                                                                                        │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/framework/cl │
│ i/project.py:456 in run                                                                          │
│                                                                                                  │
│   453 │   node_names = node_names + nodes_names                                                  │
│   454 │   load_version = {**load_version, **load_versions}                                       │
│   455 │                                                                                          │
│ ❱ 456 │   with KedroSession.create(                                                              │
│   457 │   │   env=env, conf_source=conf_source, extra_params=params                              │
│   458 │   ) as session:                                                                          │
│   459 │   │   session.run(                                                                       │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/framework/se │
│ ssion/session.py:194 in create                                                                   │
│                                                                                                  │
│   191 │   │   session._store.update(session_data)                                                │
│   192 │   │                                                                                      │
│   193 │   │   # We need ConfigLoader and env to setup logging correctly                          │
│ ❱ 194 │   │   session._setup_logging()                                                           │
│   195 │   │   session_data.update(**_describe_git(session._project_path))                        │
│   196 │   │   session._store.update(session_data)                                                │
│   197                                                                                            │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/framework/se │
│ ssion/session.py:212 in _setup_logging                                                           │
│                                                                                                  │
│   209 │   def _setup_logging(self) -> None:                                                      │
│   210 │   │   """Register logging specified in logging directory."""                             │
│   211 │   │   try:                                                                               │
│ ❱ 212 │   │   │   logging_config = self._get_logging_config()                                    │
│   213 │   │   except MissingConfigException:                                                     │
│   214 │   │   │   self._logger.debug(                                                            │
│   215 │   │   │   │   "No project logging configuration loaded; "                                │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/framework/se │
│ ssion/session.py:201 in _get_logging_config                                                      │
│                                                                                                  │
│   198 │   │   return session                                                                     │
│   199 │                                                                                          │
│   200 │   def _get_logging_config(self) -> dict[str, Any]:                                       │
│ ❱ 201 │   │   logging_config = self._get_config_loader()["logging"]                              │
│   202 │   │   # turn relative paths in logging config into absolute path                         │
│   203 │   │   # before initialising loggers                                                      │
│   204 │   │   logging_config = _convert_paths_to_absolute_posix(                                 │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/config/confi │
│ g.py:117 in __getitem__                                                                          │
│                                                                                                  │
│   114 │   │   # explicitly on the ``ConfigLoader`` instance.                                     │
│   115 │   │   if key in self:                                                                    │
│   116 │   │   │   return super().__getitem__(key)                                                │
│ ❱ 117 │   │   return self.get(*self.config_patterns[key])                                        │
│   118 │                                                                                          │
│   119 │   def __repr__(self):  # pragma: no cover                                                │
│   120 │   │   return (                                                                           │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/config/confi │
│ g.py:131 in get                                                                                  │
│                                                                                                  │
│   128 │   │   return _remove_duplicates(self._build_conf_paths())                                │
│   129 │                                                                                          │
│   130 │   def get(self, *patterns: str) -> dict[str, Any]:  # type: ignore                       │
│ ❱ 131 │   │   return _get_config_from_patterns(                                                  │
│   132 │   │   │   conf_paths=self.conf_paths, patterns=list(patterns)                            │
│   133 │   │   )                                                                                  │
│   134                                                                                            │
│                                                                                                  │
│ /home/gitpod/.pyenv/versions/mambaforge-22.9.0-2/lib/python3.10/site-packages/kedro/config/commo │
│ n.py:73 in _get_config_from_patterns                                                             │
│                                                                                                  │
│    70 │                                                                                          │
│    71 │   for conf_path in conf_paths:                                                           │
│    72 │   │   if not Path(conf_path).is_dir():                                                   │
│ ❱  73 │   │   │   raise ValueError(                                                              │
│    74 │   │   │   │   f"Given configuration path either does not exist "                         │
│    75 │   │   │   │   f"or is not a valid directory: {conf_path}"                                │
│    76 │   │   │   )                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Given configuration path either does not exist or is not a valid directory: 
/workspace/kedro-academy/kedro-intermediate/spaceflights-intermediate/dist/conf-spaceflights_intermediate.tar.gz/base

Your Environment

  • Kedro version used (pip show kedro or kedro -V): 0.18.10
  • Python version used (python -V): 3.10
  • Operating system and version: Linux
@astrojuanlu astrojuanlu added the Issue: Bug Report 🐞 Bug that needs to be fixed label Jun 23, 2023
@ankatiyar
Copy link
Contributor

@astrojuanlu This feature only works with OmegaConfigLoader which needs to be selected in settings.py. Seems like you tried this with ConfigLoader?

@astrojuanlu
Copy link
Member Author

Thanks @ankatiyar, I missed that. I made that change but kedro-mlflow plugin crashed:

[07/05/23 14:55:16] WARNING  /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro_mlf warnings.py:109
                             low/mlflow/kedro_pipeline_model.py:5: DeprecationWarning: `kedro.extras.datasets`                
                             is deprecated and will be removed in Kedro 0.19, install `kedro-datasets` instead                
                             by running `pip install kedro-datasets`.                                                         
                               from kedro.extras.datasets.pickle import PickleDataSet                                         
                                                                                                                              
[07/05/23 14:55:16] INFO     Kedro project test-conf-tar                                                        session.py:359
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/juan_cano/.micromamba/envs/kedro310/bin/kedro:8 in <module>                               │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/cli/cli. │
│ py:211 in main                                                                                   │
│                                                                                                  │
│   208 │   """                                                                                    │
│   209 │   _init_plugins()                                                                        │
│   210 │   cli_collection = KedroCLI(project_path=Path.cwd())                                     │
│ ❱ 211 │   cli_collection()                                                                       │
│   212                                                                                            │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:1130 in    │
│ __call__                                                                                         │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/cli/cli. │
│ py:139 in main                                                                                   │
│                                                                                                  │
│   136 │   │   )                                                                                  │
│   137 │   │                                                                                      │
│   138 │   │   try:                                                                               │
│ ❱ 139 │   │   │   super().main(                                                                  │
│   140 │   │   │   │   args=args,                                                                 │
│   141 │   │   │   │   prog_name=prog_name,                                                       │
│   142 │   │   │   │   complete_var=complete_var,                                                 │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:1055 in    │
│ main                                                                                             │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:1657 in    │
│ invoke                                                                                           │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:1404 in    │
│ invoke                                                                                           │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:760 in     │
│ invoke                                                                                           │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/cli/proj │
│ ect.py:459 in run                                                                                │
│                                                                                                  │
│   456 │   with KedroSession.create(                                                              │
│   457 │   │   env=env, conf_source=conf_source, extra_params=params                              │
│   458 │   ) as session:                                                                          │
│ ❱ 459 │   │   session.run(                                                                       │
│   460 │   │   │   tags=tag,                                                                      │
│   461 │   │   │   runner=runner(is_async=is_async),                                              │
│   462 │   │   │   node_names=node_names,                                                         │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/session/ │
│ session.py:371 in run                                                                            │
│                                                                                                  │
│   368 │   │   session_id = self.store["session_id"]                                              │
│   369 │   │   save_version = session_id                                                          │
│   370 │   │   extra_params = self.store.get("extra_params") or {}                                │
│ ❱ 371 │   │   context = self.load_context()                                                      │
│   372 │   │                                                                                      │
│   373 │   │   name = pipeline_name or "__default__"                                              │
│   374                                                                                            │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/session/ │
│ session.py:275 in load_context                                                                   │
│                                                                                                  │
│   272 │   │   │   extra_params=extra_params,                                                     │
│   273 │   │   │   hook_manager=self._hook_manager,                                               │
│   274 │   │   )                                                                                  │
│ ❱ 275 │   │   self._hook_manager.hook.after_context_created(  # pylint: disable=no-member        │
│   276 │   │   │   context=context                                                                │
│   277 │   │   )                                                                                  │
│   278                                                                                            │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_hooks.py:265 in  │
│ __call__                                                                                         │
│                                                                                                  │
│   262 │   │   else:                                                                              │
│   263 │   │   │   firstresult = False                                                            │
│   264 │   │                                                                                      │
│ ❱ 265 │   │   return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)        │
│   266 │                                                                                          │
│   267 │   def call_historic(self, result_callback=None, kwargs=None):                            │
│   268 │   │   """Call the hook with given ``kwargs`` for all registered plugins and              │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_manager.py:80 in │
│ _hookexec                                                                                        │
│                                                                                                  │
│    77 │   def _hookexec(self, hook_name, methods, kwargs, firstresult):                          │
│    78 │   │   # called from all hookcaller instances.                                            │
│    79 │   │   # enable_tracing will set its own wrapping function at self._inner_hookexec        │
│ ❱  80 │   │   return self._inner_hookexec(hook_name, methods, kwargs, firstresult)               │
│    81 │                                                                                          │
│    82 │   def register(self, plugin, name=None):                                                 │
│    83 │   │   """Register a plugin and return its canonical name or ``None`` if the name         │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_manager.py:327   │
│ in traced_hookexec                                                                               │
│                                                                                                  │
│   324 │   │   │   │   lambda: oldcall(hook_name, hook_impls, kwargs, firstresult)                │
│   325 │   │   │   )                                                                              │
│   326 │   │   │   after(outcome, hook_name, hook_impls, kwargs)                                  │
│ ❱ 327 │   │   │   return outcome.get_result()                                                    │
│   328 │   │                                                                                      │
│   329 │   │   self._inner_hookexec = traced_hookexec                                             │
│   330                                                                                            │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_result.py:60 in  │
│ get_result                                                                                       │
│                                                                                                  │
│   57 │   │   │   return self._result                                                             │
│   58 │   │   else:                                                                               │
│   59 │   │   │   ex = self._excinfo                                                              │
│ ❱ 60 │   │   │   raise ex[1].with_traceback(ex[2])                                               │
│   61                                                                                             │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_result.py:33 in  │
│ from_call                                                                                        │
│                                                                                                  │
│   30 │   │   __tracebackhide__ = True                                                            │
│   31 │   │   result = excinfo = None                                                             │
│   32 │   │   try:                                                                                │
│ ❱ 33 │   │   │   result = func()                                                                 │
│   34 │   │   except BaseException:                                                               │
│   35 │   │   │   excinfo = sys.exc_info()                                                        │
│   36                                                                                             │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_manager.py:324   │
│ in <lambda>                                                                                      │
│                                                                                                  │
│   321 │   │   def traced_hookexec(hook_name, hook_impls, kwargs, firstresult):                   │
│   322 │   │   │   before(hook_name, hook_impls, kwargs)                                          │
│   323 │   │   │   outcome = _Result.from_call(                                                   │
│ ❱ 324 │   │   │   │   lambda: oldcall(hook_name, hook_impls, kwargs, firstresult)                │
│   325 │   │   │   )                                                                              │
│   326 │   │   │   after(outcome, hook_name, hook_impls, kwargs)                                  │
│   327 │   │   │   return outcome.get_result()                                                    │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_callers.py:60 in │
│ _multicall                                                                                       │
│                                                                                                  │
│   57 │   │   │   except StopIteration:                                                           │
│   58 │   │   │   │   pass                                                                        │
│   59 │   │                                                                                       │
│ ❱ 60 │   │   return outcome.get_result()                                                         │
│   61                                                                                             │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_result.py:60 in  │
│ get_result                                                                                       │
│                                                                                                  │
│   57 │   │   │   return self._result                                                             │
│   58 │   │   else:                                                                               │
│   59 │   │   │   ex = self._excinfo                                                              │
│ ❱ 60 │   │   │   raise ex[1].with_traceback(ex[2])                                               │
│   61                                                                                             │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/pluggy/_callers.py:39 in │
│ _multicall                                                                                       │
│                                                                                                  │
│   36 │   │   │   │   │   except StopIteration:                                                   │
│   37 │   │   │   │   │   │   _raise_wrapfail(gen, "did not yield")                               │
│   38 │   │   │   │   else:                                                                       │
│ ❱ 39 │   │   │   │   │   res = hook_impl.function(*args)                                         │
│   40 │   │   │   │   │   if res is not None:                                                     │
│   41 │   │   │   │   │   │   results.append(res)                                                 │
│   42 │   │   │   │   │   │   if firstresult:  # halt further impl calls                          │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro_mlflow/framework/h │
│ ooks/mlflow_hook.py:73 in after_context_created                                                  │
│                                                                                                  │
│    70 │   │   │   # but we got an empty dict                                                     │
│    71 │   │   │   conf_mlflow_yml = {}                                                           │
│    72 │   │                                                                                      │
│ ❱  73 │   │   mlflow_config = KedroMlflowConfig.parse_obj({**conf_mlflow_yml})                   │
│    74 │   │                                                                                      │
│    75 │   │   self._already_active_mlflow = False                                                │
│    76 │   │   if mlflow.active_run():                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: 'str' object is not a mapping

After uninstalling it, I got another error:

[07/05/23 15:00:09] INFO     Kedro project test-conf-tar                                                        session.py:359
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/juan_cano/.micromamba/envs/kedro310/bin/kedro:8 in <module>                               │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/cli/cli. │
│ py:211 in main                                                                                   │
│                                                                                                  │
│   208 │   """                                                                                    │
│   209 │   _init_plugins()                                                                        │
│   210 │   cli_collection = KedroCLI(project_path=Path.cwd())                                     │
│ ❱ 211 │   cli_collection()                                                                       │
│   212                                                                                            │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:1130 in    │
│ __call__                                                                                         │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/cli/cli. │
│ py:139 in main                                                                                   │
│                                                                                                  │
│   136 │   │   )                                                                                  │
│   137 │   │                                                                                      │
│   138 │   │   try:                                                                               │
│ ❱ 139 │   │   │   super().main(                                                                  │
│   140 │   │   │   │   args=args,                                                                 │
│   141 │   │   │   │   prog_name=prog_name,                                                       │
│   142 │   │   │   │   complete_var=complete_var,                                                 │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:1055 in    │
│ main                                                                                             │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:1657 in    │
│ invoke                                                                                           │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:1404 in    │
│ invoke                                                                                           │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/click/core.py:760 in     │
│ invoke                                                                                           │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/cli/proj │
│ ect.py:459 in run                                                                                │
│                                                                                                  │
│   456 │   with KedroSession.create(                                                              │
│   457 │   │   env=env, conf_source=conf_source, extra_params=params                              │
│   458 │   ) as session:                                                                          │
│ ❱ 459 │   │   session.run(                                                                       │
│   460 │   │   │   tags=tag,                                                                      │
│   461 │   │   │   runner=runner(is_async=is_async),                                              │
│   462 │   │   │   node_names=node_names,                                                         │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/session/ │
│ session.py:412 in run                                                                            │
│                                                                                                  │
│   409 │   │   │   "runner": getattr(runner, "__name__", str(runner)),                            │
│   410 │   │   }                                                                                  │
│   411 │   │                                                                                      │
│ ❱ 412 │   │   catalog = context._get_catalog(                                                    │
│   413 │   │   │   save_version=save_version,                                                     │
│   414 │   │   │   load_versions=load_versions,                                                   │
│   415 │   │   )                                                                                  │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/context/ │
│ context.py:291 in _get_catalog                                                                   │
│                                                                                                  │
│   288 │   │   │   save_version=save_version,                                                     │
│   289 │   │   )                                                                                  │
│   290 │   │                                                                                      │
│ ❱ 291 │   │   feed_dict = self._get_feed_dict()                                                  │
│   292 │   │   catalog.add_feed_dict(feed_dict)                                                   │
│   293 │   │   if catalog.layers:                                                                 │
│   294 │   │   │   _validate_layers_for_transcoding(catalog)                                      │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/context/ │
│ context.py:307 in _get_feed_dict                                                                 │
│                                                                                                  │
│   304 │                                                                                          │
│   305 │   def _get_feed_dict(self) -> dict[str, Any]:                                            │
│   306 │   │   """Get parameters and return the feed dictionary."""                               │
│ ❱ 307 │   │   params = self.params                                                               │
│   308 │   │   feed_dict = {"parameters": params}                                                 │
│   309 │   │                                                                                      │
│   310 │   │   def _add_param_to_feed_dict(param_name, param_value):                              │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/framework/context/ │
│ context.py:244 in params                                                                         │
│                                                                                                  │
│   241 │   │   │   │   extra parameters passed at initialization.                                 │
│   242 │   │   """                                                                                │
│   243 │   │   try:                                                                               │
│ ❱ 244 │   │   │   params = self.config_loader["parameters"]                                      │
│   245 │   │   except MissingConfigException as exc:                                              │
│   246 │   │   │   warn(f"Parameters not found in your Kedro project config.\n{str(exc)}")        │
│   247 │   │   │   params = {}                                                                    │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/config/omegaconf_c │
│ onfig.py:171 in __getitem__                                                                      │
│                                                                                                  │
│   168 │   │   │   base_path = str(Path(self.conf_source) / self.base_env)                        │
│   169 │   │   else:                                                                              │
│   170 │   │   │   base_path = str(Path(self._fs.ls("", detail=False)[-1]) / self.base_env)       │
│ ❱ 171 │   │   base_config = self.load_and_merge_dir_config(                                      │
│   172 │   │   │   base_path, patterns, key, processed_files, read_environment_variables          │
│   173 │   │   )                                                                                  │
│   174 │   │   config = base_config                                                               │
│                                                                                                  │
│ /Users/juan_cano/.micromamba/envs/kedro310/lib/python3.10/site-packages/kedro/config/omegaconf_c │
│ onfig.py:261 in load_and_merge_dir_config                                                        │
│                                                                                                  │
│   258 │   │   │   │   with self._fs.open(str(config_filepath.as_posix())) as open_config:        │
│   259 │   │   │   │   │   # As fsspec doesn't allow the file to be read as StringIO,             │
│   260 │   │   │   │   │   # this is a workaround to read it as a binary file and decode it bac   │
│ ❱ 261 │   │   │   │   │   tmp_fo = io.StringIO(open_config.read().decode("utf8"))                │
│   262 │   │   │   │   │   config = OmegaConf.load(tmp_fo)                                        │
│   263 │   │   │   │   │   processed_files.add(config_filepath)                                   │
│   264 │   │   │   │   if read_environment_variables:                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 45: invalid start byte

this is my kedro info:


 _            _
| | _____  __| |_ __ ___
| |/ / _ \/ _` | '__/ _ \
|   <  __/ (_| | | | (_) |
|_|\_\___|\__,_|_|  \___/
v0.18.11

Kedro is a Python framework for
creating reproducible, maintainable
and modular data science code.

Installed plugins:
kedro_telemetry: 0.2.4 (entry points:cli_hooks,hooks)
kedro_viz: 6.1.0 (entry points:global,line_magic)

@ankatiyar
Copy link
Contributor

This seems to a problem at kedro-mlflow end. It uses the config_loader.get() API in the after_context_created hook which doesn't exist for OmegaConfigLoader. (#1870)

@ankatiyar
Copy link
Contributor

@astrojuanlu We can close this issue, I opened a new one on the kedro-mlflow repo for this Galileo-Galilei/kedro-mlflow#430

@astrojuanlu
Copy link
Member Author

Thanks for opening the issue upstream @ankatiyar! Although for clarity, the UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 45: invalid start byte part happened after I uninstalled kedro-mlflow, maybe we should reopen this

@ankatiyar ankatiyar reopened this Jul 5, 2023
@github-project-automation github-project-automation bot moved this from Done to In Progress in Kedro Framework Jul 5, 2023
@astrojuanlu astrojuanlu changed the title kedro run --conf-source=conf.tar.gz fails kedro run --conf-source=conf.tar.gz gives UnicodeDecodeError Jul 5, 2023
@ankatiyar ankatiyar moved this from In Progress to To Do in Kedro Framework Jul 10, 2023
@github-project-automation github-project-automation bot moved this from To Do to Done in Kedro Framework Dec 18, 2023
@astrojuanlu
Copy link
Member Author

(Closing because I haven't found this ever again and nobody else seems to be affected)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Bug Report 🐞 Bug that needs to be fixed
Projects
Archived in project
Development

No branches or pull requests

2 participants