Skip to content

Commit 28752f2

Browse files
achalsadchia
authored andcommitted
fix: Use cwd when getting module path (#2577)
Signed-off-by: Achal Shah <achals@gmail.com>
1 parent 4dce254 commit 28752f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sdk/python/feast/repo_operations.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
from feast.usage import log_exceptions_and_usage
2929

3030

31-
def py_path_to_module(path: Path, repo_root: Path) -> str:
31+
def py_path_to_module(path: Path) -> str:
3232
return (
33-
str(path.relative_to(repo_root))[: -len(".py")]
33+
str(path.relative_to(os.getcwd()))[: -len(".py")]
3434
.replace("./", "")
3535
.replace("/", ".")
3636
)
@@ -111,7 +111,7 @@ def parse_repo(repo_root: Path) -> RepoContents:
111111
)
112112

113113
for repo_file in get_repo_files(repo_root):
114-
module_path = py_path_to_module(repo_file, repo_root)
114+
module_path = py_path_to_module(repo_file)
115115
module = importlib.import_module(module_path)
116116
for attr_name in dir(module):
117117
obj = getattr(module, attr_name)

0 commit comments

Comments
 (0)