diff --git a/pyproject.toml b/pyproject.toml index b1df4f3..e37b0e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "python_tabular" -version = "0.1.9" +version = "0.1.9.1" authors = [ { name="Curtis Stallings", email="curtisrstallings@gmail.com" }, ] diff --git a/pytabular/partition.py b/pytabular/partition.py index 8afc2cf..1b6dd9d 100644 --- a/pytabular/partition.py +++ b/pytabular/partition.py @@ -41,7 +41,7 @@ def Refresh(self, *args, **kwargs) -> pd.DataFrame: Returns: pd.DataFrame: Returns pandas dataframe with some refresh details """ - return self.Table.Model.Refresh(self._object, *args, **kwargs) + return self.Table.Model.Refresh(self, *args, **kwargs) class PyPartitions(PyObjects): diff --git a/pytabular/refresh.py b/pytabular/refresh.py index 5902f32..bd852cd 100644 --- a/pytabular/refresh.py +++ b/pytabular/refresh.py @@ -199,6 +199,7 @@ def _pre_checks(self): ] def row_count_assertion(pre, post): + post = 0 if post is None else post return post > 0 for table in set(tables): diff --git a/pytabular/table.py b/pytabular/table.py index 6202c68..0a936cb 100644 --- a/pytabular/table.py +++ b/pytabular/table.py @@ -69,7 +69,7 @@ def Refresh(self, *args, **kwargs) -> pd.DataFrame: Returns: pd.DataFrame: Returns pandas dataframe with some refresh details """ - return self.Model.Refresh(self._object, *args, **kwargs) + return self.Model.Refresh(self, *args, **kwargs) class PyTables(PyObjects): diff --git a/test/test_tabular.py b/test/test_tabular.py index 917d285..7403bca 100644 --- a/test/test_tabular.py +++ b/test/test_tabular.py @@ -98,6 +98,16 @@ def test_pytables_count(model): assert model.Tables[testingtablename].Row_Count() > 0 +@pytest.mark.parametrize("model", testing_parameters) +def test_pytables_refresh(model): + assert model.Tables[testingtablename].Refresh() + + +@pytest.mark.parametrize("model", testing_parameters) +def test_pypartitions_refresh(model): + assert model.Tables[testingtablename].Partitions[0].Refresh() + + @pytest.mark.parametrize("model", testing_parameters) def test_backingup_table(model): model.Backup_Table(testingtablename)