<#4437 [Core feature] `flytekit.configuration.Conf...
# flyte-github
c
#4437 [Core feature]
flytekit.configuration.Config
file path inputs should accept
pathlib.Path
Issue created by cosmicBboy ### Motivation: Why do you think this is important? Currently, using a
pathlibPath
as an argument to
Config
will fail: from pathlib import Path from flytekit.remote import FlyteRemote from flytekit.configuration import Config remote = FlyteRemote( config=Config.auto(Path.home() / ".flyte" / "config-demo.yaml"), default_project="my_project", default_domain="development", ) Error:
Copy code
╭─────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────╮
│ /Users/nielsbantilan/git/llm-fine-tuning/flyte_llama/resource_opt.py:7 in <module>                               │
│                                                                                                                  │
│ ❱  7 │   config=Config.auto(Path.home() / ".flyte" / "config-demo.yaml"),                                        │
│                                                                                                                  │
│ /Users/nielsbantilan/venvs/flyte-llama/lib/python3.11/site-packages/flytekit/configuration/__init__.py:665 in    │
│ auto                                                                                                             │
│                                                                                                                  │
│ ❱ 665 │   │   set_if_exists(kwargs, "local_sandbox_path", _internal.LocalSDK.LOCAL_SANDBOX.rea                   │
│                                                                                                                  │
│ /Users/nielsbantilan/venvs/flyte-llama/lib/python3.11/site-packages/flytekit/configuration/file.py:161 in read   │
│                                                                                                                  │
│ ❱ 161 │   │   if cfg and cfg.legacy_config:                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'PosixPath' object has no attribute 'legacy_config'
### Goal: What should the final outcome look like, ideally?
Config
should accept
pathlib.Path
### Describe alternatives you've considered Maintaining the status quo makes for a bad UX ### Propose: Link/Inline OR Additional context No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte