From 5bf7c64d31d565b90c701fdfa5a27c9c3d11bc27 Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Tue, 19 Apr 2022 21:58:03 -0700 Subject: [PATCH] fix: Use cwd when getting module path Signed-off-by: Achal Shah --- sdk/python/feast/repo_operations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/python/feast/repo_operations.py b/sdk/python/feast/repo_operations.py index 8a5e6b39f97..40f1a055a94 100644 --- a/sdk/python/feast/repo_operations.py +++ b/sdk/python/feast/repo_operations.py @@ -28,9 +28,9 @@ from feast.usage import log_exceptions_and_usage -def py_path_to_module(path: Path, repo_root: Path) -> str: +def py_path_to_module(path: Path) -> str: return ( - str(path.relative_to(repo_root))[: -len(".py")] + str(path.relative_to(os.getcwd()))[: -len(".py")] .replace("./", "") .replace("/", ".") ) @@ -111,7 +111,7 @@ def parse_repo(repo_root: Path) -> RepoContents: ) for repo_file in get_repo_files(repo_root): - module_path = py_path_to_module(repo_file, repo_root) + module_path = py_path_to_module(repo_file) module = importlib.import_module(module_path) for attr_name in dir(module): obj = getattr(module, attr_name)