From b80dc5d590cc2db01578e2e2870355791294d140 Mon Sep 17 00:00:00 2001 From: Curtis Stallings Date: Tue, 4 Oct 2022 08:12:34 -0500 Subject: [PATCH] repr tabular class fix --- pyproject.toml | 2 +- pytabular/pytabular.py | 2 +- test/test_tabular.py | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0e1cb41..9be8a69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "python_tabular" -version = "0.1.5" +version = "0.1.6" authors = [ { name="Curtis Stallings", email="curtisrstallings@gmail.com" }, ] diff --git a/pytabular/pytabular.py b/pytabular/pytabular.py index a4f251e..4077afd 100644 --- a/pytabular/pytabular.py +++ b/pytabular/pytabular.py @@ -78,7 +78,7 @@ def __init__(self, CONNECTION_STR: str): pass def __repr__(self) -> str: - return f"{self.Server.Name}::{self.Database.Name}::{self.Model.Name}\nEstimated Size::{self.Database.EstimatedSize}\nTables::{len(self.Tables)}\nColumns::{len(self.Columns)}\nPartitions::{len(self.Partitions)}\nMeasures::{len(self.Measures)}" + return f"Server::{self.Server.Name}\nDatabase::{self.Database.Name}\nModel::{self.Model.Name}\nEstimated Size::{self.Database.EstimatedSize}" def Reload_Model_Info(self) -> bool: """Runs on __init__ iterates through details, can be called after any model changes. Called in SaveChanges() diff --git a/test/test_tabular.py b/test/test_tabular.py index 0a629d2..efa973c 100644 --- a/test/test_tabular.py +++ b/test/test_tabular.py @@ -47,6 +47,11 @@ def test_file_query(model): ) +@pytest.mark.parametrize("model", testing_parameters) +def test_repr_str(model): + assert isinstance(model.__repr__(), str) + + @pytest.mark.parametrize("model", testing_parameters) def test_query_every_table(model): assert len(model.Query_Every_Table()) > 0