Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "python_tabular"
version = "0.2.1"
version = "0.2.2"
authors = [
{ name="Curtis Stallings", email="curtisrstallings@gmail.com" },
]
Expand Down
4 changes: 2 additions & 2 deletions pytabular/pytabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def __init__(self, CONNECTION_STR: str):
logger.info(f"Connected to Model - {self.Model.Name}")
self.Adomd: Connection = Connection(self.Server)
self.Effective_Users = dict()
self.PyRefresh = PyRefresh
# Build PyObjects
self.Reload_Model_Info()

Expand Down Expand Up @@ -161,8 +162,7 @@ def Refresh(self, *args, **kwargs) -> pd.DataFrame:
Returns:
pd.DataFrame
"""
r = PyRefresh(self, *args, **kwargs)
return r.Run()
return self.PyRefresh(self, *args, **kwargs).Run()

def Update(self, UpdateOptions: UpdateOptions = UpdateOptions.ExpandFull) -> None:
"""[Update Model](https://docs.microsoft.com/en-us/dotnet/api/microsoft.analysisservices.majorobject.update?view=analysisservices-dotnet#microsoft-analysisservices-majorobject-update(microsoft-analysisservices-updateoptions))
Expand Down
2 changes: 1 addition & 1 deletion pytabular/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def Query(self, Query_Str: str) -> Union[pd.DataFrame, str, int]:
is_file = False

if is_file:
logging.debug(
logger.debug(
f"File path detected, reading file... -> {Query_Str}",
)
with open(Query_Str, "r") as file:
Expand Down
7 changes: 7 additions & 0 deletions pytabular/refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ def __iter__(self):
def add_refresh_check(self, refresh_check: Refresh_Check):
self._refresh_checks.append(refresh_check)

def remove_refresh_check(self, refresh_check: Refresh_Check):
self._refresh_checks.remove(refresh_check)

def clear_refresh_checks(self):
self._refresh_checks.clear()


class PyRefresh:
def __init__(
Expand Down Expand Up @@ -217,6 +223,7 @@ def _post_checks(self):
self.trace.Drop()
for check in self._checks:
check.Post_Check()
self._checks.remove_refresh_check(check)
pass

def _get_trace(self) -> Base_Trace:
Expand Down
2 changes: 1 addition & 1 deletion test/test_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

aas = pytabular.Tabular(local.AAS)
gen2 = pytabular.Tabular(local.GEN2)
testing_parameters = [(aas), (gen2)]
testing_parameters = [pytest.param(aas, id="AAS"), pytest.param(gen2, id="GEN2")]
testingtablename = "PyTestTable"
testingtabledf = pd.DataFrame(data={"col1": [1, 2, 3], "col2": ["four", "five", "six"]})

Expand Down