diff --git a/dist/python_tabular-0.1.1-py3-none-any.whl b/dist/python_tabular-0.1.1-py3-none-any.whl deleted file mode 100644 index 05352fe..0000000 Binary files a/dist/python_tabular-0.1.1-py3-none-any.whl and /dev/null differ diff --git a/dist/python_tabular-0.1.1.tar.gz b/dist/python_tabular-0.1.1.tar.gz deleted file mode 100644 index b451513..0000000 Binary files a/dist/python_tabular-0.1.1.tar.gz and /dev/null differ diff --git a/dist/python_tabular-0.1.2-py3-none-any.whl b/dist/python_tabular-0.1.2-py3-none-any.whl deleted file mode 100644 index 692957e..0000000 Binary files a/dist/python_tabular-0.1.2-py3-none-any.whl and /dev/null differ diff --git a/dist/python_tabular-0.1.2.tar.gz b/dist/python_tabular-0.1.2.tar.gz deleted file mode 100644 index 634a354..0000000 Binary files a/dist/python_tabular-0.1.2.tar.gz and /dev/null differ diff --git a/dist/python_tabular-0.1.4-py3-none-any.whl b/dist/python_tabular-0.1.4-py3-none-any.whl deleted file mode 100644 index e23c9df..0000000 Binary files a/dist/python_tabular-0.1.4-py3-none-any.whl and /dev/null differ diff --git a/dist/python_tabular-0.1.4.tar.gz b/dist/python_tabular-0.1.4.tar.gz deleted file mode 100644 index 8e41256..0000000 Binary files a/dist/python_tabular-0.1.4.tar.gz and /dev/null differ diff --git a/dist/python_tabular-0.1.5-py3-none-any.whl b/dist/python_tabular-0.1.5-py3-none-any.whl deleted file mode 100644 index 8c7b115..0000000 Binary files a/dist/python_tabular-0.1.5-py3-none-any.whl and /dev/null differ diff --git a/dist/python_tabular-0.1.5.tar.gz b/dist/python_tabular-0.1.5.tar.gz deleted file mode 100644 index 0d1ef16..0000000 Binary files a/dist/python_tabular-0.1.5.tar.gz and /dev/null differ diff --git a/pyproject.toml b/pyproject.toml index e37b0e0..22e667b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "python_tabular" -version = "0.1.9.1" +version = "0.1.9.2" authors = [ { name="Curtis Stallings", email="curtisrstallings@gmail.com" }, ] diff --git a/pytabular/query.py b/pytabular/query.py index e237059..fa63a6b 100644 --- a/pytabular/query.py +++ b/pytabular/query.py @@ -57,8 +57,14 @@ def Query(self, Query_Str: str) -> Union[pd.DataFrame, str, int]: ] Results = list() while Query.Read(): + """This is a bit garbage will need to refactor later but fixing issue with System.Decimal conversion""" Results.append( - [Query.GetValue(index) for index in range(0, len(Column_Headers))] + [ + Query.GetValue(index) + if Query.GetDataTypeName((index)) not in ("Object", "Decimal") + else Query.GetValue(index).ToDouble(Query.GetValue(index)) + for index in range(0, len(Column_Headers)) + ] ) Query.Close() logger.debug("Data retrieved... reading...") diff --git a/test/test_tabular.py b/test/test_tabular.py index 8756a36..79e02d8 100644 --- a/test/test_tabular.py +++ b/test/test_tabular.py @@ -37,6 +37,20 @@ def test_basic_query(model): assert int_result == 1 and text_result == "Hello World" +datatype_queries = [ + ["this is a string", '"this is a string"'], + [1, 1], + [1000.78, "CONVERT(1000.78,CURRENCY)"], +] + + +@pytest.mark.parametrize("model", testing_parameters) +def test_datatype_query(model): + for query in datatype_queries: + result = model.Query(f"EVALUATE {{{query[1]}}}") + assert result == query[0] + + @pytest.mark.parametrize("model", testing_parameters) def test_file_query(model): singlevaltest = local.SINGLEVALTESTPATH