Skip to content

Commit

Permalink
updates gx path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
BWMac committed Nov 16, 2023
1 parent 9f78e8c commit ad19174
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 2 additions & 4 deletions src/agoradatatools/gx.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ def __init__(
)

def _get_data_context_location(self) -> str:
"""Gets the absolute path to the great_expectations directory"""
"""Gets the path to the great_expectations directory"""
script_dir = os.path.dirname(os.path.realpath(__file__))
parent_dir = os.path.dirname(script_dir)
project_dir = os.path.dirname(parent_dir)
gx_directory = os.path.join(project_dir, "great_expectations")
gx_directory = os.path.join(script_dir, "../../great_expectations")
return gx_directory

def _check_if_expectation_suite_exists(self) -> bool:
Expand Down
8 changes: 5 additions & 3 deletions tests/test_gx.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ def test_that_an_initialized_runner_has_the_attributes_it_should(self, syn):
+ "/gx/uncommitted/data_docs/local_site/validations"
)

def test_that_get_data_context_location_returns_the_absolute_path_to_the_gx_directory(
def test_that_get_data_context_location_returns_the_path_to_the_gx_directory(
self,
):
assert self.good_runner._get_data_context_location() == os.path.join(
os.getcwd(), "great_expectations"
expected = os.path.join(
os.getcwd(), "src", "agoradatatools", "../..", "great_expectations"
)
result = self.good_runner._get_data_context_location()
assert result == expected

def test_check_if_expectation_suite_exists_returns_false_when_the_expectation_suite_does_not_exist(
self,
Expand Down

0 comments on commit ad19174

Please sign in to comment.