Skip to content

Commit

Permalink
fix: Use cwd when getting module path (#2577)
Browse files Browse the repository at this point in the history
Signed-off-by: Achal Shah <[email protected]>
  • Loading branch information
achals authored Apr 20, 2022
1 parent 160d7b7 commit b550e59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/python/feast/repo_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("/", ".")
)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b550e59

Please sign in to comment.